Add more frontend hooks (#1687)

*  add hook for nodecreatelist mount

*  add hook for nodeCreateList selectedTypeChanged

*  add hook for nodeCreateList nodeFilterChanged

*  add hook for nodeCreateList filteredNodeTypesComputed

*  add hook for nodeView.activeNodeChanged

*  add hook for credentialsEdit credentialTypeChanged

*  add hook for onDocumentationUrlClick

*  add hook for executionsList openDialog

*  add hook for execution open

*  add hook for credentialsList dialogVisibleChanged

*  add hook for workflowSettings

*  add hook for showMessage showError

*  add hook for nodeView createNodeActiveChanged

*  add hook for nodeView addNodeButton

*  cleanup

*  add hook for workflowRun runWorkflow

*  add hook for pushConnection executionFinished

*  add hook for runData.displayModeChanged

*  update nodeCreateList.nodeFilterChanged hook

*  update dataDisplay nodeTypeChanged hook

*  update dataDisplay nodeTypeChanged hook

*  update dataDisplay nodeTypeChanged hook

*  update error data in hooks

* update workflowRun runError hook

*  Minor improvements

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Ahsan Virani
2021-05-06 02:46:33 +02:00
committed by GitHub
parent f324fe1dff
commit 2052cadce9
13 changed files with 143 additions and 54 deletions

View File

@@ -8,6 +8,7 @@ import {
IPushDataTestWebhook,
} from '../../Interface';
import { externalHooks } from '@/components/mixins/externalHooks';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { showMessage } from '@/components/mixins/showMessage';
import { titleChange } from '@/components/mixins/titleChange';
@@ -15,6 +16,7 @@ import { titleChange } from '@/components/mixins/titleChange';
import mixins from 'vue-typed-mixins';
export const pushConnection = mixins(
externalHooks,
nodeHelpers,
showMessage,
titleChange,
@@ -202,6 +204,7 @@ export const pushConnection = mixins(
const runDataExecuted = pushData.data;
let runDataExecutedErrorMessage;
// @ts-ignore
const workflow = this.getWorkflow();
if (runDataExecuted.finished !== true) {
@@ -221,6 +224,9 @@ export const pushConnection = mixins(
: runDataExecuted.data.resultData.error.message;
errorMessage = `There was a problem executing the workflow:<br /><strong>"${receivedError}"</strong>`;
}
runDataExecutedErrorMessage = errorMessage;
this.$titleSet(workflow.name, 'ERROR');
this.$showMessage({
title: 'Problem executing workflow',
@@ -249,6 +255,20 @@ export const pushConnection = mixins(
// Set the node execution issues on all the nodes which produced an error so that
// it can be displayed in the node-view
this.updateNodesExecutionIssues();
let itemsCount = 0;
if(runDataExecuted.data.resultData.lastNodeExecuted && !runDataExecutedErrorMessage) {
itemsCount = runDataExecuted.data.resultData.runData[runDataExecuted.data.resultData.lastNodeExecuted][0].data!.main[0]!.length;
}
this.$externalHooks().run('pushConnection.executionFinished', {
itemsCount,
nodeName: runDataExecuted.data.resultData.lastNodeExecuted,
errorMessage: runDataExecutedErrorMessage,
runDataExecutedStartData: runDataExecuted.data.startData,
resultDataError: runDataExecuted.data.resultData.error,
});
} else if (receivedData.type === 'executionStarted') {
const pushData = receivedData.data as IPushDataExecutionStarted;