From aefbc2e0b9682ab69b4765819ca21bee45cdd414 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 11 Feb 2025 15:53:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=82(frontend)=20hide=20version=20resto?= =?UTF-8?q?re=20button=20when=20reader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When you are a reader member, you have the right to see the version but you cannot restore them. So, we hide the restore button when you are a reader. --- CHANGELOG.md | 1 + .../components/ModalSelectVersion.tsx | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ffda055..e933ca54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ## Changed +- 🛂(frontend) Restore version visibility #629 - 📝(doc) minor README.md formatting and wording enhancements - ♻️Stop setting a default title on doc creation #634 diff --git a/src/frontend/apps/impress/src/features/docs/doc-versioning/components/ModalSelectVersion.tsx b/src/frontend/apps/impress/src/features/docs/doc-versioning/components/ModalSelectVersion.tsx index 9485f64b..5b4bb882 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-versioning/components/ModalSelectVersion.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-versioning/components/ModalSelectVersion.tsx @@ -36,8 +36,9 @@ export const ModalSelectVersion = ({ const { t } = useTranslation(); const [selectedVersionId, setSelectedVersionId] = useState(); - + const canRestore = doc.abilities.partial_update; const restoreModal = useModal(); + return ( <> - - - + + + )}