From 8465659e0aba103ea55d89a7813b565a7bb14894 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Sun, 4 Nov 2018 15:36:22 -0600 Subject: Hide project-specific cluster apps in non-project clusters --- app/assets/javascripts/clusters/clusters_bundle.js | 6 ++++-- app/assets/javascripts/clusters/components/applications.vue | 11 +++++++++++ app/views/clusters/clusters/show.html.haml | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js index 6bc71fa91bf..7f9398413eb 100644 --- a/app/assets/javascripts/clusters/clusters_bundle.js +++ b/app/assets/javascripts/clusters/clusters_bundle.js @@ -30,6 +30,7 @@ export default class Clusters { installJupyterPath, installPrometheusPath, managePrometheusPath, + clusterType, clusterStatus, clusterStatusReason, helpPath, @@ -65,7 +66,7 @@ export default class Clusters { initDismissableCallout('.js-cluster-security-warning'); initSettingsPanels(); setupToggleButtons(document.querySelector('.js-cluster-enable-toggle-area')); - this.initApplications(); + this.initApplications(clusterType); if (this.store.state.status !== 'created') { this.updateContainer(null, this.store.state.status, this.store.state.statusReason); @@ -77,7 +78,7 @@ export default class Clusters { } } - initApplications() { + initApplications(type) { const { store } = this; const el = document.querySelector('#js-cluster-applications'); @@ -91,6 +92,7 @@ export default class Clusters { render(createElement) { return createElement(Applications, { props: { + type, applications: this.state.applications, helpPath: this.state.helpPath, ingressHelpPath: this.state.ingressHelpPath, diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index d779f5e9158..3fbc71e0d4a 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -20,6 +20,11 @@ export default { clipboardButton, }, props: { + type: { + type: String, + required: false, + default: 'project_type', + }, applications: { type: Object, required: false, @@ -57,6 +62,9 @@ export default { prometheusLogo, }), computed: { + isProjectCluster() { + return this.type === 'project_type'; + }, helmInstalled() { return ( this.applications.helm.status === APPLICATION_STATUS.INSTALLED || @@ -276,6 +284,7 @@ export default {