From 20e7ef6f3b5691e3eaf13440ecc23c9cb4ec76af Mon Sep 17 00:00:00 2001
From: Piotr Bletek
Date: Mon, 17 Jan 2022 09:29:40 +0100
Subject: [PATCH] bugfix: get default status from workflow (#1188)
---
.../components/Buttons/UpdateWorkflowTranslationButton.vue | 1 +
.../workflow/src/components/Inputs/WorkflowStatusPreview.vue | 2 +-
.../src/components/Modals/CreateWorkflowStatusModalForm.vue | 2 ++
.../src/components/Tabs/WorkflowStatusGeneralTab.vue | 1 +
modules/@ergonode/workflow/src/locales/en_GB.json | 3 +++
modules/@ergonode/workflow/src/locales/pl_PL.json | 3 +++
modules/@ergonode/workflow/src/store/workflow/actions.js | 5 ++++-
7 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/modules/@ergonode/workflow/src/components/Buttons/UpdateWorkflowTranslationButton.vue b/modules/@ergonode/workflow/src/components/Buttons/UpdateWorkflowTranslationButton.vue
index 862f8465e..61d7da02b 100644
--- a/modules/@ergonode/workflow/src/components/Buttons/UpdateWorkflowTranslationButton.vue
+++ b/modules/@ergonode/workflow/src/components/Buttons/UpdateWorkflowTranslationButton.vue
@@ -65,6 +65,7 @@ export default {
this.removeScopeErrors(this.scope);
this.updateStatus({
+ workflowId: this.$route.params.workflowId,
scope: this.scope,
onSuccess: this.onUpdateSuccess,
onError: this.onUpdateError,
diff --git a/modules/@ergonode/workflow/src/components/Inputs/WorkflowStatusPreview.vue b/modules/@ergonode/workflow/src/components/Inputs/WorkflowStatusPreview.vue
index 095b2cee0..8441048fa 100644
--- a/modules/@ergonode/workflow/src/components/Inputs/WorkflowStatusPreview.vue
+++ b/modules/@ergonode/workflow/src/components/Inputs/WorkflowStatusPreview.vue
@@ -22,7 +22,7 @@
+ :label="$t('@Workflow.workflow.components.WorkflowStatusPreview.label')" />
diff --git a/modules/@ergonode/workflow/src/components/Modals/CreateWorkflowStatusModalForm.vue b/modules/@ergonode/workflow/src/components/Modals/CreateWorkflowStatusModalForm.vue
index 547a22f59..18e7832dd 100644
--- a/modules/@ergonode/workflow/src/components/Modals/CreateWorkflowStatusModalForm.vue
+++ b/modules/@ergonode/workflow/src/components/Modals/CreateWorkflowStatusModalForm.vue
@@ -77,6 +77,7 @@ export default {
this.removeScopeErrors(this.scope);
this.createStatus({
+ workflowId: this.$route.params.workflowId,
scope: this.scope,
onSuccess: this.onCreateSuccess,
onError: this.onCreateError,
@@ -91,6 +92,7 @@ export default {
this.removeScopeErrors(this.scope);
this.createStatus({
+ workflowId: this.$route.params.workflowId,
scope: this.scope,
onSuccess: this.onProceedSuccess,
onError: this.onCreateError,
diff --git a/modules/@ergonode/workflow/src/components/Tabs/WorkflowStatusGeneralTab.vue b/modules/@ergonode/workflow/src/components/Tabs/WorkflowStatusGeneralTab.vue
index 43e4a7c35..f4e227cb7 100644
--- a/modules/@ergonode/workflow/src/components/Tabs/WorkflowStatusGeneralTab.vue
+++ b/modules/@ergonode/workflow/src/components/Tabs/WorkflowStatusGeneralTab.vue
@@ -51,6 +51,7 @@ export default {
this.removeScopeErrors(this.scope);
this.updateStatus({
+ workflowId: this.$route.params.workflowId,
scope: this.scope,
onSuccess: this.onUpdateSuccess,
onError: this.onUpdateError,
diff --git a/modules/@ergonode/workflow/src/locales/en_GB.json b/modules/@ergonode/workflow/src/locales/en_GB.json
index 0b2f9a9d2..3fe0629ac 100644
--- a/modules/@ergonode/workflow/src/locales/en_GB.json
+++ b/modules/@ergonode/workflow/src/locales/en_GB.json
@@ -40,6 +40,9 @@
"ConditionsSideBar": {
"title": "Conditions"
},
+ "WorkflowStatusPreview": {
+ "label": "Status preview"
+ },
"ConditionsVerticalTab": {
"title": "Conditions"
},
diff --git a/modules/@ergonode/workflow/src/locales/pl_PL.json b/modules/@ergonode/workflow/src/locales/pl_PL.json
index 006bab435..59db4d8f3 100644
--- a/modules/@ergonode/workflow/src/locales/pl_PL.json
+++ b/modules/@ergonode/workflow/src/locales/pl_PL.json
@@ -40,6 +40,9 @@
"ConditionsSideBar": {
"title": "Warunki"
},
+ "WorkflowStatusPreview": {
+ "label": "PodglÄ…d statusu"
+ },
"ConditionsVerticalTab": {
"title": "Warunki"
},
diff --git a/modules/@ergonode/workflow/src/store/workflow/actions.js b/modules/@ergonode/workflow/src/store/workflow/actions.js
index 9320abaa8..ba5df26bc 100644
--- a/modules/@ergonode/workflow/src/store/workflow/actions.js
+++ b/modules/@ergonode/workflow/src/store/workflow/actions.js
@@ -116,7 +116,6 @@ export default {
},
});
// EXTENDED BEFORE METHOD
- console.log('run run ');
const data = await getWorkflow({
$axios: this.app.$axios,
@@ -187,6 +186,7 @@ export default {
state,
},
{
+ workflowId,
scope,
onSuccess = () => {},
onError = () => {},
@@ -227,6 +227,7 @@ export default {
await updateDefaultStatus({
$axios: this.app.$axios,
id,
+ workflowId,
});
}
@@ -261,6 +262,7 @@ export default {
state,
rootState,
}, {
+ workflowId,
scope,
onSuccess = () => {},
onError = () => {},
@@ -310,6 +312,7 @@ export default {
requests.push(updateDefaultStatus({
$axios: this.app.$axios,
id,
+ workflowId,
}));
}