Skip to content

Commit

Permalink
Merge pull request #1493 from bcgov/feat/kevin-1467
Browse files Browse the repository at this point in the history
feat: nested links
  • Loading branch information
kevin-hashimoto authored Dec 18, 2024
2 parents fa8aeb3 + 29703ca commit 38c46c1
Showing 1 changed file with 78 additions and 40 deletions.
118 changes: 78 additions & 40 deletions frontend/src/views/ComplianceReports/components/ActivityLinkList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,33 @@ export const ActivityLinksList = () => {
compliancePeriod
).replace(':complianceReportId', complianceReportId)
)
}
},
{
name: t('report:activityLists.finalSupplyEquipment'),
action: () => {
navigate(
ROUTES.REPORTS_ADD_FINAL_SUPPLY_EQUIPMENTS.replace(
':compliancePeriod',
compliancePeriod
).replace(':complianceReportId', complianceReportId)
)
}
},
{
name: t('report:activityLists.allocationAgreements'),
action: () => {
navigate(
ROUTES.REPORTS_ADD_ALLOCATION_AGREEMENTS.replace(
':compliancePeriod',
compliancePeriod
).replace(':complianceReportId', complianceReportId)
)
}
},
children: [
{
name: t('report:activityLists.finalSupplyEquipment'),
action: () => {
navigate(
ROUTES.REPORTS_ADD_FINAL_SUPPLY_EQUIPMENTS.replace(
':compliancePeriod',
compliancePeriod
).replace(':complianceReportId', complianceReportId)
)
}
},
{
name: t('report:activityLists.allocationAgreements'),
action: () => {
navigate(
ROUTES.REPORTS_ADD_ALLOCATION_AGREEMENTS.replace(
':compliancePeriod',
compliancePeriod
).replace(':complianceReportId', complianceReportId)
)
}
}
]
},

{
name: t('report:activityLists.notionalTransfers'),
action: () => {
Expand Down Expand Up @@ -89,24 +92,59 @@ export const ActivityLinksList = () => {
sx={{ maxWidth: '100%', listStyleType: 'disc' }}
>
{activityList.map((activity, index) => (
<StyledListItem
sx={{ cursor: 'pointer' }}
component="a"
key={index}
alignItems="flex-start"
onClick={activity.action}
>
<BCTypography
variant="subtitle2"
color="link"
sx={{
textDecoration: 'underline',
'&:hover': { color: 'info.main' }
}}
<>
<StyledListItem
sx={{ cursor: 'pointer' }}
component="a"
key={index}
alignItems="flex-start"
onClick={activity.action}
>
{activity.name}
</BCTypography>
</StyledListItem>
<BCTypography
variant="subtitle2"
color="link"
sx={{
textDecoration: 'underline',
'&:hover': { color: 'info.main' }
}}
>
{activity.name}
</BCTypography>
</StyledListItem>
{activity.children && (
<List
data-test="schedule-list"
component="div"
sx={{
maxWidth: '100%',
listStyleType: 'disc',
marginLeft: '20px',
padding: '0'
}}
>
{activity.children.map((activity, index) => (
<StyledListItem
sx={{ cursor: 'pointer' }}
component="a"
key={index}
alignItems="flex-start"
onClick={activity.action}
>
<BCTypography
variant="subtitle2"
color="link"
sx={{
textDecoration: 'underline',
'&:hover': { color: 'info.main' }
}}
>
{activity.name}
</BCTypography>
</StyledListItem>
))}
</List>
)}
</>
))}
</List>
)
Expand Down

0 comments on commit 38c46c1

Please sign in to comment.