@dhis2-ui/header-bar 8.5.3 → 8.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 (25) hide show
  1. package/build/cjs/__e2e__/header-bar.stories.e2e.js +7 -7
  2. package/build/cjs/__e2e__/stories/common.js +3 -2
  3. package/build/cjs/__e2e__/stories/online-status-message.js +49 -0
  4. package/build/cjs/features/the_headerbar_can_display_online_status/the_headerbar_displays_online_status.js +18 -4
  5. package/build/cjs/features/the_headerbar_can_display_online_status.feature +26 -27
  6. package/build/cjs/header-bar.stories.js +24 -21
  7. package/build/cjs/locales/cs/translations.json +9 -9
  8. package/build/cjs/locales/en/translations.json +0 -1
  9. package/build/cjs/locales/uk/translations.json +12 -1
  10. package/build/cjs/online-status.js +10 -34
  11. package/build/cjs/online-status.styles.js +2 -2
  12. package/build/es/__e2e__/header-bar.stories.e2e.js +1 -1
  13. package/build/es/__e2e__/stories/common.js +3 -2
  14. package/build/es/__e2e__/stories/online-status-message.js +31 -0
  15. package/build/es/features/the_headerbar_can_display_online_status/the_headerbar_displays_online_status.js +19 -5
  16. package/build/es/features/the_headerbar_can_display_online_status.feature +26 -27
  17. package/build/es/header-bar.stories.js +18 -16
  18. package/build/es/locales/cs/translations.json +9 -9
  19. package/build/es/locales/en/translations.json +0 -1
  20. package/build/es/locales/uk/translations.json +12 -1
  21. package/build/es/online-status.js +11 -34
  22. package/build/es/online-status.styles.js +2 -2
  23. package/package.json +16 -16
  24. package/build/cjs/__e2e__/stories/with-last-online.js +0 -26
  25. package/build/es/__e2e__/stories/with-last-online.js +0 -12
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "MeWithAvatar", {
21
21
  return _meWithAvatar.MeWithAvatar;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "OnlineStatusMessagingWithPwaEnabled", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _onlineStatusMessage.OnlineStatusMessagingWithPwaEnabled;
28
+ }
29
+ });
24
30
  Object.defineProperty(exports, "PWAEnabled", {
25
31
  enumerable: true,
26
32
  get: function () {
@@ -63,12 +69,6 @@ Object.defineProperty(exports, "UserHasWebMessagingAuthority", {
63
69
  return _userHasWebMessagingAuthority.UserHasWebMessagingAuthority;
64
70
  }
65
71
  });
66
- Object.defineProperty(exports, "WithLastOnline", {
67
- enumerable: true,
68
- get: function () {
69
- return _withLastOnline.WithLastOnline;
70
- }
71
- });
72
72
  Object.defineProperty(exports, "WithSpecialAppNameCharacters", {
73
73
  enumerable: true,
74
74
  get: function () {
@@ -133,7 +133,7 @@ var _showOnlineStatus = require("./stories/show-online-status.js");
133
133
 
134
134
  var _pwaEnabled = require("./stories/pwa-enabled.js");
135
135
 
136
- var _withLastOnline = require("./stories/with-last-online.js");
136
+ var _onlineStatusMessage = require("./stories/online-status-message.js");
137
137
 
138
138
  var _meWithAvatar = require("./stories/me-with-avatar.js");
139
139
 
@@ -418,9 +418,10 @@ const MocklAlertStack = () => {
418
418
  })));
419
419
  };
420
420
 
421
- const createDecoratorProvider = config => {
421
+ const createDecoratorProvider = (config, offlineInterface) => {
422
422
  return fn => /*#__PURE__*/_react.default.createElement(_appRuntime.Provider, {
423
- config: config || providerConfig
423
+ config: config || providerConfig,
424
+ offlineInterface: offlineInterface
424
425
  }, fn(), /*#__PURE__*/_react.default.createElement(MocklAlertStack, null));
425
426
  };
426
427
 
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.OnlineStatusMessagingWithPwaEnabled = exports.OnlineStatusMessageUpdate = void 0;
7
+
8
+ var _button = require("@dhis2-ui/button");
9
+
10
+ var _appRuntime = require("@dhis2/app-runtime");
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _index = require("../../index.js");
15
+
16
+ var _common = require("./common.js");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const OnlineStatusMessageUpdate = () => {
21
+ const {
22
+ onlineStatusMessage,
23
+ setOnlineStatusMessage
24
+ } = (0, _appRuntime.useOnlineStatusMessage)();
25
+ const buttonLabel = !onlineStatusMessage ? 'display online status message' : 'remove online status message';
26
+ return /*#__PURE__*/_react.default.createElement(_button.Button, {
27
+ onClick: () => {
28
+ setOnlineStatusMessage(!onlineStatusMessage ? '8 offline events' : '');
29
+ }
30
+ }, buttonLabel);
31
+ };
32
+
33
+ exports.OnlineStatusMessageUpdate = OnlineStatusMessageUpdate;
34
+
35
+ const OnlineStatusMessaging = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_index.HeaderBar, {
36
+ appName: "Example!"
37
+ }), /*#__PURE__*/_react.default.createElement(OnlineStatusMessageUpdate, null));
38
+
39
+ const OnlineStatusMessagingWithPwaEnabled = () => /*#__PURE__*/_react.default.createElement(OnlineStatusMessaging, null);
40
+
41
+ exports.OnlineStatusMessagingWithPwaEnabled = OnlineStatusMessagingWithPwaEnabled;
42
+ OnlineStatusMessagingWithPwaEnabled.decorators = [(0, _common.createDecoratorCustomDataProviderHeaderBar)(), (0, _common.createDecoratorProvider)({ ..._common.providerConfig,
43
+ pwaEnabled: true
44
+ }, {
45
+ pwaEnabled: true,
46
+ startRecording: async () => undefined,
47
+ getCachedSections: async () => [],
48
+ removeSection: async () => false
49
+ })];
@@ -43,7 +43,9 @@ const goOnline = () => {
43
43
  });
44
44
  };
45
45
 
46
- (0, _steps.Before)(() => goOnline());
46
+ (0, _steps.Before)(() => {
47
+ goOnline();
48
+ });
47
49
  (0, _steps.After)(() => goOnline());
48
50
  (0, _steps.Given)('the HeaderBar loads without error with showOnlineStatus configured', () => {
49
51
  cy.visitStory('HeaderBarTesting', 'Show Online Status');
@@ -51,8 +53,8 @@ const goOnline = () => {
51
53
  (0, _steps.Given)('the HeaderBar loads without error when PWA is enabled', () => {
52
54
  cy.visitStory('HeaderBarTesting', 'PWA Enabled');
53
55
  });
54
- (0, _steps.Given)("the HeaderBar loads without error with 'LAST_ONLINE' configured", () => {
55
- cy.visitStory('HeaderBarTesting', 'With Last Online');
56
+ (0, _steps.Given)('the HeaderBar loads and is PWA enabled so online status messages will be visible', () => {
57
+ cy.visitStory('HeaderBarTesting', 'Online Status Messaging With PWA Enabled');
56
58
  });
57
59
  (0, _steps.And)('the viewport is narrower than 480px', () => {
58
60
  cy.viewport(460, 660);
@@ -91,10 +93,22 @@ const goOnline = () => {
91
93
  expect($icon).to.have.class('offline');
92
94
  });
93
95
  });
94
- (0, _steps.Then)('no info text is displayed', () => {
96
+ (0, _steps.Then)('no online status message text is displayed', () => {
95
97
  cy.get('[data-test="headerbar-online-status"] .info').should('not.exist');
96
98
  cy.get('[data-test="headerbar-online-status"] .info-dense').should('not.exist');
97
99
  });
100
+ (0, _steps.When)('an online status message is sent', () => {
101
+ cy.get('button').contains('display online status message').click();
102
+ });
103
+ (0, _steps.When)('an online status message is removed', () => {
104
+ cy.get('button').contains('remove online status message').click();
105
+ });
106
+ (0, _steps.Then)('an online status message is displayed', () => {
107
+ cy.get('[data-test="headerbar-online-status"] .info').should('include.text', '8 offline events');
108
+ });
109
+ (0, _steps.Then)('an online status message is displayed with formatting for small screens', () => {
110
+ cy.get('[data-test="headerbar-online-status"] .info-dense').should('include.text', '8 offline events');
111
+ });
98
112
  (0, _steps.Then)('last online text is displayed in the status badge', () => {
99
113
  cy.get('[data-test="headerbar-online-status"].badge .info').should('include.text', 'Last online');
100
114
  });
@@ -26,38 +26,37 @@ Feature: The HeaderBar can display online status
26
26
  And the viewport is narrower than 480px
27
27
  Then the HeaderBar displays only the mobile status bar
28
28
 
29
+ # the following test has been know to fail when run locally and appears to be a know cypress issue
30
+ # https://github.com/cypress-io/cypress/issues/17723
31
+ # at time of writing the problem doesn't appear to happen on CI
29
32
  Scenario: The HeaderBar displays an offline status when offline
30
33
  Given the HeaderBar loads without error when PWA is enabled
31
34
  And the browser goes offline
32
35
  Then the status badge shows offline
33
36
 
34
- # Additional text
37
+ # Online status message
35
38
 
36
- Scenario: No additional status text is displayed by default
37
- Given the HeaderBar loads without error when PWA is enabled
38
- Then no info text is displayed
39
- And the browser goes offline
40
- Then no info text is displayed
39
+ Scenario: In the HeaderBar no online status message text is displayed by default
40
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
41
+ Then no online status message text is displayed
41
42
 
42
- Scenario: No additional status text is displayed by default on small screens
43
- Given the HeaderBar loads without error when PWA is enabled
43
+ Scenario: In the HeaderBar the online status message text is displayed
44
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
45
+ When an online status message is sent
46
+ Then an online status message is displayed
47
+
48
+ Scenario: In the HeaderBar the online status message text can be removed
49
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
50
+ When an online status message is sent
51
+ Then an online status message is displayed
52
+ When an online status message is removed
53
+ Then no online status message text is displayed
54
+
55
+ # Online status message - small screens
56
+
57
+ Scenario: In the HeaderBar the online status message text can be set on small screens
58
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
44
59
  And the viewport is narrower than 480px
45
- Then no info text is displayed
46
- And the browser goes offline
47
- Then no info text is displayed
48
-
49
- # These tests can individually fail intermittently, disrupting CI.
50
- # Disabled for the time being:
51
-
52
- # Scenario: Last online text is displayed in status badge when configured and offline
53
- # Given the HeaderBar loads without error with 'LAST_ONLINE' configured
54
- # Then no info text is displayed
55
- # And the browser goes offline
56
- # Then last online text is displayed in the status badge
57
-
58
- # Scenario: Last online text is displayed in status bar when configured and offline
59
- # Given the HeaderBar loads without error with 'LAST_ONLINE' configured
60
- # And the viewport is narrower than 480px
61
- # Then no info text is displayed
62
- # And the browser goes offline
63
- # Then last online text is displayed in the mobile status bar
60
+ Then no online status message text is displayed
61
+ When an online status message is sent
62
+ Then an online status message is displayed with formatting for small screens
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.WithUpdateNotification = exports.WithOnlineStatus = exports.WithLastOnlineInfo = exports.NonEnglishUserLocale = exports.NoAuthorityForInterpretationsApp = exports.Loading = exports.Error = exports.Default = exports.CustomLogoWideDimension = void 0;
6
+ exports.default = exports.WithUpdateNotification = exports.WithOnlineStatusMessage = exports.WithOnlineStatus = exports.NonEnglishUserLocale = exports.NoAuthorityForInterpretationsApp = exports.Loading = exports.Error = exports.Default = exports.CustomLogoWideDimension = void 0;
7
7
 
8
8
  var _appRuntime = require("@dhis2/app-runtime");
9
9
 
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _common = require("./__e2e__/stories/common.js");
13
13
 
14
+ var _onlineStatusMessage = require("./__e2e__/stories/online-status-message.js");
15
+
14
16
  var _headerBar = require("./header-bar.js");
15
17
 
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -228,33 +230,34 @@ WithOnlineStatus.parameters = {
228
230
  }
229
231
  };
230
232
 
231
- const WithLastOnlineInfo = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
233
+ const WithUpdateNotification = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
232
234
  data: customData
233
235
  }, /*#__PURE__*/_react.default.createElement(_headerBar.HeaderBar, {
234
- appName: "Exemple!"
236
+ appName: "Data Visualizer",
237
+ updateAvailable: true
235
238
  }));
236
239
 
237
- exports.WithLastOnlineInfo = WithLastOnlineInfo;
238
- WithLastOnlineInfo.decorators = [(0, _common.createDecoratorProvider)({ ..._common.providerConfig,
240
+ exports.WithUpdateNotification = WithUpdateNotification;
241
+
242
+ const WithOnlineStatusMessage = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
243
+ data: customData
244
+ }, /*#__PURE__*/_react.default.createElement(_headerBar.HeaderBar, {
245
+ appName: "Exemple!"
246
+ }), /*#__PURE__*/_react.default.createElement(_onlineStatusMessage.OnlineStatusMessageUpdate, null));
247
+
248
+ exports.WithOnlineStatusMessage = WithOnlineStatusMessage;
249
+ WithOnlineStatusMessage.decorators = [(0, _common.createDecoratorProvider)({ ..._common.providerConfig,
250
+ pwaEnabled: true
251
+ }, {
239
252
  pwaEnabled: true,
240
- headerbar: {
241
- onlineStatusInfo: 'LAST_ONLINE'
242
- }
253
+ startRecording: async () => undefined,
254
+ getCachedSections: async () => [],
255
+ removeSection: async () => false
243
256
  })];
244
- WithLastOnlineInfo.parameters = {
257
+ WithOnlineStatusMessage.parameters = {
245
258
  docs: {
246
259
  description: {
247
- story: 'When offline, the status indicator will show text describing \
248
- time since last online.'
260
+ story: 'When online status is updated, the status indicator will show react node sent as the message'
249
261
  }
250
262
  }
251
- };
252
-
253
- const WithUpdateNotification = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
254
- data: customData
255
- }, /*#__PURE__*/_react.default.createElement(_headerBar.HeaderBar, {
256
- appName: "Data Visualizer",
257
- updateAvailable: true
258
- }));
259
-
260
- exports.WithUpdateNotification = WithUpdateNotification;
263
+ };
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "Search apps": "Hledat aplikace",
3
3
  "DHIS2 {{dhis2Version}}": "DHIS2 {{dhis2Version}}",
4
- "DHIS2 version unknown": "",
5
- "{{appName}} version unknown": "",
6
- "App {{appVersion}}": "",
7
- "App version unknown": "",
8
- "Debug info": "",
4
+ "DHIS2 version unknown": "Verze DHIS2 neznámá",
5
+ "{{appName}} version unknown": "Neznámá verze aplikace {{appName}}",
6
+ "App {{appVersion}}": "Aplikace {{appVersion}}",
7
+ "App version unknown": "Verze aplikace neznámá",
8
+ "Debug info": "Informace o ladění",
9
9
  "Close": "Zavřít",
10
- "Copy debug info": "",
10
+ "Copy debug info": "Zkopírovat informace o ladění",
11
11
  "Last online {{relativeTime}}": "Poslední online {{relativeTime}}",
12
12
  "Online": "Online",
13
13
  "Offline": "Offline",
@@ -17,7 +17,7 @@
17
17
  "Help": "Nápověda",
18
18
  "About DHIS2": "O DHIS2",
19
19
  "Logout": "Odhlásit",
20
- "New {{appName}} version available": "",
21
- "New app version available": "",
22
- "Click to reload": ""
20
+ "New {{appName}} version available": "K dispozici je nová verze aplikace {{appName}}",
21
+ "New app version available": "K dispozici nová verze aplikace",
22
+ "Click to reload": "Kliknutím znovu načtete"
23
23
  }
@@ -8,7 +8,6 @@
8
8
  "Debug info": "Debug info",
9
9
  "Close": "Close",
10
10
  "Copy debug info": "Copy debug info",
11
- "Last online {{relativeTime}}": "Last online {{relativeTime}}",
12
11
  "Online": "Online",
13
12
  "Offline": "Offline",
14
13
  "Edit profile": "Edit profile",
@@ -1,5 +1,13 @@
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": "",
9
+ "Close": "Закрити",
10
+ "Copy debug info": "",
3
11
  "Last online {{relativeTime}}": "Останній раз онлайн {{relativeTime}}",
4
12
  "Online": "Онлайн",
5
13
  "Offline": "Офлайн",
@@ -8,5 +16,8 @@
8
16
  "Account": "Обліковий запис",
9
17
  "Help": "Довідка",
10
18
  "About DHIS2": "Про DHIS2",
11
- "Logout": "Вийти"
19
+ "Logout": "Вийти",
20
+ "New {{appName}} version available": "",
21
+ "New app version available": "",
22
+ "Click to reload": ""
12
23
  }
@@ -11,8 +11,6 @@ var _appRuntime = require("@dhis2/app-runtime");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _moment = _interopRequireDefault(require("moment"));
15
-
16
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
17
15
 
18
16
  var _react = _interopRequireDefault(require("react"));
@@ -23,52 +21,30 @@ var _onlineStatusStyles = _interopRequireDefault(require("./online-status.styles
23
21
 
24
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
23
 
26
- const useOnlineStatusInfo = _ref => {
27
- let {
28
- online,
29
- lastOnline
30
- } = _ref;
31
- const {
32
- headerbar
33
- } = (0, _appRuntime.useConfig)();
34
-
35
- if ((headerbar === null || headerbar === void 0 ? void 0 : headerbar.onlineStatusInfo) === 'LAST_ONLINE' && !online && lastOnline) {
36
- return _index.default.t('Last online {{relativeTime}}', {
37
- relativeTime: (0, _moment.default)(lastOnline).fromNow()
38
- });
39
- } // todo: in the future, support 'CUSTOM' option
40
-
41
-
42
- return null;
43
- };
44
24
  /** A badge to display online/offline status in the header bar */
45
-
46
-
47
- function OnlineStatus(_ref2) {
25
+ function OnlineStatus(_ref) {
48
26
  let {
49
27
  dense
50
- } = _ref2;
28
+ } = _ref;
51
29
  const {
52
- online,
53
- lastOnline
30
+ online
54
31
  } = (0, _appRuntime.useOnlineStatus)();
55
- const info = useOnlineStatusInfo({
56
- online,
57
- lastOnline
58
- });
32
+ const {
33
+ onlineStatusMessage
34
+ } = (0, _appRuntime.useOnlineStatusMessage)();
59
35
  const displayStatus = online ? _index.default.t('Online') : _index.default.t('Offline');
60
36
  return /*#__PURE__*/_react.default.createElement("div", {
61
37
  "data-test": "headerbar-online-status",
62
38
  className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + ((0, _classnames.default)('container', dense ? 'bar' : 'badge') || "")
63
- }, info && !dense && /*#__PURE__*/_react.default.createElement("span", {
39
+ }, onlineStatusMessage && !dense && /*#__PURE__*/_react.default.createElement("span", {
64
40
  className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + "info unselectable"
65
- }, info), /*#__PURE__*/_react.default.createElement("div", {
41
+ }, onlineStatusMessage), /*#__PURE__*/_react.default.createElement("div", {
66
42
  className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + ((0, _classnames.default)('icon', online ? 'online' : 'offline') || "")
67
43
  }), /*#__PURE__*/_react.default.createElement("span", {
68
44
  className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + "label unselectable"
69
- }, displayStatus), info && dense && /*#__PURE__*/_react.default.createElement("span", {
45
+ }, displayStatus), onlineStatusMessage && dense && /*#__PURE__*/_react.default.createElement("span", {
70
46
  className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + "info-dense unselectable"
71
- }, info), /*#__PURE__*/_react.default.createElement(_style.default, {
47
+ }, onlineStatusMessage), /*#__PURE__*/_react.default.createElement(_style.default, {
72
48
  id: _onlineStatusStyles.default.__hash
73
49
  }, _onlineStatusStyles.default));
74
50
  }
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _uiConstants = require("@dhis2/ui-constants");
9
9
 
10
- const _defaultExport = [".container.jsx-1778673733{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;background-color:#104167;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:".concat(_uiConstants.colors.grey100, ";}"), ".container.badge.jsx-1778673733{margin-right:".concat(_uiConstants.spacers.dp24, ";padding:").concat(_uiConstants.spacers.dp8, ";border-radius:5px;font-size:14px;}"), ".container.bar.jsx-1778673733{display:none;padding:0px ".concat(_uiConstants.spacers.dp4, ";min-height:24px;font-size:13px;}"), "@media (max-width:480px){.container.badge.jsx-1778673733{display:none;}.container.bar.jsx-1778673733{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}", ".unselectable.jsx-1778673733{cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".info.jsx-1778673733{margin-right:".concat(_uiConstants.spacers.dp16, ";}"), ".info-dense.jsx-1778673733{margin-left:".concat(_uiConstants.spacers.dp12, ";font-size:12px;}"), ".icon.jsx-1778673733{width:8px;height:8px;border-radius:8px;margin-right:".concat(_uiConstants.spacers.dp4, ";}"), ".icon.online.jsx-1778673733{background-color:".concat(_uiConstants.colors.teal400, ";}"), ".icon.offline.jsx-1778673733{background-color:transparent;border:1px solid ".concat(_uiConstants.colors.yellow300, ";}"), ".icon.reconnecting.jsx-1778673733{background:".concat(_uiConstants.colors.grey300, ";-webkit-animation:fadeinout 2s linear infinite;-webkit-animation:fadeinout-jsx-1778673733 2s linear infinite;animation:fadeinout-jsx-1778673733 2s linear infinite;opacity:0;}"), "@-webkit-keyframes fadeinout{50%.jsx-1778673733{opacity:1;}}", "@-webkit-keyframes fadeinout-jsx-1778673733{50%{opacity:1;}}", "@keyframes fadeinout-jsx-1778673733{50%{opacity:1;}}", ".label.jsx-1778673733{-webkit-letter-spacing:0.5px;-moz-letter-spacing:0.5px;-ms-letter-spacing:0.5px;letter-spacing:0.5px;}"];
11
- _defaultExport.__hash = "1778673733";
10
+ const _defaultExport = [".container.jsx-2116755021{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;background-color:#104167;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:".concat(_uiConstants.colors.grey100, ";}"), ".container.badge.jsx-2116755021{margin-right:".concat(_uiConstants.spacers.dp24, ";padding:").concat(_uiConstants.spacers.dp8, ";border-radius:5px;font-size:14px;}"), ".container.bar.jsx-2116755021{display:none;padding:0px ".concat(_uiConstants.spacers.dp4, ";min-height:24px;font-size:13px;}"), "@media (max-width:480px){.container.badge.jsx-2116755021{display:none;}.container.bar.jsx-2116755021{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}", ".unselectable.jsx-2116755021{cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".info.jsx-2116755021{margin-right:".concat(_uiConstants.spacers.dp16, ";}"), ".info-dense.jsx-2116755021{margin-left:".concat(_uiConstants.spacers.dp12, ";font-size:12px;}"), ".icon.jsx-2116755021{width:8px;min-width:8px;height:8px;border-radius:8px;margin-right:".concat(_uiConstants.spacers.dp4, ";}"), ".icon.online.jsx-2116755021{background-color:".concat(_uiConstants.colors.teal400, ";}"), ".icon.offline.jsx-2116755021{background-color:transparent;border:1px solid ".concat(_uiConstants.colors.yellow300, ";}"), ".icon.reconnecting.jsx-2116755021{background:".concat(_uiConstants.colors.grey300, ";-webkit-animation:fadeinout 2s linear infinite;-webkit-animation:fadeinout-jsx-2116755021 2s linear infinite;animation:fadeinout-jsx-2116755021 2s linear infinite;opacity:0;}"), "@-webkit-keyframes fadeinout{50%.jsx-2116755021{opacity:1;}}", "@-webkit-keyframes fadeinout-jsx-2116755021{50%{opacity:1;}}", "@keyframes fadeinout-jsx-2116755021{50%{opacity:1;}}", ".label.jsx-2116755021{-webkit-letter-spacing:0.5px;-moz-letter-spacing:0.5px;-ms-letter-spacing:0.5px;letter-spacing:0.5px;}"];
11
+ _defaultExport.__hash = "2116755021";
12
12
  var _default = _defaultExport;
13
13
  exports.default = _default;
@@ -6,7 +6,7 @@ export default {
6
6
  export { Default } from './stories/default.js';
7
7
  export { ShowOnlineStatus } from './stories/show-online-status.js';
8
8
  export { PWAEnabled } from './stories/pwa-enabled.js';
9
- export { WithLastOnline } from './stories/with-last-online.js';
9
+ export { OnlineStatusMessagingWithPwaEnabled } from './stories/online-status-message.js';
10
10
  export { MeWithAvatar } from './stories/me-with-avatar.js';
11
11
  export { WithSpecialAppNameCharacters } from './stories/with-special-app-name-character.js';
12
12
  export { CustomApplicationTitle } from './stories/custom-application-title.js';
@@ -394,8 +394,9 @@ const MocklAlertStack = () => {
394
394
  })));
395
395
  };
396
396
 
397
- export const createDecoratorProvider = config => {
397
+ export const createDecoratorProvider = (config, offlineInterface) => {
398
398
  return fn => /*#__PURE__*/React.createElement(Provider, {
399
- config: config || providerConfig
399
+ config: config || providerConfig,
400
+ offlineInterface: offlineInterface
400
401
  }, fn(), /*#__PURE__*/React.createElement(MocklAlertStack, null));
401
402
  };
@@ -0,0 +1,31 @@
1
+ import { Button } from '@dhis2-ui/button';
2
+ import { useOnlineStatusMessage } from '@dhis2/app-runtime';
3
+ import React from 'react';
4
+ import { HeaderBar } from '../../index.js';
5
+ import { providerConfig, createDecoratorCustomDataProviderHeaderBar, createDecoratorProvider } from './common.js';
6
+ export const OnlineStatusMessageUpdate = () => {
7
+ const {
8
+ onlineStatusMessage,
9
+ setOnlineStatusMessage
10
+ } = useOnlineStatusMessage();
11
+ const buttonLabel = !onlineStatusMessage ? 'display online status message' : 'remove online status message';
12
+ return /*#__PURE__*/React.createElement(Button, {
13
+ onClick: () => {
14
+ setOnlineStatusMessage(!onlineStatusMessage ? '8 offline events' : '');
15
+ }
16
+ }, buttonLabel);
17
+ };
18
+
19
+ const OnlineStatusMessaging = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HeaderBar, {
20
+ appName: "Example!"
21
+ }), /*#__PURE__*/React.createElement(OnlineStatusMessageUpdate, null));
22
+
23
+ export const OnlineStatusMessagingWithPwaEnabled = () => /*#__PURE__*/React.createElement(OnlineStatusMessaging, null);
24
+ OnlineStatusMessagingWithPwaEnabled.decorators = [createDecoratorCustomDataProviderHeaderBar(), createDecoratorProvider({ ...providerConfig,
25
+ pwaEnabled: true
26
+ }, {
27
+ pwaEnabled: true,
28
+ startRecording: async () => undefined,
29
+ getCachedSections: async () => [],
30
+ removeSection: async () => false
31
+ })];
@@ -1,4 +1,4 @@
1
- import { Before, After, Given, Then, And } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Before, After, Given, Then, When, And } from 'cypress-cucumber-preprocessor/steps';
2
2
  import '../common/index.js'; // https://www.cypress.io/blog/2020/11/12/testing-application-in-offline-network-mode/
3
3
 
4
4
  const goOffline = () => {
@@ -39,7 +39,9 @@ const goOnline = () => {
39
39
  });
40
40
  };
41
41
 
42
- Before(() => goOnline());
42
+ Before(() => {
43
+ goOnline();
44
+ });
43
45
  After(() => goOnline());
44
46
  Given('the HeaderBar loads without error with showOnlineStatus configured', () => {
45
47
  cy.visitStory('HeaderBarTesting', 'Show Online Status');
@@ -47,8 +49,8 @@ Given('the HeaderBar loads without error with showOnlineStatus configured', () =
47
49
  Given('the HeaderBar loads without error when PWA is enabled', () => {
48
50
  cy.visitStory('HeaderBarTesting', 'PWA Enabled');
49
51
  });
50
- Given("the HeaderBar loads without error with 'LAST_ONLINE' configured", () => {
51
- cy.visitStory('HeaderBarTesting', 'With Last Online');
52
+ Given('the HeaderBar loads and is PWA enabled so online status messages will be visible', () => {
53
+ cy.visitStory('HeaderBarTesting', 'Online Status Messaging With PWA Enabled');
52
54
  });
53
55
  And('the viewport is narrower than 480px', () => {
54
56
  cy.viewport(460, 660);
@@ -87,10 +89,22 @@ Then('the status badge shows offline', () => {
87
89
  expect($icon).to.have.class('offline');
88
90
  });
89
91
  });
90
- Then('no info text is displayed', () => {
92
+ Then('no online status message text is displayed', () => {
91
93
  cy.get('[data-test="headerbar-online-status"] .info').should('not.exist');
92
94
  cy.get('[data-test="headerbar-online-status"] .info-dense').should('not.exist');
93
95
  });
96
+ When('an online status message is sent', () => {
97
+ cy.get('button').contains('display online status message').click();
98
+ });
99
+ When('an online status message is removed', () => {
100
+ cy.get('button').contains('remove online status message').click();
101
+ });
102
+ Then('an online status message is displayed', () => {
103
+ cy.get('[data-test="headerbar-online-status"] .info').should('include.text', '8 offline events');
104
+ });
105
+ Then('an online status message is displayed with formatting for small screens', () => {
106
+ cy.get('[data-test="headerbar-online-status"] .info-dense').should('include.text', '8 offline events');
107
+ });
94
108
  Then('last online text is displayed in the status badge', () => {
95
109
  cy.get('[data-test="headerbar-online-status"].badge .info').should('include.text', 'Last online');
96
110
  });
@@ -26,38 +26,37 @@ Feature: The HeaderBar can display online status
26
26
  And the viewport is narrower than 480px
27
27
  Then the HeaderBar displays only the mobile status bar
28
28
 
29
+ # the following test has been know to fail when run locally and appears to be a know cypress issue
30
+ # https://github.com/cypress-io/cypress/issues/17723
31
+ # at time of writing the problem doesn't appear to happen on CI
29
32
  Scenario: The HeaderBar displays an offline status when offline
30
33
  Given the HeaderBar loads without error when PWA is enabled
31
34
  And the browser goes offline
32
35
  Then the status badge shows offline
33
36
 
34
- # Additional text
37
+ # Online status message
35
38
 
36
- Scenario: No additional status text is displayed by default
37
- Given the HeaderBar loads without error when PWA is enabled
38
- Then no info text is displayed
39
- And the browser goes offline
40
- Then no info text is displayed
39
+ Scenario: In the HeaderBar no online status message text is displayed by default
40
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
41
+ Then no online status message text is displayed
41
42
 
42
- Scenario: No additional status text is displayed by default on small screens
43
- Given the HeaderBar loads without error when PWA is enabled
43
+ Scenario: In the HeaderBar the online status message text is displayed
44
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
45
+ When an online status message is sent
46
+ Then an online status message is displayed
47
+
48
+ Scenario: In the HeaderBar the online status message text can be removed
49
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
50
+ When an online status message is sent
51
+ Then an online status message is displayed
52
+ When an online status message is removed
53
+ Then no online status message text is displayed
54
+
55
+ # Online status message - small screens
56
+
57
+ Scenario: In the HeaderBar the online status message text can be set on small screens
58
+ Given the HeaderBar loads and is PWA enabled so online status messages will be visible
44
59
  And the viewport is narrower than 480px
45
- Then no info text is displayed
46
- And the browser goes offline
47
- Then no info text is displayed
48
-
49
- # These tests can individually fail intermittently, disrupting CI.
50
- # Disabled for the time being:
51
-
52
- # Scenario: Last online text is displayed in status badge when configured and offline
53
- # Given the HeaderBar loads without error with 'LAST_ONLINE' configured
54
- # Then no info text is displayed
55
- # And the browser goes offline
56
- # Then last online text is displayed in the status badge
57
-
58
- # Scenario: Last online text is displayed in status bar when configured and offline
59
- # Given the HeaderBar loads without error with 'LAST_ONLINE' configured
60
- # And the viewport is narrower than 480px
61
- # Then no info text is displayed
62
- # And the browser goes offline
63
- # Then last online text is displayed in the mobile status bar
60
+ Then no online status message text is displayed
61
+ When an online status message is sent
62
+ Then an online status message is displayed with formatting for small screens
@@ -1,6 +1,7 @@
1
1
  import { CustomDataProvider } from '@dhis2/app-runtime';
2
2
  import React from 'react';
3
3
  import { createDecoratorProvider, providerConfig } from './__e2e__/stories/common.js';
4
+ import { OnlineStatusMessageUpdate } from './__e2e__/stories/online-status-message.js';
4
5
  import { HeaderBar } from './header-bar.js';
5
6
  const subtitle = 'The common navigation bar used in all DHIS2 apps';
6
7
  const description = "\nThe header bar is mandatory for all apps. This creates a stable, understandable point of reference for the user across all kinds of different apps. It must always be displayed fixed to the top of the screen. Do not interfere or obstruct interaction with the header bar.\n\nThe header bar is included automatically with the App Shell and should not need any configuration.\n\n#### Theme\n\nThe header bar can be themeed to suit the brand/color of your DHIS2 instance. The color of the text/icons will be automatically adjusted based on the selected color.\n\n```js\nimport { HeaderBar } from '@dhis2/ui'\n```\n";
@@ -192,28 +193,29 @@ WithOnlineStatus.parameters = {
192
193
  }
193
194
  }
194
195
  };
195
- export const WithLastOnlineInfo = () => /*#__PURE__*/React.createElement(CustomDataProvider, {
196
+ export const WithUpdateNotification = () => /*#__PURE__*/React.createElement(CustomDataProvider, {
196
197
  data: customData
197
198
  }, /*#__PURE__*/React.createElement(HeaderBar, {
198
- appName: "Exemple!"
199
+ appName: "Data Visualizer",
200
+ updateAvailable: true
199
201
  }));
200
- WithLastOnlineInfo.decorators = [createDecoratorProvider({ ...providerConfig,
202
+ export const WithOnlineStatusMessage = () => /*#__PURE__*/React.createElement(CustomDataProvider, {
203
+ data: customData
204
+ }, /*#__PURE__*/React.createElement(HeaderBar, {
205
+ appName: "Exemple!"
206
+ }), /*#__PURE__*/React.createElement(OnlineStatusMessageUpdate, null));
207
+ WithOnlineStatusMessage.decorators = [createDecoratorProvider({ ...providerConfig,
208
+ pwaEnabled: true
209
+ }, {
201
210
  pwaEnabled: true,
202
- headerbar: {
203
- onlineStatusInfo: 'LAST_ONLINE'
204
- }
211
+ startRecording: async () => undefined,
212
+ getCachedSections: async () => [],
213
+ removeSection: async () => false
205
214
  })];
206
- WithLastOnlineInfo.parameters = {
215
+ WithOnlineStatusMessage.parameters = {
207
216
  docs: {
208
217
  description: {
209
- story: 'When offline, the status indicator will show text describing \
210
- time since last online.'
218
+ story: 'When online status is updated, the status indicator will show react node sent as the message'
211
219
  }
212
220
  }
213
- };
214
- export const WithUpdateNotification = () => /*#__PURE__*/React.createElement(CustomDataProvider, {
215
- data: customData
216
- }, /*#__PURE__*/React.createElement(HeaderBar, {
217
- appName: "Data Visualizer",
218
- updateAvailable: true
219
- }));
221
+ };
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "Search apps": "Hledat aplikace",
3
3
  "DHIS2 {{dhis2Version}}": "DHIS2 {{dhis2Version}}",
4
- "DHIS2 version unknown": "",
5
- "{{appName}} version unknown": "",
6
- "App {{appVersion}}": "",
7
- "App version unknown": "",
8
- "Debug info": "",
4
+ "DHIS2 version unknown": "Verze DHIS2 neznámá",
5
+ "{{appName}} version unknown": "Neznámá verze aplikace {{appName}}",
6
+ "App {{appVersion}}": "Aplikace {{appVersion}}",
7
+ "App version unknown": "Verze aplikace neznámá",
8
+ "Debug info": "Informace o ladění",
9
9
  "Close": "Zavřít",
10
- "Copy debug info": "",
10
+ "Copy debug info": "Zkopírovat informace o ladění",
11
11
  "Last online {{relativeTime}}": "Poslední online {{relativeTime}}",
12
12
  "Online": "Online",
13
13
  "Offline": "Offline",
@@ -17,7 +17,7 @@
17
17
  "Help": "Nápověda",
18
18
  "About DHIS2": "O DHIS2",
19
19
  "Logout": "Odhlásit",
20
- "New {{appName}} version available": "",
21
- "New app version available": "",
22
- "Click to reload": ""
20
+ "New {{appName}} version available": "K dispozici je nová verze aplikace {{appName}}",
21
+ "New app version available": "K dispozici nová verze aplikace",
22
+ "Click to reload": "Kliknutím znovu načtete"
23
23
  }
@@ -8,7 +8,6 @@
8
8
  "Debug info": "Debug info",
9
9
  "Close": "Close",
10
10
  "Copy debug info": "Copy debug info",
11
- "Last online {{relativeTime}}": "Last online {{relativeTime}}",
12
11
  "Online": "Online",
13
12
  "Offline": "Offline",
14
13
  "Edit profile": "Edit profile",
@@ -1,5 +1,13 @@
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": "",
9
+ "Close": "Закрити",
10
+ "Copy debug info": "",
3
11
  "Last online {{relativeTime}}": "Останній раз онлайн {{relativeTime}}",
4
12
  "Online": "Онлайн",
5
13
  "Offline": "Офлайн",
@@ -8,5 +16,8 @@
8
16
  "Account": "Обліковий запис",
9
17
  "Help": "Довідка",
10
18
  "About DHIS2": "Про DHIS2",
11
- "Logout": "Вийти"
19
+ "Logout": "Вийти",
20
+ "New {{appName}} version available": "",
21
+ "New app version available": "",
22
+ "Click to reload": ""
12
23
  }
@@ -1,58 +1,35 @@
1
1
  import _JSXStyle from "styled-jsx/style";
2
- import { useConfig, useOnlineStatus } from '@dhis2/app-runtime';
2
+ import { useOnlineStatus, useOnlineStatusMessage } from '@dhis2/app-runtime';
3
3
  import cx from 'classnames';
4
- import moment from 'moment';
5
4
  import PropTypes from 'prop-types';
6
5
  import React from 'react';
7
6
  import i18n from './locales/index.js';
8
7
  import styles from './online-status.styles.js';
9
-
10
- const useOnlineStatusInfo = _ref => {
11
- let {
12
- online,
13
- lastOnline
14
- } = _ref;
15
- const {
16
- headerbar
17
- } = useConfig();
18
-
19
- if ((headerbar === null || headerbar === void 0 ? void 0 : headerbar.onlineStatusInfo) === 'LAST_ONLINE' && !online && lastOnline) {
20
- return i18n.t('Last online {{relativeTime}}', {
21
- relativeTime: moment(lastOnline).fromNow()
22
- });
23
- } // todo: in the future, support 'CUSTOM' option
24
-
25
-
26
- return null;
27
- };
28
8
  /** A badge to display online/offline status in the header bar */
29
9
 
30
-
31
- export function OnlineStatus(_ref2) {
10
+ export function OnlineStatus(_ref) {
32
11
  let {
33
12
  dense
34
- } = _ref2;
13
+ } = _ref;
35
14
  const {
36
- online,
37
- lastOnline
15
+ online
38
16
  } = useOnlineStatus();
39
- const info = useOnlineStatusInfo({
40
- online,
41
- lastOnline
42
- });
17
+ const {
18
+ onlineStatusMessage
19
+ } = useOnlineStatusMessage();
43
20
  const displayStatus = online ? i18n.t('Online') : i18n.t('Offline');
44
21
  return /*#__PURE__*/React.createElement("div", {
45
22
  "data-test": "headerbar-online-status",
46
23
  className: "jsx-".concat(styles.__hash) + " " + (cx('container', dense ? 'bar' : 'badge') || "")
47
- }, info && !dense && /*#__PURE__*/React.createElement("span", {
24
+ }, onlineStatusMessage && !dense && /*#__PURE__*/React.createElement("span", {
48
25
  className: "jsx-".concat(styles.__hash) + " " + "info unselectable"
49
- }, info), /*#__PURE__*/React.createElement("div", {
26
+ }, onlineStatusMessage), /*#__PURE__*/React.createElement("div", {
50
27
  className: "jsx-".concat(styles.__hash) + " " + (cx('icon', online ? 'online' : 'offline') || "")
51
28
  }), /*#__PURE__*/React.createElement("span", {
52
29
  className: "jsx-".concat(styles.__hash) + " " + "label unselectable"
53
- }, displayStatus), info && dense && /*#__PURE__*/React.createElement("span", {
30
+ }, displayStatus), onlineStatusMessage && dense && /*#__PURE__*/React.createElement("span", {
54
31
  className: "jsx-".concat(styles.__hash) + " " + "info-dense unselectable"
55
- }, info), /*#__PURE__*/React.createElement(_JSXStyle, {
32
+ }, onlineStatusMessage), /*#__PURE__*/React.createElement(_JSXStyle, {
56
33
  id: styles.__hash
57
34
  }, styles));
58
35
  }
@@ -1,4 +1,4 @@
1
1
  import { colors, spacers } from '@dhis2/ui-constants';
2
- const _defaultExport = [".container.jsx-1778673733{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;background-color:#104167;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:".concat(colors.grey100, ";}"), ".container.badge.jsx-1778673733{margin-right:".concat(spacers.dp24, ";padding:").concat(spacers.dp8, ";border-radius:5px;font-size:14px;}"), ".container.bar.jsx-1778673733{display:none;padding:0px ".concat(spacers.dp4, ";min-height:24px;font-size:13px;}"), "@media (max-width:480px){.container.badge.jsx-1778673733{display:none;}.container.bar.jsx-1778673733{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}", ".unselectable.jsx-1778673733{cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".info.jsx-1778673733{margin-right:".concat(spacers.dp16, ";}"), ".info-dense.jsx-1778673733{margin-left:".concat(spacers.dp12, ";font-size:12px;}"), ".icon.jsx-1778673733{width:8px;height:8px;border-radius:8px;margin-right:".concat(spacers.dp4, ";}"), ".icon.online.jsx-1778673733{background-color:".concat(colors.teal400, ";}"), ".icon.offline.jsx-1778673733{background-color:transparent;border:1px solid ".concat(colors.yellow300, ";}"), ".icon.reconnecting.jsx-1778673733{background:".concat(colors.grey300, ";-webkit-animation:fadeinout 2s linear infinite;-webkit-animation:fadeinout-jsx-1778673733 2s linear infinite;animation:fadeinout-jsx-1778673733 2s linear infinite;opacity:0;}"), "@-webkit-keyframes fadeinout{50%.jsx-1778673733{opacity:1;}}", "@-webkit-keyframes fadeinout-jsx-1778673733{50%{opacity:1;}}", "@keyframes fadeinout-jsx-1778673733{50%{opacity:1;}}", ".label.jsx-1778673733{-webkit-letter-spacing:0.5px;-moz-letter-spacing:0.5px;-ms-letter-spacing:0.5px;letter-spacing:0.5px;}"];
3
- _defaultExport.__hash = "1778673733";
2
+ const _defaultExport = [".container.jsx-2116755021{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;background-color:#104167;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:".concat(colors.grey100, ";}"), ".container.badge.jsx-2116755021{margin-right:".concat(spacers.dp24, ";padding:").concat(spacers.dp8, ";border-radius:5px;font-size:14px;}"), ".container.bar.jsx-2116755021{display:none;padding:0px ".concat(spacers.dp4, ";min-height:24px;font-size:13px;}"), "@media (max-width:480px){.container.badge.jsx-2116755021{display:none;}.container.bar.jsx-2116755021{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}", ".unselectable.jsx-2116755021{cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".info.jsx-2116755021{margin-right:".concat(spacers.dp16, ";}"), ".info-dense.jsx-2116755021{margin-left:".concat(spacers.dp12, ";font-size:12px;}"), ".icon.jsx-2116755021{width:8px;min-width:8px;height:8px;border-radius:8px;margin-right:".concat(spacers.dp4, ";}"), ".icon.online.jsx-2116755021{background-color:".concat(colors.teal400, ";}"), ".icon.offline.jsx-2116755021{background-color:transparent;border:1px solid ".concat(colors.yellow300, ";}"), ".icon.reconnecting.jsx-2116755021{background:".concat(colors.grey300, ";-webkit-animation:fadeinout 2s linear infinite;-webkit-animation:fadeinout-jsx-2116755021 2s linear infinite;animation:fadeinout-jsx-2116755021 2s linear infinite;opacity:0;}"), "@-webkit-keyframes fadeinout{50%.jsx-2116755021{opacity:1;}}", "@-webkit-keyframes fadeinout-jsx-2116755021{50%{opacity:1;}}", "@keyframes fadeinout-jsx-2116755021{50%{opacity:1;}}", ".label.jsx-2116755021{-webkit-letter-spacing:0.5px;-moz-letter-spacing:0.5px;-ms-letter-spacing:0.5px;letter-spacing:0.5px;}"];
3
+ _defaultExport.__hash = "2116755021";
4
4
  export default _defaultExport;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/header-bar",
3
- "version": "8.5.3",
3
+ "version": "8.6.0",
4
4
  "description": "UI HeaderBar",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,21 +33,21 @@
33
33
  "styled-jsx": "^4"
34
34
  },
35
35
  "dependencies": {
36
- "@dhis2-ui/box": "8.5.3",
37
- "@dhis2-ui/button": "8.5.3",
38
- "@dhis2-ui/card": "8.5.3",
39
- "@dhis2-ui/center": "8.5.3",
40
- "@dhis2-ui/divider": "8.5.3",
41
- "@dhis2-ui/input": "8.5.3",
42
- "@dhis2-ui/layer": "8.5.3",
43
- "@dhis2-ui/loader": "8.5.3",
44
- "@dhis2-ui/logo": "8.5.3",
45
- "@dhis2-ui/menu": "8.5.3",
46
- "@dhis2-ui/modal": "8.5.3",
47
- "@dhis2-ui/user-avatar": "8.5.3",
36
+ "@dhis2-ui/box": "8.6.0",
37
+ "@dhis2-ui/button": "8.6.0",
38
+ "@dhis2-ui/card": "8.6.0",
39
+ "@dhis2-ui/center": "8.6.0",
40
+ "@dhis2-ui/divider": "8.6.0",
41
+ "@dhis2-ui/input": "8.6.0",
42
+ "@dhis2-ui/layer": "8.6.0",
43
+ "@dhis2-ui/loader": "8.6.0",
44
+ "@dhis2-ui/logo": "8.6.0",
45
+ "@dhis2-ui/menu": "8.6.0",
46
+ "@dhis2-ui/modal": "8.6.0",
47
+ "@dhis2-ui/user-avatar": "8.6.0",
48
48
  "@dhis2/prop-types": "^3.1.2",
49
- "@dhis2/ui-constants": "8.5.3",
50
- "@dhis2/ui-icons": "8.5.3",
49
+ "@dhis2/ui-constants": "8.6.0",
50
+ "@dhis2/ui-icons": "8.6.0",
51
51
  "classnames": "^2.3.1",
52
52
  "moment": "^2.29.1",
53
53
  "prop-types": "^15.7.2"
@@ -56,7 +56,7 @@
56
56
  "build"
57
57
  ],
58
58
  "devDependencies": {
59
- "@dhis2/app-runtime": "^3.0.0",
59
+ "@dhis2/app-runtime": "^3.6.0",
60
60
  "@dhis2/d2-i18n": "^1.1.0",
61
61
  "react": "16.13",
62
62
  "react-dom": "16.13",
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.WithLastOnline = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _index = require("../../index.js");
11
-
12
- var _common = require("./common.js");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- const WithLastOnline = () => /*#__PURE__*/_react.default.createElement(_index.HeaderBar, {
17
- appName: "Example!"
18
- });
19
-
20
- exports.WithLastOnline = WithLastOnline;
21
- WithLastOnline.decorators = [(0, _common.createDecoratorCustomDataProviderHeaderBar)(), (0, _common.createDecoratorProvider)({ ..._common.providerConfig,
22
- headerbar: {
23
- showOnlineStatus: true,
24
- onlineStatusInfo: 'LAST_ONLINE'
25
- }
26
- })];
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { HeaderBar } from '../../index.js';
3
- import { providerConfig, createDecoratorCustomDataProviderHeaderBar, createDecoratorProvider } from './common.js';
4
- export const WithLastOnline = () => /*#__PURE__*/React.createElement(HeaderBar, {
5
- appName: "Example!"
6
- });
7
- WithLastOnline.decorators = [createDecoratorCustomDataProviderHeaderBar(), createDecoratorProvider({ ...providerConfig,
8
- headerbar: {
9
- showOnlineStatus: true,
10
- onlineStatusInfo: 'LAST_ONLINE'
11
- }
12
- })];