Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
</VContent>
</template>
</Uploader>

</VCard>
<BottomBar v-if="!loading && !loadError && !showFileUploadDefault">
<VLayout row align-center fill-height class="px-2">
Expand All @@ -124,6 +125,10 @@
<AboutLicensesModal
v-if="isAboutLicensesModalOpen"
/>
<InheritAncestorMetadataModal
:parent="(createMode && detailNodeIds.length) ? parent : null"
@inherit="inheritMetadata"
/>
</VDialog>

<!-- Dialog for catching unsaved changes -->
Expand Down Expand Up @@ -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';
Expand All @@ -210,6 +216,7 @@
EditView,
ResizableNavigationDrawer,
Uploader,
InheritAncestorMetadataModal,
FileStorage,
FileUploadDefault,
LoadingText,
Expand Down Expand Up @@ -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;
},
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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',
Expand Down
Loading