Skip to content

Commit

Permalink
Merge branch 'main' into mig-wave-eom-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 authored Jan 3, 2024
2 parents 3f80f28 + 0f64970 commit 9392817
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 72 deletions.
149 changes: 78 additions & 71 deletions client/src/app/pages/archetypes/archetypes-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ const Archetypes: React.FC = () => {
<FilterToolbar {...filterToolbarProps} />
<ToolbarGroup variant="button-group">
<ToolbarItem>
<CreateButton />
{archetypeWriteAccess && <CreateButton />}
</ToolbarItem>
</ToolbarGroup>
<ToolbarItem {...paginationToolbarItemProps}>
Expand Down 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
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const ArchetypeDetailDrawer: React.FC<IArchetypeDetailDrawerProps> = ({
</Tab>
<Tab
eventKey={TabKey.Reviews}
title={<TabTitleText>{t("terms.reviews")}</TabTitleText>}
title={<TabTitleText>{t("terms.review")}</TabTitleText>}
>
<ReviewFields archetype={archetype} />
</Tab>
Expand Down

0 comments on commit 9392817

Please sign in to comment.