Commit ebc16e44 authored by Oleksii Savran's avatar Oleksii Savran

PrettyFilters in Dashboard

parent 8248bded
......@@ -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": {
"datasets": {
"_text": "Keywords",
"accessionIdentifier": {
"accessionRef": {
"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"
},
"descriptorList": {
"descriptorlists": {
"_text": "Keywords",
"description": "Description",
"owner": {
......@@ -184,9 +187,10 @@
},
"published": "Published",
"publisher": "Publisher",
"title": "Title"
"title": "Title",
"state": "Status"
},
"descriptor": {
"descriptors": {
"_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": {
......
......@@ -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> }
......
......@@ -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> }
......
......@@ -44,7 +44,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> {
infinite
/>
<PrettyFilters
prefix="dataset"
prefix="datasets"
filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters }
/>
......
......@@ -50,7 +50,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> {
infinite
/>
<PrettyFilters
prefix="descriptorList"
prefix="descriptorlists"
filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters }
/>
......
......@@ -49,7 +49,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> {
sortOptions={ Descriptor.SORT_OPTIONS }
/>
<PrettyFilters
prefix="descriptor"
prefix="descriptors"
filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters }
/>
......
......@@ -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
......
......@@ -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": {
"datasets": {
"_text": "Keywords",
"accessionIdentifier": {
"accessionRef": {
"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"
},
"descriptorList": {
"descriptorlists": {
"_text": "Keywords",
"description": "Description",
"owner": {
......@@ -183,9 +186,10 @@
},
"published": "Published",
"publisher": "Publisher",
"title": "Title"
"title": "Title",
"state": "Status"
},
"descriptor": {
"descriptors": {
"_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": {
......
......@@ -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 FilteredPage from 'model/FilteredPage';
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: FilteredPage<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
......
......@@ -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,
});
......
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