Continues implementation of item metadata bulk edition modal

This commit is contained in:
Mateus Machado Luna 2018-10-26 10:35:05 -03:00
parent a1f76f965f
commit 1632573f25
2 changed files with 50 additions and 5 deletions

View File

@ -242,6 +242,7 @@ export default {
collectionID: this.collectionId collectionID: this.collectionId
}).then((group) => { }).then((group) => {
let sequenceId = group.id; let sequenceId = group.id;
console.log(this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, sequenceId, 1))
this.$router.push(this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, sequenceId, 1)); this.$router.push(this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, sequenceId, 1));
}); });
}, },

View File

@ -86,7 +86,6 @@
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import CustomDialog from '../other/custom-dialog.vue';
export default { export default {
name: 'ItemMetadataBulkEditionForm', name: 'ItemMetadataBulkEditionForm',
@ -98,6 +97,38 @@ export default {
items: '', items: '',
collapseAll: false, collapseAll: false,
metadatumCollapses: [], metadatumCollapses: [],
statuses: {
draft: 'draft',
publish: 'publish',
private: 'private'
},
editionCriteria: [1],
editionActionsForMultiple: {
add: this.$i18n.get('add_value'),
redefine: this.$i18n.get('set_new_value'),
remove: this.$i18n.get('remove_value'),
replace: this.$i18n.get('replace_value'),
},
editionActionsForNotMultiple: {
redefine: this.$i18n.get('set_new_value'),
},
bulkEditionProcedures: {
1: {
isDone: false,
isDoneWithError: false,
isExecuting: false,
actionResult: '',
totalItemsEditedWithSuccess: 0,
tooltipShow: true,
}
},
groupID: null,
dones: [false],
}
},
computed: {
metadata() {
return this.getMetadata();
} }
}, },
methods: { methods: {
@ -111,9 +142,12 @@ export default {
'getMetadata', 'getMetadata',
]), ]),
...mapActions('bulkedition', [ ...mapActions('bulkedition', [
'fetchItemIdInSequence', 'setValueInBulk',
'fetchGroup', 'addValueInBulk',
'createEditGroup' 'replaceValueInBulk',
'redefineValueInBulk',
'setStatusInBulk',
'removeValueInBulk'
]), ]),
...mapGetters('bulkedition', [ ...mapGetters('bulkedition', [
'getItemIdInSequence', 'getItemIdInSequence',
@ -132,13 +166,23 @@ export default {
created() { created() {
// Obtains collection ID // Obtains collection ID
this.collectionId = this.$route.params.collectionId; this.collectionId = this.$route.params.collectionId;
this.groupID = this.$route.params.groupId;
// Obtains collection name // Obtains collection name
this.fetchCollectionName(this.collectionId).then((collectionName) => { this.fetchCollectionName(this.collectionId).then((collectionName) => {
this.collectionName = collectionName; this.collectionName = collectionName;
}); });
// this.isLoadingMetadata = true; this.isLoadingMetadata = true;
this.fetchMetadata({
collectionId: this.collectionID,
isRepositoryLevel: false,
isContextEdit: true,
includeDisabled: false,
}).then(() => {
this.isLoadingMetadata = false;
});
} }
} }