|
1 | 1 | import PixPagination from '@1024pix/pix-ui/components/pix-pagination'; |
| 2 | +import PixTable from '@1024pix/pix-ui/components/pix-table'; |
| 3 | +import PixTableColumn from '@1024pix/pix-ui/components/pix-table-column'; |
2 | 4 | import { LinkTo } from '@ember/routing'; |
3 | 5 | import Component from '@glimmer/component'; |
| 6 | +import { t } from 'ember-intl'; |
4 | 7 |
|
5 | | -import CertificationInfoPublished from './info-published'; |
6 | 8 | import CertificationStatus from './status'; |
7 | | - |
8 | 9 | export default class CertificationsHeader extends Component { |
9 | 10 | get sortedCertificationJurySummaries() { |
10 | 11 | return this.args.juryCertificationSummaries.sortBy('numberOfCertificationIssueReportsWithRequiredAction').reverse(); |
11 | 12 | } |
12 | 13 |
|
13 | 14 | <template> |
14 | | - <div class="table-admin"> |
15 | | - <table> |
16 | | - <thead> |
17 | | - <tr> |
18 | | - <th class="table__column table__column--id">ID</th> |
19 | | - <th>Prénom</th> |
20 | | - <th>Nom</th> |
21 | | - <th>Statut</th> |
22 | | - <th>Signalements impactants non résolus</th> |
23 | | - {{#if @displayHasSeenEndTestScreenColumn}} |
24 | | - <th>Ecran de fin de test vu</th> |
25 | | - {{/if}} |
26 | | - <th>Autre certification</th> |
27 | | - <th>Score</th> |
28 | | - <th>Début</th> |
29 | | - <th>Fin</th> |
30 | | - <th>Publiée</th> |
31 | | - </tr> |
32 | | - </thead> |
33 | | - |
34 | | - {{#if @juryCertificationSummaries}} |
35 | | - <tbody> |
36 | | - {{#each this.sortedCertificationJurySummaries as |certification|}} |
37 | | - <tr aria-label="Certifications de {{certification.firstName certification.LastName}}"> |
38 | | - <td class="table__column table__column--id"> |
39 | | - <LinkTo @route="authenticated.certifications.certification.informations" @model={{certification.id}}> |
40 | | - {{certification.id}} |
41 | | - </LinkTo> |
42 | | - </td> |
43 | | - <td>{{certification.firstName}}</td> |
44 | | - <td>{{certification.lastName}}</td> |
45 | | - <td> |
46 | | - <CertificationStatus @record={{certification}} /> |
47 | | - </td> |
48 | | - <td |
49 | | - class="certification-list-page__cell--important" |
50 | | - >{{certification.numberOfCertificationIssueReportsWithRequiredActionLabel}}</td> |
51 | | - {{#if @displayHasSeenEndTestScreenColumn}} |
52 | | - <td class="certification-list-page__cell--important">{{certification.hasSeenEndTestScreenLabel}}</td> |
53 | | - {{/if}} |
54 | | - <td>{{certification.complementaryCertificationTakenLabel}}</td> |
55 | | - <td>{{certification.pixScore}}</td> |
56 | | - <td>{{certification.creationDate}}</td> |
57 | | - <td>{{certification.completionDate}}</td> |
58 | | - <td> |
59 | | - <CertificationInfoPublished @record={{certification}} /> |
60 | | - </td> |
61 | | - </tr> |
62 | | - {{/each}} |
63 | | - </tbody> |
64 | | - {{/if}} |
65 | | - </table> |
66 | | - </div> |
67 | | - |
68 | 15 | {{#if @juryCertificationSummaries}} |
| 16 | + <PixTable |
| 17 | + @variant="primary" |
| 18 | + @data={{this.sortedCertificationJurySummaries}} |
| 19 | + @caption={{t "pages.certifications.table.caption"}} |
| 20 | + > |
| 21 | + <:columns as |certification context|> |
| 22 | + <PixTableColumn @context={{context}}> |
| 23 | + <:header> |
| 24 | + {{t "pages.certifications.table.headers.id"}} |
| 25 | + </:header> |
| 26 | + <:cell> |
| 27 | + <LinkTo @route="authenticated.certifications.certification.informations" @model={{certification.id}}> |
| 28 | + {{certification.id}} |
| 29 | + </LinkTo> |
| 30 | + </:cell> |
| 31 | + </PixTableColumn> |
| 32 | + <PixTableColumn @context={{context}}> |
| 33 | + <:header> |
| 34 | + {{t "pages.certifications.table.headers.first-name"}} |
| 35 | + </:header> |
| 36 | + <:cell> |
| 37 | + {{certification.firstName}} |
| 38 | + </:cell> |
| 39 | + </PixTableColumn> |
| 40 | + <PixTableColumn @context={{context}}> |
| 41 | + <:header> |
| 42 | + {{t "pages.certifications.table.headers.last-name"}} |
| 43 | + </:header> |
| 44 | + <:cell> |
| 45 | + {{certification.lastName}} |
| 46 | + </:cell> |
| 47 | + </PixTableColumn> |
| 48 | + <PixTableColumn @context={{context}}> |
| 49 | + <:header> |
| 50 | + {{t "pages.certifications.table.headers.status"}} |
| 51 | + </:header> |
| 52 | + <:cell> |
| 53 | + <CertificationStatus @record={{certification}} /> |
| 54 | + </:cell> |
| 55 | + </PixTableColumn> |
| 56 | + <PixTableColumn @context={{context}}> |
| 57 | + <:header> |
| 58 | + {{t "pages.certifications.table.headers.unresolved-reports"}} |
| 59 | + </:header> |
| 60 | + <:cell> |
| 61 | + {{certification.numberOfCertificationIssueReportsWithRequiredActionLabel}} |
| 62 | + </:cell> |
| 63 | + </PixTableColumn> |
| 64 | + {{#if @displayHasSeenEndTestScreenColumn}} |
| 65 | + <PixTableColumn @context={{context}}> |
| 66 | + <:header> |
| 67 | + Ecran de fin de test vu |
| 68 | + </:header> |
| 69 | + <:cell> |
| 70 | + {{certification.hasSeenEndTestScreenLabel}} |
| 71 | + </:cell> |
| 72 | + </PixTableColumn> |
| 73 | + {{/if}} |
| 74 | + <PixTableColumn @context={{context}}> |
| 75 | + <:header> |
| 76 | + {{t "pages.certifications.table.headers.other-certification"}} |
| 77 | + </:header> |
| 78 | + <:cell> |
| 79 | + {{certification.complementaryCertificationTakenLabel}} |
| 80 | + </:cell> |
| 81 | + </PixTableColumn> |
| 82 | + <PixTableColumn @context={{context}}> |
| 83 | + <:header> |
| 84 | + {{t "pages.certifications.table.headers.pix-score"}} |
| 85 | + </:header> |
| 86 | + <:cell> |
| 87 | + {{certification.pixScore}} |
| 88 | + </:cell> |
| 89 | + </PixTableColumn> |
| 90 | + <PixTableColumn @context={{context}}> |
| 91 | + <:header> |
| 92 | + {{t "pages.certifications.table.headers.started-certification-date"}} |
| 93 | + </:header> |
| 94 | + <:cell> |
| 95 | + {{certification.creationDate}} |
| 96 | + </:cell> |
| 97 | + </PixTableColumn> |
| 98 | + <PixTableColumn @context={{context}}> |
| 99 | + <:header> |
| 100 | + {{t "pages.certifications.table.headers.finished-certification-date"}} |
| 101 | + </:header> |
| 102 | + <:cell> |
| 103 | + {{certification.completionDate}} |
| 104 | + </:cell> |
| 105 | + </PixTableColumn> |
| 106 | + </:columns> |
| 107 | + </PixTable> |
| 108 | + |
69 | 109 | <PixPagination @pagination={{@pagination}} /> |
| 110 | + {{else}} |
| 111 | + <p class="certification-list-page__empty">{{t "common.tables.empty-result"}}</p> |
70 | 112 | {{/if}} |
71 | 113 | </template> |
72 | 114 | } |
0 commit comments