Commit b72a575f authored by Patricio Bruna's avatar Patricio Bruna

Merge pull request #122 from ZBoxApp/link_to_domain_withoutlimit

Link para mostrar dominios sin limites asignados, Fix #62
parents 5e94fe33 2fe981a5
......@@ -185,13 +185,13 @@
"react/no-is-mounted": 2,
"react/no-string-refs": 0,
"react/jsx-pascal-case": 2,
"react/jsx-indent": [1, 4],
// "react/jsx-indent": [1, 4],
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-handler-names": 0,
"react/jsx-boolean-value": [2, "always"],
"react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }],
"react/jsx-curly-spacing": [2, "never"],
"react/jsx-indent-props": [2, 4],
// "react/jsx-indent-props": [2, 4],
"react/jsx-key": 2,
"react/jsx-max-props-per-line": [2, { "maximum": 1 }],
"react/jsx-no-bind": 1,
......
module.exports = {"main":{"js":"/950474bundle.js"}}
\ No newline at end of file
module.exports = {"main":{"js":"/080240bundle.js"}}
\ No newline at end of file
......@@ -264,7 +264,9 @@ export default class Companies extends React.Component {
<MessageBar
message='Existen dominios sin límites asignados'
type='WARNING'
autoclose={true}
autoclose={false}
link={`/search/${Constants.ZimbraSearchs.DOMAINS_WITHOUT_LIMITS}`}
linkText='Ver dominios sin límites'
/>
);
}
......
......@@ -3,6 +3,7 @@
import $ from 'jquery';
import React from 'react';
import {Link} from 'react-router';
import Constants from '../utils/constants.jsx';
......@@ -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}`;
let icon;
switch (this.props.type) {
......@@ -91,7 +107,7 @@ export default class MessageBar extends React.Component {
role='alert'
>
{closeButton}
{icon} {message}
{icon} {message} {messageLink}
</div>
</div>
);
......@@ -107,7 +123,9 @@ MessageBar.defaultProps = {
position: 'relative',
canClose: true,
autoclose: false,
autocloseInSecs: 10
autocloseInSecs: 10,
link: null,
linkText: null
};
MessageBar.propTypes = {
......@@ -116,5 +134,7 @@ MessageBar.propTypes = {
position: React.PropTypes.oneOf(['absolute', 'fixed', 'relative', 'static', 'inherit']),
canClose: React.PropTypes.bool,
autoclose: React.PropTypes.bool,
autocloseInSecs: React.PropTypes.number
autocloseInSecs: React.PropTypes.number,
link: React.PropTypes.string,
linkText: React.PropTypes.string
};
......@@ -28,16 +28,11 @@ export default class SearchView extends React.Component {
this.makeSearch(query);
}
makeSearch(query) {
runSearch(queryObject) {
this.setState({
loading: true
});
Client.search({
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}*))`,
types: 'accounts,distributionlists,domains',
attrs: 'objectClass'
}, (success) => {
Client.search(queryObject, (success) => {
const result = [];
for (const key in success) {
......@@ -65,6 +60,26 @@ export default class SearchView extends React.Component {
});
}
makeSearch(query) {
let advanceQuery = false;
try {
advanceQuery = JSON.parse(query).advanceQuery;
} catch (e) {
advanceQuery = false;
}
if (advanceQuery) {
this.runSearch(advanceQuery);
} else {
const queryObject = {
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}*))`,
types: 'accounts,distributionlists,domains',
attrs: 'objectClass'
};
this.runSearch(queryObject);
}
}
render() {
const query = this.props.params.query;
let content = null;
......
......@@ -23,4 +23,10 @@
background: $color-violet;
color: $white;
}
a {
color: $white;
text-decoration: underline;
}
}
......@@ -49,6 +49,10 @@ export default {
AUTH__REQUIRED: 'service.AUTH_REQUIRED'
},
ZimbraSearchs: {
DOMAINS_WITHOUT_LIMITS: '{"advance_query": {"query": "(!(zimbraDomainCOSMaxAccounts=*))", "types": "domains"}}'
},
RESERVED_USERNAMES: [
'admin',
'root'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment