diff --git a/admin/app/components/certifications/header.gjs b/admin/app/components/certifications/header.gjs new file mode 100644 index 00000000000..02710a05752 --- /dev/null +++ b/admin/app/components/certifications/header.gjs @@ -0,0 +1,51 @@ +import PixButton from '@1024pix/pix-ui/components/pix-button'; +import PixTooltip from '@1024pix/pix-ui/components/pix-tooltip'; +import { service } from '@ember/service'; + +export default class CertificationsHeader extends Component { + @service accessControl; + + get canPublish() { + return ( + !this.args.juryCertificationSummaries.some( + (certification) => certification.status === 'error' && !certification.isCancelled, + ) && this.args.session.isFinalized + ); + } + + +} diff --git a/admin/app/templates/authenticated/sessions/session/certifications.hbs b/admin/app/templates/authenticated/sessions/session/certifications.hbs index 12172ce3599..7cc3f210b93 100644 --- a/admin/app/templates/authenticated/sessions/session/certifications.hbs +++ b/admin/app/templates/authenticated/sessions/session/certifications.hbs @@ -3,40 +3,11 @@
-
-

Certifications

- {{#if this.accessControl.hasAccessToCertificationActionsScope}} -
- - {{#if this.model.session.isPublished}} - Dépublier la session - {{else}} - - {{#if this.canPublish}} - Publier la session - {{else}} - - - <:triggerElement> - - Publier la session - - - <:tooltip> - Vous ne pouvez pas publier la session tant qu'elle n'est pas finalisée ou qu'il reste des - certifications en erreur. - - - {{/if}} - - {{/if}} -
- {{/if}} -
- + +
\ No newline at end of file +/>