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
9e9b3d05
Commit
9e9b3d05
authored
May 31, 2016
by
Juorder Antonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove store from domains sections to call always via api.
parent
b13ce7be
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
147 additions
and
57 deletions
+147
-57
action_set_name
.vagrant/machines/default/virtualbox/action_set_name
+1
-1
path.json
path.json
+1
-1
domain_admin_list.jsx
src/components/domain/domain_admin_list.jsx
+2
-1
domain_details.jsx
src/components/domain/domain_details.jsx
+2
-1
domain_general_info.jsx
src/components/domain/domain_general_info.jsx
+28
-23
domains.jsx
src/components/domain/domains.jsx
+6
-2
edit_domain.jsx
src/components/domain/edit_domain.jsx
+2
-1
confirm_delete_modal.jsx
src/components/mailbox/confirm_delete_modal.jsx
+0
-1
create_mailbox.jsx
src/components/mailbox/create_mailbox.jsx
+25
-2
edit_mailbox.jsx
src/components/mailbox/edit_mailbox.jsx
+77
-9
mailbox.jsx
src/components/mailbox/mailbox.jsx
+0
-13
client.jsx
src/utils/client.jsx
+2
-2
constants.jsx
src/utils/constants.jsx
+1
-0
No files found.
.vagrant/machines/default/virtualbox/action_set_name
View file @
9e9b3d05
1465225624
\ No newline at end of file
1465307111
\ No newline at end of file
path.json
View file @
9e9b3d05
module.exports
=
{
"main"
:{
"js"
:
"/029325bundle.js"
}}
\ No newline at end of file
module.exports
=
{
"main"
:{
"js"
:
"/482549bundle.js"
}}
\ No newline at end of file
src/components/domain/domain_admin_list.jsx
View file @
9e9b3d05
...
...
@@ -26,7 +26,8 @@ export default class DomainAdminList extends React.Component {
}
getStateFromStores
()
{
const
admins
=
DomainStore
.
getAdmins
(
this
.
props
.
domain
);
//const admins = DomainStore.getAdmins(this.props.domain);
const
admins
=
null
;
return
{
admins
};
...
...
src/components/domain/domain_details.jsx
View file @
9e9b3d05
...
...
@@ -45,7 +45,8 @@ export default class DomainDetails extends React.Component {
}
getDomain
()
{
const
domain
=
DomainStore
.
getCurrent
();
//const domain = DomainStore.getCurrent();
const
domain
=
null
;
const
states
=
{};
if
(
domain
&&
domain
.
id
===
this
.
props
.
params
.
id
)
{
...
...
src/components/domain/domain_general_info.jsx
View file @
9e9b3d05
...
...
@@ -40,7 +40,7 @@ export default class DomainGeneralInfo extends React.Component {
domain
.
checkMxRecord
((
err
,
data
)
=>
{
if
(
err
)
{
return
self
.
setState
({
mx
:
err
mx
:
err
.
message
||
err
.
extra
.
reason
});
}
...
...
@@ -82,11 +82,33 @@ export default class DomainGeneralInfo extends React.Component {
}
render
()
{
const
domain
=
this
.
props
.
domain
;
let
editDomainButton
=
null
;
let
masterID
=
null
;
let
editDomainButton
;
let
masterID
;
let
masterDomain
;
let
badgeMaster
;
if
(
domain
.
attrs
.
zimbraDomainAliasTargetId
)
{
if
(
domain
.
isAliasDomain
&&
domain
.
masterDomainName
)
{
masterID
=
domain
.
attrs
.
zimbraDomainAliasTargetId
;
masterDomain
=
(
<
li
>
<
strong
>
{
'Dominio Maestro: '
}
</
strong
>
<
a
className=
'account-name'
onClick=
{
(
e
)
=>
Utils
.
handleLink
(
e
,
`/domains/${masterID}`
,
this
.
props
.
location
)
}
>
{
`${domain.masterDomainName}`
}
</
a
>
</
li
>
);
badgeMaster
=
(
<
li
>
<
StatusLabel
classes=
'btn btn-md btn-warning'
children=
'Dominio Alias'
/>
</
li
>
);
}
const
infoBody
=
(
...
...
@@ -114,31 +136,14 @@ export default class DomainGeneralInfo extends React.Component {
<
strong
>
{
'MX Record: '
}
</
strong
>
{
this
.
state
.
mx
}
</
li
>
{
domain
.
isAliasDomain
&&
domain
.
masterDomainName
&&
(
<
li
>
<
strong
>
{
'Dominio Maestro: '
}
</
strong
>
<
a
className=
'account-name'
onClick=
{
(
e
)
=>
Utils
.
handleLink
(
e
,
`/domains/${masterID}`
,
this
.
props
.
location
)
}
>
{
domain
.
masterDomainName
}
</
a
>
</
li
>
)
}
{
masterDomain
}
<
li
>
<
strong
>
{
'Próxima renovación: '
}
</
strong
>
{
this
.
state
.
date
}
</
li
>
</
ul
>
<
ul
className=
'list-inline list-unstyled'
>
{
domain
.
isAliasDomain
&&
(
<
li
>
<
StatusLabel
classes=
'btn btn-md btn-warning'
children=
'Dominio Alias'
/>
</
li
>
)
}
{
badgeMaster
}
<
li
>
<
StatusLabel
classes=
'btn btn-md btn-info'
...
...
src/components/domain/domains.jsx
View file @
9e9b3d05
...
...
@@ -45,7 +45,7 @@ export default class Domains extends React.Component {
maxResults
:
window
.
manager_config
.
maxResultOnRequestZimbra
};
if
(
DomainStore
.
getDomains
())
{
/*
if (DomainStore.getDomains()) {
const data = DomainStore.getDomains();
GlobalActions.emitEndLoading();
...
...
@@ -54,7 +54,7 @@ export default class Domains extends React.Component {
data,
loading: false
});
}
}
*/
const
attrneeded
=
Utils
.
getAttrsBySectionFromConfig
(
'domains'
);
attrs
.
attrs
=
attrneeded
;
...
...
@@ -62,6 +62,10 @@ export default class Domains extends React.Component {
Client
.
getAllDomains
(
attrs
,
(
data
)
=>
{
data
.
domain
=
data
.
domain
.
filter
((
dom
)
=>
{
return
!
dom
.
isAliasDomain
;
});
data
.
total
=
data
.
domain
.
length
;
domains
=
data
.
domain
;
DomainStore
.
setDomains
(
data
);
this
.
getPlans
(
domains
).
...
...
src/components/domain/edit_domain.jsx
View file @
9e9b3d05
...
...
@@ -29,8 +29,9 @@ export default class EditDomain extends React.Component {
}
getDomain
()
{
//const domain = DomainStore.getCurrent();
const
domainId
=
this
.
props
.
params
.
id
;
const
domain
=
DomainStore
.
getCurrent
()
;
const
domain
=
null
;
if
(
domain
&&
domain
.
id
===
domainId
)
{
return
this
.
getCompanies
(
domain
);
...
...
src/components/mailbox/confirm_delete_modal.jsx
View file @
9e9b3d05
...
...
@@ -87,7 +87,6 @@ export default class ConfirmDeleteModal extends React.Component {
handleKeyUp
()
{
let
val
=
this
.
refs
.
confirmMailbox
.
value
;
if
(
val
===
this
.
props
.
data
.
attrs
.
mail
)
{
if
(
this
.
refs
.
buttonDelete
.
hasAttribute
('
disabled
'))
{
Utils
.
toggleStatusButtons
('
.
action
-
delete
',
false
);
...
...
src/components/mailbox/create_mailbox.jsx
View file @
9e9b3d05
...
...
@@ -67,7 +67,7 @@ export default class CreateMailBox extends React.Component {
return
false
;
}
if
(
passwd
.
length
<
9
)
{
if
(
passwd
.
length
<
Constants
.
MaxLengthOfPasswd
)
{
GlobalActions
.
emitMessage
({
message
:
'La contraseña debe ser mayor a 8 caracteres, verifique por favor.'
,
typeError
:
messageType
.
ERROR
...
...
@@ -86,7 +86,8 @@ export default class CreateMailBox extends React.Component {
sn
:
this
.
refs
.
sn
.
value
,
description
:
this
.
refs
.
description
.
value
,
zimbraCOSId
:
this
.
refs
.
zimbraCOSId
.
value
,
zimbraAccountStatus
:
this
.
refs
.
zimbraAccountStatus
.
value
zimbraAccountStatus
:
this
.
refs
.
zimbraAccountStatus
.
value
,
zimbraIsDelegatedAdminAccount
:
this
.
refs
.
zimbraIsDelegatedAdminAccount
.
checked
.
toString
().
toUpperCase
()
};
Client
.
createAccount
(
...
...
@@ -384,6 +385,28 @@ export default class CreateMailBox extends React.Component {
</
div
>
</
div
>
<
div
className=
'form-group string'
>
<
label
className=
'string col-sm-3 control-label'
>
{
'Administrador Delegado'
}
</
label
>
<
div
className=
'col-sm-8'
>
<
label
className=
'radio radio-info radio-inline pretty-input'
>
<
div
className=
'pretty-checkbox'
>
<
input
type=
'checkbox'
className=
'pretty'
name=
'mailbox'
ref=
'zimbraIsDelegatedAdminAccount'
/>
<
span
></
span
>
</
div
>
</
label
>
</
div
>
</
div
>
<
div
className=
'form-group string'
>
<
label
className=
'string required col-sm-3 control-label'
>
<
abbr
title=
'Requerido'
>
{
'*'
}
</
abbr
>
...
...
src/components/mailbox/edit_mailbox.jsx
View file @
9e9b3d05
//import select2 from 'select2';
//import ConfirmDeleteModal from './confirm_delete_modal.jsx';
//import ToggleModalButton from '../toggle_modal_button.jsx';
import
$
from
'jquery'
;
import
React
from
'react'
;
import
sweetAlert
from
'sweetalert'
;
import
Button
from
'../button.jsx'
;
import
MessageBar
from
'../message_bar.jsx'
;
import
Panel
from
'../panel.jsx'
;
import
ConfirmDeleteModal
from
'./confirm_delete_modal.jsx'
;
import
ToggleModalButton
from
'../toggle_modal_button.jsx'
;
import
DataList
from
'react-datalist'
;
import
UserStore
from
'../../stores/user_store.jsx'
;
import
Promise
from
'bluebird'
;
...
...
@@ -45,6 +46,64 @@ export default class EditMailBox extends React.Component {
this
.
refs
.
zimbraCOSId
.
value
=
val
;
}
removeAccount
()
{
const
account
=
this
.
state
.
data
;
const
response
=
{
title
:
'Se ha borrado con éxito'
,
type
:
'success'
};
sweetAlert
({
title
:
'Borrar Casilla'
,
text
:
`¿Esta seguro que dese borrar la casilla
${
account
.
name
}
?`
,
type
:
'info'
,
showCancelButton
:
true
,
confirmButtonColor
:
'#DD6B55'
,
confirmButtonText
:
'Si, deseo borrarlo!'
,
closeOnConfirm
:
false
,
showLoaderOnConfirm
:
true
,
animation
:
'slide-from-top'
},
(
isDeleted
)
=>
{
if
(
isDeleted
)
{
new
Promise
((
resolve
,
reject
)
=>
{
// start loading
GlobalActions
.
emitStartLoading
();
Client
.
removeAccount
(
account
.
id
,
()
=>
{
return
resolve
(
true
);
},
(
error
)
=>
{
return
reject
(
error
);
}
);
}).
then
(()
=>
{
MailboxStore
.
removeAccount
(
account
);
response
.
text
=
'Será redireccionado a Casillas.'
;
return
sweetAlert
(
response
,
()
=>
{
Utils
.
handleLink
(
event
,
'/mailboxes/'
,
this
.
props
.
location
);
}
);
}).
catch
((
error
)
=>
{
response
.
title
=
'Ha ocurrido un error.'
;
response
.
text
=
error
.
message
;
response
.
type
=
'error'
;
response
.
confirmButtonText
=
'Intentar de nuevo'
;
response
.
confirmButtonColor
=
'#DD6B55'
;
return
sweetAlert
(
response
);
}).
finally
(()
=>
{
GlobalActions
.
emitEndLoading
();
});
}
}
);
}
handleEnabledRename
()
{
const
selfButton
=
this
.
refs
.
rename
;
const
inputs
=
document
.
querySelectorAll
(
'.action-rename'
);
...
...
@@ -313,11 +372,6 @@ export default class EditMailBox extends React.Component {
}
componentDidMount
()
{
/*Client.renameAccount('nuevomodificado@zboxapp.dev', (exito) => {
console.log('exito', exito);
}, (fallo) => {
console.log('fallo', fallo);
});*/
$
(
'#sidebar-mailboxes'
).
addClass
(
'active'
);
EventStore
.
addMessageListener
(
this
.
showMessage
);
this
.
getMailbox
(
this
.
props
.
params
.
id
);
...
...
@@ -339,12 +393,12 @@ export default class EditMailBox extends React.Component {
}
render
()
{
let
buttonDelete
=
null
;
let
message
;
let
data
;
let
actions
;
let
form
;
const
domains
=
[];
let
buttonDelete
=
null
;
let
currentDomain
=
''
;
const
cosElements
=
[];
let
datalist
=
(
...
...
@@ -371,7 +425,7 @@ export default class EditMailBox extends React.Component {
const
cos
=
this
.
state
.
cos
;
currentDomain
=
data
.
name
.
split
(
'@'
).
pop
();
buttonDelete
=
(
/*
buttonDelete = (
<ToggleModalButton
role='button'
className='btn btn-xs btn-danger action-button'
...
...
@@ -381,6 +435,20 @@ export default class EditMailBox extends React.Component {
>
{'Eliminar'}
</ToggleModalButton>
);*/
buttonDelete
=
(
<
a
className=
'btn btn-danger btn-xs action-button'
onClick=
{
()
=>
{
this
.
removeAccount
();
}
}
key=
'btn-delete-mailbox-key'
>
{
'Eliminar Casilla'
}
</
a
>
);
const
length
=
doms
.
length
;
...
...
src/components/mailbox/mailbox.jsx
View file @
9e9b3d05
...
...
@@ -206,19 +206,6 @@ export default class Mailboxes extends React.Component {
this
.
domainName
=
domainName
;
}
/*const attrsForLockOut = Object.assign({}, attrs);
attrsForLockOut.query = 'zimbraAccountStatus=lockout';
attrsForLockOut.limit = 10;
attrsForLockOut.countOnly = true;
promises.push(Client.getAllAccountsByBatch(attrsForLockOut));
Client.batchRequest(promises, (exito) => {
console.log('exito', exito);
}, (err) => {
console.log('error', err);
});*/
new
Promise
((
resolve
,
reject
)
=>
{
if
(
domainName
)
{
const
hasMailboxForDomain
=
MailboxStore
.
getMailboxByDomainId
(
this
.
domainId
);
...
...
src/utils/client.jsx
View file @
9e9b3d05
...
...
@@ -202,10 +202,10 @@ export function getCompany(id) {
},
dataType
:
'json'
,
success
:
function
onSuccess
(
data
)
{
resolve
(
data
);
re
turn
re
solve
(
data
);
},
error
:
function
onError
(
xhr
)
{
reject
(
xhr
.
responseJSON
);
re
turn
re
ject
(
xhr
.
responseJSON
);
}
});
});
...
...
src/utils/constants.jsx
View file @
9e9b3d05
...
...
@@ -106,6 +106,7 @@ export default {
'TXT'
,
'WKS'
],
MaxLengthOfPasswd
:
9
,
status
:
{
active
:
{
label
:
'Activa'
,
...
...
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