@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,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
  }
@@ -15,6 +15,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
15
15
 
16
16
  var _react = _interopRequireDefault(require("react"));
17
17
 
18
+ var _index = _interopRequireDefault(require("./locales/index.js"));
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
20
22
  function icon(kind) {
@@ -34,12 +36,16 @@ const NotificationIcon = _ref => {
34
36
  count,
35
37
  href,
36
38
  kind,
37
- dataTestId
39
+ dataTestId,
40
+ title,
41
+ 'aria-label': ariaLabel
38
42
  } = _ref;
39
43
  return /*#__PURE__*/_react.default.createElement("a", {
40
44
  dir: "ltr",
41
45
  href: href,
42
46
  "data-test": dataTestId,
47
+ title: _index.default.t(title),
48
+ "aria-label": _index.default.t(ariaLabel),
43
49
  className: _style.default.dynamic([["995028205", [_uiConstants.spacers.dp12, _uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]]]) + " " + (kind || "")
44
50
  }, icon(kind), count > 0 && /*#__PURE__*/_react.default.createElement("span", {
45
51
  "data-test": "".concat(dataTestId, "-count"),
@@ -55,7 +61,9 @@ NotificationIcon.defaultProps = {
55
61
  count: 0
56
62
  };
57
63
  NotificationIcon.propTypes = {
64
+ 'aria-label': _propTypes.default.string.isRequired,
58
65
  href: _propTypes.default.string.isRequired,
66
+ title: _propTypes.default.string.isRequired,
59
67
  count: _propTypes.default.number,
60
68
  dataTestId: _propTypes.default.string,
61
69
  kind: _propTypes.default.oneOf(['interpretation', 'message'])
@@ -15,16 +15,12 @@ var _react = _interopRequireDefault(require("react"));
15
15
 
16
16
  var _joinPath = require("./join-path.js");
17
17
 
18
+ var _index = _interopRequireDefault(require("./locales/index.js"));
19
+
18
20
  var _notificationIcon = require("./notification-icon.js");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
22
- /*
23
- AUTHORITIES:
24
- - ALL: superuser
25
- - M_dhis-web-interpretation: access to interpretations app
26
- - M_dhis-web-messaging: access to messaging app
27
- */
28
24
  const hasAuthority = (userAuthorities, authId) => Array.isArray(userAuthorities) && userAuthorities.some(userAuthId => userAuthId === 'ALL' || userAuthId === authId);
29
25
 
30
26
  const Notifications = _ref => {
@@ -43,13 +39,17 @@ const Notifications = _ref => {
43
39
  count: interpretations,
44
40
  href: (0, _joinPath.joinPath)(baseUrl, 'dhis-web-interpretation'),
45
41
  kind: "message",
46
- dataTestId: "headerbar-interpretations"
42
+ dataTestId: "headerbar-interpretations",
43
+ title: _index.default.t('Interpretations'),
44
+ "aria-label": _index.default.t('Interpretations')
47
45
  }), hasAuthority(userAuthorities, 'M_dhis-web-messaging') && /*#__PURE__*/_react.default.createElement(_notificationIcon.NotificationIcon, {
48
46
  message: "email",
49
47
  count: messages,
50
48
  href: (0, _joinPath.joinPath)(baseUrl, 'dhis-web-messaging'),
51
49
  kind: "interpretation",
52
- dataTestId: "headerbar-messages"
50
+ dataTestId: "headerbar-messages",
51
+ title: _index.default.t('Messages'),
52
+ "aria-label": _index.default.t('Messages')
53
53
  }), /*#__PURE__*/_react.default.createElement(_style.default, {
54
54
  id: "55705730"
55
55
  }, ["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%;}"]));
@@ -15,7 +15,9 @@ var _react = _interopRequireWildcard(require("react"));
15
15
 
16
16
  var _debugInfoModal = require("./debug-info/debug-info-modal.js");
17
17
 
18
- var _index = require("./profile-menu/index.js");
18
+ var _index = _interopRequireDefault(require("./locales/index.js"));
19
+
20
+ var _index2 = require("./profile-menu/index.js");
19
21
 
20
22
  var _useOnDocClick = require("./profile/use-on-doc-click.js");
21
23
 
@@ -44,13 +46,15 @@ const Profile = _ref => {
44
46
  className: "jsx-3442481507" + " " + "headerbar-profile"
45
47
  }, /*#__PURE__*/_react.default.createElement("button", {
46
48
  onClick: toggleProfileMenu,
49
+ title: _index.default.t('header bar profile'),
50
+ "aria-label": _index.default.t('header bar profile'),
47
51
  className: "jsx-3442481507" + " " + "headerbar-profile-btn"
48
52
  }, /*#__PURE__*/_react.default.createElement(_userAvatar.UserAvatar, {
49
53
  avatarId: avatarId,
50
54
  name: name,
51
55
  dataTest: "headerbar-profile-icon",
52
56
  medium: true
53
- })), showProfileMenu && /*#__PURE__*/_react.default.createElement(_index.ProfileMenu, {
57
+ })), showProfileMenu && /*#__PURE__*/_react.default.createElement(_index2.ProfileMenu, {
54
58
  avatarId: avatarId,
55
59
  name: name,
56
60
  email: email,
@@ -2,6 +2,7 @@
2
2
  import { CustomDataProvider, Provider, useAlerts } from '@dhis2/app-runtime';
3
3
  import PropTypes from 'prop-types';
4
4
  import React, { useEffect } from 'react';
5
+ export { modulesWithSpecialCharacters } from './modulesWithSpecialCharacters.js';
5
6
  export const defaultModules = [{
6
7
  name: 'dhis-web-dashboard',
7
8
  namespace: '/dhis-web-dashboard',
@@ -66,203 +67,6 @@ export const defaultModules = [{
66
67
  icon: 'https://debug.dhis2.org/dev/api/apps/Dashboard-Classic/icon.png',
67
68
  description: 'DHIS2 Legacy Dashboard App'
68
69
  }];
69
- export const modulesWithSpecialCharacters = [{
70
- name: '/',
71
- namespace: '//',
72
- defaultAction: '..//.action',
73
- displayName: 'A / character',
74
- icon: '../icons/dhis-web-dashboard.png',
75
- description: ''
76
- }, {
77
- name: '-',
78
- namespace: '/-',
79
- defaultAction: '../-.action',
80
- displayName: 'A - character',
81
- icon: '../icons/dhis-web-dashboard.png',
82
- description: ''
83
- }, {
84
- name: '(',
85
- namespace: '/(',
86
- defaultAction: '../(.action',
87
- displayName: 'A ( character',
88
- icon: '../icons/dhis-web-data-visualizer.png',
89
- description: ''
90
- }, {
91
- name: ')',
92
- namespace: '/)',
93
- defaultAction: '../).action',
94
- displayName: 'A ) character',
95
- icon: '../icons/dhis-web-data-visualizer.png',
96
- description: ''
97
- }, {
98
- name: '[',
99
- namespace: '/[',
100
- defaultAction: '../[.action',
101
- displayName: 'A [ character',
102
- icon: '../icons/dhis-web-data-visualizer.png',
103
- description: ''
104
- }, {
105
- name: ']',
106
- namespace: '/]',
107
- defaultAction: '../].action',
108
- displayName: 'A ] character',
109
- icon: '../icons/dhis-web-data-visualizer.png',
110
- description: ''
111
- }, {
112
- name: '{',
113
- namespace: '/{',
114
- defaultAction: '../{.action',
115
- displayName: 'A { character',
116
- icon: '../icons/dhis-web-data-visualizer.png',
117
- description: ''
118
- }, {
119
- name: '}',
120
- namespace: '/}',
121
- defaultAction: '../}.action',
122
- displayName: 'A } character',
123
- icon: '../icons/dhis-web-data-visualizer.png',
124
- description: ''
125
- }, {
126
- name: '*',
127
- namespace: '/*',
128
- defaultAction: '../*.action',
129
- displayName: 'A * character',
130
- icon: '../icons/dhis-web-data-visualizer.png',
131
- description: ''
132
- }, {
133
- name: '+',
134
- namespace: '/+',
135
- defaultAction: '../+.action',
136
- displayName: 'A + character',
137
- icon: '../icons/dhis-web-data-visualizer.png',
138
- description: ''
139
- }, {
140
- name: '?',
141
- namespace: '/?',
142
- defaultAction: '../?.action',
143
- displayName: 'A ? character',
144
- icon: '../icons/dhis-web-data-visualizer.png',
145
- description: ''
146
- }, {
147
- name: '.',
148
- namespace: '/.',
149
- defaultAction: '../..action',
150
- displayName: 'A . character',
151
- icon: '../icons/dhis-web-data-visualizer.png',
152
- description: ''
153
- }, {
154
- name: ',',
155
- namespace: '/,',
156
- defaultAction: '../,.action',
157
- displayName: 'A , character',
158
- icon: '../icons/dhis-web-data-visualizer.png',
159
- description: ''
160
- }, {
161
- name: '^',
162
- namespace: '/^',
163
- defaultAction: '../^.action',
164
- displayName: 'A ^ character',
165
- icon: '../icons/dhis-web-data-visualizer.png',
166
- description: ''
167
- }, {
168
- name: '$',
169
- namespace: '/$',
170
- defaultAction: '../$.action',
171
- displayName: 'A $ character',
172
- icon: '../icons/dhis-web-data-visualizer.png',
173
- description: ''
174
- }, {
175
- name: '|',
176
- namespace: '/|',
177
- defaultAction: '../|.action',
178
- displayName: 'A | character',
179
- icon: '../icons/dhis-web-data-visualizer.png',
180
- description: ''
181
- }, {
182
- name: '#',
183
- namespace: '/#',
184
- defaultAction: '../#.action',
185
- displayName: 'A # character',
186
- icon: '../icons/dhis-web-data-visualizer.png',
187
- description: ''
188
- }, {
189
- name: '\\s',
190
- namespace: '/\\s',
191
- defaultAction: '../\\s.action',
192
- displayName: 'A \\s character',
193
- icon: '../icons/dhis-web-data-visualizer.png',
194
- description: ''
195
- }, {
196
- name: '\\',
197
- namespace: '/\\',
198
- defaultAction: '../\\.action',
199
- displayName: 'A \\ character',
200
- icon: '../icons/dhis-web-data-visualizer.png',
201
- description: ''
202
- }, {
203
- name: 'dhis-web-dashboard',
204
- namespace: '/dhis-web-dashboard',
205
- defaultAction: '../dhis-web-dashboard/index.action',
206
- displayName: 'Dashboard',
207
- icon: '../icons/dhis-web-dashboard.png',
208
- description: ''
209
- }, {
210
- name: 'dhis-web-capture',
211
- namespace: '/dhis-web-capture',
212
- defaultAction: '../dhis-web-capture/index.action',
213
- displayName: 'Capture',
214
- icon: '../icons/dhis-web-capture.png',
215
- description: ''
216
- }, {
217
- name: 'dhis-web-maintenance',
218
- namespace: '/dhis-web-maintenance',
219
- defaultAction: '../dhis-web-maintenance/index.action',
220
- displayName: 'Maintenance',
221
- icon: '../icons/dhis-web-maintenance.png',
222
- description: ''
223
- }, {
224
- name: 'dhis-web-maps',
225
- namespace: '/dhis-web-maps',
226
- defaultAction: '../dhis-web-maps/index.action',
227
- displayName: 'Maps',
228
- icon: '../icons/dhis-web-maps.png',
229
- description: ''
230
- }, {
231
- name: 'dhis-web-event-reports',
232
- namespace: '/dhis-web-event-reports',
233
- defaultAction: '../dhis-web-event-reports/index.action',
234
- displayName: 'Event Reports',
235
- icon: '../icons/dhis-web-event-reports.png',
236
- description: ''
237
- }, {
238
- name: 'dhis-web-interpretation',
239
- namespace: '/dhis-web-interpretation',
240
- defaultAction: '../dhis-web-interpretation/index.action',
241
- displayName: 'Interpretations',
242
- icon: '../icons/dhis-web-interpretation.png',
243
- description: ''
244
- }, {
245
- name: 'dhis-web-import-export',
246
- namespace: '/dhis-web-import-export',
247
- defaultAction: '../dhis-web-import-export/index.action',
248
- displayName: 'Import/Export',
249
- icon: '../icons/dhis-web-importexport.png',
250
- description: ''
251
- }, {
252
- name: 'WHO Metadata browser',
253
- namespace: 'WHO Metadata browser',
254
- defaultAction: 'https://debug.dhis2.org/dev/api/apps/WHO-Metadata-browser/index.html',
255
- displayName: '',
256
- icon: 'https://debug.dhis2.org/dev/api/apps/WHO-Metadata-browser/icons/medicine-48.png',
257
- description: ''
258
- }, {
259
- name: 'Dashboard Classic',
260
- namespace: 'Dashboard Classic',
261
- defaultAction: 'https://debug.dhis2.org/dev/api/apps/Dashboard-Classic/index.html',
262
- displayName: '',
263
- icon: 'https://debug.dhis2.org/dev/api/apps/Dashboard-Classic/icon.png',
264
- description: 'DHIS2 Legacy Dashboard App'
265
- }];
266
70
  export const applicationTitle = 'Foobar';
267
71
  export const dataProviderData = {
268
72
  'systemSettings/applicationTitle': {
@@ -0,0 +1,197 @@
1
+ export const modulesWithSpecialCharacters = [{
2
+ name: '/',
3
+ namespace: '//',
4
+ defaultAction: '..//.action',
5
+ displayName: 'A / character',
6
+ icon: '../icons/dhis-web-dashboard.png',
7
+ description: ''
8
+ }, {
9
+ name: '-',
10
+ namespace: '/-',
11
+ defaultAction: '../-.action',
12
+ displayName: 'A - character',
13
+ icon: '../icons/dhis-web-dashboard.png',
14
+ description: ''
15
+ }, {
16
+ name: '(',
17
+ namespace: '/(',
18
+ defaultAction: '../(.action',
19
+ displayName: 'A ( character',
20
+ icon: '../icons/dhis-web-data-visualizer.png',
21
+ description: ''
22
+ }, {
23
+ name: ')',
24
+ namespace: '/)',
25
+ defaultAction: '../).action',
26
+ displayName: 'A ) character',
27
+ icon: '../icons/dhis-web-data-visualizer.png',
28
+ description: ''
29
+ }, {
30
+ name: '[',
31
+ namespace: '/[',
32
+ defaultAction: '../[.action',
33
+ displayName: 'A [ character',
34
+ icon: '../icons/dhis-web-data-visualizer.png',
35
+ description: ''
36
+ }, {
37
+ name: ']',
38
+ namespace: '/]',
39
+ defaultAction: '../].action',
40
+ displayName: 'A ] character',
41
+ icon: '../icons/dhis-web-data-visualizer.png',
42
+ description: ''
43
+ }, {
44
+ name: '{',
45
+ namespace: '/{',
46
+ defaultAction: '../{.action',
47
+ displayName: 'A { character',
48
+ icon: '../icons/dhis-web-data-visualizer.png',
49
+ description: ''
50
+ }, {
51
+ name: '}',
52
+ namespace: '/}',
53
+ defaultAction: '../}.action',
54
+ displayName: 'A } character',
55
+ icon: '../icons/dhis-web-data-visualizer.png',
56
+ description: ''
57
+ }, {
58
+ name: '*',
59
+ namespace: '/*',
60
+ defaultAction: '../*.action',
61
+ displayName: 'A * character',
62
+ icon: '../icons/dhis-web-data-visualizer.png',
63
+ description: ''
64
+ }, {
65
+ name: '+',
66
+ namespace: '/+',
67
+ defaultAction: '../+.action',
68
+ displayName: 'A + character',
69
+ icon: '../icons/dhis-web-data-visualizer.png',
70
+ description: ''
71
+ }, {
72
+ name: '?',
73
+ namespace: '/?',
74
+ defaultAction: '../?.action',
75
+ displayName: 'A ? character',
76
+ icon: '../icons/dhis-web-data-visualizer.png',
77
+ description: ''
78
+ }, {
79
+ name: '.',
80
+ namespace: '/.',
81
+ defaultAction: '../..action',
82
+ displayName: 'A . character',
83
+ icon: '../icons/dhis-web-data-visualizer.png',
84
+ description: ''
85
+ }, {
86
+ name: ',',
87
+ namespace: '/,',
88
+ defaultAction: '../,.action',
89
+ displayName: 'A , character',
90
+ icon: '../icons/dhis-web-data-visualizer.png',
91
+ description: ''
92
+ }, {
93
+ name: '^',
94
+ namespace: '/^',
95
+ defaultAction: '../^.action',
96
+ displayName: 'A ^ character',
97
+ icon: '../icons/dhis-web-data-visualizer.png',
98
+ description: ''
99
+ }, {
100
+ name: '$',
101
+ namespace: '/$',
102
+ defaultAction: '../$.action',
103
+ displayName: 'A $ character',
104
+ icon: '../icons/dhis-web-data-visualizer.png',
105
+ description: ''
106
+ }, {
107
+ name: '|',
108
+ namespace: '/|',
109
+ defaultAction: '../|.action',
110
+ displayName: 'A | character',
111
+ icon: '../icons/dhis-web-data-visualizer.png',
112
+ description: ''
113
+ }, {
114
+ name: '#',
115
+ namespace: '/#',
116
+ defaultAction: '../#.action',
117
+ displayName: 'A # character',
118
+ icon: '../icons/dhis-web-data-visualizer.png',
119
+ description: ''
120
+ }, {
121
+ name: '\\s',
122
+ namespace: '/\\s',
123
+ defaultAction: '../\\s.action',
124
+ displayName: 'A \\s character',
125
+ icon: '../icons/dhis-web-data-visualizer.png',
126
+ description: ''
127
+ }, {
128
+ name: '\\',
129
+ namespace: '/\\',
130
+ defaultAction: '../\\.action',
131
+ displayName: 'A \\ character',
132
+ icon: '../icons/dhis-web-data-visualizer.png',
133
+ description: ''
134
+ }, {
135
+ name: 'dhis-web-dashboard',
136
+ namespace: '/dhis-web-dashboard',
137
+ defaultAction: '../dhis-web-dashboard/index.action',
138
+ displayName: 'Dashboard',
139
+ icon: '../icons/dhis-web-dashboard.png',
140
+ description: ''
141
+ }, {
142
+ name: 'dhis-web-capture',
143
+ namespace: '/dhis-web-capture',
144
+ defaultAction: '../dhis-web-capture/index.action',
145
+ displayName: 'Capture',
146
+ icon: '../icons/dhis-web-capture.png',
147
+ description: ''
148
+ }, {
149
+ name: 'dhis-web-maintenance',
150
+ namespace: '/dhis-web-maintenance',
151
+ defaultAction: '../dhis-web-maintenance/index.action',
152
+ displayName: 'Maintenance',
153
+ icon: '../icons/dhis-web-maintenance.png',
154
+ description: ''
155
+ }, {
156
+ name: 'dhis-web-maps',
157
+ namespace: '/dhis-web-maps',
158
+ defaultAction: '../dhis-web-maps/index.action',
159
+ displayName: 'Maps',
160
+ icon: '../icons/dhis-web-maps.png',
161
+ description: ''
162
+ }, {
163
+ name: 'dhis-web-event-reports',
164
+ namespace: '/dhis-web-event-reports',
165
+ defaultAction: '../dhis-web-event-reports/index.action',
166
+ displayName: 'Event Reports',
167
+ icon: '../icons/dhis-web-event-reports.png',
168
+ description: ''
169
+ }, {
170
+ name: 'dhis-web-interpretation',
171
+ namespace: '/dhis-web-interpretation',
172
+ defaultAction: '../dhis-web-interpretation/index.action',
173
+ displayName: 'Interpretations',
174
+ icon: '../icons/dhis-web-interpretation.png',
175
+ description: ''
176
+ }, {
177
+ name: 'dhis-web-import-export',
178
+ namespace: '/dhis-web-import-export',
179
+ defaultAction: '../dhis-web-import-export/index.action',
180
+ displayName: 'Import/Export',
181
+ icon: '../icons/dhis-web-importexport.png',
182
+ description: ''
183
+ }, {
184
+ name: 'WHO Metadata browser',
185
+ namespace: 'WHO Metadata browser',
186
+ defaultAction: 'https://debug.dhis2.org/dev/api/apps/WHO-Metadata-browser/index.html',
187
+ displayName: '',
188
+ icon: 'https://debug.dhis2.org/dev/api/apps/WHO-Metadata-browser/icons/medicine-48.png',
189
+ description: ''
190
+ }, {
191
+ name: 'Dashboard Classic',
192
+ namespace: 'Dashboard Classic',
193
+ defaultAction: 'https://debug.dhis2.org/dev/api/apps/Dashboard-Classic/index.html',
194
+ displayName: '',
195
+ icon: 'https://debug.dhis2.org/dev/api/apps/Dashboard-Classic/icon.png',
196
+ description: 'DHIS2 Legacy Dashboard App'
197
+ }];
@@ -1,4 +1,4 @@
1
- import { Before, Given } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Before, Given } from '@badeball/cypress-cucumber-preprocessor';
2
2
  export const baseUrl = 'https://domain.tld/';
3
3
  export const webCommons = 'https://domain.tld/dhis-web-commons/';
4
4
  Before(() => {
@@ -1,5 +1,4 @@
1
- import { Before, After, Given, Then, When, And } from 'cypress-cucumber-preprocessor/steps';
2
- import '../common/index.js'; // see https://github.com/cypress-io/cypress/issues/17723#issuecomment-1457064322
1
+ import { Before, After, Given, Then, When } from '@badeball/cypress-cucumber-preprocessor'; // see https://github.com/cypress-io/cypress/issues/17723#issuecomment-1457064322
3
2
 
4
3
  const goOffline = () => {
5
4
  cy.log('**go offline**') // stub every request with a StaticResponse to simulate network error
@@ -27,7 +26,7 @@ Given('the HeaderBar loads without error when PWA is enabled', () => {
27
26
  Given('the HeaderBar loads and is PWA enabled so online status messages will be visible', () => {
28
27
  cy.visitStory('HeaderBarTesting', 'Online Status Messaging With PWA Enabled');
29
28
  });
30
- And('the viewport is narrower than 480px', () => {
29
+ Given('the viewport is narrower than 480px', () => {
31
30
  cy.viewport(460, 660);
32
31
  });
33
32
  Then('the HeaderBar does not render online status', () => {
@@ -41,7 +40,7 @@ Then('the HeaderBar displays only the desktop status badge', () => {
41
40
  cy.get('[data-test="headerbar-online-status"].badge').should('be.visible');
42
41
  cy.get('[data-test="headerbar-online-status"].bar').should('not.be.visible');
43
42
  });
44
- And('the status badge shows online', () => {
43
+ Then('the status badge shows online', () => {
45
44
  cy.get('[data-test="headerbar-online-status"].badge .label').should($label => {
46
45
  expect($label.text()).to.equal('Online');
47
46
  });
@@ -53,7 +52,7 @@ Then('the HeaderBar displays only the mobile status bar', () => {
53
52
  cy.get('[data-test="headerbar-online-status"].bar').should('be.visible');
54
53
  cy.get('[data-test="headerbar-online-status"].badge').should('not.be.visible');
55
54
  });
56
- And('the browser goes offline', () => {
55
+ Given('the browser goes offline', () => {
57
56
  goOffline();
58
57
  });
59
58
  Then('the status badge shows offline', () => {
@@ -1,4 +1,4 @@
1
- import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('the user has the ALL authority', () => {
3
3
  cy.visitStory('HeaderBarTesting', 'User Has All Authority');
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Then('the HeaderBar dos not display the app menu', () => {
3
3
  cy.get('[data-test="headerbar-apps-menu"]').should('not.exist');
4
4
  });
@@ -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 opens the menu', () => {
4
3
  cy.get('[data-test="headerbar-apps-icon"]').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('the HeaderBar displays a menu icon', () => {
4
3
  cy.get('[data-test="headerbar-apps-icon"]').should('exist');
5
4
  });
@@ -1,4 +1,4 @@
1
- import { When, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { When, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  When('the user clicks on the menu icons', () => {
3
3
  cy.get('[data-test="headerbar-apps-icon"]').click();
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Then, When } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Then, When } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Then('the HeaderBar does not display the profile menu', () => {
3
3
  cy.get('[data-test="headerbar-profile-menu"]').should('not.exist');
4
4
  });
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
3
2
  Given('the HeaderBar loads without an error and the user does not have an avatar', () => {
4
3
  cy.visitStory('HeaderBarTesting', 'Default');
5
4
  });
@@ -1,4 +1,4 @@
1
- import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('the HeaderBar loads without an error and the user has an avatar', () => {
3
3
  cy.visitStory('HeaderBarTesting', 'Me With Avatar');
4
4
  });
@@ -1 +1 @@
1
- import '../common/index.js'; // all step definitions are shared with other scenarios
1
+ // all step definitions are shared with other scenarios
@@ -1,5 +1,4 @@
1
- import '../common/index.js';
2
- import { When, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { When, Then } from '@badeball/cypress-cucumber-preprocessor';
3
2
  When('the user clicks on the profile icons', () => {
4
3
  cy.get("\n [data-test=\"headerbar-profile-icon-text\"],\n [data-test=\"headerbar-profile-icon-image\"]\n ").click();
5
4
  });