-
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.
- Loading branch information
Showing
2 changed files
with
57 additions
and
35 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,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 | ||
); | ||
} | ||
|
||
<template> | ||
<header class="certification-list-page__header"> | ||
<h2>Certifications</h2> | ||
{{#if this.accessControl.hasAccessToCertificationActionsScope}} | ||
<div class="btn-group" role="group"> | ||
|
||
{{#if @session.isPublished}} | ||
<PixButton @triggerAction={{this.displayCertificationStatusUpdateConfirmationModal}}>Dépublier la session</PixButton> | ||
{{else}} | ||
|
||
{{#if this.canPublish}} | ||
<PixButton @triggerAction={{this.displayCertificationStatusUpdateConfirmationModal}}>Publier la session</PixButton> | ||
{{else}} | ||
|
||
<PixTooltip @position="left" @isWide={{true}}> | ||
<:triggerElement> | ||
<PixButton | ||
@triggerAction={{this.displayCertificationStatusUpdateConfirmationModal}} | ||
@isDisabled={{true}} | ||
> | ||
Publier la session | ||
</PixButton> | ||
</:triggerElement> | ||
<:tooltip> | ||
Vous ne pouvez pas publier la session tant qu'elle n'est pas finalisée ou qu'il reste des | ||
certifications en erreur. | ||
</:tooltip> | ||
</PixTooltip> | ||
{{/if}} | ||
|
||
{{/if}} | ||
</div> | ||
{{/if}} | ||
</header> | ||
</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