Skip to content

Commit be1665f

Browse files
committed
tech(orga): implem banner inside layout
1 parent b79f127 commit be1665f

File tree

6 files changed

+44
-31
lines changed

6 files changed

+44
-31
lines changed

Diff for: orga/app/components/banner/communication.gjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function bannerContent() {
1919

2020
<template>
2121
{{#if (isEnabled)}}
22-
<PixBannerAlert @type={{(bannerType)}} class="sticker-banner">
22+
<PixBannerAlert @type={{(bannerType)}}>
2323
{{textWithMultipleLang (bannerContent)}}
2424
</PixBannerAlert>
2525
{{/if}}

Diff for: orga/app/controllers/authenticated.js renamed to orga/app/controllers/application.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import Controller from '@ember/controller';
22
import { action } from '@ember/object';
33
import { service } from '@ember/service';
44

5-
export default class AuthenticatedController extends Controller {
6-
@service currentUser;
7-
@service store;
5+
export default class ApplicationController extends Controller {
6+
@service router;
7+
8+
get isAuthenticatedRoute() {
9+
return this.router.currentRouteName.startsWith('authenticated.');
10+
}
811

912
@action
1013
onChangeOrganization() {

Diff for: orga/app/styles/pages/authenticated.scss

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
.sticker-banner {
2-
position: sticky;
3-
top: 0;
4-
z-index: 200;
1+
.unauthenticated-page {
2+
& > .pix-app-layout__main, .pix-app-layout__footer, .pix-app-layout__navigation {
3+
padding: 0;
4+
}
5+
6+
& > .pix-app-layout__main {
7+
max-width: 100%;
8+
}
59
}
610

Diff for: orga/app/templates/application.hbs

+23-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,26 @@
44
<meta name="description" content={{t "application.description"}} />
55
{{/in-element}}
66

7-
<Banner::Communication />
8-
<Banner::InformationBanners @banners={{this.model.informationBanner.banners}} />
9-
10-
{{outlet}}
7+
<PixAppLayout @variant="orga" class="{{unless this.isAuthenticatedRoute 'unauthenticated-page'}}">
8+
<:banner>
9+
<Banner::Communication />
10+
<Banner::InformationBanners @banners={{this.model.informationBanner.banners}} />
11+
</:banner>
12+
<:navigation>
13+
{{#if this.isAuthenticatedRoute}}
14+
<Layout::Sidebar
15+
@placesCount={{this.model.placeStatistics.available}}
16+
@onChangeOrganization={{this.onChangeOrganization}}
17+
/>
18+
{{/if}}
19+
</:navigation>
20+
<:main>
21+
{{outlet}}
22+
</:main>
23+
<:footer>
24+
{{#if this.isAuthenticatedRoute}}
25+
<Layout::Footer />
26+
{{/if}}
27+
</:footer>
28+
</PixAppLayout>
29+
<NotificationContainer @position="bottom-right" />

Diff for: orga/app/templates/authenticated.hbs

+4-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
<PixAppLayout @variant="orga" class="app">
2-
<:navigation>
3-
4-
<Layout::Sidebar @placesCount={{@model.available}} @onChangeOrganization={{this.onChangeOrganization}} />
5-
</:navigation>
6-
<:main>
7-
8-
<main class="main-content__body page">
9-
<Banner::TopBanners />
10-
{{outlet}}
11-
</main>
12-
</:main>
13-
<:footer>
14-
<Layout::Footer />
15-
</:footer>
16-
</PixAppLayout>
17-
<NotificationContainer @position="bottom-right" />
1+
<main class="main-content__body page">
2+
<Banner::TopBanners />
3+
{{outlet}}
4+
</main>

Diff for: orga/tests/unit/controllers/authenticated-test.js renamed to orga/tests/unit/controllers/application-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { setupTest } from 'ember-qunit';
22
import { module, test } from 'qunit';
33
import sinon from 'sinon';
44

5-
module('Unit | Controller | authenticated', function (hooks) {
5+
module('Unit | Controller | application', function (hooks) {
66
setupTest(hooks);
77

88
test('should call send method', async function (assert) {
99
// given
10-
const controller = this.owner.lookup('controller:authenticated');
10+
const controller = this.owner.lookup('controller:application');
1111
controller.send = sinon.stub();
1212

1313
// when

0 commit comments

Comments
 (0)