From 17d621a3f4628f69057b2e96ad857d4daa2177bf Mon Sep 17 00:00:00 2001 From: Michael Mancini Date: Mon, 28 Feb 2022 10:31:09 -0500 Subject: [PATCH 1/2] fix: save workflow error when updating with parameters --- apps/st2-actions/actions-panel.component.js | 1 - apps/st2-history/history-panel.component.js | 1 - apps/st2-rules/rules-panel.component.js | 1 - apps/st2-workflows/workflows.component.js | 10 ++++++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/st2-actions/actions-panel.component.js b/apps/st2-actions/actions-panel.component.js index 7f8e41c17..1252a3bf3 100644 --- a/apps/st2-actions/actions-panel.component.js +++ b/apps/st2-actions/actions-panel.component.js @@ -303,7 +303,6 @@ export default class ActionsPanel extends React.Component { this._details = ref} handleNavigate={(...args) => this.navigate(...args)} handleRun={(...args) => this.handleRun(...args)} handleDelete={(...arg) => this.handleDelete(...arg)} diff --git a/apps/st2-history/history-panel.component.js b/apps/st2-history/history-panel.component.js index c03542dad..6856ae992 100644 --- a/apps/st2-history/history-panel.component.js +++ b/apps/st2-history/history-panel.component.js @@ -531,7 +531,6 @@ export default class HistoryPanel extends React.Component { this._details = ref} handleNavigate={(...args) => this.navigate(...args)} handleRerun={(...args) => this.handleRerun(...args)} handleCancel={(...args) => this.handleCancel(...args)} diff --git a/apps/st2-rules/rules-panel.component.js b/apps/st2-rules/rules-panel.component.js index ab1c96f96..8d366d36b 100644 --- a/apps/st2-rules/rules-panel.component.js +++ b/apps/st2-rules/rules-panel.component.js @@ -281,7 +281,6 @@ export default class RulesPanel extends React.Component { this._details = ref} onNavigate={(...args) => this.navigate(...args)} id={id} diff --git a/apps/st2-workflows/workflows.component.js b/apps/st2-workflows/workflows.component.js index b682e22d4..5cea5174f 100644 --- a/apps/st2-workflows/workflows.component.js +++ b/apps/st2-workflows/workflows.component.js @@ -266,6 +266,16 @@ export default class Workflows extends Component { const promise = (async () => { if (existingAction) { + + // remove "_name" key from parameter keys for successful request + if (meta.parameters) { + Object.keys(meta.parameters).forEach(key => { + if (meta.parameters[key]._name) { + delete meta.parameters[key]._name; + } + }); + } + await api.request({ method: 'put', path: `/actions/${pack}.${meta.name}` }, meta); } else { From b5f58c29d0ef5b5fd59ee8ef13f2ccd8200c2484 Mon Sep 17 00:00:00 2001 From: Michael Mancini Date: Mon, 7 Mar 2022 18:43:34 -0500 Subject: [PATCH 2/2] extra space for linting --- apps/st2-workflows/workflows.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/st2-workflows/workflows.component.js b/apps/st2-workflows/workflows.component.js index 5cea5174f..8cd73ff75 100644 --- a/apps/st2-workflows/workflows.component.js +++ b/apps/st2-workflows/workflows.component.js @@ -271,7 +271,7 @@ export default class Workflows extends Component { if (meta.parameters) { Object.keys(meta.parameters).forEach(key => { if (meta.parameters[key]._name) { - delete meta.parameters[key]._name; + delete meta.parameters[key]._name; } }); }