Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIIKUNTA-582, LIIKUNTA-585 | feat: add hierarchical menus & universal bar menu support to Navigation #138

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

karisal-anders
Copy link
Contributor

@karisal-anders karisal-anders commented Nov 18, 2023

Description

feat: add hierarchical menus & universal bar menu support to Navigation

Navigation:

  • add support for hierarchical menus
  • add support for universal bar menu
    • the universal bar menu is shown on the top of the header at least
      when using a wide screen
  • remove deprecated variant property

queries:

  • add parentId to menu query to fetch hierarchy of menus

mocks:

  • make navigation mock menu hierarchical
    • this hierarchical menu can be seen in storybook's ArchiveSearchPage
  • add mock for universal bar menu

packages:

  • add crypto-browserify as development dependency to fix running
    storybook
    • crypto is being used by hds-react since HDS v3
  • set version to 1.0.0-alpha230

refs LIIKUNTA-582

Issues

Closes

Related

LIIKUNTA-582
LIIKUNTA-585

Testing

In PR review environments (if they are working):

Locally:

  • Check out this PR's branch
  • yarn
  • yarn storybook

Automated tests

Manual testing

Screenshots

image

Additional notes

Published as canary build [email protected] to npm

@karisal-anders karisal-anders changed the title LIIKUNTA-582 | feat: add hierarchical menus & universal bar menu support to Navigation LIIKUNTA-582, LIIKUNTA-585 | feat: add hierarchical menus & universal bar menu support to Navigation Nov 18, 2023
@karisal-anders karisal-anders force-pushed the LIIKUNTA-582-extend-header-menus branch 2 times, most recently from 3cab750 to aa71ea3 Compare November 18, 2023 15:00
karisal-anders added a commit to City-of-Helsinki/events-helsinki-monorepo that referenced this pull request Nov 18, 2023
uses canary build of HCRC from
City-of-Helsinki/react-helsinki-headless-cms#138

refs LIIKUNTA-582 (add support for hierarchical menus in header)
refs LIIKUNTA-585 (add support for universal bar menu in header)
karisal-anders added a commit to City-of-Helsinki/events-helsinki-monorepo that referenced this pull request Nov 20, 2023
uses canary build of HCRC from
City-of-Helsinki/react-helsinki-headless-cms#138

refs LIIKUNTA-582 (add support for hierarchical menus in header)
refs LIIKUNTA-585 (add support for universal bar menu in header)
};

const LOGO_ARIA_LABELS = {
const CITY_OF_HELSINKI_TRANSLATIONS = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add those though hcrc config, in copy section we have translations

Copy link
Contributor Author

@karisal-anders karisal-anders Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to config:

  • LOGO_ARIA_LABELS/CITY_OF_HELSINKI_TRANSLATIONS -> config.translations.cityOfHelsinki

EN: 'City of Helsinki',
FI: 'Helsingin kaupunki',
SV: 'Helsingfors stad',
} as const satisfies Record<LanguageCodeEnum, string>;

const LOGO_LABELS = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add those though hcrc config, in copy section we have translations

Copy link
Contributor Author

@karisal-anders karisal-anders Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to config:

  • LOGO_LABELS -> config.translations.helsinki

};

const localizedCityOfHelsinki =
CITY_OF_HELSINKI_TRANSLATIONS[currentLanguageCode];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when translations are added though the config we dont need this code anymore

Copy link
Contributor Author

@karisal-anders karisal-anders Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to config:

  • CITY_OF_HELSINKI_TRANSLATIONS -> config.translations.cityOfHelsinki

Copy link
Contributor

@melniiv melniiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, if translations are fixed

@karisal-anders karisal-anders force-pushed the LIIKUNTA-582-extend-header-menus branch 3 times, most recently from c8571d2 to 41b8c9d Compare November 21, 2023 07:10
Navigation:
 - add support for hierarchical menus
 - add support for universal bar menu
   - the universal bar menu is shown on the top of the header at least
     when using a wide screen
 - remove deprecated variant property

queries:
 - add parentId to menu query to fetch hierarchy of menus

mocks:
 - make navigation mock menu hierarchical
   - this hierarchical menu can be seen in storybook's ArchiveSearchPage
 - add mock for universal bar menu

packages:
 - add crypto-browserify as development dependency to fix running
   storybook
   - crypto is being used by hds-react since HDS v3
 - set version to 1.0.0-alpha230

refs LIIKUNTA-582
@karisal-anders karisal-anders force-pushed the LIIKUNTA-582-extend-header-menus branch from 41b8c9d to 39d5f3e Compare November 21, 2023 09:06
@karisal-anders karisal-anders merged commit 2609d15 into main Nov 21, 2023
1 check passed
@karisal-anders karisal-anders deleted the LIIKUNTA-582-extend-header-menus branch November 21, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants