-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ORGA] Afficher le décompte des places dans le header de l'application (
- Loading branch information
Showing
19 changed files
with
507 additions
and
169 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
orga/app/components/layout/organization-places-or-credit-info.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,44 @@ | ||
import PixTooltip from '@1024pix/pix-ui/components/pix-tooltip'; | ||
import { service } from '@ember/service'; | ||
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon'; | ||
import Component from '@glimmer/component'; | ||
import { t } from 'ember-intl'; | ||
import { eq } from 'ember-truth-helpers'; | ||
|
||
export default class OrganizationPlacesOrCreditInfo extends Component { | ||
@service currentUser; | ||
|
||
get canShowCredit() { | ||
return this.currentUser.isAdminInOrganization && this.currentUser.organization.credit > 0; | ||
} | ||
|
||
<template> | ||
{{#if this.currentUser.prescriber.placesManagement}} | ||
<div class="organization-places-or-credit-info hide-on-mobile"> | ||
{{#if (eq @placesCount 0)}} | ||
<span class="organization-places-or-credit-info__warning"> | ||
<FaIcon @icon="triangle-exclamation" class="warning-icon" /> | ||
{{t "navigation.places.number" count=@placesCount}}</span> | ||
{{else}} | ||
<span>{{t "navigation.places.number" count=@placesCount}}</span> | ||
{{/if}} | ||
{{#if this.currentUser.isAdminInOrganization}} | ||
<a href="/places" class="organization-places-or-credit-info__link">{{t "navigation.places.link"}}</a> | ||
{{/if}} | ||
</div> | ||
{{else if this.canShowCredit}} | ||
<div class="organization-places-or-credit-info hide-on-mobile"> | ||
<span>{{t "navigation.credits.number" count=this.currentUser.organization.credit}}</span> | ||
|
||
<PixTooltip @id="credit-info-tooltip" @position="bottom-left" @isWide={{true}} @isLight={{true}}> | ||
<:triggerElement> | ||
<FaIcon @icon="circle-info" class="info-icon" tabindex="0" aria-describedby="credit-info-tooltip" /> | ||
</:triggerElement> | ||
<:tooltip> | ||
{{t "navigation.credits.tooltip-text" htmlSafe=true}} | ||
</:tooltip> | ||
</PixTooltip> | ||
</div> | ||
{{/if}} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<div class="topbar"> | ||
<div class="topbar__organization-credit-info hide-on-mobile"> | ||
<Layout::OrganizationCreditInfo /> | ||
</div> | ||
<Layout::OrganizationPlacesOrCreditInfo @placesCount={{@placesCount}} /> | ||
<Layout::UserLoggedMenu class="topbar__user-logged-menu" /> | ||
</div> |
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
16 changes: 0 additions & 16 deletions
16
orga/app/styles/components/layout/organization-credit-info.scss
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
orga/app/styles/components/layout/organization-places-or-credit-info.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,30 @@ | ||
.organization-places-or-credit-info { | ||
@extend %pix-body-s; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
padding: 0 30px; | ||
color: var(--pix-neutral-900); | ||
font-weight: var(--pix-font-bold); | ||
|
||
&__warning { | ||
color: var(--pix-error-700); | ||
font-weight: var(--pix-font-medium); | ||
} | ||
|
||
&__link { | ||
color: var(--pix-neutral-500); | ||
font-weight: var(--pix-font-medium); | ||
text-decoration: underline; | ||
} | ||
|
||
.info-icon { | ||
margin: 0 8px; | ||
color: var(--pix-neutral-100); | ||
} | ||
|
||
.warning-icon { | ||
margin: 0 var(--pix-spacing-1x); | ||
color: var(--pix-error-700); | ||
} | ||
} |
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
78 changes: 0 additions & 78 deletions
78
orga/tests/integration/components/layout/organization-credit-info_test.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.