mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(editor): Turn showMessage mixin to composable (#6081)
* refactor(editor): move $getExecutionError from showMessages mixin to pushConnection (it is used there only) * refactor(editor): resolve showMessage mixin methods * fix(editor): use composable instead of mixin * fix(editor): resolve conflicts * fix(editor): replace clearAllStickyNotifications * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): remove last confirmMessage usage * fix(editor): remove $prompt usage * fix(editor): remove $show methods * fix(editor): lint fix * fix(editor): lint fix * fix(editor): fixes after review
This commit is contained in:
@@ -35,18 +35,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mixins from 'vue-typed-mixins';
|
||||
import Modal from './Modal.vue';
|
||||
import {
|
||||
COMMUNITY_PACKAGE_CONFIRM_MODAL_KEY,
|
||||
COMMUNITY_PACKAGE_MANAGE_ACTIONS,
|
||||
} from '../constants';
|
||||
import { showMessage } from '@/mixins/showMessage';
|
||||
import { defineComponent } from 'vue';
|
||||
import Modal from '@/components/Modal.vue';
|
||||
import { COMMUNITY_PACKAGE_CONFIRM_MODAL_KEY, COMMUNITY_PACKAGE_MANAGE_ACTIONS } from '@/constants';
|
||||
import { useToast } from '@/composables';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useCommunityNodesStore } from '@/stores/communityNodes.store';
|
||||
import { createEventBus } from '@/event-bus';
|
||||
|
||||
export default mixins(showMessage).extend({
|
||||
export default defineComponent({
|
||||
name: 'CommunityPackageManageConfirmModal',
|
||||
components: {
|
||||
Modal,
|
||||
@@ -64,6 +61,11 @@ export default mixins(showMessage).extend({
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
...useToast(),
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@@ -140,12 +142,12 @@ export default mixins(showMessage).extend({
|
||||
});
|
||||
this.loading = true;
|
||||
await this.communityNodesStore.uninstallPackage(this.activePackageName);
|
||||
this.$showMessage({
|
||||
this.showMessage({
|
||||
title: this.$locale.baseText('settings.communityNodes.messages.uninstall.success.title'),
|
||||
type: 'success',
|
||||
});
|
||||
} catch (error) {
|
||||
this.$showError(
|
||||
this.showError(
|
||||
error,
|
||||
this.$locale.baseText('settings.communityNodes.messages.uninstall.error'),
|
||||
);
|
||||
@@ -167,7 +169,7 @@ export default mixins(showMessage).extend({
|
||||
this.loading = true;
|
||||
const updatedVersion = this.activePackage.updateAvailable;
|
||||
await this.communityNodesStore.updatePackage(this.activePackageName);
|
||||
this.$showMessage({
|
||||
this.showMessage({
|
||||
title: this.$locale.baseText('settings.communityNodes.messages.update.success.title'),
|
||||
message: this.$locale.baseText(
|
||||
'settings.communityNodes.messages.update.success.message',
|
||||
@@ -181,7 +183,7 @@ export default mixins(showMessage).extend({
|
||||
type: 'success',
|
||||
});
|
||||
} catch (error) {
|
||||
this.$showError(
|
||||
this.showError(
|
||||
error,
|
||||
this.$locale.baseText('settings.communityNodes.messages.update.error.title'),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user