Skip to content

Modular logistics and supply chain operating system (LSOS)

preparing for v0.4.10 release

Ronald A. Richardson79604c798110
diff --git a/console/app/components/configure/notification-channels.js b/console/app/components/configure/notification-channels.js
index b520273f..34038c78 100644
--- a/console/app/components/configure/notification-channels.js
+++ b/console/app/components/configure/notification-channels.js
@@ -24,7 +24,7 @@ export default class ConfigureNotificationChannelsComponent extends Component {
production: true,
};
@tracked firebase = {
- credentials: ''
+ credentials: '',
};
constructor() {
diff --git a/console/app/initializers/load-socketcluster-client.js b/console/app/initializers/load-socketcluster-client.js
index 63981f0c..9e960398 100644
--- a/console/app/initializers/load-socketcluster-client.js
+++ b/console/app/initializers/load-socketcluster-client.js
@@ -1,7 +1,12 @@
export function initialize() {
- const socketClusterClientScript = document.createElement('script');
- socketClusterClientScript.src = '/assets/socketcluster-client.min.js';
- document.body.appendChild(socketClusterClientScript);
+ // Check if the script already exists
+ // Only insert the script tag if it doesn't already exist
+ if (!document.querySelector('script[data-socketcluster-client]')) {
+ const socketClusterClientScript = document.createElement('script');
+ socketClusterClientScript.setAttribute('data-socketcluster-client', '1');
+ socketClusterClientScript.src = '/assets/socketcluster-client.min.js';
+ document.body.appendChild(socketClusterClientScript);
+ }
}
export default {
diff --git a/console/app/models/category.js b/console/app/models/category.js
index 5c12866c..f1fee4a3 100644
--- a/console/app/models/category.js
+++ b/console/app/models/category.js
@@ -29,6 +29,7 @@ export default class CategoryModel extends Model {
@attr('string') slug;
@attr('string') order;
@attr('raw') translations;
+ @attr('raw') meta;
/** @dates */
@attr('date') deleted_at;
diff --git a/console/app/models/custom-field.js b/console/app/models/custom-field.js
new file mode 100644
index 00000000..26d6b0ba
--- /dev/null
+++ b/console/app/models/custom-field.js
@@ -0,0 +1,47 @@
+import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { format, formatDistanceToNow } from 'date-fns';
+
+export default class CustomFieldModel extends Model {
+ /** @ids */
+ @attr('string') company_uuid;
+ @attr('string') category_uuid;
+ @attr('string') subject_uuid;
+ @attr('string') subject_type;
+
+ /** @attributes */
+ @attr('string') name;
+ @attr('string') description;
+ @attr('string') help_text;
+ @attr('string') label;
+ @attr('string') type;
+ @attr('string') component;
+ @attr('string') default_value;
+ @attr('number') order;
+ @attr('boolean') required;
+ @attr('raw') options;
+ @attr('raw') validation_rules;
+ @attr('raw') meta;
+
+ /** @dates */
+ @attr('date') created_at;
+ @attr('date') updated_at;
+ @attr('date') deleted_at;
+
+ /** @computed */
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+}
diff --git a/console/config/environment.js b/console/config/environment.js
index 568876af..2594908f 100644
--- a/console/config/environment.js
+++ b/console/config/environment.js
@@ -46,9 +46,12 @@ module.exports = function (environment) {
driverImage: getenv('DEFAULT_DRIVER_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
userImage: getenv('DEFAULT_USER_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
contactImage: getenv('DEFAULT_CONTACT_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
+ entityImage: getenv('DEFAULT_ENTITY_IMAGE', 'https://flb-assets.s3-ap-southeast-1.amazonaws.com/static/parcels/medium.png'),
vendorImage: getenv('DEFAULT_VENDOR_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
vehicleImage: getenv('DEFAULT_VEHICLE_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/vehicle-placeholder.png'),
vehicleAvatar: getenv('DEFAUL_VEHICLE_AVATAR', 'https://flb-assets.s3-ap-southeast-1.amazonaws.com/static/vehicle-icons/mini_bus.svg'),
+ driverAvatar: getenv('DEFAUL_DRIVER_AVATAR', 'https://flb-assets.s3-ap-southeast-1.amazonaws.com/static/driver-icons/moto-driver.png'),
+ placeAvatar: getenv('DEFAUL_PLACE_AVATAR', 'https://flb-assets.s3-ap-southeast-1.amazonaws.com/static/place-icons/basic-building.png'),
},
'ember-simple-auth': {
diff --git a/console/tests/unit/models/custom-field-test.js b/console/tests/unit/models/custom-field-test.js
new file mode 100644
index 00000000..1b1eefa6
--- /dev/null
+++ b/console/tests/unit/models/custom-field-test.js
@@ -0,0 +1,14 @@
+import { module, test } from 'qunit';
+
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | custom field', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('custom-field', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/translations/en-us.yaml b/console/translations/en-us.yaml
index 23ab05a3..387dba97 100644
--- a/console/translations/en-us.yaml
+++ b/console/translations/en-us.yaml
@@ -16,6 +16,7 @@ common:
confirm: Confirm
edit: Edit
save: Save
+ save-changes: Save Changes
cancel: Cancel
2fa-config: 2FA Config
account: Account
diff --git a/docker/httpd/vhost.conf b/docker/httpd/vhost.conf
index 4b267f02..40db64b4 100644
--- a/docker/httpd/vhost.conf
+++ b/docker/httpd/vhost.conf
@@ -12,6 +12,30 @@ server {
send_timeout 600;
index index.php;
+ # tweaks
+ client_max_body_size 600M;
+ client_body_buffer_size 1m;
+ client_header_buffer_size 1k;
+ large_client_header_buffers 4 16k;
+ keepalive_timeout 2 2;
+
+ #gzip tweaks
+ gzip on;
+ gzip_disable "msie6";
+ gzip_vary on;
+ gzip_proxied any;
+ gzip_comp_level 6;
+ gzip_min_length 1100;
+ gzip_buffers 16 8k;
+ gzip_http_version 1.1;
+ gzip_types text/plain application/javascript application/json application/x-javascript text/xml text/css;
+
+ #open file cache tweaks
+ open_file_cache max=2000 inactive=20s;
+ open_file_cache_valid 60s;
+ open_file_cache_min_uses 5;
+ open_file_cache_errors off;
+
location / {
proxy_pass http://${NGINX_APPLICATION_HOSTNAME}:8000;
}