-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TECH] Monter la version d'ember-source orga en V6 (PIX-15770)
- Loading branch information
Showing
17 changed files
with
111 additions
and
839 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import PixProgressBar from '@1024pix/pix-ui/components/pix-progress-bar'; | ||
import { t } from 'ember-intl'; | ||
|
||
import multiply from '../../../helpers/multiply'; | ||
import TableHeader from '../../table/header'; | ||
|
||
function sortedCompetenceResults(results) { | ||
return results.sort((a, b) => { | ||
return a.index.localeCompare(b.index); | ||
}); | ||
} | ||
|
||
function displayResults(results) { | ||
return results.length > 0; | ||
} | ||
|
||
function competenceCount(results) { | ||
return results.length; | ||
} | ||
|
||
<template> | ||
<section class="panel panel--light-shadow participant-results__details"> | ||
<h3 class="screen-reader-only">{{t "pages.assessment-individual-results.table.title"}}</h3> | ||
|
||
<table class="content-text content-text--small"> | ||
<thead> | ||
<tr> | ||
<TableHeader @size="wide">{{t | ||
"pages.assessment-individual-results.table.column.competences" | ||
count=(competenceCount @results) | ||
}}</TableHeader> | ||
<TableHeader @size="wide">{{t "pages.assessment-individual-results.table.column.results.label"}}</TableHeader> | ||
</tr> | ||
</thead> | ||
|
||
{{#if (displayResults @results)}} | ||
<tbody> | ||
{{#each (sortedCompetenceResults @results) as |competenceResult|}} | ||
<tr aria-label={{t "pages.assessment-individual-results.table.row-title"}}> | ||
<td class="competences-col__name"> | ||
<span class="competences-col__border competences-col__border--{{competenceResult.areaColor}}"></span> | ||
<span> | ||
{{competenceResult.name}} | ||
</span> | ||
</td> | ||
<td class="competences-col__gauge"> | ||
<PixProgressBar | ||
@value={{multiply competenceResult.competenceMasteryRate 100}} | ||
@tooltipText={{t | ||
"pages.assessment-individual-results.table.column.results.tooltip" | ||
result=competenceResult.competenceMasteryRate | ||
competence=competenceResult.name | ||
htmlSafe=true | ||
}} | ||
/> | ||
</td> | ||
</tr> | ||
{{/each}} | ||
</tbody> | ||
{{/if}} | ||
</table> | ||
|
||
{{#unless (displayResults @results)}} | ||
<p class="table__empty content-text">{{t "pages.assessment-individual-results.table.empty"}}</p> | ||
{{/unless}} | ||
</section> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
orga/app/routes/authenticated/campaigns/participant-assessment/results.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default class ResultsRoute extends Route { | ||
model() { | ||
async model() { | ||
const { campaignAssessmentParticipation } = this.modelFor('authenticated.campaigns.participant-assessment'); | ||
return campaignAssessmentParticipation; | ||
const campaignAssessmentParticipationResult = | ||
await campaignAssessmentParticipation.campaignAssessmentParticipationResult; | ||
const competenceResults = await campaignAssessmentParticipationResult.competenceResults; | ||
|
||
return competenceResults.slice(0); | ||
} | ||
} |
6 changes: 1 addition & 5 deletions
6
orga/app/templates/authenticated/campaigns/participant-assessment/results.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{{page-title this.pageTitle}} | ||
|
||
<Participant::Assessment::Results | ||
@results={{@model.campaignAssessmentParticipationResult}} | ||
@displayResults={{gt @model.campaignAssessmentParticipationResult.sortedCompetenceResults.length 0}} | ||
@class="participant-results" | ||
/> | ||
<Participant::Assessment::Results @results={{@model}} @class="participant-results" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.