mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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:
@@ -18,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { WEBHOOK_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE } from '@/constants';
|
||||
import { WEBHOOK_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE, MODAL_CONFIRM } from '@/constants';
|
||||
import type { INodeUi } from '@/Interface';
|
||||
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||
import mixins from 'vue-typed-mixins';
|
||||
@@ -29,6 +29,7 @@ import { mapStores } from 'pinia';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useToast, useMessage } from '@/composables';
|
||||
|
||||
export default mixins(workflowRun, pinData).extend({
|
||||
props: {
|
||||
@@ -56,6 +57,12 @@ export default mixins(workflowRun, pinData).extend({
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
...useToast(),
|
||||
...useMessage(),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useNodeTypesStore, useNDVStore, useWorkflowsStore),
|
||||
node(): INodeUi | null {
|
||||
@@ -173,7 +180,7 @@ export default mixins(workflowRun, pinData).extend({
|
||||
try {
|
||||
await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId);
|
||||
} catch (error) {
|
||||
this.$showError(error, this.$locale.baseText('ndv.execute.stopWaitingForWebhook.error'));
|
||||
this.showError(error, this.$locale.baseText('ndv.execute.stopWaitingForWebhook.error'));
|
||||
return;
|
||||
}
|
||||
},
|
||||
@@ -186,13 +193,15 @@ export default mixins(workflowRun, pinData).extend({
|
||||
} else {
|
||||
let shouldUnpinAndExecute = false;
|
||||
if (this.hasPinData) {
|
||||
shouldUnpinAndExecute = await this.confirmMessage(
|
||||
const confirmResult = await this.confirm(
|
||||
this.$locale.baseText('ndv.pinData.unpinAndExecute.description'),
|
||||
this.$locale.baseText('ndv.pinData.unpinAndExecute.title'),
|
||||
null,
|
||||
this.$locale.baseText('ndv.pinData.unpinAndExecute.confirm'),
|
||||
this.$locale.baseText('ndv.pinData.unpinAndExecute.cancel'),
|
||||
{
|
||||
confirmButtonText: this.$locale.baseText('ndv.pinData.unpinAndExecute.confirm'),
|
||||
cancelButtonText: this.$locale.baseText('ndv.pinData.unpinAndExecute.cancel'),
|
||||
},
|
||||
);
|
||||
shouldUnpinAndExecute = confirmResult === MODAL_CONFIRM;
|
||||
|
||||
if (shouldUnpinAndExecute) {
|
||||
dataPinningEventBus.emit('data-unpinning', { source: 'unpin-and-execute-modal' });
|
||||
|
||||
Reference in New Issue
Block a user