Add visibility options for record view custom menu items#9415
Add visibility options for record view custom menu items#9415tylerjmchugh wants to merge 7 commits into
Conversation
9f93292 to
3c1256d
Compare
6649b21 to
8c5a31d
Compare
|
@tylerjmchugh please check some formatting issues in See https://github.com/geonetwork/core-geonetwork/actions/runs/29095471994/job/86370837094?pr=9415 |
| return icon; | ||
| } | ||
|
|
||
| @Column(nullable = false, columnDefinition = "boolean default true") |
There was a problem hiding this comment.
When using db.migration_onstartup=false which sets hibernate.hbm2ddl.auto=validate, the new columns will not be created, probably better to add the new columns in the migration scripts.
On upgrade, Hibernate will find the entity declaring the new columns that don't exist in the DB and fail startup.
With the default db.migration_onstartup=true this problem will not happen.
There was a problem hiding this comment.
Fixed in latest push
| var currentRecord = $scope.context.currentRecord; | ||
| if (!currentRecord.isWorkflowEnabled()) | ||
| return page.showWhenWorkflowDisabled === true; | ||
| if (currentRecord.mdStatus === "2") return page.showOnApproved === true; |
There was a problem hiding this comment.
Other places comparing mdStatus use a number value. If that is the case, strict string comparison will fail. Can you check this?
There was a problem hiding this comment.
Fixed in latest push
| ); | ||
|
|
||
| // Rebuild visibility-dependent menu items when context or any nested value changes. | ||
| $scope.$watch( |
There was a problem hiding this comment.
Deep $watch over the entire metadata record, which can be a large object, dirty-checks the whole graph on every digest and rebuilds the menu on any nested change.
Not sure why context has been changed to include all the metadata, it should be more efficient to keep as previously adding the mdStatus field that is required now.
There was a problem hiding this comment.
Fixed in latest push
|
@tylerjmchugh I never used the record view menu, but I have tried to created this page, that it shows properly in the header and footer, but not in the record page. Do I miss anything?
|
Fixed in latest push |
@josegar74 The record view custom menu field seems to be documented incorrectly. The ui help text says:
But this does not seem to be correct. If not provided it seems to use the standard menus and does not include any static pages. For my testing I had set the |




Static page menu items displayed in the record view menu cannot currently be configured based on the record's workflow state. This prevents custom menu items from being restricted to approved records, working copies, or records with workflow disabled.
This PR aims to fix this issue by adding the following workflow-based visibility options for
record_view_menuitems:showWhenWorkflowDisabledshowOnApprovedshowOnNonApprovedThese options allow custom menu items to control whether they are displayed for each workflow state.
This is required for our custom external publishing link, which should only be displayed for approved records and should remain hidden for working copies, other non-approved records, and records with workflow disabled.
All three options default to true to maintain backwards compatibility. Existing menu items will therefore continue to display in the same workflow states as before unless the new options are explicitly configured.
Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation