Skip to content

Commit

Permalink
small improvements to ux
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Aug 30, 2024
1 parent 3402302 commit d97b767
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 17 deletions.
16 changes: 16 additions & 0 deletions addon/routes/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class ApplicationRoute extends Route {
@service notifications;
@service hostRouter;
@service abilities;
@service intl;

beforeModel() {
if (this.abilities.cannot('developers see extension')) {
this.notifications.warning(this.intl.t('common.unauthorized-access'));
return this.hostRouter.transitionTo('console');
}
}
}
10 changes: 5 additions & 5 deletions addon/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<EmberWormhole @to="sidebar-menu-items">
<Layout::Sidebar::Panel @open={{true}} @title={{t "developers.application.sidebar.title"}}>
<Layout::Sidebar::Item @route="console.developers.home" @icon="home">{{t "developers.application.sidebar.items.home"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.api-keys" @icon="key" @permission="developers list api-key">{{t "developers.application.sidebar.items.api-keys"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.webhooks" @icon="globe-asia">{{t "developers.application.sidebar.items.webhooks"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.sockets" @icon="plug">{{t "developers.application.sidebar.items.websockets"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.logs" @icon="file-lines">{{t "developers.application.sidebar.items.logs"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.events" @icon="calendar-day">{{t "developers.application.sidebar.items.events"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.api-keys" @icon="key" @permission="developers list api-key" @visible={{can "developers see api-key"}}>{{t "developers.application.sidebar.items.api-keys"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.webhooks" @icon="globe-asia" @permission="developers list webhook" @visible={{can "developers see webhook"}}>{{t "developers.application.sidebar.items.webhooks"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.sockets" @icon="plug" @permission="developers list socket" @visible={{can "developers see socket"}}>{{t "developers.application.sidebar.items.websockets"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.logs" @icon="file-lines" @permission="developers list log" @visible={{can "developers see log"}}>{{t "developers.application.sidebar.items.logs"}}</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.developers.events" @icon="calendar-day" @permission="developers list event" @visible={{can "developers see event"}}>{{t "developers.application.sidebar.items.events"}}</Layout::Sidebar::Item>
</Layout::Sidebar::Panel>

</EmberWormhole>
Expand Down
1 change: 1 addition & 0 deletions app/routes/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@fleetbase/dev-engine/routes/application';
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
},
"dependencies": {
"@babel/core": "^7.23.2",
"@fleetbase/ember-core": "^0.2.16",
"@fleetbase/ember-ui": "^0.2.22",
"@fleetbase/ember-core": "^0.2.17",
"@fleetbase/ember-ui": "^0.2.24",
"@fortawesome/ember-fontawesome": "^2.0.0",
"@fortawesome/fontawesome-svg-core": "6.4.0",
"@fortawesome/free-brands-svg-icons": "6.4.0",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions tests/unit/routes/application-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'dummy/tests/helpers';

module('Unit | Route | application', function (hooks) {
setupTest(hooks);

test('it exists', function (assert) {
let route = this.owner.lookup('route:application');
assert.ok(route);
});
});

0 comments on commit d97b767

Please sign in to comment.