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
6273468d
Commit
6273468d
authored
Apr 22, 2016
by
Elias Nahum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter mailboxes for a domain
parent
4dfd93b7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
13 deletions
+74
-13
mailbox.jsx
src/components/mailbox/mailbox.jsx
+69
-12
page_info.jsx
src/components/page_info.jsx
+1
-1
index.jsx
src/index.jsx
+4
-0
No files found.
src/components/mailbox/mailbox.jsx
View file @
6273468d
...
@@ -15,8 +15,10 @@ import statusLabel from '../status_label.jsx';
...
@@ -15,8 +15,10 @@ import statusLabel from '../status_label.jsx';
import
*
as
Client
from
'../../utils/client.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
Constants
from
'../../utils/constants.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
Constants
from
'../../utils/constants.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
const
QueryOptions
=
Constants
.
QueryOptions
;
const
QueryOptions
=
Constants
.
QueryOptions
;
...
@@ -30,6 +32,7 @@ export default class Mailboxes extends React.Component {
...
@@ -30,6 +32,7 @@ export default class Mailboxes extends React.Component {
this
.
handleExportAsCSV
=
this
.
handleExportAsCSV
.
bind
(
this
);
this
.
handleExportAsCSV
=
this
.
handleExportAsCSV
.
bind
(
this
);
this
.
handleTabChanged
=
this
.
handleTabChanged
.
bind
(
this
);
this
.
handleTabChanged
=
this
.
handleTabChanged
.
bind
(
this
);
this
.
handleWatchInfo
=
this
.
handleWatchInfo
.
bind
(
this
);
this
.
handleWatchInfo
=
this
.
handleWatchInfo
.
bind
(
this
);
this
.
domainInfo
=
this
.
domainInfo
.
bind
(
this
);
const
page
=
parseInt
(
this
.
props
.
location
.
query
.
page
,
10
)
||
1
;
const
page
=
parseInt
(
this
.
props
.
location
.
query
.
page
,
10
)
||
1
;
...
@@ -39,15 +42,38 @@ export default class Mailboxes extends React.Component {
...
@@ -39,15 +42,38 @@ export default class Mailboxes extends React.Component {
};
};
}
}
domainInfo
(
domainId
)
{
return
new
Promise
(
(
resolve
,
reject
)
=>
{
const
domain
=
DomainStore
.
getCurrent
();
if
(
domain
&&
domainId
===
domain
.
id
)
{
return
resolve
();
}
return
Client
.
getDomain
(
domainId
,
(
data
)
=>
{
DomainStore
.
setCurrent
(
data
);
return
resolve
();
},
()
=>
{
return
reject
();
}
);
}
);
}
handleWatchInfo
(
e
,
path
,
location
)
{
handleWatchInfo
(
e
,
path
,
location
)
{
Utils
.
handleLink
(
e
,
path
,
location
);
Utils
.
handleLink
(
e
,
path
,
location
);
}
}
get
Mailboxes
(
)
{
get
Accounts
(
domainName
)
{
Client
.
getAllAccounts
(
Client
.
getAllAccounts
(
{
{
limit
:
QueryOptions
.
DEFAULT_LIMIT
,
limit
:
QueryOptions
.
DEFAULT_LIMIT
,
offset
:
this
.
state
.
offset
offset
:
this
.
state
.
offset
,
domain
:
domainName
},
},
(
data
)
=>
{
(
data
)
=>
{
this
.
setState
({
this
.
setState
({
...
@@ -64,6 +90,20 @@ export default class Mailboxes extends React.Component {
...
@@ -64,6 +90,20 @@ export default class Mailboxes extends React.Component {
);
);
}
}
getMailboxes
()
{
const
domainId
=
this
.
props
.
params
.
domain_id
;
if
(
domainId
)
{
return
this
.
domainInfo
(
domainId
).
then
(
()
=>
{
const
domain
=
DomainStore
.
getCurrent
();
this
.
getAccounts
(
domain
.
name
);
}
);
}
return
this
.
getAccounts
();
}
handleAddMailbox
(
e
,
path
)
{
handleAddMailbox
(
e
,
path
)
{
e
.
preventDefault
();
e
.
preventDefault
();
if
((
this
.
props
.
location
.
basename
+
this
.
props
.
location
.
pathname
)
!==
path
)
{
if
((
this
.
props
.
location
.
basename
+
this
.
props
.
location
.
pathname
)
!==
path
)
{
...
@@ -127,7 +167,7 @@ export default class Mailboxes extends React.Component {
...
@@ -127,7 +167,7 @@ export default class Mailboxes extends React.Component {
let
tableResults
;
let
tableResults
;
let
total
=
0
;
let
total
=
0
;
le
t
arrLocked
=
[];
cons
t
arrLocked
=
[];
if
(
this
.
state
.
data
)
{
if
(
this
.
state
.
data
)
{
total
=
this
.
state
.
data
.
account
.
length
;
total
=
this
.
state
.
data
.
account
.
length
;
...
@@ -250,11 +290,11 @@ export default class Mailboxes extends React.Component {
...
@@ -250,11 +290,11 @@ export default class Mailboxes extends React.Component {
const
icon
=
(
const
icon
=
(
<
div
>
<
div
>
<
i
className=
'/fa fa-download'
/>
<
i
className=
'/fa fa-download'
/>
<
span
>
Exportar
</
span
>
<
span
>
{
'Exportar'
}
</
span
>
</
div
>
</
div
>
);
);
le
t
tab1
=
(
cons
t
tab1
=
(
<
div
>
<
div
>
<
Panel
<
Panel
title=
''
title=
''
...
@@ -283,28 +323,28 @@ export default class Mailboxes extends React.Component {
...
@@ -283,28 +323,28 @@ export default class Mailboxes extends React.Component {
</
div
>
</
div
>
);
);
le
t
tab2
=
(
cons
t
tab2
=
(
<
Panel
<
Panel
title=
'Casillas tab2'
title=
'Casillas tab2'
children=
{
[
panelBody
,
pagination
]
}
children=
{
[
panelBody
,
pagination
]
}
/>
/>
);
);
le
t
tab3
=
(
cons
t
tab3
=
(
<
Panel
<
Panel
title=
'Casillas tb3'
title=
'Casillas tb3'
children=
{
panelBody
}
children=
{
panelBody
}
/>
/>
);
);
le
t
tab4
=
(
cons
t
tab4
=
(
<
Panel
<
Panel
title=
'Casillas tab4'
title=
'Casillas tab4'
children=
{
panelBody
}
children=
{
panelBody
}
/>
/>
);
);
le
t
arrTabs
=
{};
cons
t
arrTabs
=
{};
arrTabs
[
Utils
.
slug
(
todas
)]
=
tab1
;
arrTabs
[
Utils
.
slug
(
todas
)]
=
tab1
;
arrTabs
[
Utils
.
slug
(
archiving
)]
=
tab2
;
arrTabs
[
Utils
.
slug
(
archiving
)]
=
tab2
;
arrTabs
[
Utils
.
slug
(
noPlan
)]
=
tab3
;
arrTabs
[
Utils
.
slug
(
noPlan
)]
=
tab3
;
...
@@ -322,10 +362,26 @@ export default class Mailboxes extends React.Component {
...
@@ -322,10 +362,26 @@ export default class Mailboxes extends React.Component {
const
content
=
panelTabs
||
''
;
const
content
=
panelTabs
||
''
;
let
title
=
'Casillas'
;
const
domain
=
DomainStore
.
getCurrent
();
if
(
this
.
props
.
params
.
domain_id
&&
domain
)
{
title
=
(
<
div
>
{
'Casillas del dominio: '
}
<
a
href=
'#'
onClick=
{
(
e
)
=>
Utils
.
handleLink
(
e
,
`/domains/${domain.id}`
)
}
>
{
`@${domain.name}`
}
</
a
>
</
div
>
);
}
return
(
return
(
<
div
>
<
div
>
<
PageInfo
<
PageInfo
titlePage=
'Casillas'
titlePage=
{
title
}
descriptionPage=
'Usuarios de correo electrónico'
descriptionPage=
'Usuarios de correo electrónico'
/>
/>
...
@@ -344,5 +400,6 @@ export default class Mailboxes extends React.Component {
...
@@ -344,5 +400,6 @@ export default class Mailboxes extends React.Component {
}
}
Mailboxes
.
propTypes
=
{
Mailboxes
.
propTypes
=
{
location
:
React
.
PropTypes
.
object
.
isRequired
location
:
React
.
PropTypes
.
object
.
isRequired
,
params
:
React
.
PropTypes
.
object
.
isRequired
};
};
src/components/page_info.jsx
View file @
6273468d
...
@@ -18,7 +18,7 @@ export default class PageInfo extends React.Component {
...
@@ -18,7 +18,7 @@ export default class PageInfo extends React.Component {
}
}
PageInfo
.
propTypes
=
{
PageInfo
.
propTypes
=
{
titlePage
:
React
.
PropTypes
.
string
.
isRequired
,
titlePage
:
React
.
PropTypes
.
any
.
isRequired
,
descriptionPage
:
React
.
PropTypes
.
string
descriptionPage
:
React
.
PropTypes
.
string
};
};
...
...
src/index.jsx
View file @
6273468d
...
@@ -133,6 +133,10 @@ function renderRootComponent() {
...
@@ -133,6 +133,10 @@ function renderRootComponent() {
path=
'domains/:id/edit'
path=
'domains/:id/edit'
component=
{
EditDomains
}
component=
{
EditDomains
}
/>
/>
<
Route
path=
'domains/:domain_id/mailboxes'
component=
{
Mailboxes
}
/>
<
Route
<
Route
path=
'accounts'
path=
'accounts'
...
...
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