diff --git a/client/src/app/pages/archetypes/archetypes-page.tsx b/client/src/app/pages/archetypes/archetypes-page.tsx index 66ecae0ef2..b4c6941e54 100644 --- a/client/src/app/pages/archetypes/archetypes-page.tsx +++ b/client/src/app/pages/archetypes/archetypes-page.tsx @@ -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, + }, + ] + : []), + ]} + /> + )}