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
b72a575f
Commit
b72a575f
authored
May 27, 2016
by
Patricio Bruna
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #122 from ZBoxApp/link_to_domain_withoutlimit
Link para mostrar dominios sin limites asignados, Fix #62
parents
5e94fe33
2fe981a5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
37 deletions
+84
-37
.eslintrc
.eslintrc
+2
-2
path.json
path.json
+1
-1
companies.jsx
src/components/companies/companies.jsx
+3
-1
message_bar.jsx
src/components/message_bar.jsx
+23
-3
search.jsx
src/components/search/search.jsx
+45
-30
_flash_alert.scss
src/sass/components/_flash_alert.scss
+6
-0
constants.jsx
src/utils/constants.jsx
+4
-0
No files found.
.eslintrc
View file @
b72a575f
...
@@ -185,13 +185,13 @@
...
@@ -185,13 +185,13 @@
"react/no-is-mounted": 2,
"react/no-is-mounted": 2,
"react/no-string-refs": 0,
"react/no-string-refs": 0,
"react/jsx-pascal-case": 2,
"react/jsx-pascal-case": 2,
"react/jsx-indent": [1, 4],
//
"react/jsx-indent": [1, 4],
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-handler-names": 0,
"react/jsx-handler-names": 0,
"react/jsx-boolean-value": [2, "always"],
"react/jsx-boolean-value": [2, "always"],
"react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }],
"react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }],
"react/jsx-curly-spacing": [2, "never"],
"react/jsx-curly-spacing": [2, "never"],
"react/jsx-indent-props": [2, 4],
//
"react/jsx-indent-props": [2, 4],
"react/jsx-key": 2,
"react/jsx-key": 2,
"react/jsx-max-props-per-line": [2, { "maximum": 1 }],
"react/jsx-max-props-per-line": [2, { "maximum": 1 }],
"react/jsx-no-bind": 1,
"react/jsx-no-bind": 1,
...
...
path.json
View file @
b72a575f
module.exports
=
{
"main"
:{
"js"
:
"/950474bundle.js"
}}
module.exports
=
{
"main"
:{
"js"
:
"/080240bundle.js"
}}
\ No newline at end of file
\ No newline at end of file
src/components/companies/companies.jsx
View file @
b72a575f
...
@@ -264,7 +264,9 @@ export default class Companies extends React.Component {
...
@@ -264,7 +264,9 @@ export default class Companies extends React.Component {
<
MessageBar
<
MessageBar
message=
'Existen dominios sin límites asignados'
message=
'Existen dominios sin límites asignados'
type=
'WARNING'
type=
'WARNING'
autoclose=
{
true
}
autoclose=
{
false
}
link=
{
`/search/${Constants.ZimbraSearchs.DOMAINS_WITHOUT_LIMITS}`
}
linkText=
'Ver dominios sin límites'
/>
/>
);
);
}
}
...
...
src/components/message_bar.jsx
View file @
b72a575f
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
$
from
'jquery'
;
import
$
from
'jquery'
;
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Link
}
from
'react-router'
;
import
Constants
from
'../utils/constants.jsx'
;
import
Constants
from
'../utils/constants.jsx'
;
...
@@ -64,6 +65,21 @@ export default class MessageBar extends React.Component {
...
@@ -64,6 +65,21 @@ export default class MessageBar extends React.Component {
);
);
}
}
const
link
=
this
.
props
.
link
;
const
linkText
=
this
.
props
.
linkText
?
this
.
props
.
linkText
:
link
;
let
messageLink
;
if
(
link
)
{
messageLink
=
(
<
span
>
-
<
Link
to=
{
link
}
style=
{
{
color
:
'#fff'
}
}
>
{
` ${linkText}`
}
</
Link
>
</
span
>
);
}
const
alertClass
=
`alert flash-
${
this
.
props
.
type
.
toLowerCase
()}
${
dismissible
}
`
;
const
alertClass
=
`alert flash-
${
this
.
props
.
type
.
toLowerCase
()}
${
dismissible
}
`
;
let
icon
;
let
icon
;
switch
(
this
.
props
.
type
)
{
switch
(
this
.
props
.
type
)
{
...
@@ -91,7 +107,7 @@ export default class MessageBar extends React.Component {
...
@@ -91,7 +107,7 @@ export default class MessageBar extends React.Component {
role=
'alert'
role=
'alert'
>
>
{
closeButton
}
{
closeButton
}
{
icon
}
{
message
}
{
icon
}
{
message
}
{
messageLink
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
@@ -107,7 +123,9 @@ MessageBar.defaultProps = {
...
@@ -107,7 +123,9 @@ MessageBar.defaultProps = {
position
:
'relative'
,
position
:
'relative'
,
canClose
:
true
,
canClose
:
true
,
autoclose
:
false
,
autoclose
:
false
,
autocloseInSecs
:
10
autocloseInSecs
:
10
,
link
:
null
,
linkText
:
null
};
};
MessageBar
.
propTypes
=
{
MessageBar
.
propTypes
=
{
...
@@ -116,5 +134,7 @@ MessageBar.propTypes = {
...
@@ -116,5 +134,7 @@ MessageBar.propTypes = {
position
:
React
.
PropTypes
.
oneOf
([
'absolute'
,
'fixed'
,
'relative'
,
'static'
,
'inherit'
]),
position
:
React
.
PropTypes
.
oneOf
([
'absolute'
,
'fixed'
,
'relative'
,
'static'
,
'inherit'
]),
canClose
:
React
.
PropTypes
.
bool
,
canClose
:
React
.
PropTypes
.
bool
,
autoclose
:
React
.
PropTypes
.
bool
,
autoclose
:
React
.
PropTypes
.
bool
,
autocloseInSecs
:
React
.
PropTypes
.
number
autocloseInSecs
:
React
.
PropTypes
.
number
,
link
:
React
.
PropTypes
.
string
,
linkText
:
React
.
PropTypes
.
string
};
};
src/components/search/search.jsx
View file @
b72a575f
...
@@ -28,41 +28,56 @@ export default class SearchView extends React.Component {
...
@@ -28,41 +28,56 @@ export default class SearchView extends React.Component {
this
.
makeSearch
(
query
);
this
.
makeSearch
(
query
);
}
}
runSearch
(
queryObject
)
{
this
.
setState
({
loading
:
true
});
Client
.
search
(
queryObject
,
(
success
)
=>
{
const
result
=
[];
for
(
const
key
in
success
)
{
if
(
success
.
hasOwnProperty
(
key
))
{
if
(
key
===
'dl'
||
key
===
'domain'
||
key
===
'account'
)
{
Array
.
prototype
.
push
.
apply
(
result
,
success
[
key
]);
}
}
}
if
(
success
.
total
<=
0
)
{
return
this
.
setState
({
notfound
:
true
,
loading
:
false
});
}
return
this
.
setState
({
result
,
loading
:
false
,
notfound
:
false
});
},
(
error
)
=>
{
console
.
log
(
error
);
//eslint-disable-line no-console
});
}
makeSearch
(
query
)
{
makeSearch
(
query
)
{
this
.
setState
({
let
advanceQuery
=
false
;
loading
:
true
try
{
});
advanceQuery
=
JSON
.
parse
(
query
).
advanceQuery
;
Client
.
search
({
}
catch
(
e
)
{
advanceQuery
=
false
;
}
if
(
advanceQuery
)
{
this
.
runSearch
(
advanceQuery
);
}
else
{
const
queryObject
=
{
maxResults
:
window
.
manager_config
.
maxResultOnRequestZimbra
,
maxResults
:
window
.
manager_config
.
maxResultOnRequestZimbra
,
query
:
`(|(mail=*
${
query
}
*)(cn=*
${
query
}
*)(sn=*
${
query
}
*)(gn=*
${
query
}
*)(displayName=*
${
query
}
*)(zimbraMailDeliveryAddress=*
${
query
}
*)(zimbraDomainName=*
${
query
}
*)(uid=*
${
query
}
*)(zimbraMailAlias=*
${
query
}
*)(uid=*
${
query
}
*)(zimbraDomainName=*
${
query
}
*)(cn=*
${
query
}
*))`
,
query
:
`(|(mail=*
${
query
}
*)(cn=*
${
query
}
*)(sn=*
${
query
}
*)(gn=*
${
query
}
*)(displayName=*
${
query
}
*)(zimbraMailDeliveryAddress=*
${
query
}
*)(zimbraDomainName=*
${
query
}
*)(uid=*
${
query
}
*)(zimbraMailAlias=*
${
query
}
*)(uid=*
${
query
}
*)(zimbraDomainName=*
${
query
}
*)(cn=*
${
query
}
*))`
,
types
:
'accounts,distributionlists,domains'
,
types
:
'accounts,distributionlists,domains'
,
attrs
:
'objectClass'
attrs
:
'objectClass'
},
(
success
)
=>
{
};
const
result
=
[];
this
.
runSearch
(
queryObject
);
}
for
(
const
key
in
success
)
{
if
(
success
.
hasOwnProperty
(
key
))
{
if
(
key
===
'dl'
||
key
===
'domain'
||
key
===
'account'
)
{
Array
.
prototype
.
push
.
apply
(
result
,
success
[
key
]);
}
}
}
if
(
success
.
total
<=
0
)
{
return
this
.
setState
({
notfound
:
true
,
loading
:
false
});
}
return
this
.
setState
({
result
,
loading
:
false
,
notfound
:
false
});
},
(
error
)
=>
{
console
.
log
(
error
);
//eslint-disable-line no-console
});
}
}
render
()
{
render
()
{
...
...
src/sass/components/_flash_alert.scss
View file @
b72a575f
...
@@ -23,4 +23,10 @@
...
@@ -23,4 +23,10 @@
background
:
$color-violet
;
background
:
$color-violet
;
color
:
$white
;
color
:
$white
;
}
}
a
{
color
:
$white
;
text-decoration
:
underline
;
}
}
}
src/utils/constants.jsx
View file @
b72a575f
...
@@ -49,6 +49,10 @@ export default {
...
@@ -49,6 +49,10 @@ export default {
AUTH__REQUIRED
:
'service.AUTH_REQUIRED'
AUTH__REQUIRED
:
'service.AUTH_REQUIRED'
},
},
ZimbraSearchs
:
{
DOMAINS_WITHOUT_LIMITS
:
'{"advance_query": {"query": "(!(zimbraDomainCOSMaxAccounts=*))", "types": "domains"}}'
},
RESERVED_USERNAMES
:
[
RESERVED_USERNAMES
:
[
'admin'
,
'admin'
,
'root'
'root'
...
...
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