-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Iris Benoit <iris.benoit@pix.fr> Co-authored-by: Laura Bergoens <laura.bergoens@pix.fr>
- Loading branch information
1 parent
0574964
commit 617d627
Showing
14 changed files
with
279 additions
and
22 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
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
132 changes: 132 additions & 0 deletions
132
pix-editor/app/components/competence-overview/challenges-production.gjs
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,132 @@ | ||
import Component from '@glimmer/component'; | ||
import PixTag from '@1024pix/pix-ui/components/pix-tag'; | ||
import PixIconButton from '@1024pix/pix-ui/components/pix-icon-button'; | ||
import PixButton from '@1024pix/pix-ui/components/pix-button'; | ||
import PixTable from '@1024pix/pix-ui/components/pix-table'; | ||
import PixTableColumn from '@1024pix/pix-ui/components/pix-table-column'; | ||
import PixCheckbox from '@1024pix/pix-ui/components/pix-checkbox'; | ||
|
||
export default class ChallengesProduction extends Component { | ||
get challenges() { | ||
return this.args.challenges; | ||
} | ||
|
||
<template> | ||
<section class="challenges-production"> | ||
<header class="challenges-production__header"> | ||
<p> | ||
{{@skill.name}} | ||
<PixTag @color="success"> | ||
actif | ||
</PixTag> | ||
<span class="separator"></span> | ||
V{{@skill.version}} | ||
</p> | ||
<div class="challenges-production-header__action-buttons"> | ||
<PixButton | ||
class="challenges-production-header__create-decli-button" | ||
> | ||
Créer une déclinaison | ||
</PixButton> | ||
<PixIconButton | ||
class="challenges-production-header__button-icon" | ||
@ariaLabel="Agrandir la liste des épreuves" | ||
@iconName="check" | ||
/> | ||
<span class="separator"></span> | ||
<PixIconButton | ||
class="challenges-production-header__button-icon" | ||
@ariaLabel="Fermer la liste des épreuves" | ||
@iconName="close" | ||
/> | ||
</div> | ||
</header> | ||
<div class="challenges-production--table"> | ||
<div class="display-actions"> | ||
<PixCheckbox | ||
@size="small" | ||
> | ||
<:label>Afficher les épreuves périmées</:label> | ||
</PixCheckbox> | ||
<p>Mode double écran</p> | ||
</div> | ||
<PixTable @data={{this.challenges}}> | ||
<:columns as |challenge context|> | ||
<PixTableColumn @context={{context}}> | ||
<:header> | ||
Version | ||
</:header> | ||
<:cell> | ||
{{#if challenge.isPrototype}} | ||
Proto | ||
{{else}} | ||
{{challenge.alternativeVersion}} | ||
{{/if}} | ||
</:cell> | ||
</PixTableColumn> | ||
<PixTableColumn @context={{context}}> | ||
<:header> | ||
Consigne | ||
</:header> | ||
<:cell> | ||
{{challenge.instruction}} | ||
</:cell> | ||
</PixTableColumn> | ||
<PixTableColumn @context={{context}}> | ||
<:header> | ||
Dernière MAJ | ||
</:header> | ||
<:cell> | ||
{{challenge.updatedAt}} | ||
</:cell> | ||
</PixTableColumn> | ||
<PixTableColumn @context={{context}}> | ||
<:header> | ||
Auteur | ||
</:header> | ||
<:cell> | ||
{{challenge.author}} | ||
</:cell> | ||
</PixTableColumn> | ||
<PixTableColumn @context={{context}}> | ||
<:header> | ||
Statut | ||
</:header> | ||
<:cell> | ||
<PixTag @color="success"> | ||
{{challenge.status}} | ||
</PixTag> | ||
</:cell> | ||
</PixTableColumn> | ||
<PixTableColumn @context={{context}}> | ||
<:header> | ||
Locale | ||
</:header> | ||
<:cell> | ||
{{#each challenge.locales as |locale|}} | ||
{{locale}} | ||
{{/each}} | ||
</:cell> | ||
</PixTableColumn> | ||
<PixTableColumn @context={{context}}> | ||
<:header> | ||
Actions | ||
</:header> | ||
<:cell> | ||
<PixIconButton | ||
@ariaLabel="Prévisualiser l'épreuve {{challenge.id}}" | ||
@iconName="eye" | ||
/> | ||
<PixIconButton | ||
@ariaLabel="Copier le lien de l'épreuve {{challenge.id}}" | ||
@iconName="copy" | ||
/> | ||
</:cell> | ||
</PixTableColumn> | ||
</:columns> | ||
</PixTable> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
pix-editor/app/routes/authenticated/v2/competence-overview/challenges.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class SkillRoute extends Route { | ||
|
||
@service router; | ||
@service store; | ||
|
||
async model(params) { | ||
const challenges = await this.store.findAll('challenge', { adapterOptions: { skillId: params.skill_id } }); | ||
const skill = await this.store.findRecord('skill', params.skill_id, { adapterOptions: { withPixId: true } }); | ||
|
||
return { challenges, skill }; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.v2-main { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
background-color: var(--pix-neutral-20); | ||
} |
49 changes: 49 additions & 0 deletions
49
pix-editor/app/styles/components/challenges-production.scss
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,49 @@ | ||
.challenges-production { | ||
|
||
&__header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
color: var(--pix-neutral-0); | ||
background-color: var(--pix-neutral-900); | ||
padding: var(--pix-spacing-2x) var(--pix-spacing-6x); | ||
|
||
p { | ||
display: flex; | ||
gap: var(--pix-spacing-2x); | ||
} | ||
|
||
.separator { | ||
height: 24px; | ||
width: 1px; | ||
border-right: solid 1px var(--pix-neutral-0); | ||
} | ||
} | ||
|
||
&--table { | ||
padding: var(--pix-spacing-6x) var(--pix-spacing-8x); | ||
} | ||
|
||
.display-actions { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-bottom: var(--pix-spacing-4x); | ||
} | ||
|
||
.challenges-production-header { | ||
|
||
&__action-buttons { | ||
display: flex; | ||
align-items:center; | ||
gap: var(--pix-spacing-2x); | ||
} | ||
|
||
&__button-icon { | ||
color: var(--pix-neutral-0); | ||
|
||
&:hover { | ||
background-color: rgba(var(--pix-neutral-500-inline), 0.5); | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
@competenceOverview={{this.model.competenceOverview}} | ||
@locale={{this.model.locale}} | ||
/> | ||
{{outlet}} |
4 changes: 4 additions & 0 deletions
4
pix-editor/app/templates/authenticated/v2/competence-overview/challenges.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<CompetenceOverview::ChallengesProduction | ||
@skill={{this.model.skill}} | ||
@challenges={{this.model.challenges}} | ||
/> |
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