diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue index 00ea9f39e6..486979b720 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue @@ -102,6 +102,7 @@ + @@ -124,6 +125,10 @@ + @@ -185,6 +190,7 @@ import SavingIndicator from './SavingIndicator'; import EditView from './EditView'; import EditList from './EditList'; + import InheritAncestorMetadataModal from './InheritAncestorMetadataModal'; import { ContentKindLearningActivityDefaults } from 'shared/leUtils/ContentKinds'; import { fileSizeMixin, routerMixin } from 'shared/mixins'; import FileStorage from 'shared/views/files/FileStorage'; @@ -210,6 +216,7 @@ EditView, ResizableNavigationDrawer, Uploader, + InheritAncestorMetadataModal, FileStorage, FileUploadDefault, LoadingText, @@ -270,11 +277,12 @@ uploadMode() { return this.$route.name === RouteNames.UPLOAD_FILES; }, - /* eslint-disable kolibri/vue-no-unused-properties */ createExerciseMode() { return this.$route.name === RouteNames.ADD_EXERCISE; }, - /* eslint-enable */ + createMode() { + return this.addTopicsMode || this.uploadMode || this.createExerciseMode; + }, editMode() { return this.$route.name === RouteNames.CONTENTNODE_DETAILS; }, @@ -303,9 +311,11 @@ } return this.$tr('editingDetailsHeader'); }, + parent() { + return this.$route.params.nodeId && this.getContentNode(this.$route.params.nodeId); + }, parentTitle() { - const node = this.$route.params.nodeId && this.getContentNode(this.$route.params.nodeId); - return node ? node.title : ''; + return this.parent ? this.parent.title : ''; }, invalidNodes() { return this.nodeIds.filter(id => !this.getContentNodeIsValid(id)); @@ -525,6 +535,11 @@ eventLabel: 'Upload file', }); }, + inheritMetadata(metadata) { + for (const nodeId of this.nodeIds) { + this.updateContentNode({ id: nodeId, ...metadata, mergeMapFields: true }); + } + }, }, $trs: { editingDetailsHeader: 'Edit details', diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/edit/InheritAncestorMetadataModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/edit/InheritAncestorMetadataModal.vue new file mode 100644 index 0000000000..95511179e7 --- /dev/null +++ b/contentcuration/contentcuration/frontend/channelEdit/components/edit/InheritAncestorMetadataModal.vue @@ -0,0 +1,324 @@ + + + + + + diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/move/MoveModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/move/MoveModal.vue index a68c50d51b..d5c6164863 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/move/MoveModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/move/MoveModal.vue @@ -135,7 +135,7 @@