🛂(frontend) hide version restore button when reader
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.
This commit is contained in:
@@ -11,6 +11,7 @@ and this project adheres to
|
|||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
- 🛂(frontend) Restore version visibility #629
|
||||||
- 📝(doc) minor README.md formatting and wording enhancements
|
- 📝(doc) minor README.md formatting and wording enhancements
|
||||||
- ♻️Stop setting a default title on doc creation #634
|
- ♻️Stop setting a default title on doc creation #634
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ export const ModalSelectVersion = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [selectedVersionId, setSelectedVersionId] =
|
const [selectedVersionId, setSelectedVersionId] =
|
||||||
useState<Versions['version_id']>();
|
useState<Versions['version_id']>();
|
||||||
|
const canRestore = doc.abilities.partial_update;
|
||||||
const restoreModal = useModal();
|
const restoreModal = useModal();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal
|
<Modal
|
||||||
@@ -127,6 +128,7 @@ export const ModalSelectVersion = ({
|
|||||||
selectedVersionId={selectedVersionId}
|
selectedVersionId={selectedVersionId}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
{canRestore && (
|
||||||
<Box
|
<Box
|
||||||
$padding="xs"
|
$padding="xs"
|
||||||
$css={css`
|
$css={css`
|
||||||
@@ -142,6 +144,7 @@ export const ModalSelectVersion = ({
|
|||||||
{t('Restore')}
|
{t('Restore')}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Reference in New Issue
Block a user