diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-06 17:48:44 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-06 17:52:17 +0300 |
commit | f3a3566edc8fe24337b9df163f4699785061bb38 (patch) | |
tree | 9f4c8c5ab31a0e789f2fd796d73642ccad86383c /app/assets/javascripts/clusters | |
parent | 001de85e7c6f86423aca0d245fdc83c57b374630 (diff) |
Add support for not_installable/scheduled and to not show created banner
Diffstat (limited to 'app/assets/javascripts/clusters')
-rw-r--r-- | app/assets/javascripts/clusters/clusters_bundle.js | 5 | ||||
-rw-r--r-- | app/assets/javascripts/clusters/components/application_row.vue | 7 | ||||
-rw-r--r-- | app/assets/javascripts/clusters/constants.js | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js index 9a436b3e22d..4d4c90460d2 100644 --- a/app/assets/javascripts/clusters/clusters_bundle.js +++ b/app/assets/javascripts/clusters/clusters_bundle.js @@ -132,9 +132,12 @@ export default class Clusters { handleSuccess(data) { const prevApplicationMap = Object.assign({}, this.store.state.applications); + const prevStatus = this.store.state.status; this.store.updateStateFromServer(data.data); this.checkForNewInstalls(prevApplicationMap, this.store.state.applications); - this.updateContainer(this.store.state.status, this.store.state.statusReason); + if (prevStatus.length == 0 || prevStatus !== this.store.state.status) { + this.updateContainer(this.store.state.status, this.store.state.statusReason); + } } toggle() { diff --git a/app/assets/javascripts/clusters/components/application_row.vue b/app/assets/javascripts/clusters/components/application_row.vue index f8d53fcc4b7..9c5ff39534f 100644 --- a/app/assets/javascripts/clusters/components/application_row.vue +++ b/app/assets/javascripts/clusters/components/application_row.vue @@ -3,6 +3,8 @@ import { s__ } from '../../locale'; import eventHub from '../event_hub'; import loadingButton from '../../vue_shared/components/loading_button.vue'; import { + APPLICATION_NOT_INSTALLABLE, + APPLICATION_SCHEDULED, APPLICATION_INSTALLABLE, APPLICATION_INSTALLING, APPLICATION_INSTALLED, @@ -59,6 +61,7 @@ export default { }, installButtonLoading() { return !this.status || + this.status === APPLICATION_SCHEDULED || this.status === APPLICATION_INSTALLING || this.requestStatus === REQUEST_LOADING; }, @@ -72,9 +75,9 @@ export default { }, installButtonLabel() { let label; - if (this.status === APPLICATION_INSTALLABLE || this.status === APPLICATION_ERROR) { + if (this.status === APPLICATION_INSTALLABLE || this.status === APPLICATION_ERROR || this.status === APPLICATION_NOT_INSTALLABLE) { label = s__('ClusterIntegration|Install'); - } else if (this.status === APPLICATION_INSTALLING) { + } else if (this.status === APPLICATION_SCHEDULED || this.status === APPLICATION_INSTALLING) { label = s__('ClusterIntegration|Installing'); } else if (this.status === APPLICATION_INSTALLED) { label = s__('ClusterIntegration|Installed'); diff --git a/app/assets/javascripts/clusters/constants.js b/app/assets/javascripts/clusters/constants.js index 3f202435716..f1894b173b9 100644 --- a/app/assets/javascripts/clusters/constants.js +++ b/app/assets/javascripts/clusters/constants.js @@ -1,5 +1,7 @@ // These need to match what is returned from the server +export const APPLICATION_NOT_INSTALLABLE = 'not_installable'; export const APPLICATION_INSTALLABLE = 'installable'; +export const APPLICATION_SCHEDULED = 'scheduled'; export const APPLICATION_INSTALLING = 'installing'; export const APPLICATION_INSTALLED = 'installed'; export const APPLICATION_ERROR = 'error'; |