@dhis2-ui/header-bar 8.1.11 → 8.2.2
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.
- package/build/cjs/__e2e__/header-bar.stories.e2e.js +22 -22
- package/build/cjs/__e2e__/stories/common.js +3 -2
- package/build/cjs/apps.js +65 -51
- package/build/cjs/features/common/index.js +1 -1
- package/build/cjs/features/the_headerbar_contains_a_profile_menu/common.js +1 -4
- 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 +2 -2
- package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_menu_opens.js +1 -4
- package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_can_log_out.js +1 -1
- package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +4 -2
- package/build/cjs/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +2 -1
- package/build/cjs/header-bar.js +6 -5
- package/build/cjs/header-bar.stories.js +4 -16
- package/build/cjs/join-path.js +5 -1
- package/build/cjs/notification-icon.js +19 -16
- package/build/cjs/notifications.js +6 -5
- package/build/cjs/online-status.js +14 -12
- package/build/cjs/online-status.styles.js +1 -1
- package/build/cjs/profile/profile-header.js +57 -44
- package/build/cjs/profile/profile-menu.js +26 -22
- package/build/cjs/profile.js +2 -2
- package/build/cjs/title.js +12 -9
- package/build/es/__e2e__/stories/common.js +2 -1
- package/build/es/apps.js +65 -51
- package/build/es/features/common/index.js +1 -1
- package/build/es/features/the_headerbar_contains_a_profile_menu/common.js +1 -4
- 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 +2 -2
- package/build/es/features/the_headerbar_contains_a_profile_menu/the_menu_opens.js +1 -4
- package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_can_log_out.js +1 -1
- package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +4 -2
- package/build/es/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +2 -1
- package/build/es/header-bar.js +6 -5
- package/build/es/header-bar.stories.js +3 -15
- package/build/es/join-path.js +5 -1
- package/build/es/notification-icon.js +19 -16
- package/build/es/notifications.js +6 -5
- package/build/es/online-status.js +14 -12
- package/build/es/online-status.styles.js +1 -1
- package/build/es/profile/profile-header.js +57 -44
- package/build/es/profile/profile-menu.js +26 -22
- package/build/es/profile.js +2 -2
- package/build/es/title.js +12 -9
- package/package.json +13 -13
|
@@ -3,28 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _default2.Default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ShowOnlineStatus", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _showOnlineStatus.ShowOnlineStatus;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "PWAEnabled", {
|
|
6
|
+
Object.defineProperty(exports, "CustomApplicationTitle", {
|
|
19
7
|
enumerable: true,
|
|
20
8
|
get: function () {
|
|
21
|
-
return
|
|
9
|
+
return _customApplicationTitle.CustomApplicationTitle;
|
|
22
10
|
}
|
|
23
11
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "Default", {
|
|
25
13
|
enumerable: true,
|
|
26
14
|
get: function () {
|
|
27
|
-
return
|
|
15
|
+
return _default2.Default;
|
|
28
16
|
}
|
|
29
17
|
});
|
|
30
18
|
Object.defineProperty(exports, "MeWithAvatar", {
|
|
@@ -33,16 +21,16 @@ Object.defineProperty(exports, "MeWithAvatar", {
|
|
|
33
21
|
return _meWithAvatar.MeWithAvatar;
|
|
34
22
|
}
|
|
35
23
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "PWAEnabled", {
|
|
37
25
|
enumerable: true,
|
|
38
26
|
get: function () {
|
|
39
|
-
return
|
|
27
|
+
return _pwaEnabled.PWAEnabled;
|
|
40
28
|
}
|
|
41
29
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "ShowOnlineStatus", {
|
|
43
31
|
enumerable: true,
|
|
44
32
|
get: function () {
|
|
45
|
-
return
|
|
33
|
+
return _showOnlineStatus.ShowOnlineStatus;
|
|
46
34
|
}
|
|
47
35
|
});
|
|
48
36
|
Object.defineProperty(exports, "UserHasAllAuthority", {
|
|
@@ -51,6 +39,12 @@ Object.defineProperty(exports, "UserHasAllAuthority", {
|
|
|
51
39
|
return _userHasAllAuthority.UserHasAllAuthority;
|
|
52
40
|
}
|
|
53
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "UserHasNoAuthorities", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _userHasNoAuthorities.UserHasNoAuthorities;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
54
48
|
Object.defineProperty(exports, "UserHasWebInterpretationAndMessagingAuthority", {
|
|
55
49
|
enumerable: true,
|
|
56
50
|
get: function () {
|
|
@@ -69,10 +63,16 @@ Object.defineProperty(exports, "UserHasWebMessagingAuthority", {
|
|
|
69
63
|
return _userHasWebMessagingAuthority.UserHasWebMessagingAuthority;
|
|
70
64
|
}
|
|
71
65
|
});
|
|
72
|
-
Object.defineProperty(exports, "
|
|
66
|
+
Object.defineProperty(exports, "WithLastOnline", {
|
|
73
67
|
enumerable: true,
|
|
74
68
|
get: function () {
|
|
75
|
-
return
|
|
69
|
+
return _withLastOnline.WithLastOnline;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "WithSpecialAppNameCharacters", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _withSpecialAppNameCharacter.WithSpecialAppNameCharacters;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "ZeroUnreadInterpretations", {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.providerConfig = exports.modulesWithSpecialCharacters = exports.defaultModules = exports.dataProviderData = exports.createDecoratorProvider = exports.createDecoratorCustomDataProviderHeaderBar = exports.applicationTitle = void 0;
|
|
7
7
|
|
|
8
8
|
var _appRuntime = require("@dhis2/app-runtime");
|
|
9
9
|
|
|
@@ -334,7 +334,8 @@ const dataProviderData = {
|
|
|
334
334
|
|
|
335
335
|
exports.dataProviderData = dataProviderData;
|
|
336
336
|
|
|
337
|
-
const createDecoratorCustomDataProviderHeaderBar = (
|
|
337
|
+
const createDecoratorCustomDataProviderHeaderBar = function () {
|
|
338
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : dataProviderData;
|
|
338
339
|
return fn => {
|
|
339
340
|
window.dataProviderData = data;
|
|
340
341
|
return /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
|
package/build/cjs/apps.js
CHANGED
|
@@ -39,10 +39,11 @@ function escapeRegExpCharacters(text) {
|
|
|
39
39
|
return text.replace(/[/.*+?^${}()|[\]\\]/g, '\\$&');
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function Search({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
function Search(_ref) {
|
|
43
|
+
let {
|
|
44
|
+
value,
|
|
45
|
+
onChange
|
|
46
|
+
} = _ref;
|
|
46
47
|
const {
|
|
47
48
|
baseUrl
|
|
48
49
|
} = (0, _appRuntime.useConfig)();
|
|
@@ -73,11 +74,12 @@ Search.propTypes = {
|
|
|
73
74
|
onChange: _propTypes.default.func.isRequired
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
function Item({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
function Item(_ref2) {
|
|
78
|
+
let {
|
|
79
|
+
name,
|
|
80
|
+
path,
|
|
81
|
+
img
|
|
82
|
+
} = _ref2;
|
|
81
83
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
82
84
|
href: path,
|
|
83
85
|
className: _style.default.dynamic([["3670725638", [_uiConstants.theme.primary050]]])
|
|
@@ -90,7 +92,7 @@ function Item({
|
|
|
90
92
|
}, name), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
91
93
|
id: "3670725638",
|
|
92
94
|
dynamic: [_uiConstants.theme.primary050]
|
|
93
|
-
}, ["a.__jsx-style-dynamic-selector{display:inline-block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-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;width:96px;margin:8px;padding:8px;border-radius:12px;-webkit-text-decoration:none;text-decoration:none;cursor:pointer;}",
|
|
95
|
+
}, ["a.__jsx-style-dynamic-selector{display:inline-block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-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;width:96px;margin:8px;padding:8px;border-radius:12px;-webkit-text-decoration:none;text-decoration:none;cursor:pointer;}", "a.__jsx-style-dynamic-selector:hover,a.__jsx-style-dynamic-selector:focus{background-color:".concat(_uiConstants.theme.primary050, ";cursor:pointer;}"), "a.__jsx-style-dynamic-selector:hover>div.__jsx-style-dynamic-selector{font-weight:500;cursor:pointer;}", "img.__jsx-style-dynamic-selector{width:48px;height:48px;cursor:pointer;}", "div.__jsx-style-dynamic-selector{margin-top:14px;color:rgba(0,0,0,0.87);font-size:12px;-webkit-letter-spacing:0.01em;-moz-letter-spacing:0.01em;-ms-letter-spacing:0.01em;letter-spacing:0.01em;line-height:14px;text-align:center;cursor:pointer;}"]));
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
Item.propTypes = {
|
|
@@ -99,32 +101,37 @@ Item.propTypes = {
|
|
|
99
101
|
path: _propTypes.default.string
|
|
100
102
|
};
|
|
101
103
|
|
|
102
|
-
function List({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
function List(_ref3) {
|
|
105
|
+
let {
|
|
106
|
+
apps,
|
|
107
|
+
filter
|
|
108
|
+
} = _ref3;
|
|
106
109
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
107
110
|
"data-test": "headerbar-apps-menu-list",
|
|
108
111
|
className: "jsx-2076871745"
|
|
109
|
-
}, apps.filter(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
}, apps.filter(_ref4 => {
|
|
113
|
+
let {
|
|
114
|
+
displayName,
|
|
115
|
+
name
|
|
116
|
+
} = _ref4;
|
|
113
117
|
const appName = displayName || name;
|
|
114
118
|
const formattedAppName = appName.toLowerCase();
|
|
115
119
|
const formattedFilter = escapeRegExpCharacters(filter).toLowerCase();
|
|
116
120
|
return filter.length > 0 ? formattedAppName.match(formattedFilter) : true;
|
|
117
|
-
}).map(({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
}).map((_ref5, idx) => {
|
|
122
|
+
let {
|
|
123
|
+
displayName,
|
|
124
|
+
name,
|
|
125
|
+
defaultAction,
|
|
126
|
+
icon
|
|
127
|
+
} = _ref5;
|
|
128
|
+
return /*#__PURE__*/_react.default.createElement(Item, {
|
|
129
|
+
key: "app-".concat(name, "-").concat(idx),
|
|
130
|
+
name: displayName || name,
|
|
131
|
+
path: defaultAction,
|
|
132
|
+
img: icon
|
|
133
|
+
});
|
|
134
|
+
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
128
135
|
id: "2076871745"
|
|
129
136
|
}, ["div.jsx-2076871745{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;width:30vw;min-width:300px;max-width:560px;min-height:200px;max-height:465px;margin:0 8px 8px 8px;overflow:auto;overflow-x:hidden;}"]));
|
|
130
137
|
}
|
|
@@ -134,22 +141,25 @@ List.propTypes = {
|
|
|
134
141
|
filter: _propTypes.default.string
|
|
135
142
|
};
|
|
136
143
|
|
|
137
|
-
const AppMenu =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
},
|
|
144
|
+
const AppMenu = _ref6 => {
|
|
145
|
+
let {
|
|
146
|
+
apps,
|
|
147
|
+
filter,
|
|
148
|
+
onFilterChange
|
|
149
|
+
} = _ref6;
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
151
|
+
"data-test": "headerbar-apps-menu",
|
|
152
|
+
className: "jsx-3879001227"
|
|
153
|
+
}, /*#__PURE__*/_react.default.createElement(_card.Card, null, /*#__PURE__*/_react.default.createElement(Search, {
|
|
154
|
+
value: filter,
|
|
155
|
+
onChange: onFilterChange
|
|
156
|
+
}), /*#__PURE__*/_react.default.createElement(List, {
|
|
157
|
+
apps: apps,
|
|
158
|
+
filter: filter
|
|
159
|
+
})), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
160
|
+
id: "3879001227"
|
|
161
|
+
}, ["div.jsx-3879001227{z-index:10000;position:absolute;top:28px;right:-6px;border-top:4px solid transparent;}"]));
|
|
162
|
+
};
|
|
153
163
|
|
|
154
164
|
AppMenu.propTypes = {
|
|
155
165
|
apps: _propTypes.default.array.isRequired,
|
|
@@ -157,15 +167,19 @@ AppMenu.propTypes = {
|
|
|
157
167
|
filter: _propTypes.default.string
|
|
158
168
|
};
|
|
159
169
|
|
|
160
|
-
const Apps =
|
|
161
|
-
|
|
162
|
-
|
|
170
|
+
const Apps = _ref7 => {
|
|
171
|
+
let {
|
|
172
|
+
apps
|
|
173
|
+
} = _ref7;
|
|
163
174
|
const [show, setShow] = (0, _react.useState)(false);
|
|
164
175
|
const [filter, setFilter] = (0, _react.useState)('');
|
|
165
176
|
const handleVisibilityToggle = (0, _react.useCallback)(() => setShow(!show), [show]);
|
|
166
|
-
const handleFilterChange = (0, _react.useCallback)(
|
|
167
|
-
|
|
168
|
-
|
|
177
|
+
const handleFilterChange = (0, _react.useCallback)(_ref8 => {
|
|
178
|
+
let {
|
|
179
|
+
value
|
|
180
|
+
} = _ref8;
|
|
181
|
+
return setFilter(value);
|
|
182
|
+
}, []);
|
|
169
183
|
const containerEl = (0, _react.useRef)(null);
|
|
170
184
|
const onDocClick = (0, _react.useCallback)(evt => {
|
|
171
185
|
if (containerEl.current && !containerEl.current.contains(evt.target)) {
|
|
@@ -12,7 +12,7 @@ exports.baseUrl = baseUrl;
|
|
|
12
12
|
const webCommons = 'https://domain.tld/dhis-web-commons/';
|
|
13
13
|
exports.webCommons = webCommons;
|
|
14
14
|
(0, _steps.Before)(() => {
|
|
15
|
-
cy.intercept('GET',
|
|
15
|
+
cy.intercept('GET', "".concat(baseUrl, "api/fileResources/avatarId/data"), {
|
|
16
16
|
fixture: 'HeaderBar/avatar.png'
|
|
17
17
|
}).as('avatar');
|
|
18
18
|
});
|
|
@@ -6,8 +6,5 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
6
6
|
cy.get('[data-test="headerbar-profile-menu"]').should('not.exist');
|
|
7
7
|
});
|
|
8
8
|
(0, _steps.When)('the user opens the menu', () => {
|
|
9
|
-
cy.get(
|
|
10
|
-
[data-test="headerbar-profile-icon-text"],
|
|
11
|
-
[data-test="headerbar-profile-icon-image"]
|
|
12
|
-
`).click();
|
|
9
|
+
cy.get("\n [data-test=\"headerbar-profile-icon-text\"],\n [data-test=\"headerbar-profile-icon-image\"]\n ").click();
|
|
13
10
|
});
|
|
@@ -7,7 +7,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
7
7
|
(0, _steps.Given)('the HeaderBar loads without an error and the user does not have an avatar', () => {
|
|
8
8
|
cy.visitStory('HeaderBarTesting', 'Default');
|
|
9
9
|
});
|
|
10
|
-
(0, _steps.Then)(
|
|
10
|
+
(0, _steps.Then)("the headerbar contains a text icon of size 36px", () => {
|
|
11
11
|
cy.fixture('HeaderBar/me').then(() => {
|
|
12
12
|
cy.get('[data-test="headerbar-profile-icon-text"]').should('be.visible').and('have.css', 'height', '36px').and('have.css', 'width', '36px');
|
|
13
13
|
});
|
|
@@ -15,7 +15,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
15
15
|
(0, _steps.When)('the user clicks on the text icon', () => {
|
|
16
16
|
cy.get('[data-test="headerbar-profile-icon-text"]').click();
|
|
17
17
|
});
|
|
18
|
-
(0, _steps.Then)(
|
|
18
|
+
(0, _steps.Then)("the profile menu contains a text icon of size 48px", () => {
|
|
19
19
|
cy.fixture('HeaderBar/me').then(() => {
|
|
20
20
|
cy.get('[data-test="headerbar-profile-menu-icon-text"]').should('be.visible').and('have.css', 'height', '48px').and('have.css', 'width', '48px');
|
|
21
21
|
});
|
|
@@ -5,10 +5,7 @@ require("../common/index.js");
|
|
|
5
5
|
var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
6
6
|
|
|
7
7
|
(0, _steps.When)('the user clicks on the profile icons', () => {
|
|
8
|
-
cy.get(
|
|
9
|
-
[data-test="headerbar-profile-icon-text"],
|
|
10
|
-
[data-test="headerbar-profile-icon-image"]
|
|
11
|
-
`).click();
|
|
8
|
+
cy.get("\n [data-test=\"headerbar-profile-icon-text\"],\n [data-test=\"headerbar-profile-icon-image\"]\n ").click();
|
|
12
9
|
});
|
|
13
10
|
(0, _steps.Then)('the menu opens', () => {
|
|
14
11
|
cy.get('[data-test="headerbar-profile-menu"]').should('be.visible');
|
|
@@ -4,7 +4,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
4
4
|
|
|
5
5
|
var _index = require("../common/index.js");
|
|
6
6
|
|
|
7
|
-
const logoutUrl =
|
|
7
|
+
const logoutUrl = "".concat(_index.baseUrl, "dhis-web-commons-security/logout.action");
|
|
8
8
|
(0, _steps.Then)('contains a link to log out the user', () => {
|
|
9
9
|
cy.get('[data-test="headerbar-profile-menu"] > li').should(lis => {
|
|
10
10
|
const menuItem = lis.eq(4);
|
|
@@ -5,7 +5,8 @@ require("../common/index.js");
|
|
|
5
5
|
var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
6
6
|
|
|
7
7
|
(0, _steps.Then)('contains the user name', () => {
|
|
8
|
-
cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-username"]')).then(
|
|
8
|
+
cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-username"]')).then(_ref => {
|
|
9
|
+
let [win, $name] = _ref;
|
|
9
10
|
console.log('win.dataProviderData', win.dataProviderData);
|
|
10
11
|
const {
|
|
11
12
|
name
|
|
@@ -14,7 +15,8 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
14
15
|
});
|
|
15
16
|
});
|
|
16
17
|
(0, _steps.Then)('contains the user email', () => {
|
|
17
|
-
cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-user-email"]')).then(
|
|
18
|
+
cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-user-email"]')).then(_ref2 => {
|
|
19
|
+
let [win, $email] = _ref2;
|
|
18
20
|
const {
|
|
19
21
|
email
|
|
20
22
|
} = win.dataProviderData.me;
|
|
@@ -6,7 +6,8 @@ require("../common/index.js");
|
|
|
6
6
|
|
|
7
7
|
(0, _steps.Given)(/no app name contains a (.*)/, character => {
|
|
8
8
|
// Needs to be wrapped, otherwise for some reason the wrong char is in the scope
|
|
9
|
-
cy.all(() => cy.window(), () => cy.wrap(character)).then(
|
|
9
|
+
cy.all(() => cy.window(), () => cy.wrap(character)).then(_ref => {
|
|
10
|
+
let [win, char] = _ref;
|
|
10
11
|
const {
|
|
11
12
|
dataProviderData
|
|
12
13
|
} = win;
|
package/build/cjs/header-bar.js
CHANGED
|
@@ -58,12 +58,13 @@ const query = {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
const HeaderBar =
|
|
62
|
-
appName,
|
|
63
|
-
className
|
|
64
|
-
}) => {
|
|
61
|
+
const HeaderBar = _ref => {
|
|
65
62
|
var _data$user$avatar;
|
|
66
63
|
|
|
64
|
+
let {
|
|
65
|
+
appName,
|
|
66
|
+
className
|
|
67
|
+
} = _ref;
|
|
67
68
|
const {
|
|
68
69
|
baseUrl,
|
|
69
70
|
pwaEnabled,
|
|
@@ -119,7 +120,7 @@ const HeaderBar = ({
|
|
|
119
120
|
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
120
121
|
id: "3517276904",
|
|
121
122
|
dynamic: [_uiConstants.colors.white]
|
|
122
|
-
}, [
|
|
123
|
+
}, [".main.__jsx-style-dynamic-selector{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;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;background-color:#2c6693;border-bottom:1px solid rgba(32,32,32,0.15);color:".concat(_uiConstants.colors.white, ";height:48px;}"), ".right-control-spacer.__jsx-style-dynamic-selector{margin-left:auto;}"]));
|
|
123
124
|
};
|
|
124
125
|
|
|
125
126
|
exports.HeaderBar = HeaderBar;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.WithOnlineStatus = exports.WithLastOnlineInfo = 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
|
|
|
@@ -14,21 +14,9 @@ var _headerBar = require("./header-bar.js");
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
const subtitle = 'The common navigation bar used in all DHIS2 apps';
|
|
17
|
-
const description =
|
|
18
|
-
The 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.
|
|
19
|
-
|
|
20
|
-
The header bar is included automatically with the App Shell and should not need any configuration.
|
|
21
|
-
|
|
22
|
-
#### Theme
|
|
23
|
-
|
|
24
|
-
The 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.
|
|
25
|
-
|
|
26
|
-
\`\`\`js
|
|
27
|
-
import { HeaderBar } from '@dhis2/ui'
|
|
28
|
-
\`\`\`
|
|
29
|
-
`;
|
|
17
|
+
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";
|
|
30
18
|
var _default = {
|
|
31
|
-
title: '
|
|
19
|
+
title: 'Header Bar',
|
|
32
20
|
component: _headerBar.HeaderBar,
|
|
33
21
|
parameters: {
|
|
34
22
|
componentSubtitle: subtitle,
|
|
@@ -158,7 +146,7 @@ const customLocaleData = { ...customData,
|
|
|
158
146
|
},
|
|
159
147
|
'action::menu/getModules': {
|
|
160
148
|
modules: customData['action::menu/getModules'].modules.map(mod => ({ ...mod,
|
|
161
|
-
displayName:
|
|
149
|
+
displayName: "Le ".concat(mod.displayName)
|
|
162
150
|
}))
|
|
163
151
|
}
|
|
164
152
|
};
|
package/build/cjs/join-path.js
CHANGED
|
@@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.joinPath = void 0;
|
|
7
7
|
|
|
8
|
-
const joinPath = (
|
|
8
|
+
const joinPath = function () {
|
|
9
|
+
for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
|
+
parts[_key] = arguments[_key];
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
const realParts = parts.filter(part => !!part);
|
|
10
14
|
return realParts.map(part => part.replace(/^\/+|\/+$/g, '')).join('/');
|
|
11
15
|
};
|
|
@@ -29,22 +29,25 @@ function icon(kind) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const NotificationIcon =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
const NotificationIcon = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
count,
|
|
35
|
+
href,
|
|
36
|
+
kind,
|
|
37
|
+
dataTestId
|
|
38
|
+
} = _ref;
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement("a", {
|
|
40
|
+
href: href,
|
|
41
|
+
"data-test": dataTestId,
|
|
42
|
+
className: _style.default.dynamic([["2450998793", [_uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]]]) + " " + (kind || "")
|
|
43
|
+
}, icon(kind), count > 0 && /*#__PURE__*/_react.default.createElement("span", {
|
|
44
|
+
"data-test": "".concat(dataTestId, "-count"),
|
|
45
|
+
className: _style.default.dynamic([["2450998793", [_uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]]])
|
|
46
|
+
}, count), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
47
|
+
id: "2450998793",
|
|
48
|
+
dynamic: [_uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]
|
|
49
|
+
}, ["a.__jsx-style-dynamic-selector{position:relative;margin:4px 24px 0 0;cursor:pointer;}", "a.__jsx-style-dynamic-selector:focus{outline:1px dotted white;}", "span.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;position:absolute;top:-9px;right:-6px;min-width:18px;min-height:18px;border-radius:".concat(_uiConstants.spacers.dp12, ";box-shadow:0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);background-color:").concat(_uiConstants.theme.secondary500, ";color:").concat(_uiConstants.colors.white, ";font-size:13px;font-weight:600;line-height:15px;text-align:center;cursor:inherit;padding:0 ").concat(_uiConstants.spacers.dp4, ";}")]));
|
|
50
|
+
};
|
|
48
51
|
|
|
49
52
|
exports.NotificationIcon = NotificationIcon;
|
|
50
53
|
NotificationIcon.defaultProps = {
|
|
@@ -27,11 +27,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
27
|
*/
|
|
28
28
|
const hasAuthority = (userAuthorities, authId) => Array.isArray(userAuthorities) && userAuthorities.some(userAuthId => userAuthId === 'ALL' || userAuthId === authId);
|
|
29
29
|
|
|
30
|
-
const Notifications =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const Notifications = _ref => {
|
|
31
|
+
let {
|
|
32
|
+
interpretations,
|
|
33
|
+
messages,
|
|
34
|
+
userAuthorities
|
|
35
|
+
} = _ref;
|
|
35
36
|
const {
|
|
36
37
|
baseUrl
|
|
37
38
|
} = (0, _appRuntime.useConfig)();
|
|
@@ -23,10 +23,11 @@ var _onlineStatusStyles = _interopRequireDefault(require("./online-status.styles
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
const useOnlineStatusInfo =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const useOnlineStatusInfo = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
online,
|
|
29
|
+
lastOnline
|
|
30
|
+
} = _ref;
|
|
30
31
|
const {
|
|
31
32
|
headerbar
|
|
32
33
|
} = (0, _appRuntime.useConfig)();
|
|
@@ -43,9 +44,10 @@ const useOnlineStatusInfo = ({
|
|
|
43
44
|
/** A badge to display online/offline status in the header bar */
|
|
44
45
|
|
|
45
46
|
|
|
46
|
-
function OnlineStatus({
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
function OnlineStatus(_ref2) {
|
|
48
|
+
let {
|
|
49
|
+
dense
|
|
50
|
+
} = _ref2;
|
|
49
51
|
const {
|
|
50
52
|
online,
|
|
51
53
|
lastOnline
|
|
@@ -57,15 +59,15 @@ function OnlineStatus({
|
|
|
57
59
|
const displayStatus = online ? _index.default.t('Online') : _index.default.t('Offline');
|
|
58
60
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
61
|
"data-test": "headerbar-online-status",
|
|
60
|
-
className:
|
|
62
|
+
className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + ((0, _classnames.default)('container', dense ? 'bar' : 'badge') || "")
|
|
61
63
|
}, info && !dense && /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
-
className:
|
|
64
|
+
className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + "info unselectable"
|
|
63
65
|
}, info), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className:
|
|
66
|
+
className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + ((0, _classnames.default)('icon', online ? 'online' : 'offline') || "")
|
|
65
67
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
66
|
-
className:
|
|
68
|
+
className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + "label unselectable"
|
|
67
69
|
}, displayStatus), info && dense && /*#__PURE__*/_react.default.createElement("span", {
|
|
68
|
-
className:
|
|
70
|
+
className: "jsx-".concat(_onlineStatusStyles.default.__hash) + " " + "info-dense unselectable"
|
|
69
71
|
}, info), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
70
72
|
id: _onlineStatusStyles.default.__hash
|
|
71
73
|
}, _onlineStatusStyles.default));
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _uiConstants = require("@dhis2/ui-constants");
|
|
9
9
|
|
|
10
|
-
const _defaultExport = [
|
|
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
11
|
_defaultExport.__hash = "1778673733";
|
|
12
12
|
var _default = _defaultExport;
|
|
13
13
|
exports.default = _default;
|