Removes unecessary computed properties calling directly methods from vuex store. #496

This commit is contained in:
mateuswetah 2024-04-02 14:45:06 -03:00
parent bff3278fe4
commit 98b9e0a862
35 changed files with 212 additions and 454 deletions

View File

@ -423,9 +423,9 @@ export default {
} }
}, },
computed: { computed: {
metadatumTypes() { ...mapGetters('metadata', {
return this.getMetadatumTypes(); 'metadatumTypes': 'getMetadatumTypes'
}, }),
collectionNonChildMetadata() { collectionNonChildMetadata() {
return Array.isArray(this.collectionMetadata) ? this.collectionMetadata.filter((metadatum) => !this.checkIfMetadatumIsChild(metadatum)) : []; return Array.isArray(this.collectionMetadata) ? this.collectionMetadata.filter((metadatum) => !this.checkIfMetadatumIsChild(metadatum)) : [];
} }
@ -476,12 +476,6 @@ export default {
'fetchMetadatumTypes', 'fetchMetadatumTypes',
'sendMetadatum' 'sendMetadatum'
]), ]),
...mapGetters('metadata', [
'getMetadatumTypes'
]),
...mapGetters('bgprocess', [
'getProcess'
]),
...mapActions('collection', [ ...mapActions('collection', [
'fetchCollectionBasics' 'fetchCollectionBasics'
]), ]),

View File

@ -209,12 +209,9 @@ export default {
} }
}, },
computed: { computed: {
uploadedFileList() { ...mapGetters('collection', {
return this.getFiles(); 'collection': 'getCollection'
}, })
collection() {
return this.getCollection()
}
}, },
created() { created() {
// Obtains collection ID // Obtains collection ID
@ -233,10 +230,6 @@ export default {
'sendFile', 'sendFile',
'cleanFiles', 'cleanFiles',
'deleteItem' 'deleteItem'
]),
...mapGetters('collection', [
'getFiles',
'getCollection'
]), ]),
...mapActions('item', [ ...mapActions('item', [
'sendItem', 'sendItem',

View File

@ -849,9 +849,9 @@ export default {
} }
}, },
computed: { computed: {
collection() { ...mapGetters('collection', {
return this.getCollection() 'collection': 'getCollection'
}, }),
itemMetadata() { itemMetadata() {
const realItemMetadata = JSON.parse(JSON.stringify(this.getItemMetadata())); const realItemMetadata = JSON.parse(JSON.stringify(this.getItemMetadata()));
@ -877,21 +877,17 @@ export default {
}); });
return tweakedItemMetadata; return tweakedItemMetadata;
}, },
metadataSections() { ...mapGetters('metadata', {
return this.getMetadataSections(); 'metadataSections': 'getMetadataSections'
}, }),
lastUpdated() { ...mapGetters('item', {
return this.getLastUpdated(); 'totalAttachments': 'getTotalAttachments',
}, 'lastUpdated': 'getLastUpdated'
group() { }),
return this.getGroup(); ...mapGetters('bulkedition', {
}, 'itemIdInSequence': 'getItemIdInSequence',
itemIdInSequence() { 'group': 'getGroup'
return this.getItemIdInSequence(); }),
},
totalAttachments() {
return this.getTotalAttachments();
},
totalRelatedItems() { totalRelatedItems() {
return (this.item && this.item.related_items) ? Object.values(this.item.related_items).reduce((totalItems, aRelatedItemsGroup) => totalItems + parseInt(aRelatedItemsGroup.total_items), 0) : false; return (this.item && this.item.related_items) ? Object.values(this.item.related_items).reduce((totalItems, aRelatedItemsGroup) => totalItems + parseInt(aRelatedItemsGroup.total_items), 0) : false;
}, },
@ -1144,30 +1140,17 @@ export default {
]), ]),
...mapGetters('item',[ ...mapGetters('item',[
'getItemMetadata', 'getItemMetadata',
'getTotalAttachments',
'getLastUpdated',
'getAttachments'
]), ]),
...mapActions('collection', [ ...mapActions('collection', [
'deleteItem', 'deleteItem',
]), ]),
...mapGetters('collection', [
'getCollection',
]),
...mapActions('bulkedition', [ ...mapActions('bulkedition', [
'fetchItemIdInSequence', 'fetchItemIdInSequence',
'fetchSequenceGroup' 'fetchSequenceGroup'
]), ]),
...mapGetters('bulkedition', [
'getItemIdInSequence',
'getGroup'
]),
...mapActions('metadata',[ ...mapActions('metadata',[
'fetchMetadataSections' 'fetchMetadataSections'
]), ]),
...mapGetters('metadata',[
'getMetadataSections'
]),
onSubmit(status, sequenceDirection) { onSubmit(status, sequenceDirection) {
// Puts loading on Item edition // Puts loading on Item edition

View File

@ -268,7 +268,7 @@
<script> <script>
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import { permalinkGetter, formHooks } from "../../js/mixins"; import { permalinkGetter, formHooks } from "../../js/mixins";
import { mapActions, mapGetters } from 'vuex'; import { mapActions } from 'vuex';
import TermsList from '../lists/terms-list.vue'; import TermsList from '../lists/terms-list.vue';
import CustomDialog from '../other/custom-dialog.vue'; import CustomDialog from '../other/custom-dialog.vue';
@ -389,9 +389,6 @@
'fetchTaxonomy', 'fetchTaxonomy',
'fetchOnlySlug' 'fetchOnlySlug'
]), ]),
...mapGetters('taxonomy',[
'getTaxonomy',
]),
onChangeTab(tab) { onChangeTab(tab) {
this.tabIndex = tab; this.tabIndex = tab;
if (this.tabIndex == 1) { if (this.tabIndex == 1) {

View File

@ -92,9 +92,9 @@
} }
}, },
computed: { computed: {
facetsFromItemSearch() { ...mapGetters('search', {
return this.getFacets(); 'facetsFromItemSearch': 'getFacets'
} }),
}, },
watch: { watch: {
selected: { selected: {
@ -147,9 +147,6 @@
this.$eventBusSearchEmitter.off('hasToReloadFacets', this.reloadOptions); this.$eventBusSearchEmitter.off('hasToReloadFacets', this.reloadOptions);
}, },
methods: { methods: {
...mapGetters('search', [
'getFacets'
]),
reloadOptions(shouldReload) { reloadOptions(shouldReload) {
if ( !this.isUsingElasticSearch && shouldReload ) if ( !this.isUsingElasticSearch && shouldReload )
this.loadOptions(); this.loadOptions();

View File

@ -114,12 +114,10 @@
} }
}, },
computed: { computed: {
attachments() { ...mapGetters('item', {
return this.getAttachments(); 'attachments': 'getAttachments',
}, 'totalAttachments': 'getTotalAttachments'
totalAttachments() { })
return this.getTotalAttachments();
}
}, },
watch: { watch: {
shouldLoadAttachments() { shouldLoadAttachments() {
@ -134,10 +132,6 @@
...mapActions('item', [ ...mapActions('item', [
'fetchAttachments', 'fetchAttachments',
]), ]),
...mapGetters('item', [
'getAttachments',
'getTotalAttachments'
]),
onChangeAttachmentsPerPage(value) { onChangeAttachmentsPerPage(value) {
if (value != this.attachmentsPerPage) { if (value != this.attachmentsPerPage) {

View File

@ -2045,12 +2045,16 @@ export default {
} }
}, },
computed: { computed: {
collection() { ...mapGetters('collection', {
return this.getCollection(); 'collection': 'getCollection',
}, }),
highlightedItem () { ...mapGetters('bulkedition', {
return this.getHighlightedItem(); 'groupId': 'getGroupId'
}, }),
...mapGetters('search', {
'highlightedItem': 'getHighlightedItem',
'itemsPerPage': 'getItemsPerPage'
}),
selectedItems () { selectedItems () {
if (this.$adminOptions.itemsSingleSelectionMode || this.$adminOptions.itemsMultipleSelectionMode) if (this.$adminOptions.itemsSingleSelectionMode || this.$adminOptions.itemsMultipleSelectionMode)
this.$eventBusSearch.setSelectedItemsForIframe(this.getSelectedItems()); this.$eventBusSearch.setSelectedItemsForIframe(this.getSelectedItems());
@ -2078,9 +2082,6 @@ export default {
} }
return true; return true;
}, },
itemsPerPage(){
return this.getItemsPerPage();
},
totalPages(){ totalPages(){
return Math.ceil(Number(this.totalItems)/Number(this.itemsPerPage)); return Math.ceil(Number(this.totalItems)/Number(this.itemsPerPage));
}, },
@ -2283,9 +2284,6 @@ export default {
...mapActions('collection', [ ...mapActions('collection', [
'deleteItem', 'deleteItem',
]), ]),
...mapGetters('collection', [
'getCollection',
]),
...mapActions('bulkedition', [ ...mapActions('bulkedition', [
'createEditGroup', 'createEditGroup',
'createSequenceEditGroup', 'createSequenceEditGroup',
@ -2293,9 +2291,6 @@ export default {
'deleteItemsInBulk', 'deleteItemsInBulk',
'untrashItemsInBulk' 'untrashItemsInBulk'
]), ]),
...mapGetters('bulkedition', [
'getGroupId'
]),
...mapActions('search', [ ...mapActions('search', [
'setSeletecItems', 'setSeletecItems',
'cleanSelectedItems', 'cleanSelectedItems',
@ -2303,12 +2298,8 @@ export default {
'removeSelectedItem' 'removeSelectedItem'
]), ]),
...mapGetters('search', [ ...mapGetters('search', [
'getOrder',
'getOrderBy',
'getStatus', 'getStatus',
'getSelectedItems', 'getSelectedItems',
'getHighlightedItem',
'getItemsPerPage'
]), ]),
setSelectedItemChecked(itemId) { setSelectedItemChecked(itemId) {
if (this.$adminOptions.itemsSingleSelectionMode) { if (this.$adminOptions.itemsSingleSelectionMode) {
@ -2346,8 +2337,7 @@ export default {
object: Object.keys(this.queryAllItemsSelected).length ? this.queryAllItemsSelected : this.selectedItems, object: Object.keys(this.queryAllItemsSelected).length ? this.queryAllItemsSelected : this.selectedItems,
collectionId: this.collectionId collectionId: this.collectionId
}).then(() => { }).then(() => {
let sequenceId = this.getGroupId(); this.$router.push(this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, this.groupId, 1));
this.$router.push(this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, sequenceId, 1));
}); });
}, },
selectAllItemsOnPage() { selectAllItemsOnPage() {
@ -2397,11 +2387,9 @@ export default {
collectionId: this.collectionId, collectionId: this.collectionId,
object: [itemId] object: [itemId]
}).then(() => { }).then(() => {
let groupId = this.getGroupId();
this.untrashItemsInBulk({ this.untrashItemsInBulk({
collectionId: this.collectionId, collectionId: this.collectionId,
groupId: groupId groupId: this.groupId
}).then(() => this.$eventBusSearch.loadItems() ); }).then(() => this.$eventBusSearch.loadItems() );
}); });
} }
@ -2449,11 +2437,9 @@ export default {
collectionId: this.collectionId, collectionId: this.collectionId,
object: Object.keys(this.queryAllItemsSelected).length ? this.queryAllItemsSelected : this.selectedItems object: Object.keys(this.queryAllItemsSelected).length ? this.queryAllItemsSelected : this.selectedItems
}).then(() => { }).then(() => {
let groupId = this.getGroupId();
this.untrashItemsInBulk({ this.untrashItemsInBulk({
collectionId: this.collectionId, collectionId: this.collectionId,
groupId: groupId groupId: this.groupId
}).then(() => { }).then(() => {
this.$eventBusSearch.loadItems(); this.$eventBusSearch.loadItems();
this.$emitter.emit('openProcessesPopup'); this.$emitter.emit('openProcessesPopup');
@ -2481,12 +2467,10 @@ export default {
collectionId: this.collectionId, collectionId: this.collectionId,
object: Object.keys(this.queryAllItemsSelected).length ? this.queryAllItemsSelected : this.selectedItems object: Object.keys(this.queryAllItemsSelected).length ? this.queryAllItemsSelected : this.selectedItems
}).then(() => { }).then(() => {
let groupId = this.getGroupId();
if (this.isOnTrash) { if (this.isOnTrash) {
this.deleteItemsInBulk({ this.deleteItemsInBulk({
collectionId: this.collectionId, collectionId: this.collectionId,
groupId: groupId groupId: this.groupId
}).then(() => { }).then(() => {
this.$eventBusSearch.loadItems(); this.$eventBusSearch.loadItems();
this.$emitter.emit('openProcessesPopup'); this.$emitter.emit('openProcessesPopup');
@ -2494,7 +2478,7 @@ export default {
} else { } else {
this.trashItemsInBulk({ this.trashItemsInBulk({
collectionId: this.collectionId, collectionId: this.collectionId,
groupId: groupId groupId: this.groupId
}).then(() => { }).then(() => {
this.$eventBusSearch.loadItems(); this.$eventBusSearch.loadItems();
this.$emitter.emit('openProcessesPopup'); this.$emitter.emit('openProcessesPopup');

View File

@ -230,14 +230,12 @@ export default {
} }
}, },
computed: { computed: {
metadatumMappers() { ...mapGetters('metadata', {
return this.getMetadatumMappers(); 'metadatumMappers': 'getMetadatumMappers',
}, 'activeMetadatumList': 'getMetadata'
}),
isNewMetadataMapperMetadataDisabled() { isNewMetadataMapperMetadataDisabled() {
return !this.newMetadataLabel || !this.newMetadataUri; return !this.newMetadataLabel || !this.newMetadataUri;
},
activeMetadatumList() {
return this.getMetadata();
} }
}, },
mounted() { mounted() {
@ -277,10 +275,6 @@ export default {
'fetchMetadatumMappers', 'fetchMetadatumMappers',
'updateMetadataMapperMetadata', 'updateMetadataMapperMetadata',
]), ]),
...mapGetters('metadata',[
'getMetadatumMappers',
'getMetadata'
]),
loadMetadataMappers() { loadMetadataMappers() {
this.isLoadingMetadatumMappers = true; this.isLoadingMetadatumMappers = true;
this.fetchMetadatumMappers() this.fetchMetadatumMappers()

View File

@ -10,7 +10,7 @@
{{ $i18n.get('label_available_metadata_types') }} {{ $i18n.get('label_available_metadata_types') }}
</h3> </h3>
<sortable <sortable
:list="availableMetadatumList" :list="availableMetadataTypes"
item-key="id" item-key="id"
:options="{ :options="{
group: { group: {
@ -166,14 +166,9 @@ export default {
} }
}, },
computed: { computed: {
availableMetadatumList: { ...mapGetters('metadata', {
get() { 'availableMetadataTypes': 'getMetadatumTypes'
return this.getMetadatumTypes(); }),
},
set(value) {
return this.updateMetadatumTypes(value);
}
},
}, },
mounted() { mounted() {
@ -192,9 +187,6 @@ export default {
...mapActions('metadata', [ ...mapActions('metadata', [
'fetchMetadatumTypes' 'fetchMetadatumTypes'
]), ]),
...mapGetters('metadata',[
'getMetadatumTypes'
]),
addMetadatumViaButton(metadatumType) { addMetadatumViaButton(metadatumType) {
this.$emitter.emit('addMetadatumViaButton', metadatumType); this.$emitter.emit('addMetadatumViaButton', metadatumType);
}, },

View File

@ -175,9 +175,9 @@
} }
}, },
computed: { computed: {
collection() { ...mapGetters('collection', {
return this.getCollection(); 'collection': 'getCollection'
}, }),
maxMultipleValues() { maxMultipleValues() {
return ( return (
this.itemMetadatum && this.itemMetadatum &&
@ -271,9 +271,6 @@
} }
}, },
methods: { methods: {
...mapGetters('collection', [
'getCollection'
]),
onInput(newSelected) { onInput(newSelected) {
// First we reset the input // First we reset the input
this.search(''); this.search('');

View File

@ -593,9 +593,9 @@
} }
}, },
computed: { computed: {
activity() { ...mapGetters('activity', {
return this.getActivity(); 'activity': 'getActivity'
}, }),
relatedToLink() { relatedToLink() {
switch(this.activity.object_type) { switch(this.activity.object_type) {
case 'Tainacan\\Entities\\Collection': case 'Tainacan\\Entities\\Collection':
@ -651,9 +651,6 @@
...mapActions('activity', [ ...mapActions('activity', [
'fetchActivity' 'fetchActivity'
]), ]),
...mapGetters('activity', [
'getActivity'
]),
approveActivity(){ approveActivity(){
this.$emit('approveActivity', this.activity.id); this.$emit('approveActivity', this.activity.id);
}, },

View File

@ -367,9 +367,9 @@
} }
}, },
computed: { computed: {
metadata() { ...mapGetters('metadata', {
return this.getMetadata(); 'metadata': 'getMetadata'
} })
}, },
created(){ created(){
if (this.collectionId) { if (this.collectionId) {
@ -436,9 +436,6 @@
...mapActions('metadata', [ ...mapActions('metadata', [
'fetchMetadata' 'fetchMetadata'
]), ]),
...mapGetters('metadata', [
'getMetadata'
]),
finalizeProcedure(criterion){ finalizeProcedure(criterion){
Object.assign(this.bulkEditionProcedures[criterion], { 'isDone': true }); Object.assign(this.bulkEditionProcedures[criterion], { 'isDone': true });

View File

@ -110,9 +110,9 @@ export default {
} }
}, },
computed: { computed: {
roles() { ...mapGetters('capability', {
return this.getRoles(); 'roles': 'getRoles',
} })
}, },
created() { created() {
this.isLoading = true; this.isLoading = true;
@ -126,9 +126,6 @@ export default {
'addCapabilityToRole', 'addCapabilityToRole',
'removeCapabilityFromRole' 'removeCapabilityFromRole'
]), ]),
...mapGetters('capability', [
'getRoles',
]),
updateRole(role, value) { updateRole(role, value) {
if (value) if (value)
this.addCapabilityToRole({ capabilityKey: this.capabilityKey.replace('%d', 'all'), role: role }) this.addCapabilityToRole({ capabilityKey: this.capabilityKey.replace('%d', 'all'), role: role })

View File

@ -130,9 +130,9 @@ export default {
} }
}, },
computed: { computed: {
metadatumMappers() { ...mapGetters('metadata', {
return this.getMetadatumMappers(); 'metadatumMappers': 'getMetadatumMappers'
}, }),
hasPresetsHook() { hasPresetsHook() {
if (wp !== undefined && wp.hooks !== undefined) if (wp !== undefined && wp.hooks !== undefined)
return wp.hooks.hasFilter(`tainacan_collections_presets`); return wp.hooks.hasFilter(`tainacan_collections_presets`);
@ -172,9 +172,6 @@ export default {
...mapActions('metadata', [ ...mapActions('metadata', [
'fetchMetadatumMappers' 'fetchMetadatumMappers'
]), ]),
...mapGetters('metadata', [
'getMetadatumMappers'
]),
onNewCollectionPreset(collectionPreset) { onNewCollectionPreset(collectionPreset) {
this.isCreatingCollectionPreset = true; this.isCreatingCollectionPreset = true;
axios.post(collectionPreset.endpoint) axios.post(collectionPreset.endpoint)

View File

@ -141,9 +141,9 @@ export default {
} }
}, },
computed: { computed: {
collection() { ...mapGetters('collection', {
return this.getCollection(); 'collection': 'getCollection'
} })
}, },
watch: { watch: {
'$route': { '$route': {
@ -160,11 +160,6 @@ export default {
this.activeRoute = this.$route.name; this.activeRoute = this.$route.name;
this.pageTitle = this.$route.meta.title; this.pageTitle = this.$route.meta.title;
},
methods: {
...mapGetters('collection', [
'getCollection'
])
} }
} }
</script> </script>

View File

@ -132,14 +132,11 @@ export default {
} }
}, },
computed: { computed: {
collection() { ...mapGetters('collection', {
return this.getCollection(); 'collection': 'getCollection'
} })
}, },
methods: { methods: {
...mapGetters('collection', [
'getCollection'
]),
openAvailableExportersModal(){ openAvailableExportersModal(){
this.$buefy.modal.open({ this.$buefy.modal.open({

View File

@ -72,14 +72,14 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters('collection', {
'collection': 'getCollection'
}),
slotPassed() { slotPassed() {
const slots = useSlots(); const slots = useSlots();
return !!slots['default']; return !!slots['default'];
}, },
collection() { collectionBreadCrumbItem() {
return this.getCollection();
},
collectionBreadCrumbItem() {
return { return {
url: this.collection && this.collection.id ? this.$routerHelper.getCollectionPath(this.collection.id) : '', url: this.collection && this.collection.id ? this.$routerHelper.getCollectionPath(this.collection.id) : '',
name: this.collection && this.collection.name ? this.collection.name : '' name: this.collection && this.collection.name ? this.collection.name : ''
@ -111,9 +111,6 @@ export default {
this.$emitter.on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate); this.$emitter.on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate);
}, },
methods: { methods: {
...mapGetters('collection', [
'getCollection'
]),
collectionBreadCrumbUpdate(breadCrumbItems) { collectionBreadCrumbUpdate(breadCrumbItems) {
this.childrenBreadCrumbItems = breadCrumbItems; this.childrenBreadCrumbItems = breadCrumbItems;
} }

View File

@ -62,12 +62,12 @@ export default {
isRepositoryLevel: Boolean isRepositoryLevel: Boolean
}, },
computed: { computed: {
status() { ...mapGetters('search', {
return this.getStatus(); 'status': 'getStatus'
}, }),
collection() { ...mapGetters('collection', {
return this.getCollection(); 'collection': 'getCollection'
}, }),
repositoryTotalItems() { repositoryTotalItems() {
if (!this.$adminOptions.hideItemsListStatusTabsTotalItems) { if (!this.$adminOptions.hideItemsListStatusTabsTotalItems) {
@ -94,11 +94,7 @@ export default {
} }
}, },
methods: { methods: {
...mapGetters('search', [
'getStatus'
]),
...mapGetters('collection', [ ...mapGetters('collection', [
'getCollection',
'getCollections' 'getCollections'
]), ]),
onChangeTab(status) { onChangeTab(status) {

View File

@ -311,24 +311,20 @@
} }
}, },
computed: { computed: {
filters() { ...mapGetters('collection', {
return this.getFilters(); 'collection': 'getCollection'
}, }),
repositoryCollectionFilters() { ...mapGetters('search', {
return this.getRepositoryCollectionFilters(); 'getQuery': 'getPostQuery'
}, }),
taxonomyFilters() { ...mapGetters('filter', {
return this.getTaxonomyFilters(); 'filters': 'getFilters',
}, 'taxonomyFilters': 'getTaxonomyFilters',
getQuery() { 'repositoryCollectionFilters': 'getRepositoryCollectionFilters'
return this.getPostQuery(); }),
},
taxonomyId () { taxonomyId () {
const taxonomyArray = this.taxonomy.split("_"); const taxonomyArray = this.taxonomy.split("_");
return taxonomyArray[taxonomyArray.length - 1]; return taxonomyArray[taxonomyArray.length - 1];
},
collection() {
return this.getCollection();
} }
}, },
watch: { watch: {
@ -394,11 +390,7 @@
}, },
methods: { methods: {
...mapGetters('search',[
'getPostQuery'
]),
...mapGetters('collection',[ ...mapGetters('collection',[
'getCollection',
'getCollections' 'getCollections'
]), ]),
...mapActions('collection',[ ...mapActions('collection',[
@ -409,11 +401,6 @@
'fetchTaxonomyFilters', 'fetchTaxonomyFilters',
'fetchRepositoryCollectionFilters' 'fetchRepositoryCollectionFilters'
]), ]),
...mapGetters('filter', [
'getFilters',
'getTaxonomyFilters',
'getRepositoryCollectionFilters'
]),
prepareFilters() { prepareFilters() {
// Cancels previous Request // Cancels previous Request
if (this.filtersSearchCancel != undefined) if (this.filtersSearchCancel != undefined)

View File

@ -95,6 +95,9 @@
} }
}, },
computed: { computed: {
...mapGetters('search', {
'totalItems': 'getTotalItems'
}),
filterTags() { filterTags() {
let tags = this.getFilterTags(); let tags = this.getFilterTags();
let flattenTags = []; let flattenTags = [];
@ -127,9 +130,6 @@
}); });
return flattenTags; return flattenTags;
},
totalItems() {
return this.getTotalItems()
} }
}, },
watch: { watch: {
@ -166,8 +166,7 @@
}, },
methods: { methods: {
...mapGetters('search',[ ...mapGetters('search',[
'getFilterTags', 'getFilterTags'
'getTotalItems'
]), ]),
removeMetaQuery({ filterId, value, singleLabel, label, taxonomy, metadatumId, metadatumName, argType }) { removeMetaQuery({ filterId, value, singleLabel, label, taxonomy, metadatumId, metadatumName, argType }) {
this.$eventBusSearch.resetPageOnStore(); this.$eventBusSearch.resetPageOnStore();

View File

@ -123,15 +123,11 @@ export default {
} }
}, },
computed: { computed: {
totalItems(){ ...mapGetters('search', {
return this.getTotalItems(); 'totalItems': 'getTotalItems',
}, 'page': 'getPage',
page(){ 'itemsPerPage': 'getItemsPerPage'
return this.getPage(); }),
},
itemsPerPage(){
return this.getItemsPerPage();
},
totalPages(){ totalPages(){
return Math.ceil(Number(this.totalItems)/Number(this.itemsPerPage)); return Math.ceil(Number(this.totalItems)/Number(this.itemsPerPage));
}, },
@ -150,20 +146,13 @@ export default {
} }
}, },
methods: { methods: {
...mapGetters('search', [
'getTotalItems',
'getPage',
'getItemsPerPage',
'getPostQuery'
]),
onChangeItemsPerPage(value) { onChangeItemsPerPage(value) {
if ( this.itemsPerPage == value){ if ( this.itemsPerPage == value )
return false; return false;
} else if (Number(value) > Number(this.maxItemsPerPage)) { else if ( Number(value) > Number(this.maxItemsPerPage) )
this.$eventBusSearch.setItemsPerPage(this.maxItemsPerPage); this.$eventBusSearch.setItemsPerPage(this.maxItemsPerPage);
} else { else
this.$eventBusSearch.setItemsPerPage(value); this.$eventBusSearch.setItemsPerPage(value);
}
}, },
onPageChange(page) { onPageChange(page) {
if(page == 0) if(page == 0)

View File

@ -45,9 +45,9 @@ export const dynamicFilterTypeMixin = {
}, },
emits: ['update-parent-collapse'], emits: ['update-parent-collapse'],
computed: { computed: {
facetsFromItemSearch() { ...mapGetters('search', {
return this.getFacets(); 'facetsFromItemSearch': 'getFacets'
} }),
}, },
watch: { watch: {
isLoadingItems: { isLoadingItems: {
@ -59,9 +59,6 @@ export const dynamicFilterTypeMixin = {
} }
}, },
methods: { methods: {
...mapGetters('search', [
'getFacets'
]),
getValuesPlainText({ metadatumId, search, isRepositoryLevel, valuesToIgnore, offset, number, isInCheckboxModal, getSelected = '0', countItems = true }) { getValuesPlainText({ metadatumId, search, isRepositoryLevel, valuesToIgnore, offset, number, isInCheckboxModal, getSelected = '0', countItems = true }) {
if (isInCheckboxModal || search || !this.isUsingElasticSearch) { if (isInCheckboxModal || search || !this.isUsingElasticSearch) {

View File

@ -186,9 +186,9 @@ export default {
} }
}, },
computed: { computed: {
collections() { ...mapGetters('collection', {
return this.getCollections(); 'collections': 'getCollections'
} }),
}, },
mounted() { mounted() {
this.loadCollections(); this.loadCollections();
@ -198,9 +198,6 @@ export default {
'fetchCollections', 'fetchCollections',
'cleanCollections' 'cleanCollections'
]), ]),
...mapGetters('collection', [
'getCollections'
]),
loadCollections() { loadCollections() {
this.cleanCollections(); this.cleanCollections();
this.isLoadingCollections = true; this.isLoadingCollections = true;

View File

@ -391,6 +391,9 @@
} }
}, },
computed: { computed: {
...mapGetters('bgprocess', {
'processes': 'getProcesses'
}),
activities(){ activities(){
let activitiesList = this.getActivities(); let activitiesList = this.getActivities();
@ -400,9 +403,6 @@
moment(activity['log_date'], 'YYYY-MM-DD h:mm:ss').format('DD/MM/YYYY, hh:mm:ss'); moment(activity['log_date'], 'YYYY-MM-DD h:mm:ss').format('DD/MM/YYYY, hh:mm:ss');
return activitiesList; return activitiesList;
},
processes(){
return this.getProcesses();
} }
}, },
created() { created() {
@ -451,9 +451,6 @@
...mapActions('bgprocess', [ ...mapActions('bgprocess', [
'fetchProcesses', 'fetchProcesses',
]), ]),
...mapGetters('bgprocess', [
'getProcesses'
]),
onChangeTab(tab) { onChangeTab(tab) {
this.tab = tab; this.tab = tab;
if (this.tab == 'processes') { if (this.tab == 'processes') {

View File

@ -102,6 +102,9 @@
} }
}, },
computed: { computed: {
...mapGetters('collection', {
'collection': 'getCollection'
}),
capabilities() { capabilities() {
const capabilities = this.getCapabilities() const capabilities = this.getCapabilities()
@ -140,9 +143,6 @@
} else { } else {
return [] return []
} }
},
collection() {
return this.getCollection();
} }
}, },
mounted() { mounted() {
@ -160,9 +160,6 @@
...mapGetters('capability', [ ...mapGetters('capability', [
'getCapabilities' 'getCapabilities'
]), ]),
...mapGetters('collection', [
'getCollection'
]),
loadCapabilities() { loadCapabilities() {
this.isLoading = true; this.isLoading = true;

View File

@ -433,12 +433,10 @@ export default {
} }
}, },
computed: { computed: {
collections() { ...mapGetters('collection', {
return this.getCollections(); 'collections': 'getCollections',
}, 'repositoryTotalCollections': 'getRepositoryTotalCollections'
repositoryTotalCollections(){ }),
return this.getRepositoryTotalCollections();
},
collectionTaxonomies() { collectionTaxonomies() {
let collectionTaxonomies = this.getCollectionTaxonomies(); let collectionTaxonomies = this.getCollectionTaxonomies();
@ -510,8 +508,6 @@ export default {
'fetchMetadatumMappers' 'fetchMetadatumMappers'
]), ]),
...mapGetters('collection', [ ...mapGetters('collection', [
'getCollections',
'getRepositoryTotalCollections',
'getCollectionTaxonomies' 'getCollectionTaxonomies'
]), ]),
onChangeTab(status) { onChangeTab(status) {

View File

@ -537,6 +537,9 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters('collection', {
'collection': 'getCollection',
}),
activeFiltersList: { activeFiltersList: {
get() { get() {
return this.getFilters(); return this.getFilters();
@ -545,9 +548,6 @@ export default {
this.updateFilters(value); this.updateFilters(value);
} }
}, },
collection() {
return this.getCollection();
}
}, },
watch: { watch: {
'$route.query': { '$route.query': {
@ -624,8 +624,7 @@ export default {
'moveFilterDown' 'moveFilterDown'
]), ]),
...mapGetters('filter',[ ...mapGetters('filter',[
'getFilters', 'getFilters'
'getFilterTypes'
]), ]),
...mapActions('metadata', [ ...mapActions('metadata', [
'fetchMetadata', 'fetchMetadata',
@ -633,9 +632,6 @@ export default {
...mapGetters('metadata', [ ...mapGetters('metadata', [
'getMetadata', 'getMetadata',
]), ]),
...mapGetters('collection', [
'getCollection',
]),
handleChangeOnFilter($event) { handleChangeOnFilter($event) {
switch( $event.type ) { switch( $event.type ) {
case 'add': case 'add':

View File

@ -748,46 +748,32 @@
} }
}, },
computed: { computed: {
...mapGetters('collection', {
'items': 'getItems',
'collection': 'getCollection'
}),
...mapGetters('metadata', {
'metadata': 'getMetadata'
}),
...mapGetters('search', {
'searchQuery': 'getSearchQuery',
'sentenceMode': 'getSentenceMode',
'status': 'getStatus',
'orderBy': 'getOrderBy',
'order': 'getOrder',
'totalItems': 'getTotalItems',
'adminViewMode': 'getAdminViewMode',
'metaKey': 'getMetaKey'
}),
isSortingByCustomMetadata() { isSortingByCustomMetadata() {
return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'date' && this.orderBy != 'modified'); return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'date' && this.orderBy != 'modified');
}, },
items() {
return this.getItems();
},
totalItems() {
this.updateCollectionInfo();
return this.getTotalItems();
},
metadata() {
return this.getMetadata();
},
collection() {
return this.getCollection();
},
searchQuery() {
return this.getSearchQuery();
},
status() {
return this.getStatus();
},
sentenceMode() {
return this.getSentenceMode();
},
adminViewMode() {
const currentAdminViewMode = this.getAdminViewMode();
return ['table', 'cards', 'records', 'grid', 'masonry', 'list', 'map'].indexOf(currentAdminViewMode) >= 0 ? currentAdminViewMode : 'table';
},
orderBy() {
return this.getOrderBy();
},
order() {
return this.getOrder();
},
showLoading() { showLoading() {
return this.isLoadingItems || this.isLoadingMetadata; return this.isLoadingItems || this.isLoadingMetadata;
}, },
metaKey() { adminViewMode() {
return this.getMetaKey(); const currentAdminViewMode = this.getAdminViewMode();
return ['table', 'cards', 'records', 'grid', 'masonry', 'list', 'map'].indexOf(currentAdminViewMode) >= 0 ? currentAdminViewMode : 'table';
}, },
orderByName() { orderByName() {
const metadatumName = this.$orderByHelper.getOrderByMetadatumName({ const metadatumName = this.$orderByHelper.getOrderByMetadatumName({
@ -949,6 +935,9 @@
this.$refs['filters-modal'].focus(); this.$refs['filters-modal'].focus();
}, 800); }, 800);
} }
},
totalItems() {
this.updateCollectionInfo();
} }
}, },
created() { created() {
@ -1030,28 +1019,14 @@
}, },
methods: { methods: {
...mapGetters('collection', [
'getItems',
'getCollection'
]),
...mapActions('collection', [ ...mapActions('collection', [
'fetchCollectionBasics' 'fetchCollectionBasics'
]), ]),
...mapActions('metadata', [ ...mapActions('metadata', [
'fetchMetadata' 'fetchMetadata'
]), ]),
...mapGetters('metadata', [
'getMetadata'
]),
...mapGetters('search', [ ...mapGetters('search', [
'getSearchQuery',
'getSentenceMode',
'getStatus',
'getOrderBy',
'getOrder',
'getTotalItems',
'getAdminViewMode', 'getAdminViewMode',
'getMetaKey'
]), ]),
onOpenImportersModal() { onOpenImportersModal() {
this.$buefy.modal.open({ this.$buefy.modal.open({

View File

@ -83,9 +83,9 @@ export default {
} }
}, },
computed: { computed: {
collection() { ...mapGetters('collection', {
return this.getCollection(); 'collection': 'getCollection'
}, }),
repositoryTabLabel() { repositoryTabLabel() {
let label = this.$i18n.get('metadata'); let label = this.$i18n.get('metadata');
const metadata = this.getMetadata(); const metadata = this.getMetadata();
@ -115,9 +115,6 @@ export default {
this.$emitter.emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('metadata') }]); this.$emitter.emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('metadata') }]);
}, },
methods: { methods: {
...mapGetters('collection',[
'getCollection'
]),
...mapGetters('metadata',[ ...mapGetters('metadata',[
'getMetadatumTypes', 'getMetadatumTypes',
'getMetadata', 'getMetadata',

View File

@ -283,12 +283,10 @@
} }
}, },
computed: { computed: {
taxonomies(){ ...mapGetters('taxonomy', {
return this.get(); 'taxonomies': 'get',
}, 'repositoryTotalTaxonomies': 'getRepositoryTotalTaxonomies'
repositoryTotalTaxonomies(){ }),
return this.getRepositoryTotalTaxonomies();
},
statusOptionsForTaxonomies() { statusOptionsForTaxonomies() {
return this.$statusHelper.getStatuses().filter((status) => status.slug != 'draft' && (status.slug != 'private' || (status.slug == 'private' && this.$userCaps.hasCapability('tnc_rep_read_private_taxonomies')))); return this.$statusHelper.getStatuses().filter((status) => status.slug != 'draft' && (status.slug != 'private' || (status.slug == 'private' && this.$userCaps.hasCapability('tnc_rep_read_private_taxonomies'))));
} }
@ -325,10 +323,6 @@
...mapActions('taxonomy', [ ...mapActions('taxonomy', [
'fetch', 'fetch',
]), ]),
...mapGetters('taxonomy', [
'get',
'getRepositoryTotalTaxonomies'
]),
onChangeTab(status) { onChangeTab(status) {
this.page = 1; this.page = 1;
this.status = status; this.status = status;

View File

@ -476,18 +476,16 @@
} }
}, },
computed: { computed: {
collection() { ...mapGetters('collection', {
return this.getCollection(); 'collection': 'getCollection'
}, }),
metadataSections() { ...mapGetters('metadata', {
return this.getMetadataSections(); 'metadataSections': 'getMetadataSections'
}, }),
item() { ...mapGetters('item', {
// Fills hook forms with it's real values 'item': 'getItem',
this.updateExtraFormData(this.getItem()); 'totalAttachments': 'getTotalAttachments'
}),
return this.getItem();
},
itemMetadata() { itemMetadata() {
const realItemMetadata = JSON.parse(JSON.stringify(this.getItemMetadata())); const realItemMetadata = JSON.parse(JSON.stringify(this.getItemMetadata()));
const tweakedItemMetadata = realItemMetadata.map((anItemMetadatum) => { const tweakedItemMetadata = realItemMetadata.map((anItemMetadatum) => {
@ -515,9 +513,6 @@
totalRelatedItems() { totalRelatedItems() {
return (this.item && this.item.related_items) ? Object.values(this.item.related_items).reduce((totalItems, aRelatedItemsGroup) => totalItems + parseInt(aRelatedItemsGroup.total_items), 0) : false; return (this.item && this.item.related_items) ? Object.values(this.item.related_items).reduce((totalItems, aRelatedItemsGroup) => totalItems + parseInt(aRelatedItemsGroup.total_items), 0) : false;
}, },
totalAttachments() {
return this.getTotalAttachments();
},
itemVisibility() { itemVisibility() {
return (this.collection && this.collection.status == 'publish' && this.item && this.item.status == 'publish') ? 'open_access' : 'restrict_access' return (this.collection && this.collection.status == 'publish' && this.item && this.item.status == 'publish') ? 'open_access' : 'restrict_access'
}, },
@ -554,6 +549,12 @@
return !this.$adminOptions.hideItemSingleAttachments && (this.collection && this.collection.item_enable_attachments === 'yes'); return !this.$adminOptions.hideItemSingleAttachments && (this.collection && this.collection.item_enable_attachments === 'yes');
} }
}, },
watch: {
item() {
// Fills hook forms with it's real values
this.updateExtraFormData(this.item);
}
},
created() { created() {
// Obtains item and collection ID // Obtains item and collection ID
this.collectionId = this.$route.params.collectionId; this.collectionId = this.$route.params.collectionId;
@ -609,19 +610,11 @@
'fetchItemMetadata', 'fetchItemMetadata',
]), ]),
...mapGetters('item', [ ...mapGetters('item', [
'getItem', 'getItemMetadata'
'getItemMetadata',
'getTotalAttachments'
]),
...mapGetters('collection', [
'getCollection'
]), ]),
...mapActions('metadata',[ ...mapActions('metadata',[
'fetchMetadataSections' 'fetchMetadataSections'
]), ]),
...mapGetters('metadata',[
'getMetadataSections'
]),
loadMetadata() { loadMetadata() {
// Obtains Item Metadatum // Obtains Item Metadatum
this.fetchItemMetadata(this.itemId).then(() => { this.fetchItemMetadata(this.itemId).then(() => {

View File

@ -402,18 +402,18 @@ export default {
} }
}, },
computed: { computed: {
item() { ...mapGetters('item', {
return this.getItem(); 'item': 'getItem'
}, }),
page() { ...mapGetters('search', {
this.setMaxAndMinPages(); 'totalPages': 'getTotalPages',
return this.getPage(); 'page': 'getPage',
}, })
totalPages() {
return this.getTotalPages();
}
}, },
watch: { watch: {
page() {
this.setMaxAndMinPages();
},
isLoading: { isLoading: {
handler(val, oldValue) { handler(val, oldValue) {
if (val === false && oldValue === true && this.swiper && this.items && this.items.length) { if (val === false && oldValue === true && this.swiper && this.items && this.items.length) {
@ -540,14 +540,6 @@ export default {
'fetchItem', 'fetchItem',
'replaceItem' 'replaceItem'
]), ]),
...mapGetters('item', [
'getItem'
]),
...mapGetters('search', [
'getTotalPages',
'getPage',
'getItemsPerPage'
]),
setMaxAndMinPages () { setMaxAndMinPages () {
this.minPage = JSON.parse(JSON.stringify(this.getPage() < this.minPage ? this.getPage() : this.minPage)); this.minPage = JSON.parse(JSON.stringify(this.getPage() < this.minPage ? this.getPage() : this.minPage));
this.maxPage = JSON.parse(JSON.stringify(this.getPage() > this.maxPage ? this.getPage() : this.maxPage)); this.maxPage = JSON.parse(JSON.stringify(this.getPage() > this.maxPage ? this.getPage() : this.maxPage));

View File

@ -770,6 +770,24 @@
} }
}, },
computed: { computed: {
...mapGetters('collection', {
'items': 'getItems',
'itemsListTemplate': 'getItemsListTemplate'
}),
...mapGetters('metadata', {
'metadata': 'getMetadata'
}),
...mapGetters('search', {
'searchQuery': 'getSearchQuery',
'orderBy': 'getOrderBy',
'order': 'getOrder',
'viewMode': 'getViewMode',
'totalItems': 'getTotalItems',
'sentenceMode': 'getSentenceMode',
'metaKey': 'getMetaKey',
'page': 'getPage',
'itemsPerPage': 'getItemsPerPage'
}),
wrapperClasses() { wrapperClasses() {
return { return {
'is-filters-menu-open': !this.hideFilters && this.isFiltersModalActive && !this.openAdvancedSearch, 'is-filters-menu-open': !this.hideFilters && this.isFiltersModalActive && !this.openAdvancedSearch,
@ -782,39 +800,9 @@
isSortingByCustomMetadata() { isSortingByCustomMetadata() {
return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'creation_date' && this.orderBy != 'date' && this.orderBy != 'modified'); return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'creation_date' && this.orderBy != 'date' && this.orderBy != 'modified');
}, },
items() {
return this.getItems();
},
itemsListTemplate() {
return this.getItemsListTemplate();
},
totalItems() {
return this.getTotalItems();
},
metadata() {
return this.getMetadata();
},
searchQuery() {
return this.getSearchQuery();
},
sentenceMode() {
return this.getSentenceMode();
},
viewMode() {
return this.getViewMode();
},
orderBy() {
return this.getOrderBy();
},
order() {
return this.getOrder();
},
showLoading() { showLoading() {
return this.isLoadingItems || this.isLoadingMetadata; return this.isLoadingItems || this.isLoadingMetadata;
}, },
metaKey() {
return this.getMetaKey();
},
orderByName() { orderByName() {
const metadatumName = this.$orderByHelper.getOrderByMetadatumName({ const metadatumName = this.$orderByHelper.getOrderByMetadatumName({
orderby: this.$route.query.orderby, orderby: this.$route.query.orderby,
@ -1128,8 +1116,8 @@
let existingViewModeIndex = Object.keys(this.registeredViewModes).findIndex(viewMode => viewMode == this.$userPrefs.get(prefsViewMode)); let existingViewModeIndex = Object.keys(this.registeredViewModes).findIndex(viewMode => viewMode == this.$userPrefs.get(prefsViewMode));
if (existingViewModeIndex >= 0) { if (existingViewModeIndex >= 0) {
if (!this.registeredViewModes[Object.keys(this.registeredViewModes)[existingViewModeIndex]].show_pagination) { if (!this.registeredViewModes[Object.keys(this.registeredViewModes)[existingViewModeIndex]].show_pagination) {
this.latestPerPageAfterViewModeWithoutPagination = this.getItemsPerPage(); this.latestPerPageAfterViewModeWithoutPagination = this.itemsPerPage;
this.latestPageAfterViewModeWithoutPagination = this.getPage(); this.latestPageAfterViewModeWithoutPagination = this.page;
this.$eventBusSearch.setItemsPerPage(24, true); this.$eventBusSearch.setItemsPerPage(24, true);
} }
@ -1191,28 +1179,9 @@
}, },
methods: { methods: {
...mapGetters('collection', [
'getCollection',
'getItems',
'getItemsListTemplate'
]),
...mapActions('metadata', [ ...mapActions('metadata', [
'fetchMetadata' 'fetchMetadata'
]), ]),
...mapGetters('metadata', [
'getMetadata'
]),
...mapGetters('search', [
'getSearchQuery',
'getOrderBy',
'getOrder',
'getViewMode',
'getTotalItems',
'getSentenceMode',
'getMetaKey',
'getPage',
'getItemsPerPage'
]),
parseHooks() { parseHooks() {
if (wp !== undefined && wp.hooks !== undefined) { if (wp !== undefined && wp.hooks !== undefined) {
@ -1324,8 +1293,8 @@
let existingViewModeIndex = Object.keys(this.registeredViewModes).findIndex(aViewMode => aViewMode == viewMode); let existingViewModeIndex = Object.keys(this.registeredViewModes).findIndex(aViewMode => aViewMode == viewMode);
if (existingViewModeIndex >= 0) { if (existingViewModeIndex >= 0) {
if (!this.registeredViewModes[Object.keys(this.registeredViewModes)[existingViewModeIndex]].show_pagination) { if (!this.registeredViewModes[Object.keys(this.registeredViewModes)[existingViewModeIndex]].show_pagination) {
this.latestPerPageAfterViewModeWithoutPagination = this.getItemsPerPage(); this.latestPerPageAfterViewModeWithoutPagination = this.itemsPerPage;
this.latestPageAfterViewModeWithoutPagination = this.getPage(); this.latestPageAfterViewModeWithoutPagination = this.page;
this.$eventBusSearch.setItemsPerPage(24, true); this.$eventBusSearch.setItemsPerPage(24, true);
} }

View File

@ -830,15 +830,13 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters('item', {
'itemSubmission': 'getItemSubmission',
'itemSubmissionMetadata': 'getItemSubmissionMetadata',
}),
showSteppedLayout() { showSteppedLayout() {
return this.isLayoutSteps; return this.isLayoutSteps;
}, },
itemSubmission() {
return this.getItemSubmission();
},
itemSubmissionMetadata() {
return this.getItemSubmissionMetadata();
},
itemMetadata() { itemMetadata() {
if ( !this.itemSubmissionMetadata || !this.itemSubmissionMetadata.length) if ( !this.itemSubmissionMetadata || !this.itemSubmissionMetadata.length)
@ -977,10 +975,6 @@ export default {
'finishItemSubmission', 'finishItemSubmission',
'clearItemSubmission' 'clearItemSubmission'
]), ]),
...mapGetters('item',[
'getItemSubmission',
'getItemSubmissionMetadata',
]),
...mapActions('metadata',[ ...mapActions('metadata',[
'fetchMetadata', 'fetchMetadata',
'fetchMetadataSections' 'fetchMetadataSections'

View File

@ -320,12 +320,10 @@
} }
}, },
computed: { computed: {
originalRole() { ...mapGetters('capability', {
return this.getRole() 'originalRole': 'getRole',
}, 'capabilities': 'getCapabilities'
capabilities() { }),
return this.getCapabilities();
},
collectionCapabilities() { collectionCapabilities() {
let collectionCapabilities = {} let collectionCapabilities = {}
@ -424,13 +422,6 @@
'fetchRole', 'fetchRole',
'fetchCapabilities' 'fetchCapabilities'
]), ]),
...mapGetters('collection', [
'getCollections'
]),
...mapGetters('capability', [
'getRole',
'getCapabilities'
]),
onUpdateCapability(value, capabilityKey) { onUpdateCapability(value, capabilityKey) {
this.showNotice = false; this.showNotice = false;
const capabilities = this.form.capabilities && Object.keys(this.form.capabilities).length ? this.form.capabilities : {}; const capabilities = this.form.capabilities && Object.keys(this.form.capabilities).length ? this.form.capabilities : {};