Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion web-ui/src/main/resources/catalog/js/CatController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,16 @@
return gnConfig["metadata.workflow.allowPublishNonApprovedMd"];
};

// Whether the metadata type requires validation before it can be
// published. This mirrors the backend MetadataType.requiresValidation
// logic: templates and sub-templates are incomplete by design and are
// therefore never validated, so they must not be blocked from being
// published because they are "invalid". Only normal
// records (isTemplate === "n") require validation.
$scope.metadataTypeRequiresValidation = function (md) {
return !md.isTemplate || md.isTemplate === "n";
};

$scope.getPublicationOptionClass = function (
md,
user,
Expand Down Expand Up @@ -2251,7 +2261,7 @@
) {
var publicationOptionTitle = "";
if (!md.isPublished(pubOption)) {
if (md.isValid()) {
if (!$scope.metadataTypeRequiresValidation(md) || md.isValid()) {
publicationOptionTitle = "mdvalid";
} else {
if (
Expand Down
Loading