Skip to content

Commit

Permalink
add feature id table filter
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Mar 20, 2024
1 parent 6435413 commit 8c6abe3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/TaskAnalysisTable/TaskAnalysisTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,12 @@ const setupColumnTypes = (props, taskBaseRoute, manager, data, openComments) =>
}

columns.featureId = {
id: 'name',
id: 'featureId',
Header: props.intl.formatMessage(messages.featureIdLabel),
accessor: t => t.name || t.title,
exportable: t => t.name || t.title,
sortable: false,
filterable: true,
}

columns.id = {
Expand Down
8 changes: 3 additions & 5 deletions src/pages/Review/TasksReview/TasksReviewTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,10 @@ export const setupColumnTypes = (props, openComments, data, criteria) => {
columns.featureId = {
id: 'featureId',
Header: props.intl.formatMessage(messages.featureIdLabel),
accessor: t => {
return <span>{t.geometries.features ? t.geometries.features[0].id : "N/A"}</span>
},
exportable: t => t.geometries.features ? t.geometries.features[0].id : "N/A",
accessor: t => t.name || t.title,
exportable: t => t.name || t.title,
sortable: false,
filterable: false,
filterable: true,
maxWidth: 120,
}

Expand Down
5 changes: 5 additions & 0 deletions src/services/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const PARAMS_MAP = {
reviewStatus: 'trStatus',
metaReviewStatus: 'mrStatus',
id: 'tid',
featureId: 'fid',
difficulty: 'cd',
tags: 'tt',
excludeTasks: 'tExcl',
Expand Down Expand Up @@ -281,6 +282,10 @@ export const generateSearchParametersString = (filters, boundingBox, savedChalle
searchParameters[PARAMS_MAP.id] = filters.id
}

if (filters.featureId) {
searchParameters[PARAMS_MAP.featureId] = filters.featureId
}

if (_isFinite(filters.difficulty)) {
searchParameters[PARAMS_MAP.difficulty] = filters.difficulty
}
Expand Down
2 changes: 2 additions & 0 deletions src/services/Task/TaskReview/TaskReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const buildQueryFilters = function (criteria, addedColumns) {
//Main Filters
const filters = _get(criteria, "filters", {});
const taskId = filters.id;
const featureId = filters.featureId;
const challengeId = filters.challengeId;
const projectId = filters.projectId;
const reviewedAt = filters.reviewedAt;
Expand Down Expand Up @@ -264,6 +265,7 @@ const buildQueryFilters = function (criteria, addedColumns) {

return (
`${taskId ? `taskId=${taskId}` : ""}` +
`${featureId ? `&featureId=${featureId}` : ""}` +
`&reviewStatus=${_join(reviewStatus, ",")}`+
`${reviewRequestedBy ? `&mapper=${reviewRequestedBy}` : ""}` +
`${challengeId ? `&challengeId=${challengeId}` : ""}` +
Expand Down

0 comments on commit 8c6abe3

Please sign in to comment.