Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIMS-1868 Follow Up #2602

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion express-api/src/utilities/helperFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const constructFindOptionFromQueryPid = <T>(
return { [column]: undefined } as FindOptionsWhere<T>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, operator, value] = operatorValuePair.match(/([^,]*),(.*)/).map((a) => a.trim());
const trimmedValue = value.replace(/[^\d]/g, ''); //remove all non digit characters;
const trimmedValue = value.replace(/[-]/g, ''); //remove all hyphens;
// Only continue if the trimmed value is a number
if (isNaN(parseInt(trimmedValue))) return { [column]: undefined } as FindOptionsWhere<T>;
let internalMatcher;
switch (operator) {
case 'equals':
Expand Down
12 changes: 8 additions & 4 deletions react-app/src/components/projects/ProjectsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ const ProjectsTable = () => {
break;
case 'Approved for Exemption':
case 'Approved for ERP':
case 'In ERP':
case 'Approved for SPL':
case 'Submitted':
ref.current.setFilterModel({ items: [{ value, operator: 'contains', field: 'Status' }] });
}
};
Expand Down Expand Up @@ -212,15 +213,18 @@ const ProjectsTable = () => {
All Projects
</CustomMenuItem>,
<CustomListSubheader key={'Status'}>Status</CustomListSubheader>,
<CustomMenuItem key={'In ERP'} value={'In ERP'}>
In ERP
</CustomMenuItem>,
<CustomMenuItem key={'Approved for ERP'} value={'Approved for ERP'}>
Approved for ERP
</CustomMenuItem>,
<CustomMenuItem key={'Approved for Exemption'} value={'Approved for Exemption'}>
Approved for Exemption
</CustomMenuItem>,
<CustomMenuItem key={'Submitted'} value={'Submitted'}>
Submitted
</CustomMenuItem>,
<CustomMenuItem key={'Approved for SPL'} value={'Approved for SPL'}>
Approved for SPL
</CustomMenuItem>,
]}
rowCountProp={totalCount}
rowCount={totalCount}
Expand Down
17 changes: 17 additions & 0 deletions react-app/src/components/property/PropertyTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ const PropertyTable = (props: IPropertyTable) => {
items: [{ value, operator: 'contains', field: 'PropertyType' }],
});
break;
case 'Core':
case 'Surplus':
case 'Disposed':
ref.current.setFilterModel({
items: [{ value, operator: 'contains', field: 'Classification' }],
});
break;
default:
ref.current.setFilterModel({ items: [] });
}
Expand Down Expand Up @@ -299,6 +306,16 @@ const PropertyTable = (props: IPropertyTable) => {
<CustomMenuItem key={'Parcel'} value={'Parcel'}>
Parcel
</CustomMenuItem>,
<CustomListSubheader key={'Group'}>Classification Group</CustomListSubheader>,
<CustomMenuItem key={'Core'} value={'Core'}>
Core
</CustomMenuItem>,
<CustomMenuItem key={'Surplus'} value={'Surplus'}>
Surplus
</CustomMenuItem>,
<CustomMenuItem key={'Disposed'} value={'Disposed'}>
Disposed
</CustomMenuItem>,
]}
tableHeader={'Properties Overview'}
rowCountProp={totalCount}
Expand Down
Loading