Skip to content

Commit b921926

Browse files
committed
✨ certif: use PixTable on competences list
1 parent 1b8fa8a commit b921926

File tree

1 file changed

+37
-22
lines changed

1 file changed

+37
-22
lines changed

admin/app/components/certifications/competence-list.gjs

+37-22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import PixTable from '@1024pix/pix-ui/components/pix-table';
2+
import PixTableColumn from '@1024pix/pix-ui/components/pix-table-column';
13
import { concat, fn, get } from '@ember/helper';
24
import { on } from '@ember/modifier';
35
import { action } from '@ember/object';
@@ -82,28 +84,41 @@ export default class CertificationCompetenceList extends Component {
8284
</div>
8385
{{/each}}
8486
{{else}}
85-
<table aria-label="{{t 'pages.certifications.certification.result.table.label'}}" class="table-admin">
86-
<thead>
87-
<tr>
88-
<th scope="col">{{t "pages.certifications.certification.result.table.headers.competence"}}</th>
89-
{{#if @shouldDisplayPixScore}}
90-
<th scope="col">{{t "pages.certifications.certification.result.table.headers.score"}}</th>
91-
{{/if}}
92-
<th scope="col">{{t "pages.certifications.certification.result.table.headers.level"}}</th>
93-
</tr>
94-
</thead>
95-
<tbody>
96-
{{#each @competences as |competence|}}
97-
<tr>
98-
<th scope="row">{{competence.index}}</th>
99-
{{#if @shouldDisplayPixScore}}
100-
<td>{{competence.score}}</td>
101-
{{/if}}
102-
<td>{{competence.level}}</td>
103-
</tr>
104-
{{/each}}
105-
</tbody>
106-
</table>
87+
<PixTable
88+
class="certification-details-v3-table"
89+
@variant="primary"
90+
@caption={{t "pages.certifications.certification.result.table.label"}}
91+
@data={{@competences}}
92+
>
93+
<:columns as |competence context|>
94+
<PixTableColumn @context={{context}}>
95+
<:header>
96+
{{t "pages.certifications.certification.result.table.headers.competence"}}
97+
</:header>
98+
<:cell>
99+
{{competence.index}}
100+
</:cell>
101+
</PixTableColumn>
102+
{{#if @shouldDisplayPixScore}}
103+
<PixTableColumn @context={{context}}>
104+
<:header>
105+
{{t "pages.certifications.certification.result.table.headers.score"}}
106+
</:header>
107+
<:cell>
108+
{{competence.score}}
109+
</:cell>
110+
</PixTableColumn>
111+
{{/if}}
112+
<PixTableColumn @context={{context}}>
113+
<:header>
114+
{{t "pages.certifications.certification.result.table.headers.level"}}
115+
</:header>
116+
<:cell>
117+
{{competence.level}}
118+
</:cell>
119+
</PixTableColumn>
120+
</:columns>
121+
</PixTable>
107122
{{/if}}
108123
</template>
109124
}

0 commit comments

Comments
 (0)