Commit c72cf879 authored by Mike Greiling's avatar Mike Greiling Committed by Thong Kuah

Define cluster types in a constant within frontend

parent 1eadb490
...@@ -13,7 +13,7 @@ import prometheusLogo from 'images/cluster_app_logos/prometheus.png'; ...@@ -13,7 +13,7 @@ import prometheusLogo from 'images/cluster_app_logos/prometheus.png';
import { s__, sprintf } from '../../locale'; import { s__, sprintf } from '../../locale';
import applicationRow from './application_row.vue'; import applicationRow from './application_row.vue';
import clipboardButton from '../../vue_shared/components/clipboard_button.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 { export default {
components: { components: {
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
type: { type: {
type: String, type: String,
required: false, required: false,
default: 'project_type', default: CLUSTER_TYPE.PROJECT,
}, },
applications: { applications: {
type: Object, type: Object,
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}), }),
computed: { computed: {
isProjectCluster() { isProjectCluster() {
return this.type === 'project_type'; return this.type === CLUSTER_TYPE.PROJECT;
}, },
helmInstalled() { helmInstalled() {
return ( return (
......
// 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 // These need to match what is returned from the server
export const APPLICATION_STATUS = { export const APPLICATION_STATUS = {
NOT_INSTALLABLE: 'not_installable', NOT_INSTALLABLE: 'not_installable',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment