Modular logistics and supply chain operating system (LSOS)
JavaScript driver-appfleet-managementfreight-managementinfrastructureinventory-managementlast-mile-deliverylogisticsondemandopen-sourceorder-managementroute-optimizationsupply-chain-managementtracking-and-monitoringtransport-management-systemtransportationwarehouse-management
Fix reset of branding settings
Ronald A. Richardson1c0d324ba91a
diff --git a/console/app/controllers/console/admin/branding.js b/console/app/controllers/console/admin/branding.jsindex 00fb1f94..9667d92f 100644--- a/console/app/controllers/console/admin/branding.js+++ b/console/app/controllers/console/admin/branding.js@@ -2,6 +2,7 @@ import Controller from '@ember/controller';import { tracked } from '@glimmer/tracking';import { inject as service } from '@ember/service';import { action } from '@ember/object';+import { isArray } from '@ember/array';export default class ConsoleAdminBrandingController extends Controller {/**@@ -51,13 +52,43 @@ export default class ConsoleAdminBrandingController extends Controller {}/**- * Unset a branding settings+ * Unsets the value of a given key or array of keys on the model.*- * @param {String} key+ * @action+ * @param {string | string[]} key - The key or keys to unset on the model.+ * @param {*} [newValue=null] - The new value to set for the given key or keys. Defaults to null.* @memberof ConsoleAdminBrandingController*/@action unset(key, newValue = null) {- this.model[key] = newValue;+ if (isArray(key)) {+ return key.forEach((k) => this.unset(k, undefined));+ }++ this.model.set(key, newValue);+ }++ /**+ * Unsets the icon properties on the model.+ *+ * @action+ * @returns {void} - No return value.+ * @memberof ConsoleAdminBrandingController+ */+ @action unsetIcon() {+ this.unset(['icon_uuid', 'icon_url']);+ this.model.set('icon_url', '/images/icon.png');+ }++ /**+ * Unsets the logo properties on the model.+ *+ * @action+ * @returns {void} - No return value.+ * @memberof ConsoleAdminBrandingController+ */+ @action unsetLogo() {+ this.unset(['logo_uuid', 'logo_url']);+ this.model.set('logo_url', '/images/fleetbase-logo-svg.svg');}/**diff --git a/console/app/templates/console/admin/branding.hbs b/console/app/templates/console/admin/branding.hbsindex a4aae904..4f1e710e 100644--- a/console/app/templates/console/admin/branding.hbs+++ b/console/app/templates/console/admin/branding.hbs@@ -28,7 +28,7 @@</a></FileUpload></div>- <a href="javascript:;" class="text-danger text-xs mt-1" {{on "click" (fn this.unset "icon_url" "/images/icon.png")}}>Reset to default</a>+ <a href="javascript:;" class="text-danger text-xs mt-1" {{on "click" this.unsetIcon}}>Reset to default</a></div><div class="input-group"><label>Logo</label>@@ -52,7 +52,7 @@</a></FileUpload></div>- <a href="javascript:;" class="text-danger text-xs mt-1" {{on "click" (fn this.unset "logo_url" "/images/fleetbase-logo-svg.svg")}}>Reset to default</a>+ <a href="javascript:;" class="text-danger text-xs mt-1" {{on "click" this.unsetLogo}}>Reset to default</a></div><InputGroup @name="Default Theme"><Select @value={{@model.default_theme}} @onSelect={{this.setTheme}} @options={{this.themeOptions}} />diff --git a/packages/core-api b/packages/core-apiindex 0b0fb9cd..b47debd7 160000--- a/packages/core-api+++ b/packages/core-api@@ -1 +1 @@-Subproject commit 0b0fb9cde5e82caaf2b51f68960908f3c9a35a82+Subproject commit b47debd7b3f823a5a61d8f92e3179c2ebe02a971