Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Jan 2, 2024
1 parent 0066f6f commit a5cf490
Showing 1 changed file with 77 additions and 70 deletions.
147 changes: 77 additions & 70 deletions client/src/app/pages/archetypes/archetypes-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,76 +381,83 @@ const Archetypes: React.FC = () => {
<ArchetypeApplicationsColumn archetype={archetype} />
</Td>
<Td isActionCell>
<ActionsColumn
items={[
...(archetypeWriteAccess
? [
{
title: t("actions.duplicate"),
onClick: () =>
setArchetypeToDuplicate(archetype),
},
]
: []),
...(assessmentWriteAccess
? [
{
title: t("actions.assess"),
onClick: () =>
assessSelectedArchetype(archetype),
},
]
: []),
...(reviewsWriteAccess
? [
{
title: t("actions.review"),
onClick: () =>
reviewSelectedArchetype(archetype),
},
]
: []),
...(archetypeWriteAccess
? [
{
title: t("actions.edit"),
onClick: () =>
setArchetypeToEdit(archetype),
},
]
: []),
...(archetype?.assessments?.length &&
assessmentWriteAccess
? [
{
title: t("actions.discardAssessment"),
onClick: () =>
setAssessmentToDiscard(archetype),
},
]
: []),
...(archetype?.review && reviewsWriteAccess
? [
{
title: t("actions.discardReview"),
onClick: () =>
setReviewToDiscard(archetype),
},
]
: []),
{ isSeparator: true },
...(archetypeWriteAccess
? [
{
title: t("actions.delete"),
onClick: () =>
setArchetypeToDelete(archetype),
isDanger: true,
},
]
: []),
]}
/>
{(archetypeWriteAccess ||
assessmentWriteAccess ||
reviewsWriteAccess ||
(archetype?.assessments?.length &&
assessmentWriteAccess) ||
(archetype?.review && reviewsWriteAccess)) && (
<ActionsColumn
items={[
...(archetypeWriteAccess
? [
{
title: t("actions.duplicate"),
onClick: () =>
setArchetypeToDuplicate(archetype),
},
]
: []),
...(assessmentWriteAccess
? [
{
title: t("actions.assess"),
onClick: () =>
assessSelectedArchetype(archetype),
},
]
: []),
...(reviewsWriteAccess
? [
{
title: t("actions.review"),
onClick: () =>
reviewSelectedArchetype(archetype),
},
]
: []),
...(archetypeWriteAccess
? [
{
title: t("actions.edit"),
onClick: () =>
setArchetypeToEdit(archetype),
},
]
: []),
...(archetype?.assessments?.length &&
assessmentWriteAccess
? [
{
title: t("actions.discardAssessment"),
onClick: () =>
setAssessmentToDiscard(archetype),
},
]
: []),
...(archetype?.review && reviewsWriteAccess
? [
{
title: t("actions.discardReview"),
onClick: () =>
setReviewToDiscard(archetype),
},
]
: []),
{ isSeparator: true },
...(archetypeWriteAccess
? [
{
title: t("actions.delete"),
onClick: () =>
setArchetypeToDelete(archetype),
isDanger: true,
},
]
: []),
]}
/>
)}
</Td>
</TableRowContentWithControls>
</Tr>
Expand Down

0 comments on commit a5cf490

Please sign in to comment.