Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Website
Commits
ebc16e44
Commit
ebc16e44
authored
Feb 25, 2019
by
Oleksii Savran
Browse files
PrettyFilters in Dashboard
parent
8248bded
Changes
10
Hide whitespace changes
Inline
Side-by-side
locales/en/translations.json
View file @
ebc16e44
...
...
@@ -108,7 +108,9 @@
"title"
:
"Title"
,
"crop"
:
"Crop"
,
"institutes"
:
"Institute code"
,
"description"
:
"Description"
"description"
:
"Description"
,
"state"
:
"Status"
,
"dateCreated"
:
"Date created"
},
"wiews"
:
{
"code"
:
"Institute code"
,
...
...
@@ -134,9 +136,9 @@
"state"
:
"State"
,
"pid"
:
"PID"
},
"dataset"
:
{
"dataset
s
"
:
{
"_text"
:
"Keywords"
,
"accession
Identifier
"
:
{
"accession
Ref
"
:
{
"acceNumb"
:
"Accession number"
,
"doi"
:
"Accession DOI"
,
"genus"
:
"Accession genus"
,
...
...
@@ -160,7 +162,8 @@
"published"
:
"Published"
,
"title"
:
"Title"
,
"rights"
:
"License"
,
"crop"
:
"Crop"
"crop"
:
"Crop"
,
"state"
:
"Status"
},
"partner"
:
{
"description"
:
"Description"
,
...
...
@@ -176,7 +179,7 @@
"international"
:
"International"
,
"partnerDescription"
:
"Data provider description"
},
"descriptor
L
ist"
:
{
"descriptor
l
ist
s
"
:
{
"_text"
:
"Keywords"
,
"description"
:
"Description"
,
"owner"
:
{
...
...
@@ -184,9 +187,10 @@
},
"published"
:
"Published"
,
"publisher"
:
"Publisher"
,
"title"
:
"Title"
"title"
:
"Title"
,
"state"
:
"Status"
},
"descriptor"
:
{
"descriptor
s
"
:
{
"_text"
:
"Keywords"
,
"category"
:
"Category"
,
"columnName"
:
"Column name"
,
...
...
@@ -199,7 +203,20 @@
},
"published"
:
"Published"
,
"uom"
:
"UOM"
,
"used"
:
"Used"
"used"
:
"Used"
,
"state"
:
"Status"
},
"cms"
:
{
"articles"
:
{
"template"
:
"template"
,
"slug"
:
"Slug"
,
"lang"
:
"Language"
,
"title"
:
"Title"
},
"activityPosts"
:
{
"_text"
:
"Keywords"
,
"lastModifiedDate"
:
"Last modified date"
}
}
},
"menu"
:
{
...
...
src/cms/ui/admin/ActivityPostBrowsePage.tsx
View file @
ebc16e44
...
...
@@ -19,6 +19,7 @@ import ActivityPostFilters from './c/ActivityPostFilters';
import
ContentHeaderWithButton
from
'
ui/common/heading/ContentHeaderWithButton
'
;
import
ActivityPostCard
from
'
./c/ActivityPostCard
'
;
import
CreateNewButton
from
'
ui/common/buttons/CreateNewButton
'
;
import
PrettyFilters
from
'
ui/common/filter/PrettyFilters
'
;
class
ActivityPostBrowsePage
extends
BrowsePageTemplate
<
ActivityPost
>
{
...
...
@@ -41,6 +42,11 @@ class ActivityPostBrowsePage extends BrowsePageTemplate<ActivityPost> {
<
ContentHeaderWithButton
title
=
{
t
(
'
cms.admin.p.browseActivityPost.title
'
)
}
/>
<
PrettyFilters
prefix
=
"cms.activityPosts"
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
myApplyFilters
}
/>
<
PageContents
className
=
"pt-1rem container-spacing-horizontal"
>
{
loading
&&
<
Loading
/>
}
{
error
&&
<
div
>
{
JSON
.
stringify
(
error
)
}
</
div
>
}
...
...
src/cms/ui/admin/BrowsePage.tsx
View file @
ebc16e44
...
...
@@ -19,6 +19,7 @@ import ArticleFilters from './c/ArticleFilters';
import
ArticleCard
from
'
./c/ArticleCard
'
;
import
CreateNewButton
from
'
ui/common/buttons/CreateNewButton
'
;
import
PageTitle
from
'
ui/common/PageTitle
'
;
import
PrettyFilters
from
'
ui/common/filter/PrettyFilters
'
;
class
BrowsePage
extends
BrowsePageTemplate
<
Article
>
{
...
...
@@ -39,6 +40,11 @@ class BrowsePage extends BrowsePageTemplate<Article> {
}
>
<
PageTitle
title
=
{
t
(
'
cms.admin.p.browse.title
'
)
}
/>
<
ContentHeader
title
=
{
t
(
'
cms.admin.p.browse.title
'
)
}
/>
<
PrettyFilters
prefix
=
"cms.articles"
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
myApplyFilters
}
/>
<
PageContents
className
=
"pt-1rem container-spacing-horizontal"
>
{
loading
&&
<
Loading
/>
}
{
error
&&
<
div
>
{
JSON
.
stringify
(
error
)
}
</
div
>
}
...
...
src/datasets/ui/BrowsePage.tsx
View file @
ebc16e44
...
...
@@ -44,7 +44,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> {
infinite
/>
<
PrettyFilters
prefix
=
"dataset"
prefix
=
"dataset
s
"
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
myApplyFilters
}
/>
...
...
src/descriptorlists/ui/BrowsePage.tsx
View file @
ebc16e44
...
...
@@ -50,7 +50,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> {
infinite
/>
<
PrettyFilters
prefix
=
"descriptor
L
ist"
prefix
=
"descriptor
l
ist
s
"
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
myApplyFilters
}
/>
...
...
src/descriptors/ui/BrowsePage.tsx
View file @
ebc16e44
...
...
@@ -49,7 +49,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> {
sortOptions
=
{
Descriptor
.
SORT_OPTIONS
}
/>
<
PrettyFilters
prefix
=
"descriptor"
prefix
=
"descriptor
s
"
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
myApplyFilters
}
/>
...
...
src/subsets/ui/dashboard/DashboardPage.tsx
View file @
ebc16e44
...
...
@@ -23,6 +23,7 @@ import Loading from 'ui/common/Loading';
import
PagedLoader
from
'
ui/common/PagedLoader
'
;
import
SubsetCard
from
'
subsets/ui/c/SubsetCard
'
;
import
PaginationComponent
from
'
ui/common/pagination
'
;
import
PrettyFilters
from
'
ui/common/filter/PrettyFilters
'
;
interface
IDashboardPageProps
extends
React
.
ClassAttributes
<
any
>
{
paged
:
FilteredPage
<
Subset
>
;
...
...
@@ -116,6 +117,11 @@ class DashboardPage extends React.Component<IDashboardPageProps> {
displayName
=
{
t
(
'
subsets.common.modelName
'
)
}
sortOptions
=
{
sortOptions
}
/>
<
PrettyFilters
prefix
=
"subsets"
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
myApplyFilters
}
/>
<
PageContents
className
=
"pt-1rem container-spacing-horizontal"
>
{
!
paged
?
<
Loading
/>
:
<
PagedLoader
...
...
src/translations.json
View file @
ebc16e44
...
...
@@ -107,7 +107,9 @@
"title"
:
"Title"
,
"crop"
:
"Crop"
,
"institutes"
:
"Institute code"
,
"description"
:
"Description"
"description"
:
"Description"
,
"state"
:
"Status"
,
"dateCreated"
:
"Date created"
},
"wiews"
:
{
"code"
:
"Institute code"
,
...
...
@@ -133,9 +135,9 @@
"state"
:
"State"
,
"pid"
:
"PID"
},
"dataset"
:
{
"dataset
s
"
:
{
"_text"
:
"Keywords"
,
"accession
Identifier
"
:
{
"accession
Ref
"
:
{
"acceNumb"
:
"Accession number"
,
"doi"
:
"Accession DOI"
,
"genus"
:
"Accession genus"
,
...
...
@@ -159,7 +161,8 @@
"published"
:
"Published"
,
"title"
:
"Title"
,
"rights"
:
"License"
,
"crop"
:
"Crop"
"crop"
:
"Crop"
,
"state"
:
"Status"
},
"partner"
:
{
"description"
:
"Description"
,
...
...
@@ -175,7 +178,7 @@
"international"
:
"International"
,
"partnerDescription"
:
"Data provider description"
},
"descriptor
L
ist"
:
{
"descriptor
l
ist
s
"
:
{
"_text"
:
"Keywords"
,
"description"
:
"Description"
,
"owner"
:
{
...
...
@@ -183,9 +186,10 @@
},
"published"
:
"Published"
,
"publisher"
:
"Publisher"
,
"title"
:
"Title"
"title"
:
"Title"
,
"state"
:
"Status"
},
"descriptor"
:
{
"descriptor
s
"
:
{
"_text"
:
"Keywords"
,
"category"
:
"Category"
,
"columnName"
:
"Column name"
,
...
...
@@ -198,7 +202,20 @@
},
"published"
:
"Published"
,
"uom"
:
"UOM"
,
"used"
:
"Used"
"used"
:
"Used"
,
"state"
:
"Status"
},
"cms"
:
{
"articles"
:
{
"template"
:
"template"
,
"slug"
:
"Slug"
,
"lang"
:
"Language"
,
"title"
:
"Title"
},
"activityPosts"
:
{
"_text"
:
"Keywords"
,
"lastModifiedDate"
:
"Last modified date"
}
}
},
"menu"
:
{
...
...
src/ui/catalog/dashboard/c/MyDataCards.tsx
View file @
ebc16e44
...
...
@@ -3,7 +3,7 @@ import { withStyles } from '@material-ui/core/styles';
import
*
as
_
from
'
lodash
'
;
import
{
translate
}
from
'
react-i18next
'
;
import
Page
from
'
model/Page
'
;
import
Filtered
Page
from
'
model/
Filtered
Page
'
;
import
Dataset
from
'
model/catalog/Dataset
'
;
import
DescriptorList
from
'
model/catalog/DescriptorList
'
;
import
Descriptor
from
'
model/catalog/Descriptor
'
;
...
...
@@ -15,6 +15,7 @@ import Loading from 'ui/common/Loading';
import
DashboardActionsArea
from
'
ui/catalog/dashboard/c/DashboardActionsArea
'
;
import
PagedLoader
from
'
ui/common/PagedLoader
'
;
import
{
PageContents
}
from
'
ui/layout/PageLayout
'
;
import
PrettyFilters
from
'
ui/common/filter/PrettyFilters
'
;
const
styles
=
(
theme
)
=>
({
filterSection
:
theme
.
leftPanel
.
root
,
...
...
@@ -25,7 +26,7 @@ interface IMyDataCardsProps extends React.Props<any> {
tab
:
string
;
filterComponent
?:
any
;
basePath
:
string
;
paged
:
Page
<
any
>
;
paged
:
Filtered
Page
<
any
>
;
onSortChange
:
(
page
:
number
,
results
:
number
,
sortBy
:
string
,
dir
?:
string
)
=>
void
;
pageSort
?:
string
;
onFilter
:
(
filter
)
=>
void
;
...
...
@@ -96,7 +97,7 @@ class MyDataCards extends React.Component<IMyDataCardsProps> {
public
render
()
{
const
{
isEditMode
,
setEditState
,
paged
,
t
}
=
this
.
props
;
const
{
isEditMode
,
setEditState
,
paged
,
t
,
tab
}
=
this
.
props
;
const
{
publishAllAction
,
unpublishAllAction
,
deleteAllAction
,
approveAllAction
}
=
this
.
props
;
const
{
onSortChange
,
promiseListData
}
=
this
.
props
;
const
{
buttonTitle
}
=
this
.
state
;
...
...
@@ -130,6 +131,11 @@ class MyDataCards extends React.Component<IMyDataCardsProps> {
/>
}
/>
<
PrettyFilters
prefix
=
{
tab
}
filterObj
=
{
paged
&&
paged
.
filter
||
{}
}
onSubmit
=
{
this
.
props
.
onFilter
}
/>
<
PageContents
className
=
"pt-1rem container-spacing-horizontal"
>
{
!
paged
?
<
Loading
/>
:
<
PagedLoader
...
...
src/ui/common/filter/PrettyFilters.tsx
View file @
ebc16e44
...
...
@@ -264,7 +264,12 @@ const mapStateToProps = (state, ownProps) => ({
true
:
'
Yes
'
,
false
:
'
No
'
,
},
state
:
MaterialRequest
.
STATE
,
state
:
{
...
MaterialRequest
.
STATE
,
REVIEWING
:
'
status.inReview
'
,
DRAFT
:
'
status.inProgress
'
,
PUBLISHED
:
'
status.published
'
,
},
},
labels
:
state
.
uuidDecoder
.
labels
,
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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