Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
6f62ef3b
Commit
6f62ef3b
authored
May 31, 2016
by
Juorder Antonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable add admin buttons and add allowers for domain admins, add advances for store functionality
parent
0456f57e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
140 additions
and
109 deletions
+140
-109
path.json
path.json
+1
-1
distribution_lists.jsx
src/components/distribution/distribution_lists.jsx
+3
-1
domain_admin_list.jsx
src/components/domain/domain_admin_list.jsx
+3
-1
form_resp_vacaciones_mailbox.jsx
src/components/mailbox/form_resp_vacaciones_mailbox.jsx
+9
-3
mailbox.jsx
src/components/mailbox/mailbox.jsx
+39
-38
mailbox_details.jsx
src/components/mailbox/mailbox_details.jsx
+41
-60
mailbox_store.jsx
src/stores/mailbox_store.jsx
+42
-4
constants.jsx
src/utils/constants.jsx
+2
-1
No files found.
path.json
View file @
6f62ef3b
module.exports
=
{
"main"
:{
"js"
:
"/280485bundle.js"
}}
module.exports
=
{
"main"
:{
"js"
:
"/220021bundle.js"
}}
\ No newline at end of file
\ No newline at end of file
src/components/distribution/distribution_lists.jsx
View file @
6f62ef3b
...
@@ -581,7 +581,9 @@ export default class DistributionLists extends React.Component {
...
@@ -581,7 +581,9 @@ export default class DistributionLists extends React.Component {
permitidos
:
allows
permitidos
:
allows
};
};
if
(
!
this
.
isGlobalAdmin
)
{
const
not
=
false
;
//if (!this.isGlobalAdmin) {
if
(
not
)
{
tabNamesArray
=
[
'Miembros'
];
tabNamesArray
=
[
'Miembros'
];
tabs
=
{
tabs
=
{
miembros
:
members
miembros
:
members
...
...
src/components/domain/domain_admin_list.jsx
View file @
6f62ef3b
...
@@ -193,7 +193,9 @@ export default class DomainAdminList extends React.Component {
...
@@ -193,7 +193,9 @@ export default class DomainAdminList extends React.Component {
);
);
});
});
if
(
this
.
isGlobalAdmin
)
{
//if (this.isGlobalAdmin) {
const
go
=
true
;
if
(
go
)
{
btnAddNewAdmin
=
(
btnAddNewAdmin
=
(
<
ToggleModalButton
<
ToggleModalButton
role=
'button'
role=
'button'
...
...
src/components/mailbox/form_resp_vacaciones_mailbox.jsx
View file @
6f62ef3b
...
@@ -7,6 +7,8 @@ import Constants from '../../utils/constants.jsx';
...
@@ -7,6 +7,8 @@ import Constants from '../../utils/constants.jsx';
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
MailboxStore
from
'../../stores/mailbox_store.jsx'
;
const
messageType
=
Constants
.
MessageType
;
const
messageType
=
Constants
.
MessageType
;
export
default
class
FormVacacionesMailbox
extends
React
.
Component
{
export
default
class
FormVacacionesMailbox
extends
React
.
Component
{
...
@@ -18,6 +20,8 @@ export default class FormVacacionesMailbox extends React.Component {
...
@@ -18,6 +20,8 @@ export default class FormVacacionesMailbox extends React.Component {
this
.
dateStart
=
null
;
this
.
dateStart
=
null
;
this
.
dateEnd
=
null
;
this
.
dateEnd
=
null
;
this
.
initialDate
=
Utils
.
setInitialDate
();
this
.
initialDate
=
Utils
.
setInitialDate
();
this
.
domain_id
=
this
.
props
.
domainId
||
null
;
}
}
handleChangeDate
(
x
,
from
)
{
handleChangeDate
(
x
,
from
)
{
...
@@ -62,7 +66,8 @@ export default class FormVacacionesMailbox extends React.Component {
...
@@ -62,7 +66,8 @@ export default class FormVacacionesMailbox extends React.Component {
attrs
.
zimbraPrefOutOfOfficeReplyEnabled
=
isEnabled
.
toString
().
toUpperCase
();
attrs
.
zimbraPrefOutOfOfficeReplyEnabled
=
isEnabled
.
toString
().
toUpperCase
();
}
}
Client
.
modifyAccount
(
data
.
id
,
attrs
,
()
=>
{
Client
.
modifyAccount
(
data
.
id
,
attrs
,
(
mailbox
)
=>
{
MailboxStore
.
updateMailbox
(
data
.
id
,
mailbox
,
this
.
domain_id
);
GlobalActions
.
emitMessage
({
GlobalActions
.
emitMessage
({
error
:
'Se ha modificado su respuesta de vacaciones con éxito.'
,
error
:
'Se ha modificado su respuesta de vacaciones con éxito.'
,
typeError
:
messageType
.
SUCCESS
typeError
:
messageType
.
SUCCESS
...
@@ -120,7 +125,7 @@ export default class FormVacacionesMailbox extends React.Component {
...
@@ -120,7 +125,7 @@ export default class FormVacacionesMailbox extends React.Component {
onSubmit=
{
(
e
)
=>
{
onSubmit=
{
(
e
)
=>
{
this
.
handleSubmit
(
e
);
this
.
handleSubmit
(
e
);
}
}
}
}
id=
'
createAccount
'
id=
'
resp-vacations
'
>
>
<
div
className=
'form-group string'
>
<
div
className=
'form-group string'
>
<
label
className=
'string required col-sm-3 control-label'
>
<
label
className=
'string required col-sm-3 control-label'
>
...
@@ -238,5 +243,6 @@ FormVacacionesMailbox.propTypes = {
...
@@ -238,5 +243,6 @@ FormVacacionesMailbox.propTypes = {
data
:
React
.
PropTypes
.
oneOfType
([
data
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
object
,
React
.
PropTypes
.
object
,
React
.
PropTypes
.
string
React
.
PropTypes
.
string
])
]),
domainId
:
React
.
PropTypes
.
string
};
};
src/components/mailbox/mailbox.jsx
View file @
6f62ef3b
...
@@ -30,20 +30,23 @@ import ZimbraStore from '../../stores/zimbra_store.jsx';
...
@@ -30,20 +30,23 @@ import ZimbraStore from '../../stores/zimbra_store.jsx';
const
QueryOptions
=
Constants
.
QueryOptions
;
const
QueryOptions
=
Constants
.
QueryOptions
;
const
messageType
=
Constants
.
MessageType
;
const
messageType
=
Constants
.
MessageType
;
const
codes
=
Constants
.
ZimbraCodes
;
export
default
class
Mailboxes
extends
React
.
Component
{
export
default
class
Mailboxes
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
isMounted
=
true
;
this
.
isStoreEnabled
=
window
.
manager_config
.
enableStores
;
this
.
isStoreEnabled
=
window
.
manager_config
.
enableStores
;
this
.
archivingConfig
=
window
.
manager_config
.
plans
.
archiving
;
this
.
archivingConfig
=
window
.
manager_config
.
plans
.
archiving
;
this
.
domainId
=
this
.
props
.
params
.
domain_id
||
null
;
this
.
regexp
=
new
RegExp
(
this
.
archivingConfig
.
regexp
,
'gi'
);
this
.
regexp
=
new
RegExp
(
this
.
archivingConfig
.
regexp
,
'gi'
);
this
.
showMessage
=
this
.
showMessage
.
bind
(
this
);
this
.
showMessage
=
this
.
showMessage
.
bind
(
this
);
this
.
refreshAllAccounts
=
this
.
refreshAllAccounts
.
bind
(
this
);
this
.
refreshAllAccounts
=
this
.
refreshAllAccounts
.
bind
(
this
);
this
.
handleChangeFilter
=
this
.
handleChangeFilter
.
bind
(
this
);
this
.
handleChangeFilter
=
this
.
handleChangeFilter
.
bind
(
this
);
this
.
handleTabChanged
=
this
.
handleTabChanged
.
bind
(
this
);
this
.
handleTabChanged
=
this
.
handleTabChanged
.
bind
(
this
);
this
.
makeFilter
=
this
.
makeFilter
.
bind
(
this
);
this
.
makeFilter
=
this
.
makeFilter
.
bind
(
this
);
this
.
c
=
0
;
const
page
=
parseInt
(
this
.
props
.
location
.
query
.
page
,
10
)
||
1
;
const
page
=
parseInt
(
this
.
props
.
location
.
query
.
page
,
10
)
||
1
;
this
.
mailboxes
=
null
;
this
.
mailboxes
=
null
;
...
@@ -57,7 +60,6 @@ export default class Mailboxes extends React.Component {
...
@@ -57,7 +60,6 @@ export default class Mailboxes extends React.Component {
this
.
isRefreshing
=
true
;
this
.
isRefreshing
=
true
;
this
.
optionStatus
=
Constants
.
status
;
this
.
optionStatus
=
Constants
.
status
;
this
.
optionPlans
=
window
.
manager_config
.
plans
;
this
.
optionPlans
=
window
.
manager_config
.
plans
;
this
.
domainId
=
null
;
this
.
domainName
=
null
;
this
.
domainName
=
null
;
this
.
state
=
{
this
.
state
=
{
...
@@ -86,8 +88,6 @@ export default class Mailboxes extends React.Component {
...
@@ -86,8 +88,6 @@ export default class Mailboxes extends React.Component {
this
.
selectedStatusFilter
=
selected
.
length
>
0
?
selected
:
''
;
this
.
selectedStatusFilter
=
selected
.
length
>
0
?
selected
:
''
;
}
}
/*const domainId = this.domainId;
this.getAllMailboxes(domainId, window.manager_config.maxResultOnRequestZimbra);*/
browserHistory
.
push
(
this
.
props
.
location
.
pathname
);
browserHistory
.
push
(
this
.
props
.
location
.
pathname
);
}
}
...
@@ -141,10 +141,9 @@ export default class Mailboxes extends React.Component {
...
@@ -141,10 +141,9 @@ export default class Mailboxes extends React.Component {
componentWillReceiveProps
(
newProps
)
{
componentWillReceiveProps
(
newProps
)
{
const
condition
=
this
.
props
.
location
.
query
.
page
!==
newProps
.
location
.
query
.
page
;
const
condition
=
this
.
props
.
location
.
query
.
page
!==
newProps
.
location
.
query
.
page
;
let
domainId
=
null
;
const
samePath
=
this
.
props
.
location
.
pathname
===
newProps
.
location
.
pathname
;
//this.domainName = null;
if
(
condition
&&
samePath
)
{
if
(
condition
)
{
const
page
=
parseInt
(
newProps
.
location
.
query
.
page
,
10
)
||
1
;
const
page
=
parseInt
(
newProps
.
location
.
query
.
page
,
10
)
||
1
;
GlobalActions
.
emitStartLoading
();
GlobalActions
.
emitStartLoading
();
...
@@ -155,20 +154,15 @@ export default class Mailboxes extends React.Component {
...
@@ -155,20 +154,15 @@ export default class Mailboxes extends React.Component {
loading
:
true
loading
:
true
};
};
domainId
=
this
.
domainId
;
this
.
domainId
=
this
.
props
.
params
.
domain_id
||
newProps
.
params
.
domain_id
||
null
;
if
(
this
.
props
.
params
.
domain_id
)
{
this
.
getAllMailboxes
(
this
.
domainId
,
window
.
manager_config
.
maxResultOnRequestZimbra
);
domainId
=
this
.
props
.
params
.
domain_id
;
this
.
domainId
=
domainId
;
}
this
.
getAllMailboxes
(
domainId
,
window
.
manager_config
.
maxResultOnRequestZimbra
);
}
else
{
}
else
{
GlobalActions
.
emitStartLoading
();
GlobalActions
.
emitStartLoading
();
domainId
=
newProps
.
params
.
domain_id
;
this
.
domainId
=
newProps
.
params
.
domain_id
;
this
.
getAllMailboxes
(
domainId
,
window
.
manager_config
.
maxResultOnRequestZimbra
);
this
.
getAllMailboxes
(
this
.
domainId
,
window
.
manager_config
.
maxResultOnRequestZimbra
);
}
}
}
}
...
@@ -198,16 +192,16 @@ export default class Mailboxes extends React.Component {
...
@@ -198,16 +192,16 @@ export default class Mailboxes extends React.Component {
getAccounts
(
domainName
,
maxResult
)
{
getAccounts
(
domainName
,
maxResult
)
{
//const promises = [];
//const promises = [];
const
attrneeded
=
Utils
.
getAttrsBySectionFromConfig
(
'mailboxes'
);
const
attrs
=
{
const
attrs
=
{
maxResults
:
maxResult
,
maxResults
:
maxResult
limit
:
5000
};
};
if
(
!
this
.
state
.
loading
)
{
this
.
setState
({
this
.
setState
({
loading
:
true
loading
:
true
});
});
}
const
attrneeded
=
Utils
.
getAttrsBySectionFromConfig
(
'mailboxes'
);
if
(
attrneeded
)
{
if
(
attrneeded
)
{
attrs
.
attrs
=
attrneeded
;
attrs
.
attrs
=
attrneeded
;
...
@@ -219,14 +213,18 @@ export default class Mailboxes extends React.Component {
...
@@ -219,14 +213,18 @@ export default class Mailboxes extends React.Component {
}
}
new
Promise
((
resolve
,
reject
)
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
// if domain name exists, just search all mailbox from this domain
if
(
domainName
)
{
if
(
domainName
)
{
const
hasMailboxForDomain
=
this
.
isStoreEnabled
?
MailboxStore
.
getMailboxByDomainId
(
this
.
domainId
)
:
null
;
const
hasMailboxForDomain
=
this
.
isStoreEnabled
?
MailboxStore
.
getMailboxByDomainId
(
this
.
domainId
)
:
null
;
// if mailbox by domain exists return it
if
(
hasMailboxForDomain
)
{
if
(
hasMailboxForDomain
)
{
return
resolve
(
hasMailboxForDomain
);
return
resolve
(
hasMailboxForDomain
);
}
}
// get all mailboxes from domain
return
Client
.
getAllAccounts
(
attrs
,
(
success
)
=>
{
return
Client
.
getAllAccounts
(
attrs
,
(
success
)
=>
{
if
(
success
.
total
)
{
const
data
=
Utils
.
extractLockOuts
(
success
);
const
data
=
Utils
.
extractLockOuts
(
success
);
if
(
this
.
isStoreEnabled
)
{
if
(
this
.
isStoreEnabled
)
{
MailboxStore
.
setMailboxesByDomain
(
this
.
domainId
,
data
);
MailboxStore
.
setMailboxesByDomain
(
this
.
domainId
,
data
);
...
@@ -235,6 +233,7 @@ export default class Mailboxes extends React.Component {
...
@@ -235,6 +233,7 @@ export default class Mailboxes extends React.Component {
accounts
:
data
accounts
:
data
});
});
}
}
}
return
resolve
(
success
);
return
resolve
(
success
);
},
(
error
)
=>
{
},
(
error
)
=>
{
...
@@ -242,12 +241,17 @@ export default class Mailboxes extends React.Component {
...
@@ -242,12 +241,17 @@ export default class Mailboxes extends React.Component {
});
});
}
}
// if all mailbox exists just return it
const
hasMailboxes
=
this
.
isStoreEnabled
?
MailboxStore
.
hasMailboxes
()
:
null
;
const
hasMailboxes
=
this
.
isStoreEnabled
?
MailboxStore
.
hasMailboxes
()
:
null
;
if
(
hasMailboxes
)
{
if
(
hasMailboxes
)
{
return
resolve
(
MailboxStore
.
getMailboxes
());
return
resolve
(
MailboxStore
.
getMailboxes
());
}
}
// if all mailboxes doesn't exist just search them.
return
Client
.
getAllAccounts
(
attrs
,
(
success
)
=>
{
return
Client
.
getAllAccounts
(
attrs
,
(
success
)
=>
{
const
data
=
Utils
.
extractLockOuts
(
success
);
const
data
=
Utils
.
extractLockOuts
(
success
);
if
(
this
.
isStoreEnabled
)
{
if
(
this
.
isStoreEnabled
)
{
MailboxStore
.
setMailboxes
(
data
);
MailboxStore
.
setMailboxes
(
data
);
}
}
...
@@ -264,7 +268,6 @@ export default class Mailboxes extends React.Component {
...
@@ -264,7 +268,6 @@ export default class Mailboxes extends React.Component {
const
items
=
this
.
makeFilter
()
||
this
.
mailboxes
;
const
items
=
this
.
makeFilter
()
||
this
.
mailboxes
;
//const tables = this.buildTableFromData(items, ['Todas', 'Bloqueadas']);
const
tables
=
this
.
buildTableFromData
(
items
);
const
tables
=
this
.
buildTableFromData
(
items
);
if
(
items
.
lockout
)
{
if
(
items
.
lockout
)
{
...
@@ -287,7 +290,7 @@ export default class Mailboxes extends React.Component {
...
@@ -287,7 +290,7 @@ export default class Mailboxes extends React.Component {
loading
:
false
loading
:
false
});
});
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
if
(
error
.
code
===
'account.TOO_MANY_SEARCH_RESULTS'
)
{
if
(
error
.
code
===
codes
.
TOO_MANY_SEARCH_RESULTS
)
{
this
.
isRefreshing
=
true
;
this
.
isRefreshing
=
true
;
const
newMaxResult
=
(
parseInt
(
maxResult
,
10
)
+
window
.
manager_config
.
autoincrementOnFailRequestZimbra
);
const
newMaxResult
=
(
parseInt
(
maxResult
,
10
)
+
window
.
manager_config
.
autoincrementOnFailRequestZimbra
);
window
.
manager_config
.
maxResultOnRequestZimbra
=
newMaxResult
;
window
.
manager_config
.
maxResultOnRequestZimbra
=
newMaxResult
;
...
@@ -332,18 +335,14 @@ export default class Mailboxes extends React.Component {
...
@@ -332,18 +335,14 @@ export default class Mailboxes extends React.Component {
data
:
tables
data
:
tables
});
});
}
}
const
domainId
=
this
.
props
.
params
.
domain_id
;
return
this
.
getAllMailboxes
(
this
.
domainId
);
this
.
domainId
=
domainId
;
return
this
.
getAllMailboxes
(
domainId
);
}
}
componentDidMount
()
{
componentDidMount
()
{
$
(
'#sidebar-mailboxes'
).
addClass
(
'active'
);
$
(
'#sidebar-mailboxes'
).
addClass
(
'active'
);
EventStore
.
addMessageListener
(
this
.
showMessage
);
EventStore
.
addMessageListener
(
this
.
showMessage
);
MailboxStore
.
addListenerAddMassive
(
this
.
refreshAllAccounts
);
MailboxStore
.
addListenerAddMassive
(
this
.
refreshAllAccounts
);
const
domainId
=
this
.
props
.
params
.
domain_id
;
this
.
getAllMailboxes
(
this
.
domainId
);
this
.
domainId
=
domainId
;
this
.
getAllMailboxes
(
domainId
);
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
@@ -351,6 +350,8 @@ export default class Mailboxes extends React.Component {
...
@@ -351,6 +350,8 @@ export default class Mailboxes extends React.Component {
MailboxStore
.
removeListenerAddMassive
(
this
.
showMessage
);
MailboxStore
.
removeListenerAddMassive
(
this
.
showMessage
);
$
(
'#sidebar-mailboxes'
).
removeClass
(
'active'
);
$
(
'#sidebar-mailboxes'
).
removeClass
(
'active'
);
this
.
domainName
=
null
;
this
.
domainName
=
null
;
this
.
isMounted
=
false
;
this
.
domainId
=
null
;
}
}
buildRow
(
row
,
classes
,
status
)
{
buildRow
(
row
,
classes
,
status
)
{
...
...
src/components/mailbox/mailbox_details.jsx
View file @
6f62ef3b
...
@@ -38,6 +38,12 @@ export default class MailboxDetails extends React.Component {
...
@@ -38,6 +38,12 @@ export default class MailboxDetails extends React.Component {
this
.
onRemoveAlias
=
this
.
onRemoveAlias
.
bind
(
this
);
this
.
onRemoveAlias
=
this
.
onRemoveAlias
.
bind
(
this
);
this
.
onCancelAlias
=
this
.
onCancelAlias
.
bind
(
this
);
this
.
onCancelAlias
=
this
.
onCancelAlias
.
bind
(
this
);
this
.
domain_id
=
this
.
props
.
params
.
domain_id
||
null
;
this
.
mailboxId
=
this
.
props
.
params
.
id
||
null
;
this
.
editUrlFromParams
=
this
.
domain_id
?
`/domains/
${
this
.
domain_id
}
/mailboxes/
${
this
.
mailboxId
}
`
:
`/mailboxes/
${
this
.
mailboxId
}
`
;
this
.
editUrlFromParams
+=
'/edit'
;
this
.
state
=
{};
this
.
state
=
{};
}
}
...
@@ -85,47 +91,24 @@ export default class MailboxDetails extends React.Component {
...
@@ -85,47 +91,24 @@ export default class MailboxDetails extends React.Component {
}
}
getMailbox
(
id
)
{
getMailbox
(
id
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// get mailbox from store if it exists
const
hasMailboxes
=
this
.
isStoreEnabled
?
MailboxStore
.
hasMailboxes
()
:
null
;
const
hasMailboxes
=
this
.
isStoreEnabled
?
MailboxStore
.
hasMailboxes
()
:
null
;
if
(
hasMailboxes
)
{
const
account
=
MailboxStore
.
getMailboxById
(
id
);
MailboxStore
.
setCurrent
(
account
);
let
items
=
account
.
attrs
.
zimbraMailAlias
;
if
(
items
)
{
if
(
!
Array
.
isArray
(
items
))
{
items
=
[
items
];
}
}
account
.
viewMailPath
(
global
.
window
.
manager_config
.
webmailLifetime
,
(
error
,
res
)
=>
{
if
(
hasMailboxes
)
{
if
(
res
)
{
const
account
=
MailboxStore
.
getMailboxById
(
id
)
||
MailboxStore
.
getMailboxByIdInDomain
(
id
,
this
.
domain_id
);
return
this
.
setState
({
return
resolve
(
account
);
data
:
account
,
alias
:
items
,
webmail
:
`
${
global
.
window
.
manager_config
.
webMailUrl
}${
res
}
`
});
}
}
return
this
.
setState
({
//if is not into store just search it.
data
:
account
,
return
Client
.
getAccount
(
id
,
(
data
)
=>
{
alias
:
items
,
webmail
:
false
});
});
GlobalActions
.
emitEndLoading
();
Utils
.
toggleStatusButtons
(
'.action-info-btns'
,
false
);
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
Client
.
getAccount
(
id
,
(
data
)
=>
{
return
resolve
(
data
);
return
resolve
(
data
);
},
(
error
)
=>
{
},
(
error
)
=>
{
return
reject
(
error
);
return
reject
(
error
);
});
});
}).
then
((
result
)
=>
{
}).
then
((
mailbox
)
=>
{
MailboxStore
.
setCurrent
(
result
);
MailboxStore
.
setCurrent
(
mailbox
);
let
items
=
mailbox
.
attrs
.
zimbraMailAlias
||
null
;
let
items
=
result
.
attrs
.
zimbraMailAlias
;
if
(
items
)
{
if
(
items
)
{
if
(
!
Array
.
isArray
(
items
))
{
if
(
!
Array
.
isArray
(
items
))
{
...
@@ -133,17 +116,17 @@ export default class MailboxDetails extends React.Component {
...
@@ -133,17 +116,17 @@ export default class MailboxDetails extends React.Component {
}
}
}
}
result
.
viewMailPath
(
global
.
window
.
manager_config
.
webmailLifetime
,
(
error
,
res
)
=>
{
mailbox
.
viewMailPath
(
global
.
window
.
manager_config
.
webmailLifetime
,
(
error
,
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
return
this
.
setState
({
return
this
.
setState
({
data
:
result
,
data
:
mailbox
,
alias
:
items
,
alias
:
items
,
webmail
:
`
${
global
.
window
.
manager_config
.
webMailUrl
}${
res
}
`
webmail
:
`
${
global
.
window
.
manager_config
.
webMailUrl
}${
res
}
`
});
});
}
}
return
this
.
setState
({
return
this
.
setState
({
data
:
result
,
data
:
mailbox
,
alias
:
items
,
alias
:
items
,
webmail
:
false
webmail
:
false
});
});
...
@@ -159,13 +142,10 @@ export default class MailboxDetails extends React.Component {
...
@@ -159,13 +142,10 @@ export default class MailboxDetails extends React.Component {
});
});
}
}
return
true
;
}
componentDidMount
()
{
componentDidMount
()
{
EventStore
.
addMessageListener
(
this
.
showMessage
);
EventStore
.
addMessageListener
(
this
.
showMessage
);
$
(
'#sidebar-mailboxes'
).
addClass
(
'active'
);
$
(
'#sidebar-mailboxes'
).
addClass
(
'active'
);
this
.
getMailbox
(
this
.
props
.
params
.
i
d
);
this
.
getMailbox
(
this
.
mailboxI
d
);
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
@@ -306,7 +286,7 @@ export default class MailboxDetails extends React.Component {
...
@@ -306,7 +286,7 @@ export default class MailboxDetails extends React.Component {
}
}
if
(
this
.
state
.
data
)
{
if
(
this
.
state
.
data
)
{
const
webmail
=
this
.
state
.
webmail
?
this
.
state
.
webmail
:
null
;
const
webmail
=
this
.
state
.
webmail
||
null
;
generalData
=
(
generalData
=
(
<
BlockGeneralInfoMailbox
<
BlockGeneralInfoMailbox
data=
{
this
.
state
.
data
}
data=
{
this
.
state
.
data
}
...
@@ -321,14 +301,12 @@ export default class MailboxDetails extends React.Component {
...
@@ -321,14 +301,12 @@ export default class MailboxDetails extends React.Component {
/>
/>
);
);
const
editUrlFromParams
=
this
.
props
.
params
.
domain_id
?
`/domains/
${
this
.
props
.
params
.
domain_id
}
/mailboxes/`
:
'/mailboxes/'
;
btnsGeneralInfo
=
[
btnsGeneralInfo
=
[
{
{
props
:
{
props
:
{
className
:
'btn btn-xs btn-default action-info-btns'
,
className
:
'btn btn-xs btn-default action-info-btns'
,
onClick
:
(
e
)
=>
{
onClick
:
(
e
)
=>
{
this
.
handleEdit
(
e
,
`
${
editUrlFromParams
}${
this
.
state
.
data
.
id
}
/edit`
,
this
.
props
.
location
);
this
.
handleEdit
(
e
,
this
.
editUrlFromParams
,
this
.
props
.
location
);
}
}
},
},
label
:
'Editar'
label
:
'Editar'
...
@@ -375,7 +353,10 @@ export default class MailboxDetails extends React.Component {
...
@@ -375,7 +353,10 @@ export default class MailboxDetails extends React.Component {
}
}
const
formAutoResp
=
(
const
formAutoResp
=
(
<
FormVacacionesMailbox
data=
{
this
.
state
.
data
}
/>
<
FormVacacionesMailbox
data=
{
this
.
state
.
data
}
domainId=
{
this
.
domain_id
}
/>
);
);
const
formAlias
=
(
const
formAlias
=
(
...
...
src/stores/mailbox_store.jsx
View file @
6f62ef3b
...
@@ -12,7 +12,7 @@ class MailboxStoreClass extends EventEmitter {
...
@@ -12,7 +12,7 @@ class MailboxStoreClass extends EventEmitter {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
current
=
null
;
this
.
current
=
null
;
this
.
mailboxesByDomain
=
null
;
this
.
mailboxesByDomain
=
{}
;
}
}
resetThisStore
()
{
resetThisStore
()
{
...
@@ -23,11 +23,12 @@ class MailboxStoreClass extends EventEmitter {
...
@@ -23,11 +23,12 @@ class MailboxStoreClass extends EventEmitter {
setMailboxesByDomain
(
id
,
mailboxes
)
{
setMailboxesByDomain
(
id
,
mailboxes
)
{
if
(
mailboxes
)
{
if
(
mailboxes
)
{
this
.
mailboxesByDomain
=
{};
this
.
mailboxesByDomain
[
id
]
=
mailboxes
;
this
.
mailboxesByDomain
[
id
]
=
mailboxes
;
//console.log('setMailboxesByDomain', this.mailboxesByDomain);
return
true
;
}
}
return
tru
e
;
return
fals
e
;
}
}
getMailboxByDomainId
(
id
)
{
getMailboxByDomainId
(
id
)
{
...
@@ -85,7 +86,38 @@ class MailboxStoreClass extends EventEmitter {
...
@@ -85,7 +86,38 @@ class MailboxStoreClass extends EventEmitter {
}
}
setCurrent
(
account
)
{
setCurrent
(
account
)
{
if
(
account
)
{
this
.
current
=
account
;
this
.
current
=
account
;
//console.log('setCurrent', this.current);
return
true
;
}
return
false
;
}
updateMailbox
(
mailboxId
,
newMailbox
,
domainId
)
{
if
(
mailboxesArray
)
{
const
accounts
=
mailboxesArray
.
account
;
const
index
=
accounts
.
findIndex
((
mailbox
)
=>
{
return
mailbox
.
id
===
mailboxId
;
});
if
(
index
>
-
1
)
{
accounts
[
index
]
=
newMailbox
;
}
}
if
(
domainId
&&
this
.
mailboxesByDomain
[
domainId
])
{
const
accountsFromDomain
=
this
.
mailboxesByDomain
.
account
;
const
indexOfMailbox
=
accountsFromDomain
.
findIndex
((
mailbox
)
=>
{
return
mailbox
.
id
===
mailboxId
;
});
if
(
indexOfMailbox
>
-
1
)
{
accountsFromDomain
[
indexOfMailbox
]
=
newMailbox
;
}
}
return
true
;
}
}
getCurrent
()
{
getCurrent
()
{
...
@@ -108,9 +140,15 @@ class MailboxStoreClass extends EventEmitter {
...
@@ -108,9 +140,15 @@ class MailboxStoreClass extends EventEmitter {
return
mailboxesArray
;
return
mailboxesArray
;
}
}
getMailboxByIdInDomain
()
{
return
false
;
}
setMailboxes
(
mailboxes
)
{
setMailboxes
(
mailboxes
)
{
if
(
mailboxes
)
{
if
(
mailboxes
)
{
mailboxesArray
=
mailboxes
;
mailboxesArray
=
mailboxes
;
//console.log('setMailboxes', mailboxesArray);
return
true
;
}
}
return
false
;
return
false
;
...
...
src/utils/constants.jsx
View file @
6f62ef3b
...
@@ -46,7 +46,8 @@ export default {
...
@@ -46,7 +46,8 @@ export default {
ZimbraCodes
:
{
ZimbraCodes
:
{
AUTH_EXPIRED
:
'service.AUTH_EXPIRED'
,
AUTH_EXPIRED
:
'service.AUTH_EXPIRED'
,
AUTH__REQUIRED
:
'service.AUTH_REQUIRED'
AUTH__REQUIRED
:
'service.AUTH_REQUIRED'
,
TOO_MANY_SEARCH_RESULTS
:
'account.TOO_MANY_SEARCH_RESULTS'
},
},
ZimbraSearchs
:
{
ZimbraSearchs
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment