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

@@ -53,7 +53,7 @@ export const workflowRun = mixins(
return response;
},
async runWorkflow (nodeName: string): Promise<IExecutionPushResponse | undefined> {
async runWorkflow (nodeName: string, source?: string): Promise<IExecutionPushResponse | undefined> {
if (this.$store.getters.isActionActive('workflowRunning') === true) {
return;
}
@@ -84,7 +84,7 @@ export const workflowRun = mixins(
duration: 0,
});
this.$titleSet(workflow.name as string, 'ERROR');
this.$externalHooks().run('workflow.runError', { errorMessages });
this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName });
return;
}
}
@@ -172,7 +172,11 @@ export const workflowRun = mixins(
};
this.$store.commit('setWorkflowExecutionData', executionData);
return await this.runWorkflowApi(startRunData);
const runWorkflowApiResponse = await this.runWorkflowApi(startRunData);
this.$externalHooks().run('workflowRun.runWorkflow', { nodeName, source });
return runWorkflowApiResponse;
} catch (error) {
this.$titleSet(workflow.name as string, 'ERROR');
this.$showError(error, 'Problem running workflow', 'There was a problem running the workflow:');