From e4d0affc42389c0706e9b03e832216e11ff666ae Mon Sep 17 00:00:00 2001 From: Xavier Carron <33637571+xav-car@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:09:26 +0100 Subject: [PATCH] feat(orga): add pix navigation --- .../support/step_definitions/login-logout.js | 1 - .../organization-places-or-credit-info.gjs | 16 +- orga/app/components/layout/sidebar.hbs | 102 ++++------ orga/app/components/layout/sidebar.js | 11 ++ .../components/layout/user-logged-menu.hbs | 45 ++--- .../app/components/layout/user-logged-menu.js | 25 +-- orga/app/styles/app.scss | 1 - .../organization-places-or-credit-info.scss | 18 +- .../app/styles/components/layout/sidebar.scss | 1 + orga/app/styles/globals/pages.scss | 15 -- orga/app/styles/pages/authenticated.scss | 28 --- orga/app/templates/authenticated.hbs | 23 +-- orga/app/templates/login.hbs | 2 +- orga/public/pix-orga-color.svg | 50 +++++ orga/public/pix-orga.svg | 67 ++----- orga/tests/acceptance/authentication-test.js | 20 +- .../acceptance/campaign-creation-test.js | 1 - .../acceptance/switch-organization-test.js | 73 ++++--- ...rganization-places-or-credit-info_test.gjs | 1 - .../components/layout/sidebar-test.js | 3 +- .../layout/user-logged-menu-test.js | 186 +++++++++++------- .../unit/components/user-logged-menu-test.js | 22 --- orga/translations/en.json | 3 +- orga/translations/fr.json | 3 +- orga/translations/nl.json | 3 +- 25 files changed, 338 insertions(+), 382 deletions(-) delete mode 100644 orga/app/styles/globals/pages.scss create mode 100644 orga/public/pix-orga-color.svg diff --git a/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js b/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js index 3c2d80d987c..0fd01e3e7fe 100644 --- a/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js +++ b/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js @@ -85,7 +85,6 @@ When(`je me déconnecte`, () => { }); When(`je me déconnecte de Pix Orga`, () => { - cy.get('[aria-label="Ouvrir le menu utilisateur"]').click(); cy.contains("Se déconnecter").click(); }); diff --git a/orga/app/components/layout/organization-places-or-credit-info.gjs b/orga/app/components/layout/organization-places-or-credit-info.gjs index 7907c7c9362..f554778f3d9 100644 --- a/orga/app/components/layout/organization-places-or-credit-info.gjs +++ b/orga/app/components/layout/organization-places-or-credit-info.gjs @@ -1,6 +1,5 @@ import PixIcon from '@1024pix/pix-ui/components/pix-icon'; import PixTooltip from '@1024pix/pix-ui/components/pix-tooltip'; -import { LinkTo } from '@ember/routing'; import { service } from '@ember/service'; import Component from '@glimmer/component'; import { t } from 'ember-intl'; @@ -10,12 +9,14 @@ export default class OrganizationPlacesOrCreditInfo extends Component { @service currentUser; get canShowCredit() { - return this.currentUser.isAdminInOrganization && this.currentUser.organization.credit > 0; + const canShow = this.currentUser.isAdminInOrganization && this.currentUser.organization.credit > 0; + this.args.onCanShowCredit?.(canShow); + return canShow; }