@dhis2-ui/header-bar 10.16.3-alpha.1 → 10.16.4
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__/stories/common.js +6 -11
- package/build/cjs/__e2e__/stories/with-update-available-notification.js +1 -2
- package/build/cjs/apps.js +51 -66
- package/build/cjs/debug-info/debug-info-menu-item.js +4 -5
- package/build/cjs/debug-info/debug-info-modal.js +3 -4
- package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +2 -4
- package/build/cjs/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +1 -2
- package/build/cjs/header-bar-context.js +6 -8
- package/build/cjs/header-bar.js +12 -14
- package/build/cjs/header-bar.prod.stories.js +1 -2
- package/build/cjs/join-path.js +1 -4
- package/build/cjs/locales/index.js +106 -65
- package/build/cjs/notification-icon.js +21 -24
- package/build/cjs/notifications.js +5 -6
- package/build/cjs/online-status.js +3 -4
- package/build/cjs/profile-menu/profile-header.js +44 -57
- package/build/cjs/profile-menu/profile-menu.js +17 -22
- package/build/cjs/profile-menu/update-notification.js +4 -5
- package/build/cjs/profile.js +7 -9
- package/build/cjs/title.js +9 -12
- package/build/es/__e2e__/stories/common.js +5 -9
- package/build/es/apps.js +50 -64
- package/build/es/debug-info/debug-info-menu-item.js +4 -5
- package/build/es/debug-info/debug-info-modal.js +3 -4
- package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +2 -4
- package/build/es/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +1 -2
- package/build/es/header-bar-context.js +5 -6
- package/build/es/header-bar.js +11 -12
- package/build/es/join-path.js +1 -4
- package/build/es/locales/index.js +78 -37
- package/build/es/notification-icon.js +21 -24
- package/build/es/notifications.js +5 -6
- package/build/es/online-status.js +3 -4
- package/build/es/profile-menu/profile-header.js +44 -57
- package/build/es/profile-menu/profile-menu.js +16 -20
- package/build/es/profile-menu/update-notification.js +4 -5
- package/build/es/profile.js +6 -7
- package/build/es/title.js +9 -12
- package/package.json +15 -15
- package/src/locales/index.js +114 -37
package/build/es/header-bar.js
CHANGED
|
@@ -32,15 +32,14 @@ const query = {
|
|
|
32
32
|
resource: 'me/dashboard'
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
export const HeaderBar =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} = _ref;
|
|
35
|
+
export const HeaderBar = ({
|
|
36
|
+
appName,
|
|
37
|
+
className,
|
|
38
|
+
updateAvailable,
|
|
39
|
+
onApplyAvailableUpdate,
|
|
40
|
+
skipI18n
|
|
41
|
+
}) => {
|
|
42
|
+
var _data$user2, _data$user$avatar;
|
|
44
43
|
const {
|
|
45
44
|
appName: configAppName,
|
|
46
45
|
baseUrl,
|
|
@@ -61,16 +60,16 @@ export const HeaderBar = _ref => {
|
|
|
61
60
|
}, [data, baseUrl]);
|
|
62
61
|
useEffect(() => {
|
|
63
62
|
if (!loading && !error && !skipI18n) {
|
|
64
|
-
var _data$user
|
|
63
|
+
var _data$user;
|
|
65
64
|
// This is the "legacy" way of localising the header bar, which is necesasry for external (non-platform) apps
|
|
66
65
|
// For platform apps, setting i18n is handled by the app-shell so this logic is redundant (and running it twice caused issues)
|
|
67
66
|
// For external apps, this logic is kept for backwards compatibility, but they also have the option of passing `skipI18n`
|
|
68
67
|
// and initialising i18n in the consumer
|
|
69
|
-
const locale = (data === null || data === void 0
|
|
68
|
+
const locale = (data === null || data === void 0 || (_data$user = data.user) === null || _data$user === void 0 || (_data$user = _data$user.settings) === null || _data$user === void 0 ? void 0 : _data$user.keyUiLocale) || 'en';
|
|
70
69
|
i18n.setDefaultNamespace('default');
|
|
71
70
|
i18n.changeLanguage(locale);
|
|
72
71
|
}
|
|
73
|
-
}, [data === null || data === void 0
|
|
72
|
+
}, [data === null || data === void 0 || (_data$user2 = data.user) === null || _data$user2 === void 0 || (_data$user2 = _data$user2.settings) === null || _data$user2 === void 0 ? void 0 : _data$user2.keyUiLocale, error, loading, skipI18n]);
|
|
74
73
|
return /*#__PURE__*/React.createElement(HeaderBarContextProvider, {
|
|
75
74
|
updateAvailable: updateAvailable,
|
|
76
75
|
onApplyAvailableUpdate: onApplyAvailableUpdate
|
package/build/es/join-path.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export const joinPath =
|
|
2
|
-
for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3
|
-
parts[_key] = arguments[_key];
|
|
4
|
-
}
|
|
1
|
+
export const joinPath = (...parts) => {
|
|
5
2
|
const realParts = parts.filter(part => !!part);
|
|
6
3
|
return realParts.map(part => part.replace(/^\/+|\/+$/g, '')).join('/');
|
|
7
4
|
};
|
|
@@ -45,41 +45,82 @@ import viTranslations from './vi/translations.json';
|
|
|
45
45
|
import zhTranslations from './zh/translations.json';
|
|
46
46
|
import zh_CNTranslations from './zh_CN/translations.json';
|
|
47
47
|
const namespace = 'default';
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
i18n.
|
|
53
|
-
i18n.
|
|
54
|
-
i18n.
|
|
55
|
-
i18n.
|
|
56
|
-
i18n.
|
|
57
|
-
i18n.
|
|
58
|
-
i18n.
|
|
59
|
-
i18n.
|
|
60
|
-
i18n.
|
|
61
|
-
i18n.
|
|
62
|
-
i18n.
|
|
63
|
-
i18n.
|
|
64
|
-
i18n.
|
|
65
|
-
i18n.
|
|
66
|
-
i18n.
|
|
67
|
-
i18n.
|
|
68
|
-
i18n.
|
|
69
|
-
i18n.
|
|
70
|
-
i18n.
|
|
71
|
-
i18n.
|
|
72
|
-
i18n.
|
|
73
|
-
i18n.
|
|
74
|
-
i18n.
|
|
75
|
-
i18n.
|
|
76
|
-
i18n.
|
|
77
|
-
i18n.
|
|
78
|
-
i18n.
|
|
79
|
-
i18n.
|
|
80
|
-
i18n.
|
|
81
|
-
i18n.
|
|
82
|
-
i18n.
|
|
83
|
-
i18n.
|
|
84
|
-
i18n.
|
|
48
|
+
|
|
49
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
50
|
+
// custom translations from the datastore (added by the app adapter)
|
|
51
|
+
|
|
52
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
53
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
54
|
+
i18n.addResourceBundle('ar_IQ', namespace, ar_IQTranslations, true, false);
|
|
55
|
+
i18n.addResourceBundle('ar-IQ', namespace, ar_IQTranslations, true, false);
|
|
56
|
+
i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
|
|
57
|
+
i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
|
|
58
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
59
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
60
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
61
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
62
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
63
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
64
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
65
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
66
|
+
i18n.addResourceBundle('en_US', namespace, en_USTranslations, true, false);
|
|
67
|
+
i18n.addResourceBundle('en-US', namespace, en_USTranslations, true, false);
|
|
68
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
69
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
70
|
+
i18n.addResourceBundle('es_419', namespace, es_419Translations, true, false);
|
|
71
|
+
i18n.addResourceBundle('es-419', namespace, es_419Translations, true, false);
|
|
72
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
73
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
74
|
+
i18n.addResourceBundle('hi_IN', namespace, hi_INTranslations, true, false);
|
|
75
|
+
i18n.addResourceBundle('hi-IN', namespace, hi_INTranslations, true, false);
|
|
76
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
77
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
78
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
79
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
80
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
81
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
82
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
83
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
84
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
85
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
86
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
87
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
88
|
+
i18n.addResourceBundle('or', namespace, orTranslations, true, false);
|
|
89
|
+
i18n.addResourceBundle('or', namespace, orTranslations, true, false);
|
|
90
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
91
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
92
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
93
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
94
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
95
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
96
|
+
i18n.addResourceBundle('pt_BR', namespace, pt_BRTranslations, true, false);
|
|
97
|
+
i18n.addResourceBundle('pt-BR', namespace, pt_BRTranslations, true, false);
|
|
98
|
+
i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
|
|
99
|
+
i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
|
|
100
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
101
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
102
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false);
|
|
103
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false);
|
|
104
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
105
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
106
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
107
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
108
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
109
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
110
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
111
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
112
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
113
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
114
|
+
i18n.addResourceBundle('uz_Latn', namespace, uz_LatnTranslations, true, false);
|
|
115
|
+
i18n.addResourceBundle('uz-Latn', namespace, uz_LatnTranslations, true, false);
|
|
116
|
+
i18n.addResourceBundle('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
117
|
+
i18n.addResourceBundle('uz-Cyrl-UZ', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
118
|
+
i18n.addResourceBundle('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations, true, false);
|
|
119
|
+
i18n.addResourceBundle('uz-Latn-UZ', namespace, uz_UZ_LatnTranslations, true, false);
|
|
120
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
121
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
122
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
123
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
124
|
+
i18n.addResourceBundle('zh_CN', namespace, zh_CNTranslations, true, false);
|
|
125
|
+
i18n.addResourceBundle('zh-CN', namespace, zh_CNTranslations, true, false);
|
|
85
126
|
export default i18n;
|
|
@@ -15,30 +15,27 @@ function icon(kind) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
export const NotificationIcon =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
dynamic: [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]
|
|
40
|
-
}, [`a.__jsx-style-dynamic-selector{position:relative;margin:0;cursor:pointer;padding:0 ${spacers.dp12};height:100%;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;}`, "a.__jsx-style-dynamic-selector:focus{outline:2px solid white;outline-offset:-2px;}", "a.__jsx-style-dynamic-selector:focus.__jsx-style-dynamic-selector:not(:focus-visible){outline:none;}", "a.__jsx-style-dynamic-selector:hover{background:#1a557f;}", "a.__jsx-style-dynamic-selector:active{background:#104067;}", `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:3px;inset-inline-end:2px;min-width:18px;min-height:18px;border-radius:${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:${theme.secondary500};color:${colors.white};font-size:13px;font-weight:600;line-height:15px;text-align:center;cursor:inherit;padding:0 ${spacers.dp4};}`]));
|
|
41
|
-
};
|
|
18
|
+
export const NotificationIcon = ({
|
|
19
|
+
count = 0,
|
|
20
|
+
href,
|
|
21
|
+
kind,
|
|
22
|
+
dataTestId,
|
|
23
|
+
title,
|
|
24
|
+
'aria-label': ariaLabel
|
|
25
|
+
}) => /*#__PURE__*/React.createElement("a", {
|
|
26
|
+
dir: "ltr",
|
|
27
|
+
href: href,
|
|
28
|
+
"data-test": dataTestId,
|
|
29
|
+
title: i18n.t(title),
|
|
30
|
+
"aria-label": i18n.t(ariaLabel),
|
|
31
|
+
className: _JSXStyle.dynamic([["995028205", [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]]]) + " " + (kind || "")
|
|
32
|
+
}, icon(kind), count > 0 && /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
"data-test": `${dataTestId}-count`,
|
|
34
|
+
className: _JSXStyle.dynamic([["995028205", [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]]])
|
|
35
|
+
}, count), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
36
|
+
id: "995028205",
|
|
37
|
+
dynamic: [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]
|
|
38
|
+
}, [`a.__jsx-style-dynamic-selector{position:relative;margin:0;cursor:pointer;padding:0 ${spacers.dp12};height:100%;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;}`, "a.__jsx-style-dynamic-selector:focus{outline:2px solid white;outline-offset:-2px;}", "a.__jsx-style-dynamic-selector:focus.__jsx-style-dynamic-selector:not(:focus-visible){outline:none;}", "a.__jsx-style-dynamic-selector:hover{background:#1a557f;}", "a.__jsx-style-dynamic-selector:active{background:#104067;}", `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:3px;inset-inline-end:2px;min-width:18px;min-height:18px;border-radius:${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:${theme.secondary500};color:${colors.white};font-size:13px;font-weight:600;line-height:15px;text-align:center;cursor:inherit;padding:0 ${spacers.dp4};}`]));
|
|
42
39
|
NotificationIcon.propTypes = {
|
|
43
40
|
'aria-label': PropTypes.string.isRequired,
|
|
44
41
|
href: PropTypes.string.isRequired,
|
|
@@ -6,12 +6,11 @@ import { joinPath } from './join-path.js';
|
|
|
6
6
|
import i18n from './locales/index.js';
|
|
7
7
|
import { NotificationIcon } from './notification-icon.js';
|
|
8
8
|
const hasAuthority = (userAuthorities, authId) => Array.isArray(userAuthorities) && userAuthorities.some(userAuthId => userAuthId === 'ALL' || userAuthId === authId);
|
|
9
|
-
export const Notifications =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
9
|
+
export const Notifications = ({
|
|
10
|
+
interpretations,
|
|
11
|
+
messages,
|
|
12
|
+
userAuthorities
|
|
13
|
+
}) => {
|
|
15
14
|
const {
|
|
16
15
|
baseUrl
|
|
17
16
|
} = useConfig();
|
|
@@ -7,10 +7,9 @@ import i18n from './locales/index.js';
|
|
|
7
7
|
import styles from './online-status.styles.js';
|
|
8
8
|
|
|
9
9
|
/** A badge to display online/offline status in the header bar */
|
|
10
|
-
export function OnlineStatus(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = _ref;
|
|
10
|
+
export function OnlineStatus({
|
|
11
|
+
dense
|
|
12
|
+
}) {
|
|
14
13
|
const {
|
|
15
14
|
isConnected: online
|
|
16
15
|
} = useDhis2ConnectionStatus();
|
|
@@ -5,38 +5,31 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { joinPath } from '../join-path.js';
|
|
7
7
|
import i18n from '../locales/index.js';
|
|
8
|
-
const ProfileName =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
id: "2223023701"
|
|
17
|
-
}, ["div.jsx-2223023701{margin-bottom:3px;font-size:16px;line-height:19px;}"]));
|
|
18
|
-
};
|
|
8
|
+
const ProfileName = ({
|
|
9
|
+
children
|
|
10
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
"data-test": "headerbar-profile-username",
|
|
12
|
+
className: "jsx-2223023701"
|
|
13
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
14
|
+
id: "2223023701"
|
|
15
|
+
}, ["div.jsx-2223023701{margin-bottom:3px;font-size:16px;line-height:19px;}"]));
|
|
19
16
|
ProfileName.propTypes = {
|
|
20
17
|
children: PropTypes.string
|
|
21
18
|
};
|
|
22
|
-
const ProfileEmail =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
id: "1072768994"
|
|
31
|
-
}, ["div.jsx-1072768994{margin-bottom:6px;font-size:14px;line-height:16px;}"]));
|
|
32
|
-
};
|
|
19
|
+
const ProfileEmail = ({
|
|
20
|
+
children
|
|
21
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
"data-test": "headerbar-profile-user-email",
|
|
23
|
+
className: "jsx-1072768994"
|
|
24
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
25
|
+
id: "1072768994"
|
|
26
|
+
}, ["div.jsx-1072768994{margin-bottom:6px;font-size:14px;line-height:16px;}"]));
|
|
33
27
|
ProfileEmail.propTypes = {
|
|
34
28
|
children: PropTypes.string
|
|
35
29
|
};
|
|
36
|
-
const ProfileEdit =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref3;
|
|
30
|
+
const ProfileEdit = ({
|
|
31
|
+
children
|
|
32
|
+
}) => {
|
|
40
33
|
const {
|
|
41
34
|
baseUrl
|
|
42
35
|
} = useConfig();
|
|
@@ -51,41 +44,35 @@ const ProfileEdit = _ref3 => {
|
|
|
51
44
|
ProfileEdit.propTypes = {
|
|
52
45
|
children: PropTypes.string
|
|
53
46
|
};
|
|
54
|
-
const ProfileDetails =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
id: "4236878114"
|
|
63
|
-
}, ["div.jsx-4236878114{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-inline-start:20px;color:#000;font-size:14px;font-weight:400;}"]));
|
|
64
|
-
};
|
|
47
|
+
const ProfileDetails = ({
|
|
48
|
+
name,
|
|
49
|
+
email
|
|
50
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: "jsx-4236878114"
|
|
52
|
+
}, /*#__PURE__*/React.createElement(ProfileName, null, name), /*#__PURE__*/React.createElement(ProfileEmail, null, email), /*#__PURE__*/React.createElement(ProfileEdit, null, i18n.t('Edit profile')), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
53
|
+
id: "4236878114"
|
|
54
|
+
}, ["div.jsx-4236878114{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-inline-start:20px;color:#000;font-size:14px;font-weight:400;}"]));
|
|
65
55
|
ProfileDetails.propTypes = {
|
|
66
56
|
email: PropTypes.string,
|
|
67
57
|
name: PropTypes.string
|
|
68
58
|
};
|
|
69
|
-
export const ProfileHeader =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
id: "371352323"
|
|
87
|
-
}, ["div.jsx-371352323{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-inline-start:24px;padding-top:20px;}"]));
|
|
88
|
-
};
|
|
59
|
+
export const ProfileHeader = ({
|
|
60
|
+
name,
|
|
61
|
+
email,
|
|
62
|
+
avatarId
|
|
63
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
className: "jsx-371352323"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(UserAvatar, {
|
|
66
|
+
avatarId: avatarId,
|
|
67
|
+
name: name,
|
|
68
|
+
dataTest: "headerbar-profile-menu-icon",
|
|
69
|
+
large: true
|
|
70
|
+
}), /*#__PURE__*/React.createElement(ProfileDetails, {
|
|
71
|
+
name: name,
|
|
72
|
+
email: email
|
|
73
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
74
|
+
id: "371352323"
|
|
75
|
+
}, ["div.jsx-371352323{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-inline-start:24px;padding-top:20px;}"]));
|
|
89
76
|
ProfileHeader.propTypes = {
|
|
90
77
|
avatarId: PropTypes.string,
|
|
91
78
|
email: PropTypes.string,
|
|
@@ -20,15 +20,14 @@ const LoadingMask = () => /*#__PURE__*/React.createElement(Layer, {
|
|
|
20
20
|
disablePortal: true,
|
|
21
21
|
dataTest: "headerbar-profile-menu-loading-mask"
|
|
22
22
|
}, /*#__PURE__*/React.createElement(Center, null, /*#__PURE__*/React.createElement(CircularLoader, null)));
|
|
23
|
-
const ProfileContents =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
23
|
+
const ProfileContents = ({
|
|
24
|
+
name,
|
|
25
|
+
email,
|
|
26
|
+
avatarId,
|
|
27
|
+
helpUrl,
|
|
28
|
+
hideProfileMenu,
|
|
29
|
+
showDebugInfoModal
|
|
30
|
+
}) => {
|
|
32
31
|
const {
|
|
33
32
|
baseUrl
|
|
34
33
|
} = useConfig();
|
|
@@ -108,17 +107,14 @@ ProfileContents.propTypes = {
|
|
|
108
107
|
helpUrl: PropTypes.string,
|
|
109
108
|
name: PropTypes.string
|
|
110
109
|
};
|
|
111
|
-
export const ProfileMenu =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
id: "3924623997"
|
|
120
|
-
}, ["div.jsx-3924623997{z-index:10000;position:absolute;inset-inline-end:4px;width:320px;}"]));
|
|
121
|
-
};
|
|
110
|
+
export const ProfileMenu = ({
|
|
111
|
+
...props
|
|
112
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
"data-test": "headerbar-profile-menu",
|
|
114
|
+
className: "jsx-3924623997"
|
|
115
|
+
}, /*#__PURE__*/React.createElement(ProfileContents, props), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
116
|
+
id: "3924623997"
|
|
117
|
+
}, ["div.jsx-3924623997{z-index:10000;position:absolute;inset-inline-end:4px;width:320px;}"]));
|
|
122
118
|
ProfileMenu.propTypes = {
|
|
123
119
|
hideProfileMenu: PropTypes.func.isRequired,
|
|
124
120
|
showDebugInfoModal: PropTypes.func.isRequired,
|
|
@@ -6,10 +6,9 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { useHeaderBarContext } from '../header-bar-context.js';
|
|
8
8
|
import i18n from '../locales/index.js';
|
|
9
|
-
export function UpdateNotification(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
9
|
+
export function UpdateNotification({
|
|
10
|
+
hideProfileMenu
|
|
11
|
+
}) {
|
|
13
12
|
const {
|
|
14
13
|
appName
|
|
15
14
|
} = useConfig();
|
|
@@ -19,7 +18,7 @@ export function UpdateNotification(_ref) {
|
|
|
19
18
|
} = useHeaderBarContext();
|
|
20
19
|
const onClick = () => {
|
|
21
20
|
hideProfileMenu();
|
|
22
|
-
onApplyAvailableUpdate === null || onApplyAvailableUpdate === void 0
|
|
21
|
+
onApplyAvailableUpdate === null || onApplyAvailableUpdate === void 0 || onApplyAvailableUpdate();
|
|
23
22
|
};
|
|
24
23
|
const updateNotificationLabel = /*#__PURE__*/React.createElement("div", {
|
|
25
24
|
className: _JSXStyle.dynamic([["4135170305", [colors.blue600]]]) + " " + "root"
|
package/build/es/profile.js
CHANGED
|
@@ -6,13 +6,12 @@ import { DebugInfoModal } from './debug-info/debug-info-modal.js';
|
|
|
6
6
|
import i18n from './locales/index.js';
|
|
7
7
|
import { useOnDocClick } from './profile/use-on-doc-click.js';
|
|
8
8
|
import { ProfileMenu } from './profile-menu/index.js';
|
|
9
|
-
const Profile =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
9
|
+
const Profile = ({
|
|
10
|
+
name,
|
|
11
|
+
email,
|
|
12
|
+
avatarId,
|
|
13
|
+
helpUrl
|
|
14
|
+
}) => {
|
|
16
15
|
const [showProfileMenu, setShowProfileMenu] = useState(false);
|
|
17
16
|
const [showDebugInfoModal, setShowDebugInfoModal] = useState(false);
|
|
18
17
|
const hideProfileMenu = useCallback(() => setShowProfileMenu(false), [setShowProfileMenu]);
|
package/build/es/title.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export const Title =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
id: "2721515324"
|
|
14
|
-
}, ["div.jsx-2721515324{overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;-webkit-letter-spacing:0.01em;-moz-letter-spacing:0.01em;-ms-letter-spacing:0.01em;letter-spacing:0.01em;white-space:nowrap;}"]));
|
|
15
|
-
};
|
|
4
|
+
export const Title = ({
|
|
5
|
+
app,
|
|
6
|
+
instance
|
|
7
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
"data-test": "headerbar-title",
|
|
9
|
+
className: "jsx-2721515324"
|
|
10
|
+
}, app ? `${instance} - ${app}` : `${instance}`, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
11
|
+
id: "2721515324"
|
|
12
|
+
}, ["div.jsx-2721515324{overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;-webkit-letter-spacing:0.01em;-moz-letter-spacing:0.01em;-ms-letter-spacing:0.01em;letter-spacing:0.01em;white-space:nowrap;}"]));
|
|
16
13
|
Title.propTypes = {
|
|
17
14
|
app: PropTypes.string,
|
|
18
15
|
instance: PropTypes.string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/header-bar",
|
|
3
|
-
"version": "10.16.
|
|
3
|
+
"version": "10.16.4",
|
|
4
4
|
"description": "UI HeaderBar",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"styled-jsx": "^4"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@dhis2-ui/box": "10.16.
|
|
38
|
-
"@dhis2-ui/button": "10.16.
|
|
39
|
-
"@dhis2-ui/card": "10.16.
|
|
40
|
-
"@dhis2-ui/center": "10.16.
|
|
41
|
-
"@dhis2-ui/divider": "10.16.
|
|
42
|
-
"@dhis2-ui/input": "10.16.
|
|
43
|
-
"@dhis2-ui/layer": "10.16.
|
|
44
|
-
"@dhis2-ui/loader": "10.16.
|
|
45
|
-
"@dhis2-ui/logo": "10.16.
|
|
46
|
-
"@dhis2-ui/menu": "10.16.
|
|
47
|
-
"@dhis2-ui/modal": "10.16.
|
|
48
|
-
"@dhis2-ui/user-avatar": "10.16.
|
|
37
|
+
"@dhis2-ui/box": "10.16.4",
|
|
38
|
+
"@dhis2-ui/button": "10.16.4",
|
|
39
|
+
"@dhis2-ui/card": "10.16.4",
|
|
40
|
+
"@dhis2-ui/center": "10.16.4",
|
|
41
|
+
"@dhis2-ui/divider": "10.16.4",
|
|
42
|
+
"@dhis2-ui/input": "10.16.4",
|
|
43
|
+
"@dhis2-ui/layer": "10.16.4",
|
|
44
|
+
"@dhis2-ui/loader": "10.16.4",
|
|
45
|
+
"@dhis2-ui/logo": "10.16.4",
|
|
46
|
+
"@dhis2-ui/menu": "10.16.4",
|
|
47
|
+
"@dhis2-ui/modal": "10.16.4",
|
|
48
|
+
"@dhis2-ui/user-avatar": "10.16.4",
|
|
49
49
|
"@dhis2/prop-types": "^3.1.2",
|
|
50
|
-
"@dhis2/ui-constants": "10.16.
|
|
51
|
-
"@dhis2/ui-icons": "10.16.
|
|
50
|
+
"@dhis2/ui-constants": "10.16.4",
|
|
51
|
+
"@dhis2/ui-icons": "10.16.4",
|
|
52
52
|
"classnames": "^2.3.1",
|
|
53
53
|
"moment": "^2.29.1",
|
|
54
54
|
"prop-types": "^15.7.2"
|