Commit 59290a2d authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

Merge branch '226-prettyfilters-in-dashboard' into 'master'

PrettyFilters in Dashboard

Closes #226

See merge request genesys-pgr/genesys-ui!239
parents 8248bded ebc16e44
...@@ -108,7 +108,9 @@ ...@@ -108,7 +108,9 @@
"title": "Title", "title": "Title",
"crop": "Crop", "crop": "Crop",
"institutes": "Institute code", "institutes": "Institute code",
"description": "Description" "description": "Description",
"state": "Status",
"dateCreated": "Date created"
}, },
"wiews": { "wiews": {
"code": "Institute code", "code": "Institute code",
...@@ -134,9 +136,9 @@ ...@@ -134,9 +136,9 @@
"state": "State", "state": "State",
"pid": "PID" "pid": "PID"
}, },
"dataset": { "datasets": {
"_text": "Keywords", "_text": "Keywords",
"accessionIdentifier": { "accessionRef": {
"acceNumb": "Accession number", "acceNumb": "Accession number",
"doi": "Accession DOI", "doi": "Accession DOI",
"genus": "Accession genus", "genus": "Accession genus",
...@@ -160,7 +162,8 @@ ...@@ -160,7 +162,8 @@
"published": "Published", "published": "Published",
"title": "Title", "title": "Title",
"rights": "License", "rights": "License",
"crop": "Crop" "crop": "Crop",
"state": "Status"
}, },
"partner": { "partner": {
"description": "Description", "description": "Description",
...@@ -176,7 +179,7 @@ ...@@ -176,7 +179,7 @@
"international": "International", "international": "International",
"partnerDescription": "Data provider description" "partnerDescription": "Data provider description"
}, },
"descriptorList": { "descriptorlists": {
"_text": "Keywords", "_text": "Keywords",
"description": "Description", "description": "Description",
"owner": { "owner": {
...@@ -184,9 +187,10 @@ ...@@ -184,9 +187,10 @@
}, },
"published": "Published", "published": "Published",
"publisher": "Publisher", "publisher": "Publisher",
"title": "Title" "title": "Title",
"state": "Status"
}, },
"descriptor": { "descriptors": {
"_text": "Keywords", "_text": "Keywords",
"category": "Category", "category": "Category",
"columnName": "Column name", "columnName": "Column name",
...@@ -199,7 +203,20 @@ ...@@ -199,7 +203,20 @@
}, },
"published": "Published", "published": "Published",
"uom": "UOM", "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": { "menu": {
......
...@@ -19,6 +19,7 @@ import ActivityPostFilters from './c/ActivityPostFilters'; ...@@ -19,6 +19,7 @@ import ActivityPostFilters from './c/ActivityPostFilters';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton'; import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import ActivityPostCard from './c/ActivityPostCard'; import ActivityPostCard from './c/ActivityPostCard';
import CreateNewButton from 'ui/common/buttons/CreateNewButton'; import CreateNewButton from 'ui/common/buttons/CreateNewButton';
import PrettyFilters from 'ui/common/filter/PrettyFilters';
class ActivityPostBrowsePage extends BrowsePageTemplate<ActivityPost> { class ActivityPostBrowsePage extends BrowsePageTemplate<ActivityPost> {
...@@ -41,6 +42,11 @@ class ActivityPostBrowsePage extends BrowsePageTemplate<ActivityPost> { ...@@ -41,6 +42,11 @@ class ActivityPostBrowsePage extends BrowsePageTemplate<ActivityPost> {
<ContentHeaderWithButton <ContentHeaderWithButton
title={ t('cms.admin.p.browseActivityPost.title') } 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"> <PageContents className="pt-1rem container-spacing-horizontal">
{ loading && <Loading/> } { loading && <Loading/> }
{ error && <div>{ JSON.stringify(error) }</div> } { error && <div>{ JSON.stringify(error) }</div> }
......
...@@ -19,6 +19,7 @@ import ArticleFilters from './c/ArticleFilters'; ...@@ -19,6 +19,7 @@ import ArticleFilters from './c/ArticleFilters';
import ArticleCard from './c/ArticleCard'; import ArticleCard from './c/ArticleCard';
import CreateNewButton from 'ui/common/buttons/CreateNewButton'; import CreateNewButton from 'ui/common/buttons/CreateNewButton';
import PageTitle from 'ui/common/PageTitle'; import PageTitle from 'ui/common/PageTitle';
import PrettyFilters from 'ui/common/filter/PrettyFilters';
class BrowsePage extends BrowsePageTemplate<Article> { class BrowsePage extends BrowsePageTemplate<Article> {
...@@ -39,6 +40,11 @@ class BrowsePage extends BrowsePageTemplate<Article> { ...@@ -39,6 +40,11 @@ class BrowsePage extends BrowsePageTemplate<Article> {
}> }>
<PageTitle title={ t('cms.admin.p.browse.title') }/> <PageTitle title={ t('cms.admin.p.browse.title') }/>
<ContentHeader 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"> <PageContents className="pt-1rem container-spacing-horizontal">
{ loading && <Loading/> } { loading && <Loading/> }
{ error && <div>{ JSON.stringify(error) }</div> } { error && <div>{ JSON.stringify(error) }</div> }
......
...@@ -44,7 +44,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> { ...@@ -44,7 +44,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> {
infinite infinite
/> />
<PrettyFilters <PrettyFilters
prefix="dataset" prefix="datasets"
filterObj={ paged && paged.filter || {} } filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters } onSubmit={ this.myApplyFilters }
/> />
......
...@@ -50,7 +50,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> { ...@@ -50,7 +50,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> {
infinite infinite
/> />
<PrettyFilters <PrettyFilters
prefix="descriptorList" prefix="descriptorlists"
filterObj={ paged && paged.filter || {} } filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters } onSubmit={ this.myApplyFilters }
/> />
......
...@@ -49,7 +49,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> { ...@@ -49,7 +49,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> {
sortOptions={ Descriptor.SORT_OPTIONS } sortOptions={ Descriptor.SORT_OPTIONS }
/> />
<PrettyFilters <PrettyFilters
prefix="descriptor" prefix="descriptors"
filterObj={ paged && paged.filter || {} } filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters } onSubmit={ this.myApplyFilters }
/> />
......
...@@ -23,6 +23,7 @@ import Loading from 'ui/common/Loading'; ...@@ -23,6 +23,7 @@ import Loading from 'ui/common/Loading';
import PagedLoader from 'ui/common/PagedLoader'; import PagedLoader from 'ui/common/PagedLoader';
import SubsetCard from 'subsets/ui/c/SubsetCard'; import SubsetCard from 'subsets/ui/c/SubsetCard';
import PaginationComponent from 'ui/common/pagination'; import PaginationComponent from 'ui/common/pagination';
import PrettyFilters from 'ui/common/filter/PrettyFilters';
interface IDashboardPageProps extends React.ClassAttributes<any> { interface IDashboardPageProps extends React.ClassAttributes<any> {
paged: FilteredPage<Subset>; paged: FilteredPage<Subset>;
...@@ -116,6 +117,11 @@ class DashboardPage extends React.Component<IDashboardPageProps> { ...@@ -116,6 +117,11 @@ class DashboardPage extends React.Component<IDashboardPageProps> {
displayName={ t('subsets.common.modelName') } displayName={ t('subsets.common.modelName') }
sortOptions={ sortOptions } sortOptions={ sortOptions }
/> />
<PrettyFilters
prefix="subsets"
filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters }
/>
<PageContents className="pt-1rem container-spacing-horizontal"> <PageContents className="pt-1rem container-spacing-horizontal">
{ ! paged ? <Loading /> : { ! paged ? <Loading /> :
<PagedLoader <PagedLoader
......
...@@ -107,7 +107,9 @@ ...@@ -107,7 +107,9 @@
"title": "Title", "title": "Title",
"crop": "Crop", "crop": "Crop",
"institutes": "Institute code", "institutes": "Institute code",
"description": "Description" "description": "Description",
"state": "Status",
"dateCreated": "Date created"
}, },
"wiews": { "wiews": {
"code": "Institute code", "code": "Institute code",
...@@ -133,9 +135,9 @@ ...@@ -133,9 +135,9 @@
"state": "State", "state": "State",
"pid": "PID" "pid": "PID"
}, },
"dataset": { "datasets": {
"_text": "Keywords", "_text": "Keywords",
"accessionIdentifier": { "accessionRef": {
"acceNumb": "Accession number", "acceNumb": "Accession number",
"doi": "Accession DOI", "doi": "Accession DOI",
"genus": "Accession genus", "genus": "Accession genus",
...@@ -159,7 +161,8 @@ ...@@ -159,7 +161,8 @@
"published": "Published", "published": "Published",
"title": "Title", "title": "Title",
"rights": "License", "rights": "License",
"crop": "Crop" "crop": "Crop",
"state": "Status"
}, },
"partner": { "partner": {
"description": "Description", "description": "Description",
...@@ -175,7 +178,7 @@ ...@@ -175,7 +178,7 @@
"international": "International", "international": "International",
"partnerDescription": "Data provider description" "partnerDescription": "Data provider description"
}, },
"descriptorList": { "descriptorlists": {
"_text": "Keywords", "_text": "Keywords",
"description": "Description", "description": "Description",
"owner": { "owner": {
...@@ -183,9 +186,10 @@ ...@@ -183,9 +186,10 @@
}, },
"published": "Published", "published": "Published",
"publisher": "Publisher", "publisher": "Publisher",
"title": "Title" "title": "Title",
"state": "Status"
}, },
"descriptor": { "descriptors": {
"_text": "Keywords", "_text": "Keywords",
"category": "Category", "category": "Category",
"columnName": "Column name", "columnName": "Column name",
...@@ -198,7 +202,20 @@ ...@@ -198,7 +202,20 @@
}, },
"published": "Published", "published": "Published",
"uom": "UOM", "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": { "menu": {
......
...@@ -3,7 +3,7 @@ import { withStyles } from '@material-ui/core/styles'; ...@@ -3,7 +3,7 @@ import { withStyles } from '@material-ui/core/styles';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { translate } from 'react-i18next'; import { translate } from 'react-i18next';
import Page from 'model/Page'; import FilteredPage from 'model/FilteredPage';
import Dataset from 'model/catalog/Dataset'; import Dataset from 'model/catalog/Dataset';
import DescriptorList from 'model/catalog/DescriptorList'; import DescriptorList from 'model/catalog/DescriptorList';
import Descriptor from 'model/catalog/Descriptor'; import Descriptor from 'model/catalog/Descriptor';
...@@ -15,6 +15,7 @@ import Loading from 'ui/common/Loading'; ...@@ -15,6 +15,7 @@ import Loading from 'ui/common/Loading';
import DashboardActionsArea from 'ui/catalog/dashboard/c/DashboardActionsArea'; import DashboardActionsArea from 'ui/catalog/dashboard/c/DashboardActionsArea';
import PagedLoader from 'ui/common/PagedLoader'; import PagedLoader from 'ui/common/PagedLoader';
import { PageContents } from 'ui/layout/PageLayout'; import { PageContents } from 'ui/layout/PageLayout';
import PrettyFilters from 'ui/common/filter/PrettyFilters';
const styles = (theme) => ({ const styles = (theme) => ({
filterSection: theme.leftPanel.root, filterSection: theme.leftPanel.root,
...@@ -25,7 +26,7 @@ interface IMyDataCardsProps extends React.Props<any> { ...@@ -25,7 +26,7 @@ interface IMyDataCardsProps extends React.Props<any> {
tab: string; tab: string;
filterComponent?: any; filterComponent?: any;
basePath: string; basePath: string;
paged: Page<any>; paged: FilteredPage<any>;
onSortChange: (page: number, results: number, sortBy: string, dir?: string) => void; onSortChange: (page: number, results: number, sortBy: string, dir?: string) => void;
pageSort?: string; pageSort?: string;
onFilter: (filter) => void; onFilter: (filter) => void;
...@@ -96,7 +97,7 @@ class MyDataCards extends React.Component<IMyDataCardsProps> { ...@@ -96,7 +97,7 @@ class MyDataCards extends React.Component<IMyDataCardsProps> {
public render() { 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 {publishAllAction, unpublishAllAction, deleteAllAction, approveAllAction } = this.props;
const {onSortChange, promiseListData} = this.props; const {onSortChange, promiseListData} = this.props;
const {buttonTitle} = this.state; const {buttonTitle} = this.state;
...@@ -130,6 +131,11 @@ class MyDataCards extends React.Component<IMyDataCardsProps> { ...@@ -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"> <PageContents className="pt-1rem container-spacing-horizontal">
{ !paged ? <Loading/> : { !paged ? <Loading/> :
<PagedLoader <PagedLoader
......
...@@ -264,7 +264,12 @@ const mapStateToProps = (state, ownProps) => ({ ...@@ -264,7 +264,12 @@ const mapStateToProps = (state, ownProps) => ({
true: 'Yes', true: 'Yes',
false: 'No', false: 'No',
}, },
state: MaterialRequest.STATE, state: {
...MaterialRequest.STATE,
REVIEWING: 'status.inReview',
DRAFT: 'status.inProgress',
PUBLISHED: 'status.published',
},
}, },
labels: state.uuidDecoder.labels, labels: state.uuidDecoder.labels,
}); });
......
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