diff --git a/package.json b/package.json index 3edce4ce6..4ec9038f9 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "postcss-loader": "^3.0.0", "sass-loader": "^7.1.0", "style-loader": "^0.23.1", - "uglifyjs-webpack-plugin": "^2.0.1", + "terser-webpack-plugin": "^1.1.0", "vue-custom-element": "^3.2.6", "vue-loader": "^15.4.2", "vue-template-compiler": "^2.5.17", diff --git a/src/admin/components/edition/collection-edition-form.vue b/src/admin/components/edition/collection-edition-form.vue index 22018a4b5..542a12e22 100644 --- a/src/admin/components/edition/collection-edition-form.vue +++ b/src/admin/components/edition/collection-edition-form.vue @@ -2,7 +2,8 @@
- +
- + - {{ importerFile[0].name }} + {{ (importerFile.length != undefined && importerFile.length > 0 ) ? importerFile[0].name : importerFile.name }} @@ -251,7 +255,7 @@ export default { }, onUploadFile() { return new Promise((resolve, reject) => { - this.updateImporterFile({ sessionId: this.sessionId, file: this.importerFile[0] }) + this.updateImporterFile({ sessionId: this.sessionId, file: (this.importerFile.length != undefined && this.importerFile.length > 0) ? this.importerFile[0] : this.importerFile}) .then(updatedImporter => { this.importer = updatedImporter; resolve(); diff --git a/src/admin/components/edition/item-edition-form.vue b/src/admin/components/edition/item-edition-form.vue index f5f5b4e74..174a202fa 100644 --- a/src/admin/components/edition/item-edition-form.vue +++ b/src/admin/components/edition/item-edition-form.vue @@ -765,6 +765,12 @@ export default { // Puts loading on Draft Item creation this.isLoading = true; + // Updates Collection BreadCrumb + this.$root.$emit('onCollectionBreadCrumbUpdate', [ + { path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') }, + { path: '', label: this.$i18n.get('new') } + ]); + // Creates draft Item let data = {collection_id: this.form.collectionId, status: 'auto-draft', comment_status: this.form.comment_status}; this.fillExtraFormData(data); @@ -976,6 +982,22 @@ export default { this.fetchItem(this.itemId).then(res => { this.item = res; + // Updates Collection BreadCrumb + if (this.isOnSequenceEdit) { + this.$root.$emit('onCollectionBreadCrumbUpdate', [ + { path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') }, + { path: '', label: this.$i18n.get('sequence') }, + { path: '', label: this.item.title }, + { path: '', label: this.$i18n.get('edit') } + ]); + } else { + this.$root.$emit('onCollectionBreadCrumbUpdate', [ + { path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') }, + { path: this.$routerHelper.getItemPath(this.form.collectionId, this.itemId), label: this.item.title }, + { path: '', label: this.$i18n.get('edit') } + ]); + } + // Fills hook forms with it's real values this.$nextTick() .then(() => { diff --git a/src/admin/components/edition/taxonomy-edition-form.vue b/src/admin/components/edition/taxonomy-edition-form.vue index 733ddee16..8e558ccd9 100644 --- a/src/admin/components/edition/taxonomy-edition-form.vue +++ b/src/admin/components/edition/taxonomy-edition-form.vue @@ -1,7 +1,11 @@ diff --git a/src/admin/components/navigation/tainacan-title.vue b/src/admin/components/navigation/tainacan-title.vue index ea52af92b..8d60d19d9 100644 --- a/src/admin/components/navigation/tainacan-title.vue +++ b/src/admin/components/navigation/tainacan-title.vue @@ -13,128 +13,51 @@ class="breadcrumbs"> {{ $i18n.get('repository') }} > - - - {{ arrayViewPath[index] }} - - > - + :to="$routerHelper.getCollectionsPath()">{{ $i18n.get('repository') }} +
diff --git a/src/admin/js/main.js b/src/admin/js/main.js index 3a3051b87..bd856d720 100644 --- a/src/admin/js/main.js +++ b/src/admin/js/main.js @@ -93,7 +93,8 @@ Vue.use(eventBusSearch, { store: store, router: router}); // Changing title of pages router.beforeEach((to, from, next) => { document.title = to.meta.title; - next(); + if (next() != undefined) + next(); }); new Vue({ diff --git a/src/admin/js/router.js b/src/admin/js/router.js index fd625de9e..0e512d518 100644 --- a/src/admin/js/router.js +++ b/src/admin/js/router.js @@ -52,6 +52,7 @@ const routes = [ { path: 'metadata', component: MetadataList, name: 'MetadataList', meta: {title: i18nGet('title_collection_metadata_edition'), icon: 'folder-multiple'} }, { path: 'filters', component: FiltersList, name: 'FiltersList', meta: {title: i18nGet('title_collection_filters_edition'), icon: 'folder-multiple'} }, { path: 'events', component: EventsPage, name: 'CollectionEventsPage', meta: {title: i18nGet('title_collection_events'), icon: 'flash'} }, + { path: 'events/:eventId', name: 'CollectionEventPage', component: EventPage, meta: {title: i18nGet('title_event_page'), icon: 'flash'} }, { path: 'sequence/:sequenceId', name: 'SavedSequenceEditionForm', component: ItemEditionForm, meta: {title: i18nGet('title_edit_item'), icon: 'folder-multiple'} }, { path: 'sequence/:sequenceId/:itemPosition', name: 'SequenceEditionForm', component: ItemEditionForm, meta: {title: i18nGet('title_edit_item'), icon: 'folder-multiple'} }, ] diff --git a/src/admin/js/utilities.js b/src/admin/js/utilities.js index b711c5bbf..5eb7ab072 100644 --- a/src/admin/js/utilities.js +++ b/src/admin/js/utilities.js @@ -190,8 +190,8 @@ RouterHelperPlugin.install = function (Vue, options = {}) { getItemsPath(query) { return '/items/?' + qs.stringify(query); }, - getPath(query) { - return '/taxonomies/?' + qs.stringify(query); + getTaxonomiesPath() { + return '/taxonomies/' }, getTaxonomyTermsPath(taxonomyId, query) { return '/taxonomyId/' + taxonomyId + '/terms/?' + qs.stringify(query); @@ -206,7 +206,7 @@ RouterHelperPlugin.install = function (Vue, options = {}) { return '/events/?' + qs.stringify(query); }, getAvailableImportersPath() { - return '/importers/new'; + return '/importers'; }, getProcessesPage(highlightedProcess) { if (highlightedProcess) @@ -236,6 +236,9 @@ RouterHelperPlugin.install = function (Vue, options = {}) { getImporterPath(importerType, sessionId) { return '/importers/' + importerType + '/' + sessionId; }, + getCollectionEventPath(collectionId, eventId) { + return '/collections/' + collectionId + '/events/' + eventId; + }, // New getNewCollectionPath() { return '/collections/new'; diff --git a/src/admin/pages/lists/available-importers-page.vue b/src/admin/pages/lists/available-importers-page.vue index 3664613b8..ea323fc0d 100644 --- a/src/admin/pages/lists/available-importers-page.vue +++ b/src/admin/pages/lists/available-importers-page.vue @@ -1,6 +1,7 @@