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
e46e475c
Commit
e46e475c
authored
May 31, 2016
by
Juorder Antonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update mailbox when add, remove alias and get domaind id when it doesnt exists
parent
703e1d44
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
12 deletions
+46
-12
action_set_name
.vagrant/machines/default/virtualbox/action_set_name
+1
-1
path.json
path.json
+1
-1
domain_details.jsx
src/components/domain/domain_details.jsx
+0
-4
info_general_mailbox.jsx
src/components/mailbox/info_general_mailbox.jsx
+2
-0
mailbox_details.jsx
src/components/mailbox/mailbox_details.jsx
+21
-3
mailbox_store.jsx
src/stores/mailbox_store.jsx
+14
-0
constants.jsx
src/utils/constants.jsx
+2
-1
utils.jsx
src/utils/utils.jsx
+5
-2
No files found.
.vagrant/machines/default/virtualbox/action_set_name
View file @
e46e475c
1465787195
\ No newline at end of file
1466524663
\ No newline at end of file
path.json
View file @
e46e475c
module.exports
=
{
"main"
:{
"js"
:
"/454009bundle.js"
}}
\ No newline at end of file
module.exports
=
{
"main"
:{
"js"
:
"/838029bundle.js"
}}
\ No newline at end of file
src/components/domain/domain_details.jsx
View file @
e46e475c
...
...
@@ -82,10 +82,6 @@ export default class DomainDetails extends React.Component {
}
);
}).
then
((
success
)
=>
{
/*if (this.isStoreEnabled) {
//logic
}*/
this
.
setState
({
domain
:
success
});
...
...
src/components/mailbox/info_general_mailbox.jsx
View file @
e46e475c
...
...
@@ -5,6 +5,7 @@ import * as Client from '../../utils/client.jsx';
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
ZimbraStore
from
'../../stores/zimbra_store.jsx'
;
import
MailboxStore
from
'../../stores/mailbox_store.jsx'
;
export
default
class
BlockGeneralInfoMailbox
extends
React
.
Component
{
constructor
(
props
)
{
...
...
@@ -27,6 +28,7 @@ export default class BlockGeneralInfoMailbox extends React.Component {
const
domain
=
Utils
.
getDomainFromString
(
this
.
data
.
name
);
Client
.
getDomain
(
domain
,
(
data
)
=>
{
MailboxStore
.
emitDomainId
(
data
.
id
);
this
.
setState
({
hasDomain
:
true
,
domainData
:
data
...
...
src/components/mailbox/mailbox_details.jsx
View file @
e46e475c
...
...
@@ -37,6 +37,7 @@ export default class MailboxDetails extends React.Component {
this
.
showMessage
=
this
.
showMessage
.
bind
(
this
);
this
.
onRemoveAlias
=
this
.
onRemoveAlias
.
bind
(
this
);
this
.
onCancelAlias
=
this
.
onCancelAlias
.
bind
(
this
);
this
.
setDomainId
=
this
.
setDomainId
.
bind
(
this
);
this
.
domain_id
=
this
.
props
.
params
.
domain_id
||
null
;
this
.
mailboxId
=
this
.
props
.
params
.
id
||
null
;
...
...
@@ -47,6 +48,12 @@ export default class MailboxDetails extends React.Component {
this
.
state
=
{};
}
setDomainId
(
domainId
)
{
if
(
!
this
.
domain_id
)
{
this
.
domain_id
=
domainId
;
}
}
handleEdit
(
e
,
path
,
location
)
{
Utils
.
handleLink
(
e
,
path
,
location
);
}
...
...
@@ -117,9 +124,9 @@ export default class MailboxDetails extends React.Component {
if
(
!
Array
.
isArray
(
items
))
{
items
=
[
items
];
}
}
items
.
sort
(
Utils
.
sortByNames
);
items
.
sort
(
Utils
.
sortByNames
);
}
mailbox
.
viewMailPath
(
global
.
window
.
manager_config
.
webmailLifetime
,
(
error
,
res
)
=>
{
if
(
res
)
{
...
...
@@ -149,12 +156,14 @@ export default class MailboxDetails extends React.Component {
componentDidMount
()
{
EventStore
.
addMessageListener
(
this
.
showMessage
);
MailboxStore
.
addListenerSendDomainId
(
this
.
setDomainId
);
$
(
'#sidebar-mailboxes'
).
addClass
(
'active'
);
this
.
getMailbox
(
this
.
mailboxId
);
}
componentWillUnmount
()
{
EventStore
.
removeMessageListener
(
this
.
showMessage
);
MailboxStore
.
removeListenerSendDomainId
(
this
.
setDomainId
);
$
(
'#sidebar-mailboxes'
).
removeClass
(
'active'
);
}
...
...
@@ -164,6 +173,7 @@ export default class MailboxDetails extends React.Component {
}).
then
((
data
)
=>
{
const
errors
=
[];
const
{
alias
}
=
this
.
state
;
const
mailbox
=
this
.
state
.
data
;
if
(
data
.
error
)
{
data
.
error
.
forEach
((
err
)
=>
{
...
...
@@ -181,11 +191,19 @@ export default class MailboxDetails extends React.Component {
});
data
.
completed
.
forEach
((
obj
)
=>
{
alias
.
push
(
obj
.
target
);
if
(
obj
.
isNew
)
{
alias
.
push
(
obj
.
target
);
}
});
alias
.
sort
(
Utils
.
sortByNames
);
}
if
(
this
.
isStoreEnabled
)
{
mailbox
.
attrs
.
zimbraMailAlias
=
alias
;
MailboxStore
.
updateMailbox
(
this
.
mailboxId
,
mailbox
,
this
.
domain_id
);
}
return
this
.
setState
({
error
:
errors
.
length
>
0
?
errors
:
null
,
alias
...
...
src/stores/mailbox_store.jsx
View file @
e46e475c
...
...
@@ -256,6 +256,20 @@ class MailboxStoreClass extends EventEmitter {
this
.
removeListener
(
eventTypes
.
MAILBOX_ADD_MASSIVE_EVENT
,
callback
);
}
// emit domainId to the parent component
emitDomainId
(
params
)
{
this
.
emit
(
eventTypes
.
SEND_DOMAINID_EVENT
,
params
);
}
addListenerSendDomainId
(
params
)
{
this
.
on
(
eventTypes
.
SEND_DOMAINID_EVENT
,
params
);
}
removeListenerSendDomainId
(
params
)
{
this
.
removeListener
(
eventTypes
.
SEND_DOMAINID_EVENT
,
params
);
}
}
const
MailboxStore
=
new
MailboxStoreClass
();
...
...
src/utils/constants.jsx
View file @
e46e475c
...
...
@@ -33,7 +33,8 @@ export default {
NEW_TOAST_EVENT
:
null
,
MAILBOX_ADD_MASSIVE_EVENT
:
null
,
NEXT_STEP_EVENT
:
null
,
ZONE_DNS_CHANGE_EVENT
:
null
ZONE_DNS_CHANGE_EVENT
:
null
,
SEND_DOMAINID_EVENT
:
null
}),
MessageType
:
keyMirror
({
...
...
src/utils/utils.jsx
View file @
e46e475c
...
...
@@ -739,17 +739,20 @@ export function makeRequest(response, dl, resolve, returnAPI, store) {
const
pop
=
element
.
pop
();
const
target
=
typeof
pop
===
'object'
?
pop
.
name
||
pop
.
id
:
pop
;
const
label
=
action
[
0
]
===
'remove'
?
'eliminar'
:
'agregar'
;
const
isNew
=
action
[
0
]
===
'remove'
?
0
:
1
;
return
dl
[
item
](
target
,
(
er
,
success
)
=>
{
if
(
success
)
{
if
(
res
.
completed
)
{
res
.
completed
.
push
({
action
:
label
,
target
target
,
isNew
});
}
else
{
res
.
completed
=
[{
action
:
label
,
target
target
,
isNew
}];
}
const
api
=
success
.
api
&&
APIReturn
?
success
:
dl
;
...
...
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