summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/clusters/services/application_state_machine.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/clusters/services/application_state_machine.js')
-rw-r--r--app/assets/javascripts/clusters/services/application_state_machine.js36
1 files changed, 35 insertions, 1 deletions
diff --git a/app/assets/javascripts/clusters/services/application_state_machine.js b/app/assets/javascripts/clusters/services/application_state_machine.js
index 6af9b10f12f..683b0e18534 100644
--- a/app/assets/javascripts/clusters/services/application_state_machine.js
+++ b/app/assets/javascripts/clusters/services/application_state_machine.js
@@ -14,6 +14,7 @@ const {
UNINSTALLING,
UNINSTALL_ERRORED,
PRE_INSTALLED,
+ UNINSTALLED,
} = APPLICATION_STATUS;
const applicationStateMachine = {
@@ -67,6 +68,9 @@ const applicationStateMachine = {
[PRE_INSTALLED]: {
target: PRE_INSTALLED,
},
+ [UNINSTALLED]: {
+ target: UNINSTALLED,
+ },
},
},
[NOT_INSTALLABLE]: {
@@ -87,9 +91,17 @@ const applicationStateMachine = {
[NOT_INSTALLABLE]: {
target: NOT_INSTALLABLE,
},
- // This is possible in artificial environments for E2E testing
[INSTALLED]: {
target: INSTALLED,
+ effects: {
+ installFailed: false,
+ },
+ },
+ [UNINSTALLED]: {
+ target: UNINSTALLED,
+ effects: {
+ installFailed: false,
+ },
},
},
},
@@ -125,6 +137,15 @@ const applicationStateMachine = {
uninstallSuccessful: false,
},
},
+ [UNINSTALLED]: {
+ target: UNINSTALLED,
+ },
+ [ERROR]: {
+ target: INSTALLABLE,
+ effects: {
+ installFailed: true,
+ },
+ },
},
},
[PRE_INSTALLED]: {
@@ -180,6 +201,19 @@ const applicationStateMachine = {
},
},
},
+ [UNINSTALLED]: {
+ on: {
+ [INSTALLED]: {
+ target: INSTALLED,
+ },
+ [ERROR]: {
+ target: INSTALLABLE,
+ effects: {
+ installFailed: true,
+ },
+ },
+ },
+ },
};
/**