From 2629a902249ed404c0a346fb45a12cc75a25038f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Mon, 16 Sep 2024 13:30:44 +0200 Subject: [PATCH] Metadata detail page - hide history types selector when tasks (DOI) and workflow are disabled --- .../catalog/components/history/GnHistoryDirective.js | 9 ++++++++- .../components/history/partials/recordHistory.html | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/history/GnHistoryDirective.js b/web-ui/src/main/resources/catalog/components/history/GnHistoryDirective.js index df5c81d2dbc..dbd0f27688b 100644 --- a/web-ui/src/main/resources/catalog/components/history/GnHistoryDirective.js +++ b/web-ui/src/main/resources/catalog/components/history/GnHistoryDirective.js @@ -58,7 +58,10 @@ if (gnConfig["metadata.workflow.enable"]) { types.workflow = true; } - types.task = true; + // Currently the only task is DOI + if (gnConfig["system.publication.doi.doienabled"]) { + types.task = true; + } types.event = true; scope.filter = { @@ -69,6 +72,10 @@ }; }); + scope.getNumberOfTypes = function () { + return Object.keys(scope.filter.types).length; + }; + // Wait for metatada to be available scope.$watch("md", function (n, o) { if (angular.isDefined(n)) { diff --git a/web-ui/src/main/resources/catalog/components/history/partials/recordHistory.html b/web-ui/src/main/resources/catalog/components/history/partials/recordHistory.html index 7bd26fc6311..09bcd634bc7 100644 --- a/web-ui/src/main/resources/catalog/components/history/partials/recordHistory.html +++ b/web-ui/src/main/resources/catalog/components/history/partials/recordHistory.html @@ -4,7 +4,7 @@ recordHistory
-
+