@dhis2-ui/header-bar 8.2.0 → 8.2.1
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
|
@@ -13,11 +13,12 @@ import { NotificationIcon } from './notification-icon.js';
|
|
|
13
13
|
|
|
14
14
|
const hasAuthority = (userAuthorities, authId) => Array.isArray(userAuthorities) && userAuthorities.some(userAuthId => userAuthId === 'ALL' || userAuthId === authId);
|
|
15
15
|
|
|
16
|
-
export const Notifications =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export const Notifications = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
interpretations,
|
|
19
|
+
messages,
|
|
20
|
+
userAuthorities
|
|
21
|
+
} = _ref;
|
|
21
22
|
const {
|
|
22
23
|
baseUrl
|
|
23
24
|
} = useConfig();
|
|
@@ -7,10 +7,11 @@ import React from 'react';
|
|
|
7
7
|
import i18n from './locales/index.js';
|
|
8
8
|
import styles from './online-status.styles.js';
|
|
9
9
|
|
|
10
|
-
const useOnlineStatusInfo =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const useOnlineStatusInfo = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
online,
|
|
13
|
+
lastOnline
|
|
14
|
+
} = _ref;
|
|
14
15
|
const {
|
|
15
16
|
headerbar
|
|
16
17
|
} = useConfig();
|
|
@@ -27,9 +28,10 @@ const useOnlineStatusInfo = ({
|
|
|
27
28
|
/** A badge to display online/offline status in the header bar */
|
|
28
29
|
|
|
29
30
|
|
|
30
|
-
export function OnlineStatus({
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
export function OnlineStatus(_ref2) {
|
|
32
|
+
let {
|
|
33
|
+
dense
|
|
34
|
+
} = _ref2;
|
|
33
35
|
const {
|
|
34
36
|
online,
|
|
35
37
|
lastOnline
|
|
@@ -41,15 +43,15 @@ export function OnlineStatus({
|
|
|
41
43
|
const displayStatus = online ? i18n.t('Online') : i18n.t('Offline');
|
|
42
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
45
|
"data-test": "headerbar-online-status",
|
|
44
|
-
className:
|
|
46
|
+
className: "jsx-".concat(styles.__hash) + " " + (cx('container', dense ? 'bar' : 'badge') || "")
|
|
45
47
|
}, info && !dense && /*#__PURE__*/React.createElement("span", {
|
|
46
|
-
className:
|
|
48
|
+
className: "jsx-".concat(styles.__hash) + " " + "info unselectable"
|
|
47
49
|
}, info), /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className:
|
|
50
|
+
className: "jsx-".concat(styles.__hash) + " " + (cx('icon', online ? 'online' : 'offline') || "")
|
|
49
51
|
}), /*#__PURE__*/React.createElement("span", {
|
|
50
|
-
className:
|
|
52
|
+
className: "jsx-".concat(styles.__hash) + " " + "label unselectable"
|
|
51
53
|
}, displayStatus), info && dense && /*#__PURE__*/React.createElement("span", {
|
|
52
|
-
className:
|
|
54
|
+
className: "jsx-".concat(styles.__hash) + " " + "info-dense unselectable"
|
|
53
55
|
}, info), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
54
56
|
id: styles.__hash
|
|
55
57
|
}, styles));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { colors, spacers } from '@dhis2/ui-constants';
|
|
2
|
-
const _defaultExport = [
|
|
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
3
|
_defaultExport.__hash = "1778673733";
|
|
4
4
|
export default _defaultExport;
|
|
@@ -6,35 +6,42 @@ import React from 'react';
|
|
|
6
6
|
import { joinPath } from '../join-path.js';
|
|
7
7
|
import i18n from '../locales/index.js';
|
|
8
8
|
|
|
9
|
-
const ProfileName =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
9
|
+
const ProfileName = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
children
|
|
12
|
+
} = _ref;
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
"data-test": "headerbar-profile-username",
|
|
15
|
+
className: "jsx-2223023701"
|
|
16
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
17
|
+
id: "2223023701"
|
|
18
|
+
}, ["div.jsx-2223023701{margin-bottom:3px;font-size:16px;line-height:19px;}"]));
|
|
19
|
+
};
|
|
17
20
|
|
|
18
21
|
ProfileName.propTypes = {
|
|
19
22
|
children: PropTypes.string
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
const ProfileEmail =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
25
|
+
const ProfileEmail = _ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
children
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
"data-test": "headerbar-profile-user-email",
|
|
31
|
+
className: "jsx-1072768994"
|
|
32
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
33
|
+
id: "1072768994"
|
|
34
|
+
}, ["div.jsx-1072768994{margin-bottom:6px;font-size:14px;line-height:16px;}"]));
|
|
35
|
+
};
|
|
30
36
|
|
|
31
37
|
ProfileEmail.propTypes = {
|
|
32
38
|
children: PropTypes.string
|
|
33
39
|
};
|
|
34
40
|
|
|
35
|
-
const ProfileEdit =
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
const ProfileEdit = _ref3 => {
|
|
42
|
+
let {
|
|
43
|
+
children
|
|
44
|
+
} = _ref3;
|
|
38
45
|
const {
|
|
39
46
|
baseUrl
|
|
40
47
|
} = useConfig();
|
|
@@ -51,36 +58,42 @@ ProfileEdit.propTypes = {
|
|
|
51
58
|
children: PropTypes.string
|
|
52
59
|
};
|
|
53
60
|
|
|
54
|
-
const ProfileDetails =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
61
|
+
const ProfileDetails = _ref4 => {
|
|
62
|
+
let {
|
|
63
|
+
name,
|
|
64
|
+
email
|
|
65
|
+
} = _ref4;
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "jsx-3814112749"
|
|
68
|
+
}, /*#__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, {
|
|
69
|
+
id: "3814112749"
|
|
70
|
+
}, ["div.jsx-3814112749{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-left:20px;color:#000;font-size:14px;font-weight:400;}"]));
|
|
71
|
+
};
|
|
62
72
|
|
|
63
73
|
ProfileDetails.propTypes = {
|
|
64
74
|
email: PropTypes.string,
|
|
65
75
|
name: PropTypes.string
|
|
66
76
|
};
|
|
67
|
-
export const ProfileHeader =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
77
|
+
export const ProfileHeader = _ref5 => {
|
|
78
|
+
let {
|
|
79
|
+
name,
|
|
80
|
+
email,
|
|
81
|
+
avatarId
|
|
82
|
+
} = _ref5;
|
|
83
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
className: "jsx-3625287538"
|
|
85
|
+
}, /*#__PURE__*/React.createElement(UserAvatar, {
|
|
86
|
+
avatarId: avatarId,
|
|
87
|
+
name: name,
|
|
88
|
+
dataTest: "headerbar-profile-menu-icon",
|
|
89
|
+
large: true
|
|
90
|
+
}), /*#__PURE__*/React.createElement(ProfileDetails, {
|
|
91
|
+
name: name,
|
|
92
|
+
email: email
|
|
93
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
94
|
+
id: "3625287538"
|
|
95
|
+
}, ["div.jsx-3625287538{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-left:24px;padding-top:20px;}"]));
|
|
96
|
+
};
|
|
84
97
|
ProfileHeader.propTypes = {
|
|
85
98
|
avatarId: PropTypes.string,
|
|
86
99
|
email: PropTypes.string,
|
|
@@ -20,12 +20,13 @@ const LoadingMask = () => /*#__PURE__*/React.createElement(Layer, {
|
|
|
20
20
|
dataTest: "headerbar-profile-menu-loading-mask"
|
|
21
21
|
}, /*#__PURE__*/React.createElement(Center, null, /*#__PURE__*/React.createElement(CircularLoader, null)));
|
|
22
22
|
|
|
23
|
-
const ProfileContents =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const ProfileContents = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
name,
|
|
26
|
+
email,
|
|
27
|
+
avatarId,
|
|
28
|
+
helpUrl
|
|
29
|
+
} = _ref;
|
|
29
30
|
const {
|
|
30
31
|
baseUrl
|
|
31
32
|
} = useConfig();
|
|
@@ -96,22 +97,25 @@ ProfileContents.propTypes = {
|
|
|
96
97
|
helpUrl: PropTypes.string,
|
|
97
98
|
name: PropTypes.string
|
|
98
99
|
};
|
|
99
|
-
export const ProfileMenu =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
100
|
+
export const ProfileMenu = _ref2 => {
|
|
101
|
+
let {
|
|
102
|
+
avatarId,
|
|
103
|
+
name,
|
|
104
|
+
email,
|
|
105
|
+
helpUrl
|
|
106
|
+
} = _ref2;
|
|
107
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
"data-test": "headerbar-profile-menu",
|
|
109
|
+
className: "jsx-3620236321"
|
|
110
|
+
}, /*#__PURE__*/React.createElement(ProfileContents, {
|
|
111
|
+
name: name,
|
|
112
|
+
email: email,
|
|
113
|
+
avatarId: avatarId,
|
|
114
|
+
helpUrl: helpUrl
|
|
115
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
116
|
+
id: "3620236321"
|
|
117
|
+
}, ["div.jsx-3620236321{z-index:10000;position:absolute;top:34px;right:-6px;width:310px;border-top:4px solid transparent;}"]));
|
|
118
|
+
};
|
|
115
119
|
ProfileMenu.propTypes = {
|
|
116
120
|
avatarId: PropTypes.string,
|
|
117
121
|
email: PropTypes.string,
|
package/build/es/profile.js
CHANGED
|
@@ -7,8 +7,8 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ProfileMenu } from './profile/profile-menu.js';
|
|
9
9
|
export default class Profile extends React.Component {
|
|
10
|
-
constructor(
|
|
11
|
-
super(...
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
12
|
|
|
13
13
|
_defineProperty(this, "state", {
|
|
14
14
|
show: false
|
package/build/es/title.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
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
|
-
},
|
|
4
|
+
export const Title = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
app,
|
|
7
|
+
instance
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
"data-test": "headerbar-title",
|
|
11
|
+
className: "jsx-2721515324"
|
|
12
|
+
}, app ? "".concat(instance, " - ").concat(app) : "".concat(instance), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
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
|
+
};
|
|
13
16
|
Title.propTypes = {
|
|
14
17
|
app: PropTypes.string,
|
|
15
18
|
instance: PropTypes.string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/header-bar",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"description": "UI HeaderBar",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@dhis2/prop-types": "^3.0.0-beta.1",
|
|
37
|
-
"@dhis2-ui/box": "8.2.
|
|
38
|
-
"@dhis2-ui/card": "8.2.
|
|
39
|
-
"@dhis2-ui/center": "8.2.
|
|
40
|
-
"@dhis2-ui/divider": "8.2.
|
|
41
|
-
"@dhis2-ui/input": "8.2.
|
|
42
|
-
"@dhis2-ui/layer": "8.2.
|
|
43
|
-
"@dhis2-ui/loader": "8.2.
|
|
44
|
-
"@dhis2-ui/logo": "8.2.
|
|
45
|
-
"@dhis2-ui/menu": "8.2.
|
|
46
|
-
"@dhis2-ui/user-avatar": "8.2.
|
|
47
|
-
"@dhis2/ui-constants": "8.2.
|
|
48
|
-
"@dhis2/ui-icons": "8.2.
|
|
37
|
+
"@dhis2-ui/box": "8.2.1",
|
|
38
|
+
"@dhis2-ui/card": "8.2.1",
|
|
39
|
+
"@dhis2-ui/center": "8.2.1",
|
|
40
|
+
"@dhis2-ui/divider": "8.2.1",
|
|
41
|
+
"@dhis2-ui/input": "8.2.1",
|
|
42
|
+
"@dhis2-ui/layer": "8.2.1",
|
|
43
|
+
"@dhis2-ui/loader": "8.2.1",
|
|
44
|
+
"@dhis2-ui/logo": "8.2.1",
|
|
45
|
+
"@dhis2-ui/menu": "8.2.1",
|
|
46
|
+
"@dhis2-ui/user-avatar": "8.2.1",
|
|
47
|
+
"@dhis2/ui-constants": "8.2.1",
|
|
48
|
+
"@dhis2/ui-icons": "8.2.1",
|
|
49
49
|
"classnames": "^2.3.1",
|
|
50
50
|
"moment": "^2.29.1",
|
|
51
51
|
"prop-types": "^15.7.2"
|