refactor(editor): Turn titleChange mixin to composable (#6059)

This commit is contained in:
Csaba Tuncsik
2023-04-21 15:48:07 +02:00
committed by GitHub
parent 649389edad
commit 19f540ecf9
7 changed files with 54 additions and 59 deletions

View File

@@ -209,7 +209,7 @@ import { restApi } from '@/mixins/restApi';
import useGlobalLinkActions from '@/composables/useGlobalLinkActions';
import useCanvasMouseSelect from '@/composables/useCanvasMouseSelect';
import { showMessage } from '@/mixins/showMessage';
import { titleChange } from '@/mixins/titleChange';
import { useTitleChange } from '@/composables/useTitleChange';
import { workflowHelpers } from '@/mixins/workflowHelpers';
import { workflowRun } from '@/mixins/workflowRun';
@@ -226,6 +226,7 @@ import {
IConnection,
IConnections,
IDataObject,
IExecutionsSummary,
INode,
INodeConnections,
INodeCredentialsDetails,
@@ -254,7 +255,6 @@ import type {
ITag,
INewWorkflowData,
IWorkflowTemplate,
IExecutionsSummary,
IWorkflowToShare,
IUser,
INodeUpdatePropertiesInformation,
@@ -307,7 +307,6 @@ import {
N8nPlusEndpointType,
EVENT_PLUS_ENDPOINT_CLICK,
} from '@/plugins/endpoints/N8nPlusEndpointType';
import { usePostHog } from '@/stores/posthog';
interface AddNodeOptions {
position?: XYPosition;
@@ -325,7 +324,6 @@ export default mixins(
moveNodeWorkflow,
restApi,
showMessage,
titleChange,
workflowHelpers,
workflowRun,
debounceHelper,
@@ -345,6 +343,7 @@ export default mixins(
return {
...useCanvasMouseSelect(),
...useGlobalLinkActions(),
...useTitleChange(),
};
},
errorCaptured: (err, vm, info) => {
@@ -1423,7 +1422,7 @@ export default mixins(
this.workflowsStore.executingNode = null;
this.uiStore.removeActiveAction('workflowRunning');
this.$titleSet(this.workflowsStore.workflowName, 'IDLE');
this.titleSet(this.workflowsStore.workflowName, 'IDLE');
this.$showMessage({
title: this.$locale.baseText('nodeView.showMessage.stopExecutionCatch.unsaved.title'),
message: this.$locale.baseText(
@@ -1447,7 +1446,7 @@ export default mixins(
retryOf: execution.retryOf,
} as IPushDataExecutionFinished;
this.workflowsStore.finishActiveExecution(pushData);
this.$titleSet(execution.workflowData.name, 'IDLE');
this.titleSet(execution.workflowData.name, 'IDLE');
this.workflowsStore.executingNode = null;
this.workflowsStore.setWorkflowExecutionData(executedData as IExecutionResponse);
this.uiStore.removeActiveAction('workflowRunning');
@@ -2597,7 +2596,7 @@ export default mixins(
}
if (workflow) {
this.$titleSet(workflow.name, 'IDLE');
this.titleSet(workflow.name, 'IDLE');
// Open existing workflow
await this.openWorkflow(workflow);
}
@@ -3848,7 +3847,7 @@ export default mixins(
async mounted() {
this.resetWorkspace();
this.canvasStore.initInstance(this.$refs.nodeView as HTMLElement);
this.$titleReset();
this.titleReset();
window.addEventListener('message', this.onPostMessageReceived);
this.startLoading();