Skip to content

Commit

Permalink
Merge pull request #140 from fleetbase/dev-v0.2.6
Browse files Browse the repository at this point in the history
v0.2.6
  • Loading branch information
roncodes committed Oct 27, 2023
2 parents 096cc10 + f1cec32 commit c56bea9
Show file tree
Hide file tree
Showing 17 changed files with 601 additions and 517 deletions.
4 changes: 2 additions & 2 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"require": {
"php": "^7.3|^8.0",
"fleetbase/core-api": "^1.3.1",
"fleetbase/fleetops-api": "^0.2.9",
"fleetbase/storefront-api": "^0.2.0",
"fleetbase/fleetops-api": "^0.3.0",
"fleetbase/storefront-api": "^0.2.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
Expand Down
201 changes: 98 additions & 103 deletions api/composer.lock

Large diffs are not rendered by default.

37 changes: 34 additions & 3 deletions console/app/controllers/console/admin/branding.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions console/app/templates/console/admin/branding.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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}} />
Expand Down
2 changes: 1 addition & 1 deletion console/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (environment) {
},

API: {
host: fixApiHost(getenv('API_HOST'), getenv('API_SECURE')),
host: fixApiHost(getenv('API_HOST'), toBoolean(getenv('API_SECURE'))),
namespace: getenv('API_NAMESPACE', 'int/v1'),
},

Expand Down
8 changes: 8 additions & 0 deletions console/environments/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API_HOST=http://localhost:8000
API_NAMESPACE=int/v1
SOCKETCLUSTER_PATH=/socketcluster/
SOCKETCLUSTER_HOST=localhost
SOCKETCLUSTER_SECURE=false
SOCKETCLUSTER_PORT=38000
OSRM_HOST=https://bundle.routing.fleetbase.io
OSRM_SERVERS=https://canada.routing.fleetbase.io,https://us.routing.fleetbase.io
9 changes: 9 additions & 0 deletions console/environments/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
API_HOST=
API_NAMESPACE=int/v1
API_SECURE=true
SOCKETCLUSTER_PATH=/socketcluster/
SOCKETCLUSTER_HOST=
SOCKETCLUSTER_SECURE=true
SOCKETCLUSTER_PORT=38000
OSRM_HOST=https://bundle.routing.fleetbase.io
OSRM_SERVERS=https://canada.routing.fleetbase.io,https://us.routing.fleetbase.io
Empty file added console/environments/.gitkeep
Empty file.
16 changes: 8 additions & 8 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
},
"dependencies": {
"@ember/legacy-built-in-components": "^0.4.1",
"@fleetbase/ember-core": "^0.1.5",
"@fleetbase/ember-ui": "^0.2.0",
"@fleetbase/dev-engine": "^0.1.8",
"@fleetbase/iam-engine": "^0.0.6",
"@fleetbase/fleetops-engine": "^0.2.9",
"@fleetbase/ember-core": "^0.1.6",
"@fleetbase/ember-ui": "^0.2.1",
"@fleetbase/dev-engine": "^0.1.9",
"@fleetbase/iam-engine": "^0.0.7",
"@fleetbase/fleetops-engine": "^0.3.0",
"@fleetbase/fleetops-data": "^0.1.1",
"@fleetbase/storefront-engine": "^0.2.0",
"@fleetbase/storefront-engine": "^0.2.2",
"@fleetbase/leaflet-routing-machine": "^3.2.16",
"@fortawesome/ember-fontawesome": "^0.4.1",
"ember-intl": "^6.0.0-beta.6",
Expand Down Expand Up @@ -126,8 +126,8 @@
"pnpm": {
"overrides": {
"@fleetbase/fleetops-data": "^0.1.1",
"@fleetbase/ember-core": "^0.1.5",
"@fleetbase/ember-ui": "^0.2.0"
"@fleetbase/ember-core": "^0.1.6",
"@fleetbase/ember-ui": "^0.2.1"
}
},
"prettier": {
Expand Down

0 comments on commit c56bea9

Please sign in to comment.