From 95cf245daafc521fc25e0f3bb20b5e2e9ed1b94a Mon Sep 17 00:00:00 2001 From: Katrin Yordanova Date: Wed, 9 Aug 2023 17:58:46 +0300 Subject: [PATCH] Fix compose memory leak --- .../components/Admin/Module/DalSettings.vue | 15 +++++++++++ .../Admin/Module/DiscoverySettings.vue | 13 +++++++++ .../Admin/Module/FederationSettings.vue | 18 ++++++++++++- .../Admin/Module/Records/ColumnPicker.vue | 8 ++++++ .../Admin/Page/Builder/Selector.vue | 10 +++++++ .../components/Chart/Report/GenericChart.vue | 13 +++++++++ .../components/Chart/Report/ReportEdit.vue | 12 +++++++++ .../compose/src/components/Common/Grid.vue | 12 ++++++++- .../components/Common/RecordListFilter.vue | 11 ++++++++ .../ModuleFields/Configurator/Number.vue | 11 ++++++++ .../ModuleFields/Configurator/Record.vue | 1 - .../ModuleFields/Configurator/Select.vue | 9 +++++++ .../ModuleFields/Configurator/User.vue | 9 +++++++ .../ModuleFields/Editor/Geometry.vue | 11 ++++++++ .../components/ModuleFields/Editor/Record.vue | 13 +++++++++ .../components/ModuleFields/Editor/User.vue | 10 +++++++ .../ModuleFields/Viewer/Geometry.vue | 10 +++++++ .../components/ModuleFields/Viewer/Record.vue | 11 ++++++++ .../components/PageBlocks/AutomationBase.vue | 11 ++++++++ .../components/PageBlocks/CalendarBase.vue | 14 ++++++++++ .../src/components/PageBlocks/ChartBase.vue | 17 +++++++++++- .../src/components/PageBlocks/CommentBase.vue | 11 ++++++++ .../PageBlocks/CommentConfigurator.vue | 7 +++++ .../components/PageBlocks/GeometryBase.vue | 13 +++++++++ .../GeometryConfigurator/Configurator.vue | 11 ++++++++ .../src/components/PageBlocks/Metric/Item.vue | 8 ++++++ .../src/components/PageBlocks/MetricBase.vue | 15 +++++++++-- .../PageBlocks/MetricConfigurator/index.vue | 10 +++++++ .../PageBlocks/Navigation/Configurator.vue | 12 +++++++++ .../Navigation/NavTypes/ComposePage.vue | 10 +++++++ .../Navigation/NavTypes/Dropdown.vue | 11 ++++++++ .../PageBlocks/Navigation/NavTypes/Url.vue | 11 ++++++++ .../components/PageBlocks/Nylas/NylasBase.vue | 12 +++++++++ .../PageBlocks/Nylas/NylasConfigurator.vue | 9 +++++++ .../components/PageBlocks/ProgressBase.vue | 14 +++++++++- .../PageBlocks/ProgressConfigurator.vue | 10 +++++++ .../src/components/PageBlocks/RecordBase.vue | 10 +++++++ .../components/PageBlocks/RecordListBase.vue | 27 +++++++++++++++++++ .../PageBlocks/RecordListConfigurator.vue | 9 +++++++ .../PageBlocks/RecordOrganizerBase.vue | 13 ++++++++- .../RecordOrganizerConfigurator.vue | 10 +++++++ .../PageBlocks/RecordRevisionsBase.vue | 12 +++++++++ .../RecordRevisionsConfigurator.vue | 10 +++++++ .../src/components/PageBlocks/Report/Base.vue | 10 +++++++ .../PageBlocks/Report/Configurator.vue | 8 ++++++ .../PageBlocks/TabsConfigurator.vue | 12 ++++++++- .../Public/Page/Attachment/ListLoader.vue | 9 +++++++ .../Public/Page/Attachment/Modal.vue | 13 +++++++-- .../components/Public/Page/Block/Modal.vue | 15 ++++++++++- .../Public/Record/BulkEdit/index.vue | 10 +++++++ .../src/components/Public/Record/Modal.vue | 14 +++++++++- client/web/compose/src/store/record.js | 2 ++ .../compose/src/views/Admin/Modules/Edit.vue | 17 ++++++++++++ .../src/views/Admin/Modules/Records/List.vue | 9 +++++++ .../src/views/Admin/Modules/Records/View.vue | 10 +++++++ .../compose/src/views/Admin/Pages/Builder.vue | 25 ++++++++++++++--- .../compose/src/views/Admin/Pages/Edit.vue | 19 +++++++++++++ .../compose/src/views/Admin/Pages/List.vue | 10 +++++++ client/web/compose/src/views/Layout.vue | 18 ++++++++++--- .../web/compose/src/views/Namespace/Edit.vue | 16 +++++++++++ .../web/compose/src/views/Namespace/Index.vue | 13 +++++++++ .../web/compose/src/views/Namespace/View.vue | 10 +++++++ client/web/compose/src/views/Public/Index.vue | 10 +++++++ .../src/views/Public/Pages/Records/View.vue | 17 +++++++++++- .../compose/src/views/Public/Pages/View.vue | 14 +++++++++- lib/vue/src/components/Tour/Tour.vue | 8 ++++++ lib/vue/src/components/Tour/TourStart.vue | 4 ++- .../common/types/IMG/LightboxIMG.vue | 10 +++++++ .../filePreview/common/types/PDF/PDF.vue | 11 ++++++++ .../src/components/input/CInputPresort.vue | 11 ++++++++ .../src/components/itemPicker/CItemPicker.vue | 10 +++++++ .../permissions/CPermissionsModal.vue | 25 +++++++++++++++-- .../src/components/prompts/CPromptToast.vue | 23 ++++++++++------ .../kinds/CPromptComposeRecordPicker.vue | 14 ++++++++++ lib/vue/src/components/prompts/kinds/base.vue | 2 +- .../components/resourceList/CResourceList.vue | 9 +++++++ 76 files changed, 869 insertions(+), 33 deletions(-) diff --git a/client/web/compose/src/components/Admin/Module/DalSettings.vue b/client/web/compose/src/components/Admin/Module/DalSettings.vue index 68aba9aa2c..8b73070ff5 100644 --- a/client/web/compose/src/components/Admin/Module/DalSettings.vue +++ b/client/web/compose/src/components/Admin/Module/DalSettings.vue @@ -195,6 +195,10 @@ export default { this.fetchConnections() }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { async fetchConnections () { this.processing = true @@ -263,6 +267,17 @@ export default { getOptionKey ({ connectionID }) { return connectionID }, + + setDefaultValues () { + this.processing = false + this.connections = [] + this.moduleFields = [] + this.moduleFieldEncoding = [] + this.selectedGroup = '' + this.systemFields = [] + this.systemFieldEncoding = [] + this.optionsGroups = [] + }, }, } diff --git a/client/web/compose/src/components/Admin/Module/DiscoverySettings.vue b/client/web/compose/src/components/Admin/Module/DiscoverySettings.vue index 2043b4c6ca..7d1df547e9 100644 --- a/client/web/compose/src/components/Admin/Module/DiscoverySettings.vue +++ b/client/web/compose/src/components/Admin/Module/DiscoverySettings.vue @@ -153,6 +153,7 @@ export default { const fields = [...existingFields].map(name => this.module.fields.find(field => field.name === name)) this[value].result.push({ lang, fields }) + existingFields.clear() }) }) } @@ -160,6 +161,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { onSave () { const discovery = { @@ -182,6 +187,14 @@ export default { discovery, }) }, + + setDefaultValues () { + this.public = {} + this.private = {} + this.protected = {} + this.currentTabIndex = 0 + this.currentLang = undefined + }, }, } diff --git a/client/web/compose/src/components/Admin/Module/FederationSettings.vue b/client/web/compose/src/components/Admin/Module/FederationSettings.vue index db7e3f397b..55a07dd84b 100644 --- a/client/web/compose/src/components/Admin/Module/FederationSettings.vue +++ b/client/web/compose/src/components/Admin/Module/FederationSettings.vue @@ -295,7 +295,6 @@ export default { }, computed: { - // // shared modules // @@ -382,6 +381,10 @@ export default { this.preload() }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { async preload () { await this.$FederationAPI.nodeSearch({ status: 'paired' }) @@ -732,6 +735,19 @@ export default { this.moduleMappings[nodeID] = mm }, + + setDefaultValues () { + this.showModal = false + this.servers = [] + this.moduleFields = [] + this.sharedModule = null + this.sharedModules = {} + this.sharedModulesMapped = {} + this.exposedModules = {} + this.moduleMappings = {} + this.downstream = {} + this.upstream = {} + }, }, } diff --git a/client/web/compose/src/components/Admin/Module/Records/ColumnPicker.vue b/client/web/compose/src/components/Admin/Module/Records/ColumnPicker.vue index dd9cc400de..ce623ef883 100644 --- a/client/web/compose/src/components/Admin/Module/Records/ColumnPicker.vue +++ b/client/web/compose/src/components/Admin/Module/Records/ColumnPicker.vue @@ -68,10 +68,18 @@ export default { }) }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { onSave () { this.$emit('updateFields', this.filteredFields) }, + + setDefaultValues () { + this.filteredFields = [] + }, }, } diff --git a/client/web/compose/src/components/Admin/Page/Builder/Selector.vue b/client/web/compose/src/components/Admin/Page/Builder/Selector.vue index d4dfb916d2..b3695363d3 100644 --- a/client/web/compose/src/components/Admin/Page/Builder/Selector.vue +++ b/client/web/compose/src/components/Admin/Page/Builder/Selector.vue @@ -222,6 +222,10 @@ export default { } }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { isOptionDisabled (type) { return (!this.recordPage && type.recordPageOnly) || this.disabledKinds.includes(type.block.kind) @@ -230,6 +234,12 @@ export default { getBlockLabel ({ title, kind }) { return title || kind }, + + setDefaultValues () { + this.current = undefined + this.selectedExistingBlock = undefined + this.types = [] + }, }, } diff --git a/client/web/compose/src/components/Chart/Report/GenericChart.vue b/client/web/compose/src/components/Chart/Report/GenericChart.vue index 2c725f2a58..6baab0d72b 100644 --- a/client/web/compose/src/components/Chart/Report/GenericChart.vue +++ b/client/web/compose/src/components/Chart/Report/GenericChart.vue @@ -519,6 +519,10 @@ export default { } }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { hasRelativeDisplay: compose.chartUtil.hasRelativeDisplay, @@ -536,6 +540,15 @@ export default { chartTypeChanged (metric) { metric.relativeValue = false }, + + setDefaultValues () { + this.chartTypes = [] + this.legendPositions = [] + this.axisLabelPositions = [] + this.tensionSteps = [] + this.lineStyleOptions = [] + this.scatterSymbolOptions = [] + }, }, } diff --git a/client/web/compose/src/components/Chart/Report/ReportEdit.vue b/client/web/compose/src/components/Chart/Report/ReportEdit.vue index 64b811eb07..4f06f9c9b5 100644 --- a/client/web/compose/src/components/Chart/Report/ReportEdit.vue +++ b/client/web/compose/src/components/Chart/Report/ReportEdit.vue @@ -639,6 +639,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { hasRelativeDisplay: compose.chartUtil.hasRelativeDisplay, @@ -675,6 +679,14 @@ export default { isTemporalField (name) { return this.dimensionFields.some(f => f.value === name && f.kind === 'DateTime') }, + + setDefaultValues () { + this.metricAggregates = [] + this.dimensionModifiers = [] + this.predefinedFilters = [] + this.alignments = [] + this.orientations = [] + }, }, } diff --git a/client/web/compose/src/components/Common/Grid.vue b/client/web/compose/src/components/Common/Grid.vue index a0fff57598..f2920c8343 100644 --- a/client/web/compose/src/components/Common/Grid.vue +++ b/client/web/compose/src/components/Common/Grid.vue @@ -146,7 +146,8 @@ export default { }, beforeDestroy () { - window.removeEventListener('resize', this.windowResizeThrottledHandler) + this.setDefaultValues() + this.destroyEvents() }, methods: { @@ -167,6 +168,15 @@ export default { ({ x, y, w, h, i }) => new compose.PageBlockMaker({ ...this.blocks[i], xywh: [x, y, w, h] }), )) }, + + setDefaultValues () { + this.layout = [] + this.boundingRects = [] + }, + + destroyEvents () { + window.removeEventListener('resize', this.windowResizeThrottledHandler) + }, }, } diff --git a/client/web/compose/src/components/Common/RecordListFilter.vue b/client/web/compose/src/components/Common/RecordListFilter.vue index 0f4376e1a2..b15a56f2bd 100644 --- a/client/web/compose/src/components/Common/RecordListFilter.vue +++ b/client/web/compose/src/components/Common/RecordListFilter.vue @@ -353,6 +353,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + created () { // Change all module fields to single value to keep multi value fields and single value const module = JSON.parse(JSON.stringify(this.module || {})) @@ -658,6 +662,13 @@ export default { getOptionKey ({ name }) { return name }, + + setDefaultValues () { + this.componentFilter = [] + this.conditions = [] + this.mock = {} + this.preventPopoverClose = false + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Configurator/Number.vue b/client/web/compose/src/components/ModuleFields/Configurator/Number.vue index 88b17a388f..9d58dcbd9f 100644 --- a/client/web/compose/src/components/ModuleFields/Configurator/Number.vue +++ b/client/web/compose/src/components/ModuleFields/Configurator/Number.vue @@ -399,6 +399,10 @@ export default { this.liveExample = this.field.options.display === 'number' ? 123.45679 : 33.45679 }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { addThreshold () { this.field.options.thresholds.push({ value: 0, variant: 'success' }) @@ -409,6 +413,13 @@ export default { this.field.options.thresholds.splice(index, 1) } }, + + setDefaultValues () { + this.liveExample = undefined + this.displayOptions = [] + this.variants = [] + this.mock = {} + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Configurator/Record.vue b/client/web/compose/src/components/ModuleFields/Configurator/Record.vue index 68928fdafb..5d965e85ba 100644 --- a/client/web/compose/src/components/ModuleFields/Configurator/Record.vue +++ b/client/web/compose/src/components/ModuleFields/Configurator/Record.vue @@ -109,7 +109,6 @@ export default { data () { return { - selected: null, selectOptions: [ { text: this.$t('kind.select.optionType.default'), value: 'default', allowDuplicates: true }, { text: this.$t('kind.select.optionType.multiple'), value: 'multiple' }, diff --git a/client/web/compose/src/components/ModuleFields/Configurator/Select.vue b/client/web/compose/src/components/ModuleFields/Configurator/Select.vue index 964eb62638..aea0cb5943 100644 --- a/client/web/compose/src/components/ModuleFields/Configurator/Select.vue +++ b/client/web/compose/src/components/ModuleFields/Configurator/Select.vue @@ -219,6 +219,10 @@ export default { } }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { handleAddOption () { this.f.options.options.push({ @@ -234,6 +238,11 @@ export default { this.f.options.isUniqueMultiValue = true } }, + + setDefaultValues () { + this.newOption = {} + this.options = [] + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Configurator/User.vue b/client/web/compose/src/components/ModuleFields/Configurator/User.vue index e49f5e6f71..e9e12423ec 100644 --- a/client/web/compose/src/components/ModuleFields/Configurator/User.vue +++ b/client/web/compose/src/components/ModuleFields/Configurator/User.vue @@ -93,6 +93,10 @@ export default { }) }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { getOptionKey ({ roleID }) { return roleID @@ -104,6 +108,11 @@ export default { this.f.options.isUniqueMultiValue = true } }, + + setDefaultValues () { + this.selectOptions = [] + this.roleOptions = [] + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue b/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue index 42290ebb02..70713ac575 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue @@ -298,6 +298,10 @@ export default { } }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { openMap (index) { this.localValueIndex = index @@ -421,6 +425,13 @@ export default { this.toastErrorHandler(this.$t('notification:field-geometry.geolocationErrors.locationSearchFailed'))() }) }, + + setDefaultValues () { + this.localValue = undefined + this.localValueIndex = undefined + this.map = {} + this.geoSearch = {} + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Editor/Record.vue b/client/web/compose/src/components/ModuleFields/Editor/Record.vue index 8107244a5e..99306beaf1 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/Record.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/Record.vue @@ -296,6 +296,10 @@ export default { } }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { ...mapActions({ findModuleByID: 'module/findByID', @@ -465,6 +469,7 @@ export default { } mappedIDs[r.recordID] = relatedRecordValue.join(relatedLabelField.options.multiDelimiter) + relatedRecordIDs.clear() } } else if (relatedField.kind === 'User') { this.processing = true @@ -515,6 +520,14 @@ export default { getOptionKey ({ value }) { return value }, + + setDefaultValues () { + this.processing = false + this.query = '' + this.records = [] + this.recordValues = {} + this.filter = {} + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Editor/User.vue b/client/web/compose/src/components/ModuleFields/Editor/User.vue index a93559824f..3189f8ac52 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/User.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/User.vue @@ -271,6 +271,10 @@ export default { this.fetchUsers() }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { ...mapActions({ resolveUsers: 'user/resolveUsers', @@ -362,6 +366,12 @@ export default { goToPage (next = true) { this.filter.pageCursor = next ? this.filter.nextPage : this.filter.prevPage }, + + setDefaultValues () { + this.processing = false + this.users = [] + this.filter = {} + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue b/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue index f1c69cb8b8..4029fd7285 100644 --- a/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue +++ b/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue @@ -138,6 +138,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { openMap (index) { this.localValueIndex = index @@ -191,6 +195,12 @@ export default { this.toastErrorHandler(this.$t('notification:field-geometry.geolocationErrors.locationSearchFailed'))() }) }, + + setDefaultValues () { + this.map = {} + this.localValueIndex = undefined + this.geoSearch = {} + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Viewer/Record.vue b/client/web/compose/src/components/ModuleFields/Viewer/Record.vue index 26505bbfa0..f8f6a3993e 100644 --- a/client/web/compose/src/components/ModuleFields/Viewer/Record.vue +++ b/client/web/compose/src/components/ModuleFields/Viewer/Record.vue @@ -82,6 +82,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { ...mapActions({ findModuleByID: 'module/findByID', @@ -141,6 +145,7 @@ export default { } mappedIDs[r.recordID] = relatedRecordValue.join(relatedLabelField.options.multiDelimiter) + relatedRecordIDs.clear() } } else if (relatedField.kind === 'User') { this.processing = true @@ -184,6 +189,12 @@ export default { window.open(this.$router.resolve(route).href, '_blank') } }, + + setDefaultValues () { + this.processing = false + this.recordValues = {} + this.relRecords = [] + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/AutomationBase.vue b/client/web/compose/src/components/PageBlocks/AutomationBase.vue index 7ccf1292df..dfa044fe08 100644 --- a/client/web/compose/src/components/PageBlocks/AutomationBase.vue +++ b/client/web/compose/src/components/PageBlocks/AutomationBase.vue @@ -63,5 +63,16 @@ export default { this.processing = false }) }, + + beforeDestroy () { + this.setDefaultValues() + }, + + methods: { + setDefaultValues () { + this.processing = false + this.automationScripts = [] + }, + }, } diff --git a/client/web/compose/src/components/PageBlocks/CalendarBase.vue b/client/web/compose/src/components/PageBlocks/CalendarBase.vue index 5c722ff680..9c9fc6c1ca 100644 --- a/client/web/compose/src/components/PageBlocks/CalendarBase.vue +++ b/client/web/compose/src/components/PageBlocks/CalendarBase.vue @@ -230,6 +230,10 @@ export default { this.refreshBlock(this.refresh) }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { ...mapActions({ findModuleByID: 'module/findByID', @@ -377,6 +381,16 @@ export default { return event }) }, + + setDefaultValues () { + this.processing = false + this.show = false + this.events = [] + this.locale = undefined + this.title = '' + this.loaded = {} + this.refreshing = false + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/ChartBase.vue b/client/web/compose/src/components/PageBlocks/ChartBase.vue index 29fee82ac2..8d1834feee 100644 --- a/client/web/compose/src/components/PageBlocks/ChartBase.vue +++ b/client/web/compose/src/components/PageBlocks/ChartBase.vue @@ -48,6 +48,11 @@ export default { this.$root.$on('drill-down-chart', this.drillDown) }, + beforeDestroy () { + this.setDefaultValues() + this.destroyEvents() + }, + methods: { ...mapActions({ findChartByID: 'chart/findByID', @@ -156,7 +161,17 @@ export default { this.$root.$emit('magnify-page-block', { block }) } }, - }, + setDefaultValues () { + this.chart = null + this.filter = undefined + this.drillDownFilter = undefined + }, + + destroyEvents () { + this.$root.$off('drill-down-chart') + this.$root.$off('magnify-page-block') + }, + }, } diff --git a/client/web/compose/src/components/PageBlocks/CommentBase.vue b/client/web/compose/src/components/PageBlocks/CommentBase.vue index 2e399eb108..9678b6d093 100644 --- a/client/web/compose/src/components/PageBlocks/CommentBase.vue +++ b/client/web/compose/src/components/PageBlocks/CommentBase.vue @@ -215,6 +215,10 @@ export default { this.refreshBlock(this.refresh) }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { getFormattedDate (date) { return fmt.fullDateTime(date) @@ -338,6 +342,13 @@ export default { .recordList(params) .then(({ set }) => set.map(r => Object.freeze(new compose.Record(module, r)))) }, + + setDefaultValues () { + this.processing = false + this.filter = false + this.records = [] + this.newRecord = {} + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/CommentConfigurator.vue b/client/web/compose/src/components/PageBlocks/CommentConfigurator.vue index 5fe5f602e1..449e13e3e0 100644 --- a/client/web/compose/src/components/PageBlocks/CommentConfigurator.vue +++ b/client/web/compose/src/components/PageBlocks/CommentConfigurator.vue @@ -161,6 +161,7 @@ export default { sortDirections: [{ label: this.$t('comment.sortDirection.asc'), value: 'asc' }, { label: this.$t('comment.sortDirection.desc'), value: 'desc' }], } }, + computed: { ...mapGetters({ modules: 'module/set', @@ -237,6 +238,12 @@ export default { this.options.sortDirection = 'desc' } }, + + beforeDestroy () { + this.referenceList = [] + this.sortDirections = [] + }, + methods: { selectedModuleFieldsByType (type) { return (this.selectedModuleFields || []).filter((f) => { diff --git a/client/web/compose/src/components/PageBlocks/GeometryBase.vue b/client/web/compose/src/components/PageBlocks/GeometryBase.vue index c0fc7d5ac8..9963aca53e 100644 --- a/client/web/compose/src/components/PageBlocks/GeometryBase.vue +++ b/client/web/compose/src/components/PageBlocks/GeometryBase.vue @@ -153,6 +153,10 @@ export default { this.bounds = this.options.bounds }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { ...mapActions({ findModuleByID: 'module/findByID', @@ -299,6 +303,15 @@ export default { this.$router.push(route) } }, + + setDefaultValues () { + this.map = undefined + this.processing = false + this.show = false + this.geometries = [] + this.colors = [] + this.markers = [] + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/GeometryConfigurator/Configurator.vue b/client/web/compose/src/components/PageBlocks/GeometryConfigurator/Configurator.vue index 287a56e211..bddc733c36 100644 --- a/client/web/compose/src/components/PageBlocks/GeometryConfigurator/Configurator.vue +++ b/client/web/compose/src/components/PageBlocks/GeometryConfigurator/Configurator.vue @@ -174,6 +174,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { updateCenter (coordinates) { let { lat = 0, lng = 0 } = coordinates || {} @@ -213,6 +217,13 @@ export default { const zoom = this.$refs.map.mapObject._zoom >= 13 ? this.$refs.map.mapObject._zoom : 13 this.$refs.map.mapObject.flyTo([latitude, longitude], zoom) }, + + setDefaultValues () { + this.map = {} + this.localValue = {} + this.center = [] + this.bounds = null + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/Metric/Item.vue b/client/web/compose/src/components/PageBlocks/Metric/Item.vue index 61ebb4e950..5902c1a338 100644 --- a/client/web/compose/src/components/PageBlocks/Metric/Item.vue +++ b/client/web/compose/src/components/PageBlocks/Metric/Item.vue @@ -85,6 +85,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { update () { this.$nextTick(() => { @@ -112,6 +116,10 @@ export default { return d }, + + setDefaultValues () { + this.vvb = [] + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/MetricBase.vue b/client/web/compose/src/components/PageBlocks/MetricBase.vue index f2b2f2ca42..c279c518ae 100644 --- a/client/web/compose/src/components/PageBlocks/MetricBase.vue +++ b/client/web/compose/src/components/PageBlocks/MetricBase.vue @@ -92,8 +92,8 @@ export default { }, beforeDestroy () { - this.$root.$off('metric.update', this.refresh) - this.$root.$off(`refetch-non-record-blocks:${this.page.pageID}`) + this.setDefaultValues() + this.destroyEvents() }, created () { @@ -204,6 +204,17 @@ export default { this.$root.$emit('magnify-page-block', { block }) } }, + + setDefaultValues () { + this.processing = false + this.reports = [] + }, + + destroyEvents () { + this.$root.$off('metric.update', this.refresh) + this.$root.$off(`refetch-non-record-blocks:${this.page.pageID}`) + this.$root.$off('drill-down-chart', this.drillDown) + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue b/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue index 3dd5efaa47..1d594e8211 100644 --- a/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue +++ b/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue @@ -430,6 +430,10 @@ export default { this.edit = this.metrics[0] }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { addMetric () { const m = { @@ -467,6 +471,12 @@ export default { getOptionAggregationOperationKey ({ operation }) { return operation }, + + setDefaultValues () { + this.edit = undefined + this.dimensionModifiers = [] + this.aggregationOperations = [] + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/Navigation/Configurator.vue b/client/web/compose/src/components/PageBlocks/Navigation/Configurator.vue index f4a1248d06..22e0867426 100644 --- a/client/web/compose/src/components/PageBlocks/Navigation/Configurator.vue +++ b/client/web/compose/src/components/PageBlocks/Navigation/Configurator.vue @@ -269,6 +269,10 @@ export default { } }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { addNavigationItem () { this.block.options.navigationItems.push( @@ -291,6 +295,14 @@ export default { }), ) }, + + setDefaultValues () { + this.appearanceOptions = [] + this.alignmentOptions = [] + this.justifyOptions = [] + this.backgroundColors = [] + this.navigationItemTypes = [] + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/ComposePage.vue b/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/ComposePage.vue index c9bf6ea148..d4108dc8ad 100644 --- a/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/ComposePage.vue +++ b/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/ComposePage.vue @@ -92,6 +92,10 @@ export default { } }, + beforeDestroy () { + this.setDefaultValues() + }, + created () { this.loadPages() }, @@ -121,6 +125,12 @@ export default { getOptionKey ({ pageID }) { return pageID }, + + setDefaultValues () { + this.pageList = [] + this.checkboxLabel = {} + this.targetOptions = [] + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Dropdown.vue b/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Dropdown.vue index 540f87ffaf..cdfaccee95 100644 --- a/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Dropdown.vue +++ b/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Dropdown.vue @@ -149,6 +149,17 @@ export default { ], } }, + + beforeDestroy () { + this.setDefaultValues() + }, + + methods: { + setDefaultValues () { + this.aligns = [] + this.targetOptions = [] + }, + }, } diff --git a/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Url.vue b/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Url.vue index 8975e96346..e98616683e 100644 --- a/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Url.vue +++ b/client/web/compose/src/components/PageBlocks/Navigation/NavTypes/Url.vue @@ -43,6 +43,17 @@ export default { ], } }, + + beforeDestroy () { + this.setDefaultValues() + }, + + methods: { + setDefaultValues () { + this.value = {} + this.openInType = [] + }, + }, } diff --git a/client/web/compose/src/components/PageBlocks/Nylas/NylasBase.vue b/client/web/compose/src/components/PageBlocks/Nylas/NylasBase.vue index db1608b3ff..bb36563787 100644 --- a/client/web/compose/src/components/PageBlocks/Nylas/NylasBase.vue +++ b/client/web/compose/src/components/PageBlocks/Nylas/NylasBase.vue @@ -126,6 +126,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { processPrefillValues () { if (this.module) { @@ -175,6 +179,14 @@ export default { } }) }, + + setDefaultValues () { + this.processing = false + this.isExternalConfigured = false + this.accessToken = undefined + this.tokenCheckInterval = undefined + this.prefillValues = {} + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/Nylas/NylasConfigurator.vue b/client/web/compose/src/components/PageBlocks/Nylas/NylasConfigurator.vue index e25c37e28a..d16b2f2f16 100644 --- a/client/web/compose/src/components/PageBlocks/Nylas/NylasConfigurator.vue +++ b/client/web/compose/src/components/PageBlocks/Nylas/NylasConfigurator.vue @@ -196,6 +196,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { getFieldLabel ({ name, label }) { return label || name @@ -204,6 +208,11 @@ export default { getOptionKey ({ fieldID }) { return fieldID }, + + setDefaultValues () { + this.nylasComponentKinds = [] + this.checkboxLabels = {} + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/ProgressBase.vue b/client/web/compose/src/components/PageBlocks/ProgressBase.vue index 91fc4ecc22..5c8e64669f 100644 --- a/client/web/compose/src/components/PageBlocks/ProgressBase.vue +++ b/client/web/compose/src/components/PageBlocks/ProgressBase.vue @@ -81,7 +81,8 @@ export default { }, beforeDestroy () { - this.$root.$off(`refetch-non-record-blocks:${this.page.pageID}`) + this.setDefaultValues() + this.destroyEvents() }, methods: { @@ -130,6 +131,17 @@ export default { this.processing = false }) }, + + setDefaultValues () { + this.processing = false + this.value = undefined + this.min = undefined + this.max = undefined + }, + + destroyEvents () { + this.$root.$off(`refetch-non-record-blocks:${this.page.pageID}`) + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/ProgressConfigurator.vue b/client/web/compose/src/components/PageBlocks/ProgressConfigurator.vue index 9d46f762cd..9ee673569e 100644 --- a/client/web/compose/src/components/PageBlocks/ProgressConfigurator.vue +++ b/client/web/compose/src/components/PageBlocks/ProgressConfigurator.vue @@ -654,6 +654,10 @@ export default { this.mock.record = new compose.Record(this.mock.module, { mockField: 15 }) }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { addThreshold () { this.options.display.thresholds.push({ value: 0, variant: 'success' }) @@ -682,6 +686,12 @@ export default { getOptionAggregationOperationKey ({ operation }) { return operation }, + + setDefaultValues () { + this.aggregationOperations = [] + this.variants = [] + this.mock = {} + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/RecordBase.vue b/client/web/compose/src/components/PageBlocks/RecordBase.vue index 125804142c..466bd278c4 100644 --- a/client/web/compose/src/components/PageBlocks/RecordBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordBase.vue @@ -212,6 +212,10 @@ export default { }, }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { ...mapActions({ findModuleByID: 'module/findByID', @@ -305,6 +309,12 @@ export default { return !expressions.value }, + + setDefaultValues () { + this.referenceRecord = undefined + this.referenceModule = undefined + this.inlineEdit = {} + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/RecordListBase.vue b/client/web/compose/src/components/PageBlocks/RecordListBase.vue index 1294525782..2fc29c80de 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListBase.vue @@ -1052,6 +1052,7 @@ export default { }, beforeDestroy () { + this.setDefaultValues() this.destroyEvents() }, @@ -1248,6 +1249,7 @@ export default { // If required fields are satisfied, then the validation passes resolve({ valid: !req.size }) + req.clear() }, handleDeleteInline (item, i) { @@ -1486,6 +1488,7 @@ export default { this.handleRestoreInline(item, index) } }) + sel.clear() } else { this.processing = true @@ -1514,6 +1517,7 @@ export default { this.handleDeleteInline(this.items[i], i) } } + sel.clear() } else { this.processing = true @@ -1835,6 +1839,29 @@ export default { return roles.some(roleID => this.authUserRoles.includes(roleID)) }, + + setDefaultValues () { + this.uniqueID = undefined + this.processing = false + this.prefilter = undefined + this.recordListFilter = [] + this.drillDownFilter = undefined + this.query = null + this.filter = {} + this.pagination = {} + this.selected = [] + this.inlineEdit = {} + this.sortBy = undefined + this.sortDirecton = undefined + this.ctr = 0 + this.items = [] + this.showingDeletedRecords = false + this.activeFilters = [] + this.customPresetFilters = [] + this.currentCustomPresetFilter = undefined + this.showCustomPresetFilterModal = false + this.selectedAllRecords = false + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue b/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue index d60f6ad4c6..1576bb648b 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue @@ -914,6 +914,10 @@ export default { this.fetchRoles() }, + beforeDestroy () { + this.setDefaultValues() + }, + methods: { getRoleLabel ({ name }) { return name @@ -940,6 +944,11 @@ export default { getOptionKey ({ roleID }) { return roleID }, + + setDefaultValues () { + this.checkboxLabel = {} + this.roleOptions = [] + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue b/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue index 315c255435..d8cd3ac4e5 100644 --- a/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue @@ -251,7 +251,8 @@ export default { }, beforeDestroy () { - this.$root.$off(`refetch-non-record-blocks:${this.page.pageID}`) + this.setDefaultValues() + this.destroyEvents() }, methods: { @@ -483,6 +484,16 @@ export default { refresh () { this.pullRecords() }, + + setDefaultValues () { + this.processing = false + this.filter = {} + this.records = [] + }, + + destroyEvents () { + this.$root.$off(`refetch-non-record-blocks:${this.page.pageID}`) + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/RecordOrganizerConfigurator.vue b/client/web/compose/src/components/PageBlocks/RecordOrganizerConfigurator.vue index 1f956d30aa..b5122d86f9 100644 --- a/client/web/compose/src/components/PageBlocks/RecordOrganizerConfigurator.vue +++ b/client/web/compose/src/components/PageBlocks/RecordOrganizerConfigurator.vue @@ -306,6 +306,16 @@ export default { }, }, }, + + beforeDestroy () { + this.setDefaultValues() + }, + + methods: { + setDefaultValues () { + this.mock = [] + }, + }, }