From 8e6980ee1478be86ae59f14cfbb42640dfd651c8 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Mon, 6 Jan 2020 19:31:14 -0500 Subject: [PATCH] hide preset config options, add show-all checkbox --- src/auth/ActivationPage.vue | 57 ++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/src/auth/ActivationPage.vue b/src/auth/ActivationPage.vue index 1e58bb7..b82025a 100644 --- a/src/auth/ActivationPage.vue +++ b/src/auth/ActivationPage.vue @@ -44,9 +44,15 @@ -
+
{{messages['driver_'+cloud.driverClass]}} {{messages.form_section_title_config}}
-
+
+ + +
+
@@ -93,9 +99,7 @@ const cloudNotFoundHandler = function (vue, fieldGroup) { return { get: function (target, name) { - if (typeof name === 'undefined') return null; - if (name === null) return null; - if (name === '') return null; + if (typeof name === 'undefined' || name === null || name === '') return null; if (!target.hasOwnProperty(name)) target[name] = vue.populateDefaults(fieldGroup, name); return target[name]; } @@ -113,11 +117,14 @@ description: 'root user', cloudsEnabled: {}, + showAllConfigs: {}, configValues: new Proxy(Object.assign({}), cloudNotFoundHandler(this, 'config')), credentialValues: new Proxy(Object.assign({}), cloudNotFoundHandler(this, 'credentials')), domainName: null, - publicDns: null + publicDns: null, + + displayShowAllCheckbox: null }; }, computed: { @@ -156,6 +163,17 @@ }, methods: { ...mapActions('system', ['loadIsActivated', 'activate']), + displayShowAllControl (cloudName) { + if (this.displayShowAllCheckbox == null) { + const showAll = {}; + for (let i = 0; i < this.configs.cloudConfigs.length; i++) { + const cloud = this.configs.cloudConfigs[i]; + showAll[cloud.name] = this.displayCloudConfigFields(cloud).config.length !== this.allCloudConfigFields(cloud).config.length; + } + this.displayShowAllCheckbox = showAll; + } + return this.displayShowAllCheckbox[cloudName]; + }, cloudsByType (csType) { const clouds = []; if (this.configs && this.configs.cloudConfigs) { @@ -182,7 +200,7 @@ populateDefaults (fieldGroup, cloudName) { const cloud = this.cloudByName(cloudName); if (cloud === null) return {}; - const fields = this.cloudConfigFields(cloud); + const fields = this.allCloudConfigFields(cloud); const defaults = {}; for (let i=0; i \ No newline at end of file