cozy-bar 33.1.2 → 33.2.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.
@@ -98,6 +98,7 @@ var Bar = function Bar(_ref) {
98
98
  }, barSearch || /*#__PURE__*/_react.default.createElement(_BarSearch.default, {
99
99
  isSearchEnabled: isSearchEnabled
100
100
  })), isSearchEnabled && isMobile ? /*#__PURE__*/_react.default.createElement(_SearchButton.default, null) : null, barRight, !isPublic && /*#__PURE__*/_react.default.createElement(_TwakeRight.default, {
101
+ componentsProps: componentsProps,
101
102
  apps: apps,
102
103
  appSlug: appSlug,
103
104
  homeApp: homeApp,
@@ -117,6 +118,9 @@ Bar.propTypes = {
117
118
  componentsProps: _propTypes.default.shape({
118
119
  Wrapper: _propTypes.default.shape({
119
120
  className: _propTypes.default.string
121
+ }),
122
+ UserMenu: _propTypes.default.shape({
123
+ showEmailDomainChip: _propTypes.default.bool
120
124
  })
121
125
  })
122
126
  };
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
10
12
  var _AppsMenu = _interopRequireDefault(require("../AppsMenu"));
11
13
 
12
14
  var _UserMenu = _interopRequireDefault(require("../UserMenu"));
@@ -24,6 +26,7 @@ var TwakeRight = function TwakeRight(_ref) {
24
26
  appSlug = _ref.appSlug,
25
27
  homeApp = _ref.homeApp,
26
28
  barSearch = _ref.barSearch,
29
+ componentsProps = _ref.componentsProps,
27
30
  isFetchingApps = _ref.isFetchingApps,
28
31
  isSettingsAppInstalled = _ref.isSettingsAppInstalled,
29
32
  onLogOut = _ref.onLogOut;
@@ -46,10 +49,10 @@ var TwakeRight = function TwakeRight(_ref) {
46
49
  homeApp: homeApp,
47
50
  isFetchingApps: isFetchingApps,
48
51
  shortcuts: shortcuts
49
- }), /*#__PURE__*/_react.default.createElement(_UserMenu.default, {
52
+ }), /*#__PURE__*/_react.default.createElement(_UserMenu.default, (0, _extends2.default)({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.UserMenu, {
50
53
  onLogOut: onLogOut,
51
54
  isSettingsAppInstalled: isSettingsAppInstalled
52
- }));
55
+ })));
53
56
  };
54
57
 
55
58
  var _default = TwakeRight;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _queries = require("../../queries");
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _cozyClient = require("cozy-client");
15
+
16
+ var _Chips = _interopRequireDefault(require("cozy-ui/transpiled/react/Chips"));
17
+
18
+ var _twakeI18n = require("twake-i18n");
19
+
20
+ var EmailDomainChip = function EmailDomainChip() {
21
+ var _useI18n = (0, _twakeI18n.useI18n)(),
22
+ t = _useI18n.t;
23
+
24
+ var _useInstanceInfo = (0, _cozyClient.useInstanceInfo)(),
25
+ instanceData = _useInstanceInfo.instance.data,
26
+ isInstanceInfoLoaded = _useInstanceInfo.isLoaded;
27
+
28
+ var appsQuery = (0, _queries.buildAppsQuery)();
29
+ var appsResult = (0, _cozyClient.useQuery)(appsQuery.definition, appsQuery.options);
30
+ var isAppsQueryLoaded = (0, _cozyClient.hasQueryBeenLoaded)(appsResult);
31
+
32
+ if (!isInstanceInfoLoaded || !isAppsQueryLoaded) {
33
+ return null;
34
+ }
35
+
36
+ var isMailAppInstalled = appsResult.data.some(function (app) {
37
+ return app.slug.includes('mail');
38
+ });
39
+ var isShown = !!instanceData.org_id && !isMailAppInstalled;
40
+
41
+ if (!isShown) {
42
+ return null;
43
+ }
44
+
45
+ return /*#__PURE__*/_react.default.createElement("div", {
46
+ className: "u-flex u-flex-justify-center u-mt-half"
47
+ }, /*#__PURE__*/_react.default.createElement(_Chips.default, {
48
+ variant: "ghost",
49
+ color: "warning",
50
+ label: t('userMenu.emailDomainNotActive')
51
+ }));
52
+ };
53
+
54
+ var _default = EmailDomainChip;
55
+ exports.default = _default;
@@ -47,6 +47,8 @@ var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typog
47
47
 
48
48
  var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
49
49
 
50
+ var _EmailDomainChip = _interopRequireDefault(require("./EmailDomainChip"));
51
+
50
52
  var _AvatarMyself = _interopRequireDefault(require("./components/AvatarMyself"));
51
53
 
52
54
  var _helpers = require("./helpers");
@@ -60,6 +62,7 @@ var UserMenuContent = function UserMenuContent(_ref) {
60
62
  var onLogOut = _ref.onLogOut,
61
63
  instance = _ref.instance,
62
64
  diskUsage = _ref.diskUsage,
65
+ showEmailDomainChip = _ref.showEmailDomainChip,
63
66
  isSettingsAppInstalled = _ref.isSettingsAppInstalled,
64
67
  closeMenu = _ref.closeMenu;
65
68
  var webviewIntent = (0, _cozyIntent.useWebviewIntent)();
@@ -98,7 +101,7 @@ var UserMenuContent = function UserMenuContent(_ref) {
98
101
  variant: "h4"
99
102
  }, public_name), /*#__PURE__*/_react.default.createElement(_Typography.default, {
100
103
  variant: "body2"
101
- }, email)), /*#__PURE__*/_react.default.createElement(_List.default, {
104
+ }, email)), showEmailDomainChip && /*#__PURE__*/_react.default.createElement(_EmailDomainChip.default, null), /*#__PURE__*/_react.default.createElement(_List.default, {
102
105
  className: "u-pb-0"
103
106
  }, isSettingsAppInstalled && /*#__PURE__*/_react.default.createElement(_ListItem.default, {
104
107
  button: true,
@@ -157,5 +160,8 @@ var UserMenuContent = function UserMenuContent(_ref) {
157
160
  }))));
158
161
  };
159
162
 
163
+ UserMenuContent.defaultProps = {
164
+ showEmailDomainChip: true
165
+ };
160
166
  var _default = UserMenuContent;
161
167
  exports.default = _default;
@@ -43,7 +43,8 @@ var useStyles = (0, _styles.makeStyles)({
43
43
 
44
44
  var UserMenu = function UserMenu(_ref) {
45
45
  var onLogOut = _ref.onLogOut,
46
- isSettingsAppInstalled = _ref.isSettingsAppInstalled;
46
+ isSettingsAppInstalled = _ref.isSettingsAppInstalled,
47
+ showEmailDomainChip = _ref.showEmailDomainChip;
47
48
 
48
49
  var _useState = (0, _react.useState)(false),
49
50
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -79,6 +80,7 @@ var UserMenu = function UserMenu(_ref) {
79
80
  open: isOpen,
80
81
  onClose: toggleMenu,
81
82
  content: /*#__PURE__*/_react.default.createElement(_UserMenuContent.default, {
83
+ showEmailDomainChip: showEmailDomainChip,
82
84
  onLogOut: onLogOut,
83
85
  instance: instance,
84
86
  diskUsage: diskUsage,
@@ -113,6 +115,7 @@ var UserMenu = function UserMenu(_ref) {
113
115
  paper: 'u-bdrs-7'
114
116
  }
115
117
  }, /*#__PURE__*/_react.default.createElement(_UserMenuContent.default, {
118
+ showEmailDomainChip: showEmailDomainChip,
116
119
  onLogOut: onLogOut,
117
120
  instance: instance,
118
121
  diskUsage: diskUsage,
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _en = _interopRequireDefault(require("../locales/en.json"));
11
11
 
12
- var _es = _interopRequireDefault(require("../locales/es.json"));
13
-
14
12
  var _fr = _interopRequireDefault(require("../locales/fr.json"));
15
13
 
16
14
  var _ru = _interopRequireDefault(require("../locales/ru.json"));
@@ -22,7 +20,6 @@ var _twakeI18n = require("twake-i18n");
22
20
  var locales = {
23
21
  en: _en.default,
24
22
  fr: _fr.default,
25
- es: _es.default,
26
23
  ru: _ru.default,
27
24
  vi: _vi.default
28
25
  };
@@ -55,6 +55,7 @@
55
55
  "createBusinessAccount": "Create business account",
56
56
  "storage": "Storage",
57
57
  "storageAvailable": "%{smart_count} GB available",
58
+ "emailDomainNotActive": "Email not active",
58
59
  "logOut": "Log out"
59
60
  }
60
61
  }
@@ -55,6 +55,7 @@
55
55
  "createBusinessAccount": "Créer un compte entreprise",
56
56
  "storage": "Stockage",
57
57
  "storageAvailable": "%{smart_count} Go disponible",
58
+ "emailDomainNotActive": "E-mail inactif",
58
59
  "logOut": "Se déconnecter"
59
60
  }
60
61
  }
@@ -55,6 +55,7 @@
55
55
  "createBusinessAccount": "Создать бизнес-аккаунт",
56
56
  "storage": "Хранилище",
57
57
  "storageAvailable": "Доступно %{smart_count} ГБ",
58
+ "emailDomainNotActive": "Электронная почта неактивна",
58
59
  "logOut": "Выйти"
59
60
  }
60
61
  }
@@ -55,6 +55,7 @@
55
55
  "createBusinessAccount": "Tạo tài khoản doanh nghiệp",
56
56
  "storage": "Lưu trữ",
57
57
  "storageAvailable": "Còn trống %{smart_count} GB",
58
+ "emailDomainNotActive": "Địa chỉ email chưa được kích hoạt",
58
59
  "logOut": "Đăng xuất"
59
60
  }
60
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-bar",
3
- "version": "33.1.2",
3
+ "version": "33.2.0",
4
4
  "description": "cozy-bar.js library, a small lib provided by cozy-stack to inject the Cozy-bar component into each app",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy Cloud <contact@cozycloud.cc> (https://cozy.io/)",
@@ -43,7 +43,7 @@
43
43
  "cozy-realtime": "^4.0.5",
44
44
  "cozy-search": "^0.24.0",
45
45
  "cozy-ui": "^138.1.0",
46
- "cozy-ui-plus": "^6.1.1",
46
+ "cozy-ui-plus": "^7.0.0",
47
47
  "identity-obj-proxy": "3.0.0",
48
48
  "jest": "30.3.0",
49
49
  "react": "18.0.0",
@@ -73,5 +73,5 @@
73
73
  "react-router-dom": ">=6.14.2",
74
74
  "twake-i18n": ">=0.3.0"
75
75
  },
76
- "gitHead": "aee7d46723561ad42f2cdc4fe96036ffe92adcdd"
76
+ "gitHead": "575aa6027e31f901f97aed1da6b12a096e0041cb"
77
77
  }
@@ -1,45 +0,0 @@
1
- {
2
- "drawer": "Mostrar el menu lateral",
3
- "profile": "Perfil",
4
- "connectedDevices": "Aparatos conectados",
5
- "storage": "Espacio en el disco",
6
- "storage_phrase": "%{diskUsage} Go de %{diskQuota} Go",
7
- "view_offers": "Ver ofertas",
8
- "view_my_offer": "Mi oferta",
9
- "help": "Ayuda",
10
- "logout": "Desconectar",
11
- "soon": "pronto",
12
- "error_UnavailableStack": "Conexión a la stack imposible ( se agotó el tiempo para la conexión ).",
13
- "error_UnauthorizedStack": "Faltan algunos permisos, la aplicación no puede acceder a los recursos solicitados.",
14
- "no_apps": "No se han encontrado aplicaciones en su Cozy.",
15
- "menu": {
16
- "apps": "Aplicaciones",
17
- "settings": "Parámetros",
18
- "home_mobile": "Regresar a Inicio...",
19
- "home": "Regresar a Inicio",
20
- "home_title": "Inicio"
21
- },
22
- "Categories": {
23
- "cozy": "Aplicaciones Cozy",
24
- "partners": "Aplicaciones de asociados",
25
- "ptnb": "expPTNB",
26
- "others": "Otras aplicaciones"
27
- },
28
- "permsModal": {
29
- "title": "Acceder a su Cozy desde su aplicación",
30
- "description": "Autorizar a %{app} para mostrar sus aplicaciones Cozy en este aparato",
31
- "button": "Autorizar el acceso"
32
- },
33
- "comingSoon": {
34
- "store": {
35
- "title": "En breve, la aplicación Store estará disponible en su Cozy",
36
- "description": "Gracias a Cozy Store usted podrá instalar en su Cozy las aplicaciones que desee."
37
- }
38
- },
39
- "banner": {
40
- "tos-updated": {
41
- "description": "Para cumplir con el RGPD, Cozy Cloud ha actualizado sus Condiciones de utilización que entraron en vigor desde el 25 de mayo de 2018.",
42
- "CTA": "Leerlo ahora"
43
- }
44
- }
45
- }