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
6473e3b0
Commit
6473e3b0
authored
Apr 29, 2016
by
Juorder Gonzalez
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #35 from ZBoxApp/cos
Add get plans to display for COS defined in the server
parents
fd85cc86
9ccec89c
Changes
2
Hide 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 @
6473e3b0
...
@@ -493,3 +493,22 @@ export function batchRequest(requestArray, success, error) {
...
@@ -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 @
6473e3b0
...
@@ -281,3 +281,17 @@ export function getPlansFromDomain(domain) {
...
@@ -281,3 +281,17 @@ export function getPlansFromDomain(domain) {
export
function
titleCase
(
string
)
{
export
function
titleCase
(
string
)
{
return
string
.
charAt
(
0
).
toUpperCase
()
+
string
.
slice
(
1
);
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