Replaces beforeDestroy with beforeUnmount

This commit is contained in:
mateuswetah 2023-07-14 10:18:57 -03:00
parent 5cb9398926
commit d9b2b51714
36 changed files with 37 additions and 37 deletions

View File

@ -254,7 +254,7 @@ export default {
this.updateExtraFormData(this.form);
});
},
beforeDestroy() {
beforeUnmount() {
if (this.closedByForm) {
this.$emit('onUpdateSavedState', true);
} else {

View File

@ -437,7 +437,7 @@ export default {
this.collection = collection;
});
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.metadataSearchCancel != undefined)
this.metadataSearchCancel.cancel('Metadata search Canceled.');

View File

@ -1089,7 +1089,7 @@ export default {
if (this.$adminOptions.mobileAppMode)
this.isMobileSubheaderOpen = true;
},
beforeDestroy () {
beforeUnmount () {
eventBusItemMetadata.$off('isUpdatingValue');
eventBusItemMetadata.$off('hasErrorsOnForm');
eventBusItemMetadata.$off('isOnFirstMetadatumOfCompoundNavigation');

View File

@ -205,7 +205,7 @@ export default {
this.$refs['item-edition-footer-dropdown'].toggle();
});
},
beforeDestroy() {
beforeUnmount() {
this.$parent.$off('toggleItemEditionFooterDropdown');
},
methods: {

View File

@ -101,7 +101,7 @@
created() {
this.$eventBusSearch.$on('has-to-reload-facets', this.reloadOptions);
},
beforeDestroy() {
beforeUnmount() {
this.$eventBusSearch.$off('has-to-reload-facets', this.reloadOptions);
},
methods: {

View File

@ -52,7 +52,7 @@
created() {
this.$eventBusSearch.$on('has-to-reload-facets', this.reloadOptions);
},
beforeDestroy() {
beforeUnmount() {
this.$eventBusSearch.$off('has-to-reload-facets', this.reloadOptions);
},
methods: {

View File

@ -131,7 +131,7 @@
if (!this.isUsingElasticSearch)
this.loadOptions();
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.getOptionsValuesCancel != undefined)

View File

@ -592,7 +592,7 @@ export default {
this.isLoadingMetadataSections = false;
});
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.metadataSearchCancel != undefined)
this.metadataSearchCancel.cancel('Metadata search Canceled.');

View File

@ -397,7 +397,7 @@
jQuery( document ).on( 'heartbeat-tick', this.onHeartBitTickList);
}
},
beforeDestroy() {
beforeUnmount() {
if (jQuery && jQuery( document )) {
jQuery( document ).off( 'heartbeat-tick', this.onHeartBitTickList)
}

View File

@ -337,7 +337,7 @@ export default {
this.loadMetadata();
this.$eventBusMetadataList.$on('addMetadatumViaButton', this.addMetadatumViaButton);
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.metadataSearchCancel != undefined)
this.metadataSearchCancel.cancel('Metadata search Canceled.');

View File

@ -320,7 +320,7 @@ export default {
this.$parent.$on('deleteSelectedTerms', this.deleteSelectedTerms);
this.$parent.$on('updateSelectedTermsParent', this.updateSelectedTermsParent);
},
beforeDestroy() {
beforeUnmount() {
this.$parent.$off('deleteSelectedTerms', this.deleteSelectedTerms);
this.$parent.$off('updateSelectedTermsParent', this.updateSelectedTermsParent);
},

View File

@ -185,7 +185,7 @@
eventBusItemMetadata.$on('focusPreviousChildMetadatum', this.focusPreviousChildMetadatum);
eventBusItemMetadata.$on('focusNextChildMetadatum', this.focusNextChildMetadatum);
},
beforeDestroy() {
beforeUnmount() {
eventBusItemMetadata.$off('hasRemovedItemMetadataGroup', this.laterUpdateIsRemovingGroup);
eventBusItemMetadata.$off('focusPreviousChildMetadatum', this.focusPreviousChildMetadatum);
eventBusItemMetadata.$off('focusNextChildMetadatum', this.focusNextChildMetadatum);

View File

@ -300,7 +300,7 @@
else
this.collectionId = this.$route.params.collectionId;
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.metadataSearchCancel != undefined)

View File

@ -206,7 +206,7 @@
this.handleWindowResize(mapComponentRef);
});
},
beforeDestroy() {
beforeUnmount() {
const mapComponentRef = 'map--' + this.itemMetadatumIdentifier;
eventBusItemMetadata.$off('itemEditionFormResize', () => this.handleWindowResize(mapComponentRef));
},

View File

@ -224,7 +224,7 @@
this.errorMessage = updatedErrorMessage;
});
},
beforeDestroy() {
beforeUnmount() {
if (this.itemMetadatum && this.itemMetadatum.metadatum) {
eventBusItemMetadata.$off('updateErrorMessageOf#' + (this.itemMetadatum.parent_meta_id ? this.itemMetadatum.metadatum.id + '-' + this.itemMetadatum.parent_meta_id : this.itemMetadatum.metadatum.id));
}

View File

@ -396,7 +396,7 @@
if (this.$refs.bulkEditionModal)
this.$refs.bulkEditionModal.focus();
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.metadataSearchCancel != undefined)
this.metadataSearchCancel.cancel('Metadata search Canceled.');

View File

@ -134,7 +134,7 @@
this.showProcesses = true;
});
},
beforeDestroy() {
beforeUnmount() {
this.$root.$off('openProcessesPopup');
},
methods: {

View File

@ -98,7 +98,7 @@ export default {
this.$root.$on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate);
},
beforeDestroy() {
beforeUnmount() {
this.$root.$on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate);
},
methods: {

View File

@ -413,7 +413,7 @@
if (this.isModal && this.$refs.CheckboxRadioFilterInput)
this.$refs.CheckboxRadioFilterInput.focus();
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.getOptionsValuesCancel != undefined)
this.getOptionsValuesCancel.cancel('Get options request canceled.');

View File

@ -411,7 +411,7 @@
}
});
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.getOptionsValuesCancel != undefined)
this.getOptionsValuesCancel.cancel('Get options request canceled.');

View File

@ -201,7 +201,7 @@ export default {
jQuery( document ).on( 'heartbeat-tick', this.onHeartBitTickPopup);
}
},
beforeDestroy() {
beforeUnmount() {
if (jQuery && jQuery( document )) {
jQuery( document ).off( 'heartbeat-tick', this.onHeartBitTickPopup)
}

View File

@ -356,7 +356,7 @@
})
.catch(() => this.isLoadingMetadata = false);
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.metadataSearchCancel != undefined)
this.metadataSearchCancel.cancel('Metadata search Canceled.');

View File

@ -391,7 +391,7 @@
if (this.isUsingElasticSearch)
this.$eventBusSearch.$on('isLoadingItems', this.updateIsLoadingItems);
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous collection name Request
if (this.collectionNameSearchCancel != undefined)
this.collectionNameSearchCancel.cancel('Collection name search Canceled.');

View File

@ -79,7 +79,7 @@
<script>
import { nextTick } from 'vue';
import { mapGetters } from 'vuex';
import 'swiper/css';
import 'swiper/css/mousewheel';
import 'swiper/css/navigation';
@ -158,7 +158,7 @@
});
});
},
beforeDestroy() {
beforeUnmount() {
if (typeof this.swiper.destroy == 'function')
this.swiper.destroy();
},

View File

@ -371,7 +371,7 @@ export const dynamicFilterTypeMixin = {
}
},
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous Request
if (this.getOptionsValuesCancel != undefined)
this.getOptionsValuesCancel.cancel('Facet search Canceled.');

View File

@ -579,7 +579,7 @@ export default {
}
},
beforeDestroy() {
beforeUnmount() {
// Cancels previous filters Request
if (this.filtersSearchCancel != undefined)
this.filtersSearchCancel.cancel('Metadata search Canceled.');

View File

@ -908,7 +908,7 @@
this.hideFiltersOnMobile();
window.addEventListener('resize', this.hideFiltersOnMobile);
},
beforeDestroy() {
beforeUnmount() {
this.removeEventListeners();
// Cancels previous Metadata Request

View File

@ -207,7 +207,7 @@ export default {
this.fetchCollections();
},
beforeDestroy() {
beforeUnmount() {
if (typeof this.swiper.destroy == 'function')
this.swiper.destroy();
},

View File

@ -219,7 +219,7 @@ export default {
this.fetchItems();
},
beforeDestroy() {
beforeUnmount() {
if (typeof this.swiper.destroy == 'function')
this.swiper.destroy();
},

View File

@ -209,7 +209,7 @@ export default {
this.fetchTerms();
},
beforeDestroy() {
beforeUnmount() {
if (typeof this.swiper.destroy == 'function')
this.swiper.destroy();
},

View File

@ -128,7 +128,7 @@ export default {
created() {
this.shouldUseLegacyMasonyCols = wp !== undefined && wp.hooks !== undefined && wp.hooks.hasFilter('tainacan_use_legacy_masonry_view_mode_cols') && wp.hooks.applyFilters('tainacan_use_legacy_masonry_view_mode_cols', false);
},
beforeDestroy() {
beforeUnmount() {
if (this.masonry !== false)
this.masonry.destroy();
},

View File

@ -179,7 +179,7 @@ export default {
immediate: true
}
},
beforeDestroy() {
beforeUnmount() {
if (this.masonry !== false)
this.masonry.destroy();
},

View File

@ -522,7 +522,7 @@ export default {
document.documentElement.scrollTo(0,0);
document.documentElement.classList.add('is-clipped');
},
beforeDestroy() {
beforeUnmount() {
// Remove clipped class from root html
document.documentElement.classList.remove('is-clipped');

View File

@ -1010,7 +1010,7 @@
this.itemsListBottomIntersectionObserver.observe(this.$refs['items-list-results-bottom']);
}
},
beforeDestroy() {
beforeUnmount() {
this.removeEventListeners();
// Removes intersection listener, if it was set up

View File

@ -244,7 +244,7 @@ export default {
mounted() {
this.$el.addEventListener('tainacan-blocks-facets-list-update', this.receiveSearchString);
},
beforeDestroy() {
beforeUnmount() {
this.$el.removeEventListener('tainacan-blocks-facets-list-update', this.receiveSearchString);
},
methods: {

View File

@ -967,7 +967,7 @@ export default {
else if (this.hideFileModalButton && this.hideTextModalButton && !this.hideLinkModalButton)
this.form.document_type = 'url';
},
beforeDestroy () {
beforeUnmount () {
eventBusItemMetadata.$off('hasErrorsOnForm');
},
methods: {