@dhis2-ui/header-bar 9.5.0-alpha.1 → 9.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/build/cjs/__e2e__/stories/common.js +10 -199
  2. package/build/cjs/__e2e__/stories/modulesWithSpecialCharacters.js +204 -0
  3. package/build/cjs/features/common/index.js +3 -3
  4. package/build/cjs/features/the_headerbar_can_display_online_status/the_headerbar_displays_online_status.js +21 -23
  5. package/build/cjs/features/the_headerbar_conditionally_renders_notification_icons/the_headerbar_conditionally_renders_notification_icons.js +10 -10
  6. package/build/cjs/features/the_headerbar_contains_a_menu_to_all_apps/common.js +2 -2
  7. package/build/cjs/features/the_headerbar_contains_a_menu_to_all_apps/the_app_menu_closes_when_the_user_clicks_outside.js +3 -5
  8. package/build/cjs/features/the_headerbar_contains_a_menu_to_all_apps/the_headerbar_contains_a_menu_icon.js +2 -4
  9. package/build/cjs/features/the_headerbar_contains_a_menu_to_all_apps/the_user_will_be_offered_a_menu_with_5_apps.js +4 -4
  10. package/build/cjs/features/the_headerbar_contains_a_profile_menu/common.js +3 -3
  11. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_headerbar_shows_a_text_icon_if_the_user_does_not_have_an_avatar.js +5 -7
  12. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_headerbar_shows_an_image_icon_if_the_user_has_an_avatar.js +5 -5
  13. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_menu_is_closed_by_default.js +2 -3
  14. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_menu_opens.js +3 -5
  15. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_profile_menu_closes_when_the_user_clicks_outside.js +2 -4
  16. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_can_edit_his_profile.js +2 -4
  17. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_his_account.js +2 -4
  18. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_the_about_dhis2_page.js +2 -4
  19. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_the_help_page.js +2 -4
  20. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_the_settings.js +2 -4
  21. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_can_log_out.js +7 -7
  22. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +3 -5
  23. package/build/cjs/features/the_headerbar_displays_a_link_to_interpretations_and_an_unread_count/the_headerbar_displays_a_link_to_the_interpretations.js +2 -4
  24. package/build/cjs/features/the_headerbar_displays_a_link_to_interpretations_and_an_unread_count/there_are_no_unread_interpretations.js +3 -5
  25. package/build/cjs/features/the_headerbar_displays_a_link_to_interpretations_and_an_unread_count/there_are_some_unread_interpretations.js +2 -4
  26. package/build/cjs/features/the_headerbar_displays_a_link_to_messages_and_an_unread_count/the_headerbar_displays_a_link_to_the_messages.js +2 -4
  27. package/build/cjs/features/the_headerbar_displays_a_link_to_messages_and_an_unread_count/there_are_no_unread_messages.js +3 -5
  28. package/build/cjs/features/the_headerbar_displays_a_link_to_messages_and_an_unread_count/there_are_some_unread_messages.js +2 -4
  29. package/build/cjs/features/the_headerbar_should_contain_a_logo_that_links_to_the_homepage/headerbar_contains_logo.js +3 -3
  30. package/build/cjs/features/the_headerbar_should_display_app_update_notification/index.js +11 -11
  31. package/build/cjs/features/the_headerbar_should_display_debug_version_infos/index.js +20 -20
  32. package/build/cjs/features/the_headerbar_should_display_the_title_provided_by_the_backend_and_the_app/the_headerbar_displays_the_custom_title.js +3 -3
  33. package/build/cjs/features/the_search_should_escape_regexp_character/common.js +2 -2
  34. package/build/cjs/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +3 -5
  35. package/build/cjs/features/the_search_should_escape_regexp_character/the_user_searches_for_an_app_with_a_regex_character.js +5 -7
  36. package/build/cjs/locales/en/translations.json +4 -1
  37. package/build/cjs/locales/lo/translations.json +11 -11
  38. package/build/cjs/notification-icon.js +9 -1
  39. package/build/cjs/notifications.js +8 -8
  40. package/build/cjs/profile.js +6 -2
  41. package/build/es/__e2e__/stories/common.js +1 -197
  42. package/build/es/__e2e__/stories/modulesWithSpecialCharacters.js +197 -0
  43. package/build/es/features/common/index.js +1 -1
  44. package/build/es/features/the_headerbar_can_display_online_status/the_headerbar_displays_online_status.js +4 -5
  45. package/build/es/features/the_headerbar_conditionally_renders_notification_icons/the_headerbar_conditionally_renders_notification_icons.js +1 -1
  46. package/build/es/features/the_headerbar_contains_a_menu_to_all_apps/common.js +1 -1
  47. package/build/es/features/the_headerbar_contains_a_menu_to_all_apps/the_app_menu_closes_when_the_user_clicks_outside.js +1 -2
  48. package/build/es/features/the_headerbar_contains_a_menu_to_all_apps/the_headerbar_contains_a_menu_icon.js +1 -2
  49. package/build/es/features/the_headerbar_contains_a_menu_to_all_apps/the_user_will_be_offered_a_menu_with_5_apps.js +1 -1
  50. package/build/es/features/the_headerbar_contains_a_profile_menu/common.js +1 -1
  51. package/build/es/features/the_headerbar_contains_a_profile_menu/the_headerbar_shows_a_text_icon_if_the_user_does_not_have_an_avatar.js +1 -2
  52. package/build/es/features/the_headerbar_contains_a_profile_menu/the_headerbar_shows_an_image_icon_if_the_user_has_an_avatar.js +1 -1
  53. package/build/es/features/the_headerbar_contains_a_profile_menu/the_menu_is_closed_by_default.js +1 -1
  54. package/build/es/features/the_headerbar_contains_a_profile_menu/the_menu_opens.js +1 -2
  55. package/build/es/features/the_headerbar_contains_a_profile_menu/the_profile_menu_closes_when_the_user_clicks_outside.js +1 -2
  56. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_can_edit_his_profile.js +1 -2
  57. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_his_account.js +1 -2
  58. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_the_about_dhis2_page.js +1 -2
  59. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_the_help_page.js +1 -2
  60. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_can_go_to_the_settings.js +1 -2
  61. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_can_log_out.js +3 -3
  62. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +1 -2
  63. package/build/es/features/the_headerbar_displays_a_link_to_interpretations_and_an_unread_count/the_headerbar_displays_a_link_to_the_interpretations.js +1 -2
  64. package/build/es/features/the_headerbar_displays_a_link_to_interpretations_and_an_unread_count/there_are_no_unread_interpretations.js +1 -2
  65. package/build/es/features/the_headerbar_displays_a_link_to_interpretations_and_an_unread_count/there_are_some_unread_interpretations.js +1 -2
  66. package/build/es/features/the_headerbar_displays_a_link_to_messages_and_an_unread_count/the_headerbar_displays_a_link_to_the_messages.js +1 -2
  67. package/build/es/features/the_headerbar_displays_a_link_to_messages_and_an_unread_count/there_are_no_unread_messages.js +1 -2
  68. package/build/es/features/the_headerbar_displays_a_link_to_messages_and_an_unread_count/there_are_some_unread_messages.js +1 -2
  69. package/build/es/features/the_headerbar_should_contain_a_logo_that_links_to_the_homepage/headerbar_contains_logo.js +1 -1
  70. package/build/es/features/the_headerbar_should_display_app_update_notification/index.js +1 -1
  71. package/build/es/features/the_headerbar_should_display_debug_version_infos/index.js +1 -1
  72. package/build/es/features/the_headerbar_should_display_the_title_provided_by_the_backend_and_the_app/the_headerbar_displays_the_custom_title.js +1 -1
  73. package/build/es/features/the_search_should_escape_regexp_character/common.js +1 -1
  74. package/build/es/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +1 -2
  75. package/build/es/features/the_search_should_escape_regexp_character/the_user_searches_for_an_app_with_a_regex_character.js +2 -3
  76. package/build/es/locales/en/translations.json +4 -1
  77. package/build/es/locales/lo/translations.json +11 -11
  78. package/build/es/notification-icon.js +8 -1
  79. package/build/es/notifications.js +7 -8
  80. package/build/es/profile.js +3 -0
  81. package/package.json +15 -15
  82. package/build/cjs/features/the_headerbar_contains_a_menu_to_all_apps/the_menu_is_closed_by_default.js +0 -11
  83. package/build/es/features/the_headerbar_contains_a_menu_to_all_apps/the_menu_is_closed_by_default.js +0 -6
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { When } from 'cypress-cucumber-preprocessor/steps';
1
+ import { When } from '@badeball/cypress-cucumber-preprocessor';
3
2
  When('the user clicks outside of the menu', () => {
4
3
  cy.get('[data-test="headerbar-title"]').click();
5
4
  });
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('contains a link to edit the profile', () => {
4
3
  cy.get('[data-test="headerbar-profile-edit-profile-link"]').should('be.visible');
5
4
  });
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('contains a link to the user account', () => {
4
3
  cy.get('[data-test="headerbar-profile-menu"] > li').should(lis => {
5
4
  expect(lis.eq(1)).to.be.visible;
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('contains a link to the About DHIS2 page', () => {
4
3
  cy.get('[data-test="headerbar-profile-menu"] > li').should(lis => {
5
4
  expect(lis.eq(3)).to.be.visible;
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('contains a link to the help page', () => {
4
3
  cy.get('[data-test="headerbar-profile-menu"] > li').should(lis => {
5
4
  expect(lis.eq(2)).to.be.visible;
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('contains a link to the settings', () => {
4
3
  cy.get('[data-test="headerbar-profile-menu"] > li').should(lis => {
5
4
  expect(lis.eq(0)).to.be.visible;
@@ -1,4 +1,4 @@
1
- import { And, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { When, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  import { baseUrl } from '../common/index.js';
3
3
  const logoutUrl = "".concat(baseUrl, "dhis-web-commons-security/logout.action");
4
4
  Then('contains a link to log out the user', () => {
@@ -8,7 +8,7 @@ Then('contains a link to log out the user', () => {
8
8
  expect(menuItem.find('a')).to.have.attr('href', logoutUrl);
9
9
  });
10
10
  });
11
- And('there is no loading mask', () => {
11
+ When('there is no loading mask', () => {
12
12
  cy.get('[data-test="headerbar-profile-menu-loading-mask"]').should('not.exist');
13
13
  });
14
14
  Then('the user clicks the link to log out', () => {
@@ -18,7 +18,7 @@ Then('a loading mask covers the screen', () => {
18
18
  cy.get('[data-test="headerbar-profile-menu-loading-mask"]').should('be.visible');
19
19
  }); // Currently not working
20
20
 
21
- And('clearSensitiveCaches is called', async () => {
21
+ When('clearSensitiveCaches is called', async () => {
22
22
  // Open caches to test 'clearSensitiveCaches':
23
23
  // A keepable cache
24
24
  await caches.open('workbox-precache-v2-asdf'); // Other, potentially-sensitive cache
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('contains the user name', () => {
4
3
  cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-username"]')).then(_ref => {
5
4
  let [win, $name] = _ref;
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('the HeaderBar contains a link to the interpretations', () => {
4
3
  cy.get('[data-test="headerbar-interpretations"]').should('be.visible');
5
4
  });
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Given('there are 0 unread interpretations', () => {
4
3
  cy.visitStory('HeaderBarTesting', 'Zero Unread Interpretations');
5
4
  });
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('the interpretations link contains an icon with a number greater than 0', () => {
4
3
  cy.get('[data-test="headerbar-interpretations-count"]').should($count => {
5
4
  expect(parseInt($count.text(), 10)).to.be.greaterThan(0);
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('the HeaderBar contains a link to the messages', () => {
4
3
  cy.get('[data-test="headerbar-messages"]').should('be.visible');
5
4
  });
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then, Given } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then, Given } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Given('there are 0 unread messages', () => {
4
3
  cy.visitStory('HeaderBarTesting', 'Zero Unread Messages');
5
4
  });
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Then('the messages link contains an icon with a number greater than 0', () => {
4
3
  cy.get('[data-test="headerbar-messages-count"]').should($count => {
5
4
  expect(parseInt($count.text(), 10)).to.be.greaterThan(0);
@@ -1,4 +1,4 @@
1
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  import { baseUrl } from '../common/index.js';
3
3
  Then('the HeaderBar should display the dhis2 logo', () => {
4
4
  cy.get('[data-test="headerbar-logo"]').should('be.visible');
@@ -1,4 +1,4 @@
1
- import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('the HeaderBar is rendered without an available update', () => {
3
3
  cy.visitStory('HeaderBarTesting', 'default');
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('the HeaderBar is rendered without an instance version in runtime context', () => {
3
3
  cy.visitStory('HeaderBarTesting', 'With Unknown Instance Version');
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Then, Given } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then, Given } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('the custom title is "Barbaz" and the app title is "Example!"', () => {
3
3
  cy.visitStory('HeaderBarTesting', 'Custom Application Title');
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Given } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given(/the search contains a (.*)/, character => {
3
3
  cy.get('[data-test="headerbar-apps-icon"]').click();
4
4
  cy.get('#filter').type(character);
@@ -1,5 +1,4 @@
1
- import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
2
- import '../common/index.js';
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Given(/no app name contains a (.*)/, character => {
4
3
  // Needs to be wrapped, otherwise for some reason the wrong char is in the scope
5
4
  cy.all(() => cy.window(), () => cy.wrap(character)).then(_ref => {
@@ -1,6 +1,5 @@
1
- import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
2
- import { modulesWithSpecialCharacters } from '../../__e2e__/stories/common.js';
3
- import '../common/index.js';
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
2
+ import { modulesWithSpecialCharacters } from '../../__e2e__/stories/modulesWithSpecialCharacters.js';
4
3
  Given(/some app names contain a (.*)/, character => {
5
4
  // Needs to be wrapped, otherwise for some reason the wrong char is in the scope
6
5
  cy.wrap(character).then(char => {
@@ -8,6 +8,8 @@
8
8
  "Debug info": "Debug info",
9
9
  "Close": "Close",
10
10
  "Copy debug info": "Copy debug info",
11
+ "Interpretations": "Interpretations",
12
+ "Messages": "Messages",
11
13
  "Online": "Online",
12
14
  "Offline": "Offline",
13
15
  "Edit profile": "Edit profile",
@@ -18,5 +20,6 @@
18
20
  "Logout": "Logout",
19
21
  "New {{appName}} version available": "New {{appName}} version available",
20
22
  "New app version available": "New app version available",
21
- "Click to reload": "Click to reload"
23
+ "Click to reload": "Click to reload",
24
+ "header bar profile": "header bar profile"
22
25
  }
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "Search apps": "ຄົ້ນຫາແອັບ",
3
- "DHIS2 {{dhis2Version}}": "",
4
- "DHIS2 version unknown": "",
5
- "{{appName}} version unknown": "",
6
- "App {{appVersion}}": "",
7
- "App version unknown": "",
8
- "Debug info": "",
3
+ "DHIS2 {{dhis2Version}}": "DHIS2 {{dhis2Version}}",
4
+ "DHIS2 version unknown": "DHIS2 ບໍ່ຮູ້ເວີຊັນ",
5
+ "{{appName}} version unknown": "{{appName}} ບໍ່ຮູ້ເວີຊັນ",
6
+ "App {{appVersion}}": "ແອັບ {{appVersion}}",
7
+ "App version unknown": "ບໍ່ຮູ້ເວີຊັນແອັບ",
8
+ "Debug info": "ຂໍ້ມູນການແກ້ໄຂ",
9
9
  "Close": "ປິດ",
10
- "Copy debug info": "",
10
+ "Copy debug info": "ກ໋ອບປີ້ຂໍ້ມູນການແກ້ໄຂ",
11
11
  "Online": "ມີການເຊື່ອມຕໍ່",
12
12
  "Offline": "ບໍ່ມີການເຊື່ອມຕໍ່",
13
13
  "Edit profile": "ແກ້ໄຂຂໍ້ມູນ",
14
14
  "Settings": "ຕັ້ງຄ່າ",
15
15
  "Account": "ບັນຊີ",
16
16
  "Help": "ຊ່ວຍ",
17
- "About DHIS2": "",
17
+ "About DHIS2": "ກ່ຽວກັບ DHIS2",
18
18
  "Logout": "ອອກຈາກລະບົບ",
19
- "New {{appName}} version available": "",
20
- "New app version available": "",
21
- "Click to reload": ""
19
+ "New {{appName}} version available": "ມີເວີຊັນໃໝ່ {{appName}} ",
20
+ "New app version available": "ມີແອັບເວີຊັນໃໝ່",
21
+ "Click to reload": "ຄລິກເພື່ອໂຫຼດຄືນໃໝ່"
22
22
  }
@@ -3,6 +3,7 @@ import { colors, theme, spacers } from '@dhis2/ui-constants';
3
3
  import { IconMessages24, IconMail24 } from '@dhis2/ui-icons';
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
+ import i18n from './locales/index.js';
6
7
 
7
8
  function icon(kind) {
8
9
  if (kind === 'message') {
@@ -21,12 +22,16 @@ export const NotificationIcon = _ref => {
21
22
  count,
22
23
  href,
23
24
  kind,
24
- dataTestId
25
+ dataTestId,
26
+ title,
27
+ 'aria-label': ariaLabel
25
28
  } = _ref;
26
29
  return /*#__PURE__*/React.createElement("a", {
27
30
  dir: "ltr",
28
31
  href: href,
29
32
  "data-test": dataTestId,
33
+ title: i18n.t(title),
34
+ "aria-label": i18n.t(ariaLabel),
30
35
  className: _JSXStyle.dynamic([["995028205", [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]]]) + " " + (kind || "")
31
36
  }, icon(kind), count > 0 && /*#__PURE__*/React.createElement("span", {
32
37
  "data-test": "".concat(dataTestId, "-count"),
@@ -40,7 +45,9 @@ NotificationIcon.defaultProps = {
40
45
  count: 0
41
46
  };
42
47
  NotificationIcon.propTypes = {
48
+ 'aria-label': PropTypes.string.isRequired,
43
49
  href: PropTypes.string.isRequired,
50
+ title: PropTypes.string.isRequired,
44
51
  count: PropTypes.number,
45
52
  dataTestId: PropTypes.string,
46
53
  kind: PropTypes.oneOf(['interpretation', 'message'])
@@ -3,13 +3,8 @@ import { useConfig } from '@dhis2/app-runtime';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
5
  import { joinPath } from './join-path.js';
6
+ import i18n from './locales/index.js';
6
7
  import { NotificationIcon } from './notification-icon.js';
7
- /*
8
- AUTHORITIES:
9
- - ALL: superuser
10
- - M_dhis-web-interpretation: access to interpretations app
11
- - M_dhis-web-messaging: access to messaging app
12
- */
13
8
 
14
9
  const hasAuthority = (userAuthorities, authId) => Array.isArray(userAuthorities) && userAuthorities.some(userAuthId => userAuthId === 'ALL' || userAuthId === authId);
15
10
 
@@ -29,13 +24,17 @@ export const Notifications = _ref => {
29
24
  count: interpretations,
30
25
  href: joinPath(baseUrl, 'dhis-web-interpretation'),
31
26
  kind: "message",
32
- dataTestId: "headerbar-interpretations"
27
+ dataTestId: "headerbar-interpretations",
28
+ title: i18n.t('Interpretations'),
29
+ "aria-label": i18n.t('Interpretations')
33
30
  }), hasAuthority(userAuthorities, 'M_dhis-web-messaging') && /*#__PURE__*/React.createElement(NotificationIcon, {
34
31
  message: "email",
35
32
  count: messages,
36
33
  href: joinPath(baseUrl, 'dhis-web-messaging'),
37
34
  kind: "interpretation",
38
- dataTestId: "headerbar-messages"
35
+ dataTestId: "headerbar-messages",
36
+ title: i18n.t('Messages'),
37
+ "aria-label": i18n.t('Messages')
39
38
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
40
39
  id: "55705730"
41
40
  }, ["div.jsx-55705730{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;}"]));
@@ -3,6 +3,7 @@ import { UserAvatar } from '@dhis2-ui/user-avatar';
3
3
  import PropTypes from 'prop-types';
4
4
  import React, { useCallback, useRef, useState } from 'react';
5
5
  import { DebugInfoModal } from './debug-info/debug-info-modal.js';
6
+ import i18n from './locales/index.js';
6
7
  import { ProfileMenu } from './profile-menu/index.js';
7
8
  import { useOnDocClick } from './profile/use-on-doc-click.js';
8
9
 
@@ -25,6 +26,8 @@ const Profile = _ref => {
25
26
  className: "jsx-3442481507" + " " + "headerbar-profile"
26
27
  }, /*#__PURE__*/React.createElement("button", {
27
28
  onClick: toggleProfileMenu,
29
+ title: i18n.t('header bar profile'),
30
+ "aria-label": i18n.t('header bar profile'),
28
31
  className: "jsx-3442481507" + " " + "headerbar-profile-btn"
29
32
  }, /*#__PURE__*/React.createElement(UserAvatar, {
30
33
  avatarId: avatarId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/header-bar",
3
- "version": "9.5.0-alpha.1",
3
+ "version": "9.6.0",
4
4
  "description": "UI HeaderBar",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,21 +34,21 @@
34
34
  "styled-jsx": "^4"
35
35
  },
36
36
  "dependencies": {
37
- "@dhis2-ui/box": "9.5.0-alpha.1",
38
- "@dhis2-ui/button": "9.5.0-alpha.1",
39
- "@dhis2-ui/card": "9.5.0-alpha.1",
40
- "@dhis2-ui/center": "9.5.0-alpha.1",
41
- "@dhis2-ui/divider": "9.5.0-alpha.1",
42
- "@dhis2-ui/input": "9.5.0-alpha.1",
43
- "@dhis2-ui/layer": "9.5.0-alpha.1",
44
- "@dhis2-ui/loader": "9.5.0-alpha.1",
45
- "@dhis2-ui/logo": "9.5.0-alpha.1",
46
- "@dhis2-ui/menu": "9.5.0-alpha.1",
47
- "@dhis2-ui/modal": "9.5.0-alpha.1",
48
- "@dhis2-ui/user-avatar": "9.5.0-alpha.1",
37
+ "@dhis2-ui/box": "9.6.0",
38
+ "@dhis2-ui/button": "9.6.0",
39
+ "@dhis2-ui/card": "9.6.0",
40
+ "@dhis2-ui/center": "9.6.0",
41
+ "@dhis2-ui/divider": "9.6.0",
42
+ "@dhis2-ui/input": "9.6.0",
43
+ "@dhis2-ui/layer": "9.6.0",
44
+ "@dhis2-ui/loader": "9.6.0",
45
+ "@dhis2-ui/logo": "9.6.0",
46
+ "@dhis2-ui/menu": "9.6.0",
47
+ "@dhis2-ui/modal": "9.6.0",
48
+ "@dhis2-ui/user-avatar": "9.6.0",
49
49
  "@dhis2/prop-types": "^3.1.2",
50
- "@dhis2/ui-constants": "9.5.0-alpha.1",
51
- "@dhis2/ui-icons": "9.5.0-alpha.1",
50
+ "@dhis2/ui-constants": "9.6.0",
51
+ "@dhis2/ui-icons": "9.6.0",
52
52
  "classnames": "^2.3.1",
53
53
  "moment": "^2.29.1",
54
54
  "prop-types": "^15.7.2"
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- require("../common/index.js");
4
-
5
- require("./common.js");
6
-
7
- var _steps = require("cypress-cucumber-preprocessor/steps");
8
-
9
- (0, _steps.Then)('the HeaderBar dos not display the app menu', () => {
10
- cy.get('[data-test="headerbar-apps-menu"]').should('not.exist');
11
- });
@@ -1,6 +0,0 @@
1
- import '../common/index.js';
2
- import './common.js';
3
- import { Then } from 'cypress-cucumber-preprocessor/steps';
4
- Then('the HeaderBar dos not display the app menu', () => {
5
- cy.get('[data-test="headerbar-apps-menu"]').should('not.exist');
6
- });