Skip to content

Commit

Permalink
Patch fix (#1956)
Browse files Browse the repository at this point in the history
* added list of roles for assigner

* added null check

---------

Co-authored-by: rachana-egov <rachana.singh@egovernment.org>
  • Loading branch information
rachana-egov and rachana-egov authored Dec 2, 2024
1 parent c64b251 commit dc6d329
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,26 @@ const TimelinePopUpWrapper = ({ onClose, businessId, heading,labelPrefix="" }) =

useEffect(() => {
if (workflowData && workflowData.ProcessInstances) {

// Map API response to timeline steps
const steps = workflowData.ProcessInstances.map((instance, index) => ({
label: t(`${labelPrefix}${instance?.action}`),
variant: 'completed',
subElements: [Digit.Utils.microplanv1.epochToDateTime(instance?.auditDetails?.lastModifiedTime),
instance?.assigner &&
`${instance.assigner?.name} - ${instance.assigner?.roles?.[0]?.code ? t(Digit.Utils.locale.getTransformedLocale(`MP_ROLE_${instance.assigner?.roles?.[0]?.code}`)) : t('NA')}`,
instance.comment && `${t('COMMENT_PREFIX')} "${instance.comment}"`
subElements: [
Digit.Utils.microplanv1.epochToDateTime(instance?.auditDetails?.lastModifiedTime),
instance?.assigner &&
`${instance.assigner?.name} - ${
instance.assigner?.roles
?.map(role => t(Digit.Utils.locale.getTransformedLocale(`MP_ROLE_${role.code}`)))
.join(", ") || t('NA')
}`,
instance.comment && `${t('COMMENT_PREFIX')} "${instance.comment}"`
],
showConnector: true
}));
setTimelineSteps(steps);
}
}, [workflowData]);


return (
<PopUp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ const PlanInbox = () => {
name: t(i?.question),
sortable: true,
cell: (row) => {
return t(`${row?.[`securityDetail_${i?.question}`]}`) || t("ES_COMMON_NA")},
return row?.[`securityDetail_${i?.question}`] ? t(`${row?.[`securityDetail_${i?.question}`]}`) : t("ES_COMMON_NA")},
width: "180px",
sortFunction: (rowA, rowB) => {
const valueA = (rowA?.[`securityDetail_${i?.question}`] || t("ES_COMMON_NA")).toLowerCase();
Expand Down

0 comments on commit dc6d329

Please sign in to comment.