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
9ccec89c
Commit
9ccec89c
authored
Apr 29, 2016
by
Elias Nahum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add get plans to display for COS defined in the server
parent
fd85cc86
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
client.jsx
src/utils/client.jsx
+19
-0
utils.jsx
src/utils/utils.jsx
+14
-0
No files found.
src/utils/client.jsx
View file @
9ccec89c
...
...
@@ -493,3 +493,22 @@ export function batchRequest(requestArray, success, error) {
}
);
}
export
function
getAllCos
(
success
,
error
)
{
initZimbra
().
then
(
(
zimbra
)
=>
{
zimbra
.
getAllCos
((
err
,
data
)
=>
{
if
(
err
)
{
const
e
=
handleError
(
'getAllCos'
,
err
);
return
error
(
e
);
}
return
success
(
data
);
});
},
(
err
)
=>
{
const
e
=
handleError
(
'getAllCos'
,
err
);
return
error
(
e
);
}
);
}
src/utils/utils.jsx
View file @
9ccec89c
...
...
@@ -281,3 +281,17 @@ export function getPlansFromDomain(domain) {
export
function
titleCase
(
string
)
{
return
string
.
charAt
(
0
).
toUpperCase
()
+
string
.
slice
(
1
);
}
export
function
getEnabledPlansByCos
(
cosArray
)
{
const
configPlans
=
global
.
window
.
manager_config
.
plans
;
const
plans
=
{};
cosArray
.
forEach
((
cos
)
=>
{
const
key
=
cos
.
name
;
if
(
configPlans
.
hasOwnProperty
(
key
)
&&
configPlans
[
key
])
{
plans
[
key
]
=
cos
.
id
;
}
});
return
plans
;
}
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