Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Genesys Website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Website
Commits
dab5eba3
Commit
dab5eba3
authored
Jan 21, 2019
by
Oleksii Savran
Committed by
Viacheslav Pavlov
Jan 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admin: Users sort
User sorting fix for mobile Fixed url after sorting
parent
a916cde9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
12 deletions
+61
-12
locales/en/translations.json
locales/en/translations.json
+6
-1
src/actions/navigation.ts
src/actions/navigation.ts
+2
-1
src/model/request/MaterialRequest.ts
src/model/request/MaterialRequest.ts
+2
-2
src/model/user/User.ts
src/model/user/User.ts
+13
-0
src/requests/actions/admin.ts
src/requests/actions/admin.ts
+6
-1
src/subsets/actions/dashboard.ts
src/subsets/actions/dashboard.ts
+5
-1
src/user/actions/admin.ts
src/user/actions/admin.ts
+5
-1
src/user/translations.json
src/user/translations.json
+6
-1
src/user/ui/admin/BrowsePage.tsx
src/user/ui/admin/BrowsePage.tsx
+16
-4
No files found.
locales/en/translations.json
View file @
dab5eba3
...
...
@@ -1857,7 +1857,8 @@
},
"p"
:
{
"browse"
:
{
"title"
:
"Registered user accounts"
"title"
:
"Registered user accounts"
,
"mobileTitle"
:
"Registered users"
},
"display"
:
{
"title"
:
"User profile information"
,
...
...
@@ -1936,6 +1937,10 @@
"deleted"
:
"DELETED"
,
"ldap"
:
"LDAP"
}
},
"sort"
:
{
"lastLoginAsc"
:
"Last login (old to new)"
,
"lastLoginDesc"
:
"Last login (new to old)"
}
}
,
"vocabulary"
:
{
...
...
src/actions/navigation.ts
View file @
dab5eba3
...
...
@@ -11,7 +11,8 @@ export function navigateTo(path: string, query?: object) {
}
const
location
=
getState
().
routing
.
location
.
pathname
;
if
(
location
!==
path
)
{
const
search
=
getState
().
routing
.
location
.
search
;
if
(
`
${
location
}${
search
}
`
!==
`
${
path
}${
query
?
stringify
(
query
)
:
''
}
`
)
{
if
(
!
query
)
{
dispatch
(
push
(
path
?
path
:
''
));
}
else
{
...
...
src/model/request/MaterialRequest.ts
View file @
dab5eba3
...
...
@@ -20,8 +20,8 @@ class MaterialRequest {
public
version
:
number
;
public
static
DEFAULT_SORT
=
{
property
:
'
lastModifiedDate
'
,
direction
:
'
DE
SC
'
,
property
:
'
id
'
,
direction
:
'
A
SC
'
,
};
public
static
STATE
:
{
[
key
:
number
]:
string
;
}
=
{
...
...
src/model/user/User.ts
View file @
dab5eba3
import
{
UuidModel
}
from
'
model/common.model
'
;
import
{
SortDirection
}
from
'
model/Page
'
;
class
User
extends
UuidModel
{
public
static
USERROLES
:
{
[
key
:
string
]:
any
;
}
=
{
...
...
@@ -28,6 +29,18 @@ class User extends UuidModel {
public
constructor
(
obj
?)
{
super
(
obj
);
}
public
static
DEFAULT_SORT
=
{
property
:
'
email
'
,
direction
:
SortDirection
.
ASC
,
};
public
static
CUSTOM_SORT_OPTIONS
=
{
fullName
:
{
property
:
'
fullName
'
,
label
:
'
user.common.fullName
'
,
direction
:
'
ASC
'
},
email
:
{
property
:
'
email
'
,
label
:
'
user.common.emailAddress
'
,
direction
:
'
ASC
'
},
lastLogin
:
{
property
:
'
lastLogin
'
,
label
:
'
user.sort.lastLoginAsc
'
,
direction
:
'
ASC
'
},
lastLoginDesc
:
{
property
:
'
lastLogin
'
,
label
:
'
user.sort.lastLoginDesc
'
,
direction
:
'
DESC
'
},
};
}
enum
UserRole
{
...
...
src/requests/actions/admin.ts
View file @
dab5eba3
...
...
@@ -53,6 +53,7 @@ export const loadMoreRequests = (paged?: FilteredPage<MaterialRequest>) => (disp
}
else
{
dispatch
(
appendRequests
(
page
));
}
dispatch
(
updateRoute
(
paged
));
})
.
catch
((
error
)
=>
{
dispatch
(
receiveRequests
(
null
,
error
));
...
...
@@ -117,6 +118,10 @@ export const applyFilters = (filters: string | MaterialRequestFilter, page: IPag
};
export
const
updateRoute
=
(
paged
:
FilteredPage
<
MaterialRequest
>
)
=>
(
dispatch
)
=>
{
dispatch
(
navigateTo
(
paged
.
filterCode
?
`/admin/requests/
${
paged
.
filterCode
}
`
:
'
/admin/requests
'
));
const
qs
=
{
s
:
paged
.
sort
[
0
].
property
===
MaterialRequest
.
DEFAULT_SORT
.
property
?
undefined
:
paged
.
sort
[
0
].
property
,
d
:
paged
.
sort
[
0
].
direction
===
MaterialRequest
.
DEFAULT_SORT
.
direction
?
undefined
:
paged
.
sort
[
0
].
direction
,
};
dispatch
(
navigateTo
(
paged
.
filterCode
?
`/admin/requests/
${
paged
.
filterCode
}
`
:
'
/admin/requests
'
,
qs
));
};
src/subsets/actions/dashboard.ts
View file @
dab5eba3
...
...
@@ -104,5 +104,9 @@ export const applyFilters = (filters: string | SubsetFilter, page?: Page<Subset>
};
const
updateRoute
=
(
paged
:
FilteredPage
<
Subset
>
)
=>
(
dispatch
)
=>
{
dispatch
(
navigateTo
(
paged
.
filterCode
?
`/dashboard/subsets/
${
paged
.
filterCode
}
`
:
'
/dashboard/subsets
'
));
const
qs
=
{
s
:
paged
.
sort
[
0
].
property
===
Subset
.
DEFAULT_SORT
.
property
?
undefined
:
paged
.
sort
[
0
].
property
,
d
:
paged
.
sort
[
0
].
direction
===
Subset
.
DEFAULT_SORT
.
direction
?
undefined
:
paged
.
sort
[
0
].
direction
,
};
dispatch
(
navigateTo
(
paged
.
filterCode
?
`/dashboard/subsets/
${
paged
.
filterCode
}
`
:
'
/dashboard/subsets
'
,
qs
));
};
src/user/actions/admin.ts
View file @
dab5eba3
...
...
@@ -132,6 +132,10 @@ export const loadMoreUsers = (paged?: FilteredPage<User>) => (dispatch) => {
};
export
const
updateRoute
=
(
paged
:
FilteredPage
<
User
>
)
=>
(
dispatch
)
=>
{
dispatch
(
navigateTo
(
paged
.
filterCode
?
`/admin/users/
${
paged
.
filterCode
}
`
:
'
/admin/users
'
));
const
qs
=
{
s
:
paged
.
sort
[
0
].
property
===
User
.
DEFAULT_SORT
.
property
?
undefined
:
paged
.
sort
[
0
].
property
,
d
:
paged
.
sort
[
0
].
direction
===
User
.
DEFAULT_SORT
.
direction
?
undefined
:
paged
.
sort
[
0
].
direction
,
};
dispatch
(
navigateTo
(
paged
.
filterCode
?
`/admin/users/
${
paged
.
filterCode
}
`
:
'
/admin/users
'
,
qs
));
};
src/user/translations.json
View file @
dab5eba3
...
...
@@ -41,7 +41,8 @@
},
"p"
:
{
"browse"
:
{
"title"
:
"Registered user accounts"
"title"
:
"Registered user accounts"
,
"mobileTitle"
:
"Registered users"
},
"display"
:
{
"title"
:
"User profile information"
,
...
...
@@ -120,5 +121,9 @@
"deleted"
:
"DELETED"
,
"ldap"
:
"LDAP"
}
},
"sort"
:
{
"lastLoginAsc"
:
"Last login (old to new)"
,
"lastLoginDesc"
:
"Last login (new to old)"
}
}
\ No newline at end of file
src/user/ui/admin/BrowsePage.tsx
View file @
dab5eba3
...
...
@@ -16,12 +16,16 @@ import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
import
{
PageContents
}
from
'
ui/layout/PageLayout
'
;
import
Loading
from
'
ui/common/Loading
'
;
import
PagedLoader
from
'
ui/common/PagedLoader
'
;
import
ContentHeaderWithButton
from
'
ui/common/heading/ContentHeaderWithButton
'
;
import
UserCard
from
'
./c/UserCard
'
;
import
UserFilters
from
'
user/ui/admin/c/UserFilter
'
;
import
Grid
from
'
@material-ui/core/Grid
'
;
import
PrettyFilters
from
'
ui/common/filter/PrettyFilters
'
;
import
ContentLayout
from
'
ui/layout/ContentLayout
'
;
import
PaginationComponent
from
'
ui/common/pagination
'
;
import
withWidth
from
'
@material-ui/core/withWidth
'
;
import
{
Breakpoint
}
from
'
@material-ui/core/styles/createBreakpoints
'
;
const
mobile
=
[
'
xs
'
]
as
Breakpoint
[];
class
BrowsePage
extends
BrowsePageTemplate
<
User
>
{
...
...
@@ -40,19 +44,27 @@ class BrowsePage extends BrowsePageTemplate<User> {
}
public
render
()
{
const
{
paged
,
t
,
loadMoreData
}
=
this
.
props
;
const
{
paged
,
loadMoreData
,
width
}
=
this
.
props
;
const
renderUser
=
(
user
:
User
,
index
:
number
)
=>
{
return
<
UserCard
key
=
{
user
.
uuid
}
index
=
{
index
}
user
=
{
user
}
/>;
};
const
isMobile
=
mobile
.
indexOf
(
width
)
!==
-
1
;
const
title
=
isMobile
?
'
user.admin.p.browse.mobileTitle
'
:
'
user.admin.p.browse.title
'
;
return
(
<
ContentLayout
left
=
{
<
UserFilters
initialValues
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
myApplyFilters
}
/>
}
customHeaderHeight
>
<
Grid
container
spacing
=
{
0
}
>
<
Grid
item
xs
=
{
12
}
>
<
ContentHeaderWithButton
title
=
{
t
(
`user.admin.p.browse.title`
)
}
/>
<
PaginationComponent
pageObj
=
{
paged
}
onSortChange
=
{
this
.
onSortChange
}
displayName
=
{
title
}
sortOptions
=
{
User
.
CUSTOM_SORT_OPTIONS
}
/>
<
PrettyFilters
prefix
=
"users"
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
...
...
@@ -86,4 +98,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
},
dispatch
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)((
translate
()(
BrowsePage
)));
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
withWidth
()
(
translate
()(
BrowsePage
)));
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