Skip to content

Commit

Permalink
Metadata detail page - hide history types selector when tasks (DOI) a…
Browse files Browse the repository at this point in the history
…nd workflow are disabled
  • Loading branch information
josegar74 authored and fxprunayre committed Sep 24, 2024
1 parent 0d73e4f commit 2629a90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<span data-translate="">recordHistory</span>
</div>
<div class="panel-body">
<div class="btn-group">
<div class="btn-group" data-ng-if="getNumberOfTypes() > 1">
<label
data-ng-repeat="(k, v) in filter.types"
class="btn btn-default"
Expand Down

0 comments on commit 2629a90

Please sign in to comment.