Skip to content

Modular logistics and supply chain operating system (LSOS)

Latest updates, moved save buttons to subheader for easy access to save

Ronald A. Richardson7ffb7ac24a08
diff --git a/console/app/components/configure/filesystem.hbs b/console/app/components/configure/filesystem.hbs
index 82d89f20..a5722711 100644
--- a/console/app/components/configure/filesystem.hbs
+++ b/console/app/components/configure/filesystem.hbs
@@ -16,6 +16,6 @@
<Button @wrapperClass="mt-3" @icon="plug" @text="Test Config" @onClick={{this.test}} @isLoading={{this.isLoading}} />
</ContentPanel>
-<div class="mt-3 flex items-center justify-end">
- <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
-</div>
\ No newline at end of file
+<EmberWormhole @to="next-view-section-subheader-actions">
+ <Button @type="primary" @size="sm" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</EmberWormhole>
\ No newline at end of file
diff --git a/console/app/components/configure/mail.hbs b/console/app/components/configure/mail.hbs
index ce964521..6dc61a6f 100644
--- a/console/app/components/configure/mail.hbs
+++ b/console/app/components/configure/mail.hbs
@@ -22,6 +22,6 @@
<Button @wrapperClass="mt-3" @icon="plug" @text="Test Config" @onClick={{this.test}} @isLoading={{this.isLoading}} />
</ContentPanel>
-<div class="mt-3 flex items-center justify-end">
- <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
-</div>
\ No newline at end of file
+<EmberWormhole @to="next-view-section-subheader-actions">
+ <Button @type="primary" @size="sm" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</EmberWormhole>
\ No newline at end of file
diff --git a/console/app/components/configure/notification-channels.hbs b/console/app/components/configure/notification-channels.hbs
index 7a0ee9f4..e9d3654a 100644
--- a/console/app/components/configure/notification-channels.hbs
+++ b/console/app/components/configure/notification-channels.hbs
@@ -47,6 +47,6 @@
</div>
</ContentPanel>
-<div class="mt-3 flex items-center justify-end">
- <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
-</div>
\ No newline at end of file
+<EmberWormhole @to="next-view-section-subheader-actions">
+ <Button @type="primary" @size="sm" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</EmberWormhole>
\ No newline at end of file
diff --git a/console/app/components/configure/queue.hbs b/console/app/components/configure/queue.hbs
index 4c2d7797..3600d816 100644
--- a/console/app/components/configure/queue.hbs
+++ b/console/app/components/configure/queue.hbs
@@ -20,6 +20,6 @@
<Button @wrapperClass="mt-3" @icon="plug" @text="Test Config" @onClick={{this.test}} @isLoading={{this.isLoading}} />
</ContentPanel>
-<div class="mt-3 flex items-center justify-end">
- <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
-</div>
\ No newline at end of file
+<EmberWormhole @to="next-view-section-subheader-actions">
+ <Button @type="primary" @size="sm" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</EmberWormhole>
\ No newline at end of file
diff --git a/console/app/components/configure/services.hbs b/console/app/components/configure/services.hbs
index 8f893bd3..fdcb133b 100644
--- a/console/app/components/configure/services.hbs
+++ b/console/app/components/configure/services.hbs
@@ -40,6 +40,6 @@
<InputGroup @name="IP Info API Key" @value={{this.ipinfoApiKey}} disabled={{this.isLoading}} />
</ContentPanel>
-<div class="mt-3 flex items-center justify-end">
- <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
-</div>
\ No newline at end of file
+<EmberWormhole @to="next-view-section-subheader-actions">
+ <Button @type="primary" @size="sm" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</EmberWormhole>
\ No newline at end of file
diff --git a/console/app/controllers/console/account.js b/console/app/controllers/console/account.js
index 241adaa9..18817869 100644
--- a/console/app/controllers/console/account.js
+++ b/console/app/controllers/console/account.js
@@ -2,5 +2,10 @@ import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default class ConsoleAccountController extends Controller {
+ /**
+ * Inject the `universe` service.
+ *
+ * @memberof ConsoleAdminController
+ */
@service universe;
}
diff --git a/console/app/controllers/console/admin.js b/console/app/controllers/console/admin.js
index 7ef27853..df8d8c8e 100644
--- a/console/app/controllers/console/admin.js
+++ b/console/app/controllers/console/admin.js
@@ -2,5 +2,10 @@ import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default class ConsoleAdminController extends Controller {
+ /**
+ * Inject the `universe` service.
+ *
+ * @memberof ConsoleAdminController
+ */
@service universe;
}
diff --git a/console/app/controllers/console/admin/notifications.js b/console/app/controllers/console/admin/notifications.js
index 97a05a4e..b822fb49 100644
--- a/console/app/controllers/console/admin/notifications.js
+++ b/console/app/controllers/console/admin/notifications.js
@@ -7,7 +7,6 @@ import createNotificationKey from '../../../utils/create-notification-key';
export default class ConsoleAdminNotificationsController extends Controller {
@service notifications;
@service fetch;
-
@tracked notificationSettings = {};
@tracked notificationTransportMethods = ['email', 'sms'];
@tracked isLoading = false;
@@ -77,7 +76,6 @@ export default class ConsoleAdminNotificationsController extends Controller {
*
* @returns {Promise<void>} A promise for successful retrieval and update, or an error on failure.
*/
-
getSettings() {
return this.fetch
.get('notifications/get-settings')
diff --git a/console/app/controllers/console/notifications.js b/console/app/controllers/console/notifications.js
index af3b8582..1cbc694f 100644
--- a/console/app/controllers/console/notifications.js
+++ b/console/app/controllers/console/notifications.js
@@ -7,11 +7,46 @@ import { inject as service } from '@ember/service';
* Controller for managing notifications.
*/
export default class NotificationsController extends Controller {
+ /**
+ * Inject the `socket` service
+ *
+ * @memberof NotificationsController
+ */
@service socket;
+
+ /**
+ * Inject the `store` service
+ *
+ * @memberof NotificationsController
+ */
@service store;
+
+ /**
+ * Inject the `fetch` service
+ *
+ * @memberof NotificationsController
+ */
@service fetch;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @memberof NotificationsController
+ */
@service notifications;
+
+ /**
+ * Inject the `universe` service
+ *
+ * @memberof NotificationsController
+ */
@service universe;
+
+ /**
+ * Inject the `router` service
+ *
+ * @memberof NotificationsController
+ */
@service router;
/**
@@ -51,6 +86,10 @@ export default class NotificationsController extends Controller {
*/
@tracked selected = [];
+ /**
+ * Creates an instance of NotificationsController.
+ * @memberof NotificationsController
+ */
constructor() {
super(...arguments);
@@ -63,9 +102,9 @@ export default class NotificationsController extends Controller {
/**
* Action to select or deselect a notification.
*
- * @param {Object} notification - The notification to select or deselect.
+ * @param {NotificationModel} notification - The notification to select or deselect.
+ * @memberof NotificationsController
*/
-
@action selectNotification(notification) {
if (this.selected.includes(notification)) {
this.selected.removeObject(notification);
@@ -76,6 +115,8 @@ export default class NotificationsController extends Controller {
/**
* Action to delete selected notifications.
+ *
+ * @memberof NotificationsController
*/
@action delete() {
return this.fetch
@@ -96,6 +137,8 @@ export default class NotificationsController extends Controller {
/**
* Action to mark selected notifications as read.
+ *
+ * @memberof NotificationsController
*/
@action read() {
const unreadSelectedNotifications = this.selected.filter((notification) => notification.unread);
@@ -118,6 +161,8 @@ export default class NotificationsController extends Controller {
/**
* Action to select all notifications.
+ *
+ * @memberof NotificationsController
*/
@action selectAll() {
if (this.selected.length === this.model.length) {
@@ -127,6 +172,13 @@ export default class NotificationsController extends Controller {
}
}
+ /**
+ * Action to mark a notification as read.
+ *
+ * @param {NotificationModel} notification
+ * @return {Promise}
+ * @memberof NotificationsController
+ */
@action markNotificationAsRead(notification) {
return notification.markAsRead().then(() => {
this.notifications.info('Notification marked as read.');
diff --git a/console/app/controllers/console/settings.js b/console/app/controllers/console/settings.js
index a7684b58..c4c6de16 100644
--- a/console/app/controllers/console/settings.js
+++ b/console/app/controllers/console/settings.js
@@ -2,5 +2,10 @@ import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default class ConsoleSettingsController extends Controller {
+ /**
+ * INject the `universe` service
+ *
+ * @memberof ConsoleSettingsController
+ */
@service universe;
}
diff --git a/console/app/templates/console/admin/branding.hbs b/console/app/templates/console/admin/branding.hbs
index a4aae904..2a1a385c 100644
--- a/console/app/templates/console/admin/branding.hbs
+++ b/console/app/templates/console/admin/branding.hbs
@@ -1,5 +1,7 @@
{{page-title "Branding"}}
-<Layout::Section::Header @title="Branding" />
+<Layout::Section::Header @title="Branding">
+ <Button @type="primary" @size="sm" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</Layout::Section::Header>
<Layout::Section::Body class="overflow-y-scroll h-full">
<div class="container mx-auto h-screen" {{increase-height-by 300}}>
@@ -59,10 +61,6 @@
</InputGroup>
</form>
</ContentPanel>
-
- <div class="mt-3 flex items-center justify-end">
- <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
- </div>
</div>
</div>
</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/notifications.hbs b/console/app/templates/console/admin/notifications.hbs
index fefabba8..26b8dd8e 100644
--- a/console/app/templates/console/admin/notifications.hbs
+++ b/console/app/templates/console/admin/notifications.hbs
@@ -1,11 +1,13 @@
{{page-title "Notifications"}}
-<Layout::Section::Header @title="Notifications" />
+<Layout::Section::Header @title="Notifications">
+ <Button @type="primary" @size="sm" @icon="save" @text="Save Changes" @onClick={{this.saveSettings}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</Layout::Section::Header>
<Layout::Section::Body class="overflow-y-scroll h-full">
<div class="container mx-auto h-screen" {{increase-height-by 1200}}>
- <div class="max-w-3xl my-10 mx-auto">
+ <div class="max-w-3xl my-10 mx-auto space-y-4">
{{#each-in this.groupedNotifications as |groupName notifications|}}
- <ContentPanel @title={{concat (humanize groupName) " Notification Settings"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <ContentPanel @title={{concat (smart-humanize groupName) " Notification Settings"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
{{#each notifications as |notification|}}
<InputGroup @name={{notification.name}} @helpText={{notification.description}}>
<div class="fleetbase-model-select fleetbase-power-select ember-model-select">
@@ -25,9 +27,6 @@
{{/each}}
</ContentPanel>
{{/each-in}}
- <div class="mt-3 flex items-center justify-end">
- <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.saveSettings}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
- </div>
</div>
</div>
</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/router.map.js b/console/router.map.js
index fa627d8f..c659921d 100644
--- a/console/router.map.js
+++ b/console/router.map.js
@@ -42,6 +42,7 @@ Router.map(function () {
this.route('socket');
});
this.route('branding');
+ this.route('notifications');
this.route('virtual', { path: '/:slug/:view' });
});
});