From 22f4139858067883bc7ed99a01786e1de3b259a2 Mon Sep 17 00:00:00 2001 From: Blaine Jester Date: Fri, 21 Oct 2022 13:13:15 -0700 Subject: [PATCH] Learning Activity and Completion Criteria logic on when bulk editable --- .../components/edit/DetailsTabView.vue | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue b/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue index 54b4390900..904130a43b 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue @@ -59,7 +59,7 @@ @@ -125,7 +125,7 @@ - +

{{ $tr('completionLabel') }} @@ -143,7 +143,7 @@ v-model="completionAndDuration" :kind="firstNode.kind" :fileDuration="fileDuration" - :required="!isDocument" + :required="!anyIsDocument || !allSameKind" /> @@ -528,9 +528,22 @@ allResources() { return !this.nodes.some(node => node.kind === ContentKindsNames.TOPIC); }, + allSameKind() { + const kind = this.firstNode.kind; + return !this.nodes.some(node => node.kind !== kind); + }, + anyIsDocument() { + return this.nodes.some(n => n.kind === ContentKindsNames.DOCUMENT); + }, + anyIsTopic() { + return this.nodes.some(n => n.kind === ContentKindsNames.TOPIC); + }, isImported() { return isImportedContent(this.firstNode); }, + newContent() { + return !this.nodes.some(n => n[NEW_OBJECT]); + }, importedChannelLink() { return importedChannelLink(this.firstNode, this.$router); }, @@ -706,15 +719,6 @@ videoSelected() { return this.oneSelected && this.firstNode.kind === ContentKindsNames.VIDEO; }, - newContent() { - return !this.nodes.some(n => n[NEW_OBJECT]); - }, - isDocument() { - return this.firstNode.kind === ContentKindsNames.DOCUMENT; - }, - isTopic() { - return this.firstNode.kind === ContentKindsNames.TOPIC; - }, }, watch: { nodes: {