Skip to content

Commit

Permalink
Remove pillars and dimensions filters in summary tab
Browse files Browse the repository at this point in the history
  • Loading branch information
subinasr committed Feb 16, 2024
1 parent 01b5dbc commit 03cd686
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function ScoreForm(props: Props) {

const analyticalDensityValue = {
key: 'ANALYTICAL_DENSITY',
label: 'Analytical density',
label: 'Analytical Density',
score: Math.round((median(sectorWiseDensityValue ?? []) ?? 0) * 100) / 100,
};

Expand Down
20 changes: 14 additions & 6 deletions app/views/EditAry/AssessmentRegistryForm/SummaryForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ import {
isDefined,
isNotDefined,
listToGroupList,
listToMap,
} from '@togglecorp/fujs';

import {
AssessmentRegistrySectorTypeEnum,
AssessmentRegistrySummaryFocusDimensionTypeEnum,
AssessmentRegistryFocusTypeEnum,
AssessmentRegistrySummaryPillarTypeEnum,
AssessmentRegistrySummarySubDimensionTypeEnum,
AssessmentRegistrySummarySubPillarTypeEnum,
Expand Down Expand Up @@ -138,13 +136,17 @@ function SummaryForm(props: Props) {
},
);

/*
* TODO: This logic doesn't work due to typo in server side.
* Find other ways to accomplisht this.
const selectedFocusesMap = useMemo(() => (
listToMap(
value?.focuses,
(item) => item,
() => true,
)
), [value?.focuses]);
*/

const pillarList: PillarType[] = useMemo(() => {
const pillarOptions = removeNull(data?.project?.assessmentRegistryOptions?.summaryOptions);
Expand All @@ -160,13 +162,16 @@ function SummaryForm(props: Props) {
}),
);

// FIXME: Need to remove this type cast
/* FIXME: This filter does not work as intended due to typo in server side.
* FIXME: Need to remove this type cast
return finalPillarList.filter((item) => selectedFocusesMap?.[
item.pillar as AssessmentRegistryFocusTypeEnum
]);
*/
return finalPillarList;
}, [
data,
selectedFocusesMap,
// selectedFocusesMap,
]);

const dimensionList: DimensionType[] = useMemo(() => {
Expand All @@ -184,13 +189,16 @@ function SummaryForm(props: Props) {
})),
}),
);
// FIXME: Need to remove this type cast
/* FIXME: This filter does not work as intended due to typo in server side.
* FIXME: Need to remove this type cast
return finalDimensionList.filter((item) => selectedFocusesMap?.[
item.dimension as AssessmentRegistryFocusTypeEnum
]);
*/
return finalDimensionList;
}, [
data,
selectedFocusesMap,
// selectedFocusesMap,
]);

const pillarRenderParams = useCallback(
Expand Down

0 comments on commit 03cd686

Please sign in to comment.