Skip to content

Commit

Permalink
feat(orga): add description on statistics page
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Hardouin <[email protected]>
  • Loading branch information
Alexandre-Monney committed Dec 16, 2024
1 parent 70c5490 commit 547b431
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 15 deletions.
8 changes: 7 additions & 1 deletion orga/app/components/statistics/index.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ export default class Statistics extends Component {
{{this.extractedDate}}</span>
</div>

<section class="statistics-page__info">
<p class="statistics-page-info__paragraph">
{{t "pages.statistics.description" htmlSafe="true"}}
</p>
</section>

<section class="statistics-page__filter">
<PixSelect
@onChange={{this.handleDomainFilter}}
Expand All @@ -109,7 +115,7 @@ export default class Statistics extends Component {
}}</PixButton>
</section>

<section class="statistics-page__section">
<section class="statistics-page__cover-rate">
<table class="panel">
<caption class="screen-reader-only">{{t "pages.statistics.table.caption"}}</caption>
<thead>
Expand Down
45 changes: 32 additions & 13 deletions orga/app/styles/components/statistics.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
.statistics-page__header {
display: flex;
gap: var(--pix-spacing-2x);
align-items: baseline;
margin-bottom: var(--pix-spacing-8x);
}
.statistics-page{
&__header {
display: flex;
gap: var(--pix-spacing-2x);
align-items: baseline;
margin-bottom: var(--pix-spacing-8x);
}

.statistics-page-header__date {
@extend %pix-body-xs;
}
&-header__date {
@extend %pix-body-xs;
}

&__section {
tbody > tr {
&:nth-child(odd) {
background-color: var(--pix-neutral-20);
}
}
}

&__info {
margin-bottom: var(--pix-spacing-8x);
}

&-info__paragraph {
@extend %pix-body-m;

}

.statistics-page__section {
tbody > tr {
&:nth-child(odd) {
background-color: var(--pix-neutral-20);
&__cover-rate {
tbody > tr {
&:nth-child(odd) {
background-color: var(--pix-neutral-20);
}
}
}
}
Expand Down
15 changes: 14 additions & 1 deletion orga/tests/integration/components/statistics/index-test.gjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clickByName, render } from '@1024pix/ember-testing-library';
import { clickByName, getByTextWithHtml, render } from '@1024pix/ember-testing-library';
import Service from '@ember/service';
import { click } from '@ember/test-helpers';
import dayjs from 'dayjs';
Expand Down Expand Up @@ -75,6 +75,19 @@ module('Integration | Component | Statistics | Index', function (hooks) {
assert.ok(screen.getByRole('cell', { name: t('pages.statistics.level.novice') }));
});

test('it should display table description', async function (assert) {
//given
const model = {
data: [],
};

//when
await render(<template><Statistics @model={{model}} /></template>);

//then
assert.ok(getByTextWithHtml(t('pages.statistics.description')));
});

module('pagination', function () {
test('should have pagination on page', async function (assert) {
//given
Expand Down
1 change: 1 addition & 0 deletions orga/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@
"statistics": {
"title": "Statistics",
"before-date": "on",
"description": "The table below shows how your participants are positioned by subject.'<br>' Positioning reflects the average level of your participants in relation to the maximum level they could have reached.'<br>' This data takes into account all participations shared as part of your organisation's evaluation campaigns that have not been deleted.",
"gauge": {
"label": "On the topic, your participants achieved a level of {userLevel} out of a maximum reachable level of {tubeLevel}."
},
Expand Down
1 change: 1 addition & 0 deletions orga/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,7 @@
"statistics": {
"title": "Statistiques",
"before-date": "au",
"description": "Le tableau ci-dessous vous permet de visualiser le positionnement de vos participants par sujet.'<br>' Le positionnement rend compte du niveau moyen de vos participants sur le niveau maximum qu’ils auraient pu atteindre.'<br>' Ces données tiennent compte de toutes les participations partagées dans le cadre des campagnes d’évaluation non supprimées de votre organisation.",
"gauge": {
"label": "Sur le sujet vos participants ont obtenu un niveau de {userLevel} sur un niveau maximum atteignable de {tubeLevel}."
},
Expand Down
1 change: 1 addition & 0 deletions orga/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,7 @@
"select-label": "Domein",
"title": "Statistieken",
"before-date": "op",
"description": "De tabel hieronder laat zien hoe je deelnemers per onderwerp zijn gepositioneerd.'<br>' Positionering geeft het gemiddelde niveau van je deelnemers weer ten opzichte van het maximale niveau dat ze hadden kunnen bereiken.'<br>' Deze gegevens houden rekening met alle deelnames die zijn gedeeld als onderdeel van de evaluatiecampagnes van je organisatie en die niet zijn verwijderd.",
"gauge": {
"label": "Je deelnemers behaalden een {userLevel} op een maximaal haalbaar niveau van {tubeLevel}."
},
Expand Down

0 comments on commit 547b431

Please sign in to comment.