Skip to content

Commit

Permalink
Add source & report status filtering on list view
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Farcy committed Nov 14, 2023
1 parent b5ee556 commit 34d9068
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/modules/RA/DataSource/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,18 @@ export const scrTypes = {
[EPSG3857]: 'EPSG:3857 - WGS 84 / Pseudo-Mercator',
};
export const fieldSCRChoices = typesToChoices(scrTypes);

export const sourceStatusTypes = {
0: 'datasource.refreshStatus.syncNeeded',
1: 'datasource.refreshStatus.pending',
2: 'datasource.refreshStatus.done',
};
export const sourceStatusChoices = typesToChoices(sourceStatusTypes);

export const reportStatusTypes = {
0: 'datasource.refreshStatus.success',
1: 'datasource.refreshStatus.error',
2: 'datasource.refreshStatus.warning',
3: 'datasource.refreshStatus.pending',
};
export const reportStatusChoices = typesToChoices(reportStatusTypes);
12 changes: 12 additions & 0 deletions src/modules/RA/DataSource/views/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
geomTypeChoices,
sourceTypes,
sourceTypeChoices,
sourceStatusChoices,
reportStatusChoices,
} from '..';
import CommonBulkActionButtons
from '../../../../components/react-admin/CommonBulkActionButtons';
Expand All @@ -39,6 +41,16 @@ const ListFilters = props => (
label="datasource.form.geometry"
choices={geomTypeChoices}
/>
<SelectInput
source="status"
label="datasource.form.status"
choices={sourceStatusChoices}
/>
<SelectInput
source="report__status"
label="datasource.form.report.title"
choices={reportStatusChoices}
/>
</Filter>
);

Expand Down

0 comments on commit 34d9068

Please sign in to comment.