From 43f93693f94c5029534e1e6dec1dd600ff39c85f Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Fri, 15 Nov 2024 14:38:33 +0100 Subject: [PATCH] STSMACOM-875 Use `` and `stripes.hasAnyPerm` to check for Notes assign/unassign perm. --- CHANGELOG.md | 1 + lib/Notes/NoteViewPage/components/NoteView/NoteView.js | 7 ++++--- lib/Notes/components/NotesAccordion/NotesAccordion.js | 9 ++++++--- lib/ViewMetaData/ViewMetaData.js | 8 ++++++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1a2aa40b..16e6e35a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ## [9.2.3] IN PROGRESS * Reset `qindex` once the search field is empty. Fixes STSMACOM-872. +* Use `` and `stripes.hasAnyPerm` to check for Notes assign/unassign perm. Fixes STSMACOM-875. ## [9.2.0](https://github.com/folio-org/stripes-smart-components/tree/v9.2.0) (2024-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v9.1.3...v9.2.0) diff --git a/lib/Notes/NoteViewPage/components/NoteView/NoteView.js b/lib/Notes/NoteViewPage/components/NoteView/NoteView.js index 5b7ede8d6..4e5e3ded1 100644 --- a/lib/Notes/NoteViewPage/components/NoteView/NoteView.js +++ b/lib/Notes/NoteViewPage/components/NoteView/NoteView.js @@ -7,6 +7,7 @@ import dompurify from 'dompurify'; import { IfPermission, + IfAnyPermission, AppIcon, withStripes, stripesShape, @@ -147,7 +148,7 @@ export default class NoteView extends Component { } = this.props; - const canAssignUnassign = stripes.hasPerm('ui-notes.item.assign-unassign'); + const canAssignUnassign = stripes.hasAnyPerm('ui-notes.item.assign-unassign,ui-notes.item.assign-unassign.execute'); const canDelete = stripes.hasPerm('ui-notes.item.delete'); const canEdit = stripes.hasPerm('ui-notes.item.edit'); @@ -162,7 +163,7 @@ export default class NoteView extends Component { <> { canUnassign && - + - + } - + )} { !hideNewButton && ( diff --git a/lib/ViewMetaData/ViewMetaData.js b/lib/ViewMetaData/ViewMetaData.js index 9cf43f0d3..d3c13abf8 100644 --- a/lib/ViewMetaData/ViewMetaData.js +++ b/lib/ViewMetaData/ViewMetaData.js @@ -78,6 +78,14 @@ class ViewMetaData extends React.Component { return updaters.find(r => r.id === userId); } + componentDidMount() { + console.log('metadata mount', this.props.metadata); + } + + componentWillUnmount() { + console.log('metadata unmount'); + } + render() { const { metadata,