diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-11-05 13:22:53 -0600 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-11-08 23:26:04 +1300 |
commit | c72cf87918b9c7722d5b8b67bd6a86bc3945754c (patch) | |
tree | 63e1ad6dd24961a64f0e6e665b57812ea9dad829 /app | |
parent | 1eadb490ebf70a3254b9004b32ce8b7a60c75838 (diff) | |
download | gitlab-ce-c72cf87918b9c7722d5b8b67bd6a86bc3945754c.tar.gz |
Define cluster types in a constant within frontend
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/clusters/components/applications.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/clusters/constants.js | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index 69d18bd5020..c1026d1273a 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -13,7 +13,7 @@ import prometheusLogo from 'images/cluster_app_logos/prometheus.png'; import { s__, sprintf } from '../../locale'; import applicationRow from './application_row.vue'; import clipboardButton from '../../vue_shared/components/clipboard_button.vue'; -import { APPLICATION_STATUS, INGRESS } from '../constants'; +import { CLUSTER_TYPE, APPLICATION_STATUS, INGRESS } from '../constants'; export default { components: { @@ -24,7 +24,7 @@ export default { type: { type: String, required: false, - default: 'project_type', + default: CLUSTER_TYPE.PROJECT, }, applications: { type: Object, @@ -65,7 +65,7 @@ export default { }), computed: { isProjectCluster() { - return this.type === 'project_type'; + return this.type === CLUSTER_TYPE.PROJECT; }, helmInstalled() { return ( diff --git a/app/assets/javascripts/clusters/constants.js b/app/assets/javascripts/clusters/constants.js index d707420c845..15cf4a56138 100644 --- a/app/assets/javascripts/clusters/constants.js +++ b/app/assets/javascripts/clusters/constants.js @@ -1,3 +1,10 @@ +// These need to match the enum found in app/models/clusters/cluster.rb +export const CLUSTER_TYPE = { + INSTANCE: 'instance_type', + GROUP: 'group_type', + PROJECT: 'project_type', +}; + // These need to match what is returned from the server export const APPLICATION_STATUS = { NOT_INSTALLABLE: 'not_installable', |