diff --git a/client/src/app/pages/archetypes/archetypes-page.tsx b/client/src/app/pages/archetypes/archetypes-page.tsx index 879c9c0cc..b4c6941e5 100644 --- a/client/src/app/pages/archetypes/archetypes-page.tsx +++ b/client/src/app/pages/archetypes/archetypes-page.tsx @@ -307,7 +307,7 @@ const Archetypes: React.FC = () => { - + {archetypeWriteAccess && } @@ -381,76 +381,83 @@ const Archetypes: React.FC = () => { - - 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)) && ( + + 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, + }, + ] + : []), + ]} + /> + )}