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
54ee229e
Commit
54ee229e
authored
May 31, 2016
by
Juorder Antonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get mailquota from attrs, add missing atts inside config file, centralize status in constants.
parent
778b7ee7
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
166 additions
and
122 deletions
+166
-122
add_admin_modal.jsx
src/components/domain/add_admin_modal.jsx
+1
-1
antispam.jsx
src/components/domain/antispam.jsx
+1
-1
create_domain.jsx
src/components/domain/create_domain.jsx
+1
-1
domain_general_info.jsx
src/components/domain/domain_general_info.jsx
+12
-7
edit_domain.jsx
src/components/domain/edit_domain.jsx
+89
-76
create_domain_form.jsx
src/components/domain/multiform/create_domain_form.jsx
+8
-0
create_mailbox.jsx
src/components/mailbox/create_mailbox.jsx
+16
-3
mailbox.jsx
src/components/mailbox/mailbox.jsx
+2
-7
stats_mailbox.jsx
src/components/mailbox/stats_mailbox.jsx
+12
-25
config.json
src/config/config.json
+1
-0
constants.jsx
src/utils/constants.jsx
+23
-1
No files found.
src/components/domain/add_admin_modal.jsx
View file @
54ee229e
...
...
@@ -159,7 +159,7 @@ export default class AddAdminModal extends React.Component {
</
td
>
<
td
className=
'text-center'
>
<
a
className=
'btn btn-
warning
btn-xs'
className=
'btn btn-
info
btn-xs'
onClick=
{
(
e
)
=>
this
.
handleAddAdmin
(
e
,
u
)
}
>
{
'Activar Admin'
}
...
...
src/components/domain/antispam.jsx
View file @
54ee229e
...
...
@@ -75,7 +75,7 @@ export default class AntiSpam extends React.Component {
if
(
invalidInput
.
test
(
value
))
{
EventStore
.
emitMessage
({
message
:
'El valor de esta lista no puede contener caracteres
"Ñ"
.'
,
message
:
'El valor de esta lista no puede contener caracteres
especiales
.'
,
typeError
:
MessageType
.
ERROR
});
return
false
;
...
...
src/components/domain/create_domain.jsx
View file @
54ee229e
...
...
@@ -144,7 +144,7 @@ export default class CreateDomain extends React.Component {
if
(
!
this
.
state
.
isGlobalAdmin
)
{
form
=
(
<
div
className=
'text-center'
>
<
h4
>
<
h4
className=
'text-danger'
>
{
'Lo sentimos pero usted no tiene permiso para crear dominios.'
}
</
h4
>
</
div
>
...
...
src/components/domain/domain_general_info.jsx
View file @
54ee229e
...
...
@@ -8,6 +8,7 @@ import Panel from '../panel.jsx';
import
StatusLabel
from
'../status_label.jsx'
;
import
CompanyStore
from
'../../stores/company_store.jsx'
;
import
UserStore
from
'../../stores/user_store.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
...
...
@@ -21,6 +22,7 @@ export default class DomainGeneralInfo extends React.Component {
this
.
getMXRecord
=
this
.
getMXRecord
.
bind
(
this
);
this
.
renovationDate
=
this
.
renovationDate
.
bind
(
this
);
this
.
getCompany
=
this
.
getCompany
.
bind
(
this
);
this
.
isGlobalAdmin
=
UserStore
.
isGlobalAdmin
();
this
.
state
=
{
mx
:
null
,
...
...
@@ -80,6 +82,7 @@ export default class DomainGeneralInfo extends React.Component {
}
render
()
{
const
domain
=
this
.
props
.
domain
;
let
editDomainButton
=
null
;
const
infoBody
=
(
<
div
className=
'row'
>
<
div
className=
'col-md-12'
>
...
...
@@ -125,13 +128,15 @@ export default class DomainGeneralInfo extends React.Component {
</
div
>
);
const
editDomainButton
=
[{
if
(
this
.
isGlobalAdmin
)
{
editDomainButton
=
[{
label
:
'Editar'
,
props
:
{
className
:
'btn btn-default btn-xs'
,
onClick
:
(
e
)
=>
Utils
.
handleLink
(
e
,
`/domains/
${
this
.
props
.
params
.
id
}
/edit`
,
this
.
props
.
location
)
}
}];
}
return
(
<
Panel
...
...
src/components/domain/edit_domain.jsx
View file @
54ee229e
...
...
@@ -7,6 +7,7 @@ import Panel from '../panel.jsx';
import
CompanyStore
from
'../../stores/company_store.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
import
UserStore
from
'../../stores/user_store.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
...
...
@@ -22,6 +23,7 @@ export default class EditDomain extends React.Component {
this
.
getDomain
=
this
.
getDomain
.
bind
(
this
);
this
.
getCompanies
=
this
.
getCompanies
.
bind
(
this
);
this
.
handleSubmit
=
this
.
handleSubmit
.
bind
(
this
);
this
.
isGlobalAdmin
=
UserStore
.
isGlobalAdmin
();
this
.
state
=
{};
}
...
...
@@ -128,6 +130,7 @@ export default class EditDomain extends React.Component {
render
()
{
const
domain
=
this
.
state
.
domain
;
const
error
=
this
.
state
.
error
;
let
form
=
null
;
if
(
domain
||
error
)
{
const
companies
=
this
.
state
.
companies
;
...
...
@@ -180,7 +183,8 @@ export default class EditDomain extends React.Component {
// </div>
// </div>
const
form
=
(
if
(
this
.
isGlobalAdmin
)
{
form
=
(
<
form
className=
'simple_form form-horizontal mailbox-form'
onSubmit=
{
this
.
handleSubmit
}
...
...
@@ -275,6 +279,15 @@ export default class EditDomain extends React.Component {
</
div
>
</
form
>
);
}
else
{
form
=
(
<
div
className=
'text-center'
>
<
h4
className=
'text-danger'
>
{
'Lo sentimos pero usted no tiene permiso para editar dominios.'
}
</
h4
>
</
div
>
);
}
const
actions
=
[
{
...
...
src/components/domain/multiform/create_domain_form.jsx
View file @
54ee229e
...
...
@@ -86,6 +86,14 @@ export default class CreateDomainForm extends React.Component {
const
name
=
this
.
refs
.
domainName
.
value
.
trim
();
const
businessCategory
=
this
.
refs
.
company
.
value
.
trim
();
const
zimbraDomainStatus
=
this
.
refs
.
zimbraDomainStatus
.
value
.
trim
();
const
isDomain
=
/^
[
a-zA-Z0-9
][
a-zA-Z0-9-
]{1,61}[
a-zA-Z0-9
](?:\.[
a-zA-Z
]{2,})
+$/gi
;
if
(
!
isDomain
.
test
(
name
))
{
return
GlobalActions
.
emitMessage
({
message
:
'No se permite caracteres especiales en un dominio, por favor verificar.'
,
typeError
:
MessageType
.
ERROR
});
}
plans
.
forEach
((
p
)
=>
{
zimbraDomainCOSMaxAccounts
.
push
(
`
${
this
.
refs
[
`plan-
${
p
}
`
].
getAttribute
(
'data-id'
)}
:
${
this
.
refs
[
`plan-
${
p
}
`
].
value
||
0
}
`
);
...
...
src/components/mailbox/create_mailbox.jsx
View file @
54ee229e
...
...
@@ -246,6 +246,21 @@ export default class CreateMailBox extends React.Component {
domains
.
push
(
object
[
limit
].
name
);
}
const
options
=
Object
.
keys
(
Constants
.
status
).
map
((
option
,
i
)
=>
{
if
(
Constants
.
status
[
option
].
isEnabledOnCreate
)
{
return
(
<
option
value=
{
option
}
key=
{
`option-plan-${i}`
}
>
{
Constants
.
status
[
option
].
label
}
</
option
>
);
}
return
null
;
});
for
(
let
plan
in
plans
)
{
if
(
plans
.
hasOwnProperty
(
plan
))
{
const
item
=
(
...
...
@@ -364,9 +379,7 @@ export default class CreateMailBox extends React.Component {
className=
'form-control'
ref=
'zimbraAccountStatus'
>
<
option
value=
'active'
>
Activa
</
option
>
<
option
value=
'closed'
>
Cerrada
</
option
>
<
option
value=
'locked'
>
Bloqueada
</
option
>
{
options
}
</
select
>
</
div
>
</
div
>
...
...
src/components/mailbox/mailbox.jsx
View file @
54ee229e
...
...
@@ -51,12 +51,7 @@ export default class Mailboxes extends React.Component {
this
.
cos
=
Utils
.
getEnabledPlansByCos
(
ZimbraStore
.
getAllCos
());
this
.
cosById
=
Utils
.
getEnabledPlansByCosId
(
ZimbraStore
.
getAllCos
());
this
.
isRefreshing
=
true
;
this
.
optionStatus
=
{
active
:
'Active'
,
locked
:
'Inactiva'
,
lockout
:
'Bloqueada'
,
closed
:
'Cerrada'
};
this
.
optionStatus
=
Constants
.
status
;
this
.
optionPlans
=
window
.
manager_config
.
plans
;
this
.
domainId
=
null
;
this
.
domainName
=
null
;
...
...
@@ -602,7 +597,7 @@ export default class Mailboxes extends React.Component {
key=
{
`status-${i}`
}
value=
{
`${item}`
}
>
{
Utils
.
titleCase
(
this
.
optionStatus
[
item
])
}
{
Utils
.
titleCase
(
this
.
optionStatus
[
item
]
.
label
)
}
</
option
>
);
});
...
...
src/components/mailbox/stats_mailbox.jsx
View file @
54ee229e
//import ZimbraStore from '../../stores/zimbra_store.jsx';
import
React
from
'react'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
ZimbraStore
from
'../../stores/zimbra_store.jsx'
;
import
bytesConvertor
from
'bytes'
;
import
Constants
from
'../../utils/constants.jsx'
;
export
default
class
BlockGeneralInfoMailbox
extends
React
.
Component
{
constructor
(
props
)
{
//this.sizeEnabled = Utils.getEnabledPlansObjectByCos(ZimbraStore.getAllCos(), this.props.data.attrs.zimbraCOSId);
super
(
props
);
this
.
date
=
null
;
this
.
status
=
null
;
this
.
className
=
null
;
this
.
lastConection
=
'No se ha conectado'
;
this
.
getMailSize
=
this
.
getMailSize
.
bind
(
this
);
this
.
sizeEnabled
=
Utils
.
getEnabledPlansObjectByCos
(
ZimbraStore
.
getAllCos
(),
this
.
props
.
data
.
attrs
.
zimbraCOSId
);
console
.
log
(
'cosID'
,
this
.
props
.
data
.
attrs
.
zimbraCOSId
);
//eslint-disable-line no-console
console
.
log
(
'all cos'
,
ZimbraStore
.
getAllCos
());
//eslint-disable-line no-console
this
.
state
=
{};
}
...
...
@@ -34,24 +33,11 @@ export default class BlockGeneralInfoMailbox extends React.Component {
componentWillMount
()
{
this
.
date
=
Utils
.
dateFormatted
(
this
.
props
.
data
.
attrs
.
zimbraCreateTimestamp
);
switch
(
this
.
props
.
data
.
attrs
.
zimbraAccountStatus
)
{
case
'lockout'
:
this
.
status
=
'Bloqueada'
;
this
.
className
=
'label-locked mailbox-status'
;
break
;
case
'active'
:
this
.
status
=
'Activa'
;
this
.
className
=
'label-success mailbox-status'
;
break
;
case
'closed'
:
this
.
status
=
'Cerrada'
;
this
.
className
=
'label-default mailbox-status'
;
break
;
case
'locked'
:
this
.
status
=
'Inactiva'
;
this
.
className
=
'label-warning mailbox-status'
;
break
;
default
:
const
status
=
this
.
props
.
data
.
attrs
.
zimbraAccountStatus
;
if
(
Constants
.
status
[
status
])
{
this
.
status
=
Constants
.
status
[
status
].
label
;
this
.
className
=
Constants
.
status
[
status
].
classes
;
}
if
(
this
.
props
.
data
.
attrs
.
zimbraLastLogonTimestamp
)
{
...
...
@@ -68,9 +54,10 @@ export default class BlockGeneralInfoMailbox extends React.Component {
if
(
this
.
state
.
size
)
{
size
=
this
.
state
.
size
;
}
console
.
log
(
this
.
sizeEnabled
);
//eslint-disable-line no-console
if
(
this
.
sizeEnabled
.
hasOwnProperty
(
'attrs'
)
&&
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
)
{
const
sizeOfPlan
=
typeof
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
===
'string'
?
parseInt
(
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
,
10
)
:
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
;
if
(
this
.
props
.
data
.
attrs
.
zimbraMailQuota
)
{
const
attrs
=
this
.
props
.
data
.
attrs
;
const
sizeOfPlan
=
typeof
attrs
.
zimbraMailQuota
===
'string'
?
parseInt
(
attrs
.
zimbraMailQuota
,
10
)
:
attrs
.
zimbraMailQuota
;
sizeEnaled
=
(
sizeOfPlan
)
?
bytesConvertor
(
sizeOfPlan
)
:
'Ilimitado'
;
}
...
...
src/config/config.json
View file @
54ee229e
...
...
@@ -54,6 +54,7 @@
"zimbraCOSId"
:
true
,
"zimbraAccountStatus"
:
true
,
"zimbraMailHost"
:
true
,
"zimbraMailQuota"
:
true
,
"zimbraArchiveAccount"
:
true
,
"zimbraMailAlias"
:
true
,
"zimbraPrefOutOfOfficeReplyEnabled"
:
true
,
...
...
src/utils/constants.jsx
View file @
54ee229e
...
...
@@ -105,5 +105,27 @@ export default {
'TSIG'
,
'TXT'
,
'WKS'
]
],
status
:
{
active
:
{
label
:
'Activa'
,
isEnabledOnCreate
:
true
,
classes
:
'label-success mailbox-status'
},
locked
:
{
label
:
'Inactiva'
,
isEnabledOnCreate
:
true
,
classes
:
'label-warning mailbox-status'
},
lockout
:
{
label
:
'Bloqueada'
,
isEnabledOnCreate
:
false
,
classes
:
'label-warning mailbox-status'
},
closed
:
{
label
:
'Cerrada'
,
isEnabledOnCreate
:
true
,
classes
:
'label-default mailbox-status'
}
}
};
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