Skip to content

Commit

Permalink
♻️ admin: Add PixIcon in admin menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mcampourcy committed Nov 7, 2024
1 parent 2bba683 commit d3ae756
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 14 deletions.
4 changes: 2 additions & 2 deletions admin/app/components/layout/menu-bar/entry.gjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import PixTooltip from '@1024pix/pix-ui/components/pix-tooltip';
import { LinkTo } from '@ember/routing';
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
import PixIcon from "@1024pix/pix-ui/components/pix-icon";

<template>
<li class="menu-bar__entry">
<PixTooltip @position="right" ...attributes>
<:triggerElement>
<LinkTo @route={{@path}}>
<FaIcon @icon={{@icon}} @title={{@title}} />
<PixIcon @name={{@icon}} @title={{@title}} @plainIcon={{true}} />
</LinkTo>
</:triggerElement>
<:tooltip>{{@title}}</:tooltip>
Expand Down
51 changes: 39 additions & 12 deletions admin/app/components/layout/menu-bar/index.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,77 @@ export default class MenuBar extends Component {
return this.session.invalidate();
}

// "building" buildings
// "user" infoUser
// "map-pin" mapPin
// "chalkboard-user" eventDate
// "graduation-cap" newRelease
// "stamp" extension
// "clipboard-list" assignment
// "signs-post" signpost
// "users" users
// "book-open" book
// "screwdriver-wrench" tools
// "crown" shieldPerson
// "power-off" power

// building location_city buildings
// user contact_page infoUser
// map-pin location_on mapPin
// Chalkboard-teacher event_note eventDate
// graduation-cap new_releases newRealease
// stamp extension extension
// clipboard-list assignment assignment
// map-signs signpost signpost
// book-open menu_book book
// tools construction tools
// crown shield_person shieldPerson
// Power-off power_settings_new power

<template>
<nav class="menu-bar" aria-label={{t "components.layout.menu-bar.label"}}>
<ul>
<MenuBarEntry
@path="authenticated.organizations"
@icon="building"
@icon="buildings"
@title={{t "components.layout.menu-bar.entries.organizations"}}
/>
<MenuBarEntry
@path="authenticated.users"
@icon="user"
@icon="infoUser"
@title={{t "components.layout.menu-bar.entries.users"}}
/>
<MenuBarEntry
@path="authenticated.certification-centers"
@icon="map-pin"
@icon="mapPin"
@title={{t "components.layout.menu-bar.entries.certification-centers"}}
@inline={{true}}
/>
<MenuBarEntry
@path="authenticated.sessions"
@icon="chalkboard-user"
@icon="session"
@title={{t "components.layout.menu-bar.entries.sessions"}}
@inline={{true}}
/>

{{#if this.accessControl.hasAccessToCertificationActionsScope}}
<MenuBarEntry
@path="authenticated.certifications"
@icon="graduation-cap"
@icon="newRealease"
@title={{t "components.layout.menu-bar.entries.certifications"}}
@inline={{true}}
/>
{{/if}}
<MenuBarEntry
@path="authenticated.complementary-certifications"
@icon="stamp"
@icon="extension"
@title={{t "components.layout.menu-bar.entries.complementary-certifications"}}
@inline={{true}}
/>
{{#if this.accessControl.hasAccessToTargetProfilesActionsScope}}
<MenuBarEntry
@path="authenticated.target-profiles"
@icon="clipboard-list"
@icon="assignment"
@title={{t "components.layout.menu-bar.entries.target-profiles"}}
@inline={{true}}
/>
Expand All @@ -74,7 +101,7 @@ export default class MenuBar extends Component {
}}
<MenuBarEntry
@path="authenticated.autonomous-courses"
@icon="signs-post"
@icon="signpost"
@title={{t "components.layout.menu-bar.entries.autonomous-courses"}}
/>
{{/if}}
Expand All @@ -89,26 +116,26 @@ export default class MenuBar extends Component {
{{#if this.accessControl.hasAccessToTrainings}}
<MenuBarEntry
@path="authenticated.trainings"
@icon="book-open"
@icon="book"
@title={{t "components.layout.menu-bar.entries.trainings"}}
/>
{{/if}}
{{#if (or this.currentUser.adminMember.isSuperAdmin this.currentUser.adminMember.isMetier)}}
<MenuBarEntry
@path="authenticated.tools"
@icon="screwdriver-wrench"
@icon="tools"
@title={{t "components.layout.menu-bar.entries.tools"}}
/>
{{/if}}
{{#if this.currentUser.adminMember.isSuperAdmin}}
<MenuBarEntry
@path="authenticated.administration"
@icon="crown"
@icon="shieldPerson"
@title={{t "components.layout.menu-bar.entries.administration"}}
/>
{{/if}}

<MenuBarEntry @path="logout" @icon="power-off" @title={{t "components.layout.menu-bar.entries.logout"}} />
<MenuBarEntry @path="logout" @icon="power" @title={{t "components.layout.menu-bar.entries.logout"}} />
</ul>
</nav>
</template>
Expand Down

0 comments on commit d3ae756

Please sign in to comment.