Skip to content

Commit 3c937f8

Browse files
[TECH] Migration de PixAdmin / Composants communs et layout (PIX-15221)
#10494
2 parents ac6c681 + 1f95481 commit 3c937f8

File tree

9 files changed

+61
-60
lines changed

9 files changed

+61
-60
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
1+
import PixIcon from '@1024pix/pix-ui/components/pix-icon';
22
import Component from '@glimmer/component';
33

44
export default class TickOrCross extends Component {
55
get icon() {
6-
return this.args.isTrue ? 'check' : 'times';
6+
return this.args.isTrue ? 'check' : 'close';
77
}
88

99
get class() {
1010
return this.args.isTrue ? 'tick-or-cross--valid' : 'tick-or-cross--invalid';
1111
}
12-
<template><FaIcon @icon={{this.icon}} class="tick-or-cross {{this.class}}" /></template>
12+
<template><PixIcon @name={{this.icon}} class="tick-or-cross {{this.class}}" /></template>
1313
}

admin/app/components/common/tubes-details/tube.gjs

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
1+
import PixIcon from '@1024pix/pix-ui/components/pix-icon';
22
import Component from '@glimmer/component';
33
import { tracked } from '@glimmer/tracking';
44

@@ -17,6 +17,14 @@ export default class Tube extends Component {
1717
}
1818
}
1919

20+
get mobileIcon() {
21+
return this.args.mobile ? 'mobile' : 'mobileOff';
22+
}
23+
24+
get tabletIcon() {
25+
return this.args.tablet ? 'tablet' : 'tabletOff';
26+
}
27+
2028
<template>
2129
<td data-testid="title-{{@id}}">
2230
{{@title}}
@@ -42,20 +50,14 @@ export default class Tube extends Component {
4250
aria-label="{{if @mobile 'compatible mobile' 'incompatible mobile'}}"
4351
data-testid="mobile-compliant-{{@id}}"
4452
>
45-
<FaIcon @icon="mobile-screen-button" class="fa-2x {{if @mobile 'is-responsive'}}" />
46-
{{#unless @mobile}}
47-
<FaIcon @icon="slash" class="fa-2x not-responsive" />
48-
{{/unless}}
53+
<PixIcon @name={{this.mobileIcon}} @plainIcon={{true}} class="{{if @mobile 'is-responsive'}}" />
4954
</div>
5055
<div
5156
class="icon-container"
5257
aria-label="{{if @tablet 'compatible tablette' 'incompatible tablette'}}"
5358
data-testid="tablet-compliant-{{@id}}"
5459
>
55-
<FaIcon @icon="tablet-screen-button" class="fa-2x {{if @tablet 'is-responsive'}}" />
56-
{{#unless @tablet}}
57-
<FaIcon @icon="slash" class="fa-2x not-responsive" />
58-
{{/unless}}
60+
<PixIcon @name={{this.tabletIcon}} @plainIcon={{true}} class="{{if @mobile 'is-responsive'}}" />
5961
</div>
6062
</td>
6163
{{/if}}

admin/app/components/common/tubes-selection/tube.gjs

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import PixCheckbox from '@1024pix/pix-ui/components/pix-checkbox';
2+
import PixIcon from '@1024pix/pix-ui/components/pix-icon';
23
import PixSelect from '@1024pix/pix-ui/components/pix-select';
34
import { on } from '@ember/modifier';
45
import { action } from '@ember/object';
5-
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
66
import Component from '@glimmer/component';
77
import { tracked } from '@glimmer/tracking';
88

@@ -47,6 +47,14 @@ export default class Tube extends Component {
4747
return this.state === 'checked';
4848
}
4949

50+
get mobileIcon() {
51+
return this.args.tube.mobile ? 'mobile' : 'mobileOff';
52+
}
53+
54+
get tabletIcon() {
55+
return this.args.tube.tablet ? 'tablet' : 'tabletOff';
56+
}
57+
5058
@action
5159
onChange(event) {
5260
if (event.target.checked) {
@@ -102,16 +110,10 @@ export default class Tube extends Component {
102110
{{#if @displayDeviceCompatibility}}
103111
<td class="table__column--center">
104112
<div class="icon-container" aria-label="{{if @tube.mobile 'compatible mobile' 'incompatible mobile'}}">
105-
<FaIcon @icon="mobile-screen-button" class="fa-2x {{if @tube.mobile 'is-responsive'}}" />
106-
{{#unless @tube.mobile}}
107-
<FaIcon @icon="slash" class="fa-2x not-responsive" />
108-
{{/unless}}
113+
<PixIcon @name={{this.mobileIcon}} @plainIcon={{true}} class="{{if @tube.mobile 'is-responsive'}}" />
109114
</div>
110115
<div class="icon-container" aria-label="{{if @tube.tablet 'compatible tablette' 'incompatible tablette'}}">
111-
<FaIcon @icon="tablet-screen-button" class="fa-2x {{if @tube.tablet 'is-responsive'}}" />
112-
{{#unless @tube.tablet}}
113-
<FaIcon @icon="slash" class="fa-2x not-responsive" />
114-
{{/unless}}
116+
<PixIcon @name={{this.tabletIcon}} @plainIcon={{true}} class="{{if @tube.tablet 'is-responsive'}}" />
115117
</div>
116118
</td>
117119
{{/if}}

admin/app/components/layout/breadcrumb.gjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import PixIcon from '@1024pix/pix-ui/components/pix-icon';
12
import { LinkTo } from '@ember/routing';
23
import { service } from '@ember/service';
3-
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
44
import Component from '@glimmer/component';
55

66
export default class Breadcrumb extends Component {
@@ -46,7 +46,7 @@ export default class Breadcrumb extends Component {
4646
<li>
4747
<LinkTo @route={{crumb.path}}>{{crumb.label}}</LinkTo>
4848
</li>
49-
<FaIcon @icon="chevron-right" />
49+
<PixIcon @name="chevronRight" />
5050
{{else}}
5151
<li>
5252
<h1>{{crumb.label}}</h1>

admin/app/components/layout/menu-bar/entry.gjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import PixIcon from '@1024pix/pix-ui/components/pix-icon';
12
import PixTooltip from '@1024pix/pix-ui/components/pix-tooltip';
23
import { LinkTo } from '@ember/routing';
3-
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
44

55
<template>
66
<li class="menu-bar__entry">
77
<PixTooltip @position="right" ...attributes>
88
<:triggerElement>
99
<LinkTo @route={{@path}}>
10-
<FaIcon @icon={{@icon}} @title={{@title}} />
10+
<PixIcon @name={{@icon}} @title={{@title}} @plainIcon={{true}} />
1111
</LinkTo>
1212
</:triggerElement>
1313
<:tooltip>{{@title}}</:tooltip>

admin/app/components/layout/menu-bar/index.gjs

+12-12
Original file line numberDiff line numberDiff line change
@@ -21,45 +21,45 @@ export default class MenuBar extends Component {
2121
<ul>
2222
<MenuBarEntry
2323
@path="authenticated.organizations"
24-
@icon="building"
24+
@icon="buildings"
2525
@title={{t "components.layout.menu-bar.entries.organizations"}}
2626
/>
2727
<MenuBarEntry
2828
@path="authenticated.users"
29-
@icon="user"
29+
@icon="infoUser"
3030
@title={{t "components.layout.menu-bar.entries.users"}}
3131
/>
3232
<MenuBarEntry
3333
@path="authenticated.certification-centers"
34-
@icon="map-pin"
34+
@icon="mapPin"
3535
@title={{t "components.layout.menu-bar.entries.certification-centers"}}
3636
@inline={{true}}
3737
/>
3838
<MenuBarEntry
3939
@path="authenticated.sessions"
40-
@icon="chalkboard-user"
40+
@icon="session"
4141
@title={{t "components.layout.menu-bar.entries.sessions"}}
4242
@inline={{true}}
4343
/>
4444

4545
{{#if this.accessControl.hasAccessToCertificationActionsScope}}
4646
<MenuBarEntry
4747
@path="authenticated.certifications"
48-
@icon="graduation-cap"
48+
@icon="newRealease"
4949
@title={{t "components.layout.menu-bar.entries.certifications"}}
5050
@inline={{true}}
5151
/>
5252
{{/if}}
5353
<MenuBarEntry
5454
@path="authenticated.complementary-certifications"
55-
@icon="stamp"
55+
@icon="extension"
5656
@title={{t "components.layout.menu-bar.entries.complementary-certifications"}}
5757
@inline={{true}}
5858
/>
5959
{{#if this.accessControl.hasAccessToTargetProfilesActionsScope}}
6060
<MenuBarEntry
6161
@path="authenticated.target-profiles"
62-
@icon="clipboard-list"
62+
@icon="assignment"
6363
@title={{t "components.layout.menu-bar.entries.target-profiles"}}
6464
@inline={{true}}
6565
/>
@@ -74,7 +74,7 @@ export default class MenuBar extends Component {
7474
}}
7575
<MenuBarEntry
7676
@path="authenticated.autonomous-courses"
77-
@icon="signs-post"
77+
@icon="signpost"
7878
@title={{t "components.layout.menu-bar.entries.autonomous-courses"}}
7979
/>
8080
{{/if}}
@@ -89,26 +89,26 @@ export default class MenuBar extends Component {
8989
{{#if this.accessControl.hasAccessToTrainings}}
9090
<MenuBarEntry
9191
@path="authenticated.trainings"
92-
@icon="book-open"
92+
@icon="book"
9393
@title={{t "components.layout.menu-bar.entries.trainings"}}
9494
/>
9595
{{/if}}
9696
{{#if (or this.currentUser.adminMember.isSuperAdmin this.currentUser.adminMember.isMetier)}}
9797
<MenuBarEntry
9898
@path="authenticated.tools"
99-
@icon="screwdriver-wrench"
99+
@icon="tools"
100100
@title={{t "components.layout.menu-bar.entries.tools"}}
101101
/>
102102
{{/if}}
103103
{{#if this.currentUser.adminMember.isSuperAdmin}}
104104
<MenuBarEntry
105105
@path="authenticated.administration"
106-
@icon="crown"
106+
@icon="shieldPerson"
107107
@title={{t "components.layout.menu-bar.entries.administration"}}
108108
/>
109109
{{/if}}
110110

111-
<MenuBarEntry @path="logout" @icon="power-off" @title={{t "components.layout.menu-bar.entries.logout"}} />
111+
<MenuBarEntry @path="logout" @icon="power" @title={{t "components.layout.menu-bar.entries.logout"}} />
112112
</ul>
113113
</nav>
114114
</template>

admin/app/styles/components/common/tubes-selection.scss

+5-8
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,13 @@
4444
}
4545

4646
.select-tube-table {
47-
.is-responsive {
48-
color: var(--pix-success-700);
47+
.icon-container > svg {
48+
width: 1.8rem;
49+
height: 1.8rem;
4950
}
5051

51-
.not-responsive {
52-
position: absolute;
53-
top: 50%;
54-
left: 50%;
55-
color: var(--pix-error-700);
56-
transform: translate(-50%, -50%);
52+
.is-responsive {
53+
color: var(--pix-success-700);
5754
}
5855

5956
table {

admin/app/styles/components/layout/breadcrumb.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212

1313
> svg {
14-
width: 0.45rem;
14+
width: 1.2rem;
1515
margin: 0 0.4rem;
1616
}
1717
}

admin/app/styles/components/layout/menu-bar.scss

+14-14
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@
1313
padding: 0 15px;
1414

1515
a {
16-
position: relative;
17-
display: block;
16+
display: flex;
17+
align-items: center;
1818
width: 50px;
19-
padding: 0;
20-
color: var(--pix-neutral-100);
21-
font-size: 1.25rem;
22-
line-height: 50px;
23-
text-align: center;
19+
height: 50px;
2420
border-radius: 5px;
2521
cursor: pointer;
2622

27-
i.fa {
28-
width: 32px;
29-
margin: 0 10px;
30-
}
31-
3223
&:hover {
33-
color: var(--pix-neutral-0);
3424
text-decoration: none;
3525
}
3626

3727
&.active {
38-
color: var(--pix-neutral-0);
3928
font-weight: 600;
4029
background-color: var(--pix-neutral-500);
4130
}
31+
32+
svg {
33+
width: 32px;
34+
margin: 0 10px;
35+
fill: var(--pix-neutral-100);
36+
}
37+
38+
&:hover svg,
39+
&.active svg {
40+
fill: var(--pix-neutral-0);
41+
}
4242
}
4343
}
4444
}

0 commit comments

Comments
 (0)