cozy-viewer 8.1.0 → 9.0.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.
- package/CHANGELOG.md +24 -0
- package/dist/Panel/Qualification.js +29 -41
- package/dist/Panel/QualificationListItemDate.js +10 -5
- package/dist/Panel/QualificationListItemInformation.js +9 -4
- package/dist/Panel/QualificationListItemOther.js +10 -5
- package/dist/Panel/QualificationListItemQualification.d.ts +6 -7
- package/dist/Panel/QualificationListItemQualification.js +17 -11
- package/dist/Panel/QualificationListItemQualificationEmpty.d.ts +2 -0
- package/dist/Panel/QualificationListItemQualificationEmpty.js +60 -0
- package/dist/Panel/Sharing.js +2 -1
- package/dist/Panel/Summary.js +3 -2
- package/dist/Panel/getPanelBlocks.js +3 -1
- package/dist/Panel/helpers.d.ts +77 -0
- package/dist/Panel/helpers.js +116 -1
- package/dist/locales/index.js +8 -0
- package/package.json +8 -8
- package/src/Panel/Qualification.jsx +28 -46
- package/src/Panel/QualificationListItemDate.jsx +34 -23
- package/src/Panel/QualificationListItemInformation.jsx +18 -11
- package/src/Panel/QualificationListItemOther.jsx +19 -10
- package/src/Panel/QualificationListItemQualification.jsx +11 -12
- package/src/Panel/QualificationListItemQualificationEmpty.jsx +40 -0
- package/src/Panel/Sharing.jsx +1 -1
- package/src/Panel/Summary.jsx +2 -2
- package/src/Panel/getPanelBlocks.jsx +2 -5
- package/src/Panel/helpers.js +127 -0
- package/src/locales/en.json +4 -0
- package/src/locales/fr.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [9.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@8.1.0...cozy-viewer@9.0.0) (2024-12-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **Viewer:** Sharing and Summary panel item right icon color ([d026cb5](https://github.com/cozy/cozy-libs/commit/d026cb5422afe4e3e332808f3302ba47b64dbfc3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **Viewer:** Add possibility to set/modify file qualification ([747eab8](https://github.com/cozy/cozy-libs/commit/747eab8acce3a12925475a4fc854749b428519b4))
|
|
17
|
+
* **Viewer:** Adjust right icon on qualification items ([a1d71d5](https://github.com/cozy/cozy-libs/commit/a1d71d5d55e30792ac15a4749a97958f3e8e6b8c))
|
|
18
|
+
* **Viewer:** Showing metadata is now based on a list ([217ccfa](https://github.com/cozy/cozy-libs/commit/217ccfa31a1ed83ef13d8759cd70443e72868d2c))
|
|
19
|
+
* **Viewer:** Upgrade packages ([8da361f](https://github.com/cozy/cozy-libs/commit/8da361f7b46cbbe96414581897ec987d4af4d86a))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* **Viewer:** You must have `cozy-client >= 51.6.0`, `cozy-ui >= 114.0.0` and `cozy-intent >= 2.29.1`
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [8.1.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@8.0.9...cozy-viewer@8.1.0) (2024-12-12)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -13,12 +13,16 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
+
var _file = require("cozy-client/dist/models/file");
|
|
17
|
+
|
|
16
18
|
var _paper = require("cozy-client/dist/models/paper");
|
|
17
19
|
|
|
18
20
|
var _Divider = _interopRequireDefault(require("cozy-ui/transpiled/react/Divider"));
|
|
19
21
|
|
|
20
22
|
var _List = _interopRequireDefault(require("cozy-ui/transpiled/react/List"));
|
|
21
23
|
|
|
24
|
+
var _QualificationModal = _interopRequireDefault(require("cozy-ui/transpiled/react/QualificationModal"));
|
|
25
|
+
|
|
22
26
|
var _ActionMenuWrapper = _interopRequireDefault(require("./ActionMenuWrapper"));
|
|
23
27
|
|
|
24
28
|
var _QualificationListItemContact = _interopRequireDefault(require("./QualificationListItemContact"));
|
|
@@ -31,14 +35,14 @@ var _QualificationListItemOther = _interopRequireDefault(require("./Qualificatio
|
|
|
31
35
|
|
|
32
36
|
var _QualificationListItemQualification = _interopRequireDefault(require("./QualificationListItemQualification"));
|
|
33
37
|
|
|
38
|
+
var _QualificationListItemQualificationEmpty = _interopRequireDefault(require("./QualificationListItemQualificationEmpty"));
|
|
39
|
+
|
|
34
40
|
var _helpers = require("./helpers");
|
|
35
41
|
|
|
36
42
|
var _ExpirationAlert = _interopRequireDefault(require("../components/ExpirationAlert"));
|
|
37
43
|
|
|
38
44
|
var _withViewerLocales = require("../hoc/withViewerLocales");
|
|
39
45
|
|
|
40
|
-
var _useReferencedContactName = _interopRequireDefault(require("../hooks/useReferencedContactName"));
|
|
41
|
-
|
|
42
46
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
47
|
|
|
44
48
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -58,26 +62,27 @@ var isExpirationAlertHidden = function isExpirationAlertHidden(file) {
|
|
|
58
62
|
};
|
|
59
63
|
|
|
60
64
|
var Qualification = function Qualification(_ref) {
|
|
61
|
-
var _file$bills2;
|
|
62
|
-
|
|
63
65
|
var file = _ref.file;
|
|
64
66
|
var _file$metadata2 = file.metadata,
|
|
65
67
|
metadata = _file$metadata2 === void 0 ? {} : _file$metadata2;
|
|
66
68
|
var actionBtnRef = (0, _react.useRef)([]);
|
|
67
69
|
|
|
68
|
-
var _useState = (0, _react.useState)(
|
|
70
|
+
var _useState = (0, _react.useState)(false),
|
|
71
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
72
|
+
showQualifModal = _useState2[0],
|
|
73
|
+
setShowQualifModal = _useState2[1];
|
|
74
|
+
|
|
75
|
+
var _useState3 = (0, _react.useState)({
|
|
69
76
|
id: '',
|
|
70
77
|
name: '',
|
|
71
78
|
value: ''
|
|
72
79
|
}),
|
|
73
|
-
|
|
74
|
-
optionFile =
|
|
75
|
-
setOptionFile =
|
|
76
|
-
|
|
77
|
-
var _useReferencedContact = (0, _useReferencedContactName.default)(file),
|
|
78
|
-
contacts = _useReferencedContact.contacts;
|
|
80
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
81
|
+
optionFile = _useState4[0],
|
|
82
|
+
setOptionFile = _useState4[1];
|
|
79
83
|
|
|
80
|
-
var
|
|
84
|
+
var formattedMetadataQualification = (0, _helpers.makeFormattedMetadataQualification)(file, metadata);
|
|
85
|
+
var showMetadataList = (0, _file.hasQualifications)(file) && formattedMetadataQualification.length > 1; // we have at minimum "contact" item
|
|
81
86
|
|
|
82
87
|
var hideActionsMenu = function hideActionsMenu() {
|
|
83
88
|
setOptionFile({
|
|
@@ -102,27 +107,6 @@ var Qualification = function Qualification(_ref) {
|
|
|
102
107
|
});
|
|
103
108
|
};
|
|
104
109
|
|
|
105
|
-
var formattedMetadataQualification = (0, _react.useMemo)(function () {
|
|
106
|
-
var _file$bills;
|
|
107
|
-
|
|
108
|
-
var relatedBills = (_file$bills = file.bills) === null || _file$bills === void 0 || (_file$bills = _file$bills.data) === null || _file$bills === void 0 ? void 0 : _file$bills[0];
|
|
109
|
-
var formattedMetadataQualification = (0, _paper.formatMetadataQualification)(metadata).sort(function (a, b) {
|
|
110
|
-
return a.name === 'qualification' ? -1 : b.name === 'qualification' ? 1 : 0;
|
|
111
|
-
}); // move "qualification" metadata in first position
|
|
112
|
-
|
|
113
|
-
if (relatedBills) {
|
|
114
|
-
var formattedBillsMetadata = _paper.KNOWN_BILLS_ATTRIBUTES_NAMES.map(function (attrName) {
|
|
115
|
-
return {
|
|
116
|
-
name: attrName,
|
|
117
|
-
value: relatedBills[attrName]
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
return formattedMetadataQualification.concat(formattedBillsMetadata);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return formattedMetadataQualification;
|
|
125
|
-
}, [metadata, (_file$bills2 = file.bills) === null || _file$bills2 === void 0 ? void 0 : _file$bills2.data]);
|
|
126
110
|
(0, _react.useEffect)(function () {
|
|
127
111
|
actionBtnRef.current = formattedMetadataQualification.map(function (_, idx) {
|
|
128
112
|
var _actionBtnRef$current;
|
|
@@ -130,20 +114,24 @@ var Qualification = function Qualification(_ref) {
|
|
|
130
114
|
return (_actionBtnRef$current = actionBtnRef.current[idx]) !== null && _actionBtnRef$current !== void 0 ? _actionBtnRef$current : /*#__PURE__*/(0, _react.createRef)();
|
|
131
115
|
});
|
|
132
116
|
}, [formattedMetadataQualification]);
|
|
133
|
-
var showMetadataList = formattedMetadataQualification.length !== 2 || formattedContactValue; // we have at minimum "qualification" and "contact" item
|
|
134
|
-
|
|
135
117
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _paper.isExpiringSoon)(file) && !isExpirationAlertHidden(file) && /*#__PURE__*/_react.default.createElement(_ExpirationAlert.default, {
|
|
136
118
|
file: file
|
|
137
|
-
}), /*#__PURE__*/_react.default.createElement(_QualificationListItemQualification.default, {
|
|
119
|
+
}), (0, _file.hasQualifications)(file) ? /*#__PURE__*/_react.default.createElement(_QualificationListItemQualification.default, {
|
|
120
|
+
file: file,
|
|
121
|
+
onClick: function onClick() {
|
|
122
|
+
return setShowQualifModal(true);
|
|
123
|
+
}
|
|
124
|
+
}) : /*#__PURE__*/_react.default.createElement(_QualificationListItemQualificationEmpty.default, {
|
|
125
|
+
onClick: function onClick() {
|
|
126
|
+
return setShowQualifModal(true);
|
|
127
|
+
}
|
|
128
|
+
}), showQualifModal && /*#__PURE__*/_react.default.createElement(_QualificationModal.default, {
|
|
138
129
|
file: file,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
toggleActionsMenu: function toggleActionsMenu(val) {
|
|
142
|
-
return _toggleActionsMenu(0, formattedMetadataQualification[0].name, val);
|
|
130
|
+
onClose: function onClose() {
|
|
131
|
+
return setShowQualifModal(false);
|
|
143
132
|
}
|
|
144
133
|
}), showMetadataList && /*#__PURE__*/_react.default.createElement(_List.default, null, formattedMetadataQualification.map(function (meta, idx) {
|
|
145
134
|
var name = meta.name;
|
|
146
|
-
if (name === 'qualification') return null;
|
|
147
135
|
var metadataQualificationType = (0, _paper.getMetadataQualificationType)(name);
|
|
148
136
|
var QualificationListItemComp = ComponentFromMetadataQualificationType[metadataQualificationType];
|
|
149
137
|
var hideDivider = (0, _helpers.makeHideDivider)(formattedMetadataQualification, idx);
|
|
@@ -21,6 +21,8 @@ var _Calendar = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/C
|
|
|
21
21
|
|
|
22
22
|
var _Dots = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Dots"));
|
|
23
23
|
|
|
24
|
+
var _Right = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Right"));
|
|
25
|
+
|
|
24
26
|
var _ListItem = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItem"));
|
|
25
27
|
|
|
26
28
|
var _ListItemIcon = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemIcon"));
|
|
@@ -61,8 +63,8 @@ var QualificationListItemDate = /*#__PURE__*/(0, _react.forwardRef)(function (_r
|
|
|
61
63
|
return /*#__PURE__*/_react.default.createElement(_ListItem.default, null, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
62
64
|
icon: _Calendar.default
|
|
63
65
|
})), /*#__PURE__*/_react.default.createElement(_QualificationListItemText.default, {
|
|
64
|
-
primary: formattedTitle,
|
|
65
|
-
secondary: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
66
|
+
primary: value ? formattedTitle : undefined,
|
|
67
|
+
secondary: value ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
66
68
|
component: "span",
|
|
67
69
|
variant: "inherit"
|
|
68
70
|
}, formattedDate), isExpirationDate && ((0, _paper.isExpired)(file) || (0, _paper.isExpiringSoon)(file)) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -70,16 +72,19 @@ var QualificationListItemDate = /*#__PURE__*/(0, _react.forwardRef)(function (_r
|
|
|
70
72
|
variant: "inherit"
|
|
71
73
|
}, ' · '), /*#__PURE__*/_react.default.createElement(_ExpirationAnnotation.default, {
|
|
72
74
|
file: file
|
|
73
|
-
}))),
|
|
75
|
+
}))) : formattedTitle,
|
|
74
76
|
disabled: !value
|
|
75
|
-
}), /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
77
|
+
}), value ? /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
76
78
|
ref: ref,
|
|
77
79
|
onClick: function onClick() {
|
|
78
80
|
return toggleActionsMenu(formattedDate);
|
|
79
81
|
}
|
|
80
82
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
81
83
|
icon: _Dots.default
|
|
82
|
-
})))
|
|
84
|
+
}))) : /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
85
|
+
icon: _Right.default,
|
|
86
|
+
color: "var(--secondaryTextColor)"
|
|
87
|
+
})));
|
|
83
88
|
});
|
|
84
89
|
QualificationListItemDate.displayName = 'QualificationListItemDate';
|
|
85
90
|
QualificationListItemDate.propTypes = {
|
|
@@ -29,6 +29,8 @@ var _Globe = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Glob
|
|
|
29
29
|
|
|
30
30
|
var _Number = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Number"));
|
|
31
31
|
|
|
32
|
+
var _Right = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Right"));
|
|
33
|
+
|
|
32
34
|
var _ListItem = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItem"));
|
|
33
35
|
|
|
34
36
|
var _ListItemIcon = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemIcon"));
|
|
@@ -80,10 +82,10 @@ var QualificationListItemInformation = /*#__PURE__*/(0, _react.forwardRef)(funct
|
|
|
80
82
|
return /*#__PURE__*/_react.default.createElement(_ListItem.default, null, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
81
83
|
icon: InformationIcon
|
|
82
84
|
})), /*#__PURE__*/_react.default.createElement(_QualificationListItemText.default, {
|
|
83
|
-
primary: titleComponent,
|
|
84
|
-
secondary: formattedValue,
|
|
85
|
+
primary: value ? titleComponent : undefined,
|
|
86
|
+
secondary: value ? formattedValue : titleComponent,
|
|
85
87
|
disabled: !value
|
|
86
|
-
}), /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
88
|
+
}), value ? /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
87
89
|
ref: ref,
|
|
88
90
|
onClick: function onClick() {
|
|
89
91
|
return toggleActionsMenu(value);
|
|
@@ -91,7 +93,10 @@ var QualificationListItemInformation = /*#__PURE__*/(0, _react.forwardRef)(funct
|
|
|
91
93
|
"data-testid": "toggleActionsMenuBtn"
|
|
92
94
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
93
95
|
icon: _Dots.default
|
|
94
|
-
})))
|
|
96
|
+
}))) : /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
97
|
+
icon: _Right.default,
|
|
98
|
+
color: "var(--secondaryTextColor)"
|
|
99
|
+
})));
|
|
95
100
|
});
|
|
96
101
|
QualificationListItemInformation.displayName = 'QualificationListItemNumber';
|
|
97
102
|
QualificationListItemInformation.propTypes = {
|
|
@@ -21,6 +21,8 @@ var _Dots = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Dots"
|
|
|
21
21
|
|
|
22
22
|
var _File = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/File"));
|
|
23
23
|
|
|
24
|
+
var _Right = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Right"));
|
|
25
|
+
|
|
24
26
|
var _ListItem = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItem"));
|
|
25
27
|
|
|
26
28
|
var _ListItemIcon = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemIcon"));
|
|
@@ -57,18 +59,21 @@ var QualificationListItemOther = /*#__PURE__*/(0, _react.forwardRef)(function (_
|
|
|
57
59
|
return /*#__PURE__*/_react.default.createElement(_ListItem.default, null, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
58
60
|
icon: _File.default
|
|
59
61
|
})), /*#__PURE__*/_react.default.createElement(_QualificationListItemText.default, {
|
|
60
|
-
primary: formattedTitle,
|
|
61
|
-
secondary: /*#__PURE__*/_react.default.createElement(_MidEllipsis.default, {
|
|
62
|
+
primary: value ? formattedTitle : undefined,
|
|
63
|
+
secondary: value ? /*#__PURE__*/_react.default.createElement(_MidEllipsis.default, {
|
|
62
64
|
text: formattedValue
|
|
63
|
-
})
|
|
64
|
-
}), /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
65
|
+
}) : formattedTitle
|
|
66
|
+
}), value ? /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
65
67
|
ref: ref,
|
|
66
68
|
onClick: function onClick() {
|
|
67
69
|
return toggleActionsMenu(formattedValue);
|
|
68
70
|
}
|
|
69
71
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
70
72
|
icon: _Dots.default
|
|
71
|
-
})))
|
|
73
|
+
}))) : /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
74
|
+
icon: _Right.default,
|
|
75
|
+
color: "var(--secondaryTextColor)"
|
|
76
|
+
})));
|
|
72
77
|
});
|
|
73
78
|
QualificationListItemOther.displayName = 'QualificationListItemOther';
|
|
74
79
|
QualificationListItemOther.propTypes = {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
export default QualificationListItemQualification;
|
|
2
|
-
declare function QualificationListItemQualification({
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare function QualificationListItemQualification({ file, onClick }: {
|
|
3
|
+
file: any;
|
|
4
|
+
onClick: any;
|
|
5
|
+
}): JSX.Element;
|
|
5
6
|
declare namespace QualificationListItemQualification {
|
|
6
7
|
const displayName: string;
|
|
7
8
|
namespace propTypes {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
value: PropTypes.Requireable<string>;
|
|
11
|
-
}>>;
|
|
9
|
+
const file: PropTypes.Requireable<object>;
|
|
10
|
+
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
import PropTypes from "prop-types";
|
|
@@ -13,6 +13,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _paper = require("cozy-client/dist/models/paper");
|
|
15
15
|
|
|
16
|
+
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
17
|
+
|
|
18
|
+
var _Right = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Right"));
|
|
19
|
+
|
|
16
20
|
var _ListItem = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItem"));
|
|
17
21
|
|
|
18
22
|
var _ListItemIcon = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemIcon"));
|
|
@@ -26,21 +30,22 @@ var _QualificationIconStack = _interopRequireDefault(require("cozy-ui/transpiled
|
|
|
26
30
|
var _I18n = require("cozy-ui/transpiled/react/providers/I18n");
|
|
27
31
|
|
|
28
32
|
var QualificationListItemQualification = function QualificationListItemQualification(_ref) {
|
|
29
|
-
var
|
|
33
|
+
var file = _ref.file,
|
|
34
|
+
onClick = _ref.onClick;
|
|
30
35
|
|
|
31
36
|
var _useI18n = (0, _I18n.useI18n)(),
|
|
32
37
|
lang = _useI18n.lang;
|
|
33
38
|
|
|
34
|
-
var
|
|
35
|
-
value = formattedMetadataQualification.value;
|
|
36
|
-
if (!value) return null;
|
|
39
|
+
var value = file.metadata.qualification.label;
|
|
37
40
|
var formattedValue = (0, _paper.formatOtherMetadataValue)(value, {
|
|
38
41
|
lang: lang,
|
|
39
|
-
name:
|
|
42
|
+
name: 'qualification'
|
|
40
43
|
});
|
|
41
44
|
return /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
42
45
|
size: "large",
|
|
43
|
-
divider: true
|
|
46
|
+
divider: true,
|
|
47
|
+
button: true,
|
|
48
|
+
onClick: onClick
|
|
44
49
|
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_QualificationIconStack.default, {
|
|
45
50
|
qualification: value
|
|
46
51
|
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
@@ -50,15 +55,16 @@ var QualificationListItemQualification = function QualificationListItemQualifica
|
|
|
50
55
|
primaryTypographyProps: {
|
|
51
56
|
variant: 'h6'
|
|
52
57
|
}
|
|
53
|
-
})
|
|
58
|
+
}), /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
59
|
+
icon: _Right.default,
|
|
60
|
+
color: "var(--secondaryTextColor)"
|
|
61
|
+
})));
|
|
54
62
|
};
|
|
55
63
|
|
|
56
64
|
QualificationListItemQualification.displayName = 'QualificationListItemQualification';
|
|
57
65
|
QualificationListItemQualification.propTypes = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
value: _propTypes.default.string
|
|
61
|
-
})
|
|
66
|
+
file: _propTypes.default.object,
|
|
67
|
+
onClick: _propTypes.default.func
|
|
62
68
|
};
|
|
63
69
|
|
|
64
70
|
var _default = exports.default = QualificationListItemQualification;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
15
|
+
|
|
16
|
+
var _LabelOutlined = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/LabelOutlined"));
|
|
17
|
+
|
|
18
|
+
var _Right = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Right"));
|
|
19
|
+
|
|
20
|
+
var _List = _interopRequireDefault(require("cozy-ui/transpiled/react/List"));
|
|
21
|
+
|
|
22
|
+
var _ListItem = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItem"));
|
|
23
|
+
|
|
24
|
+
var _ListItemIcon = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemIcon"));
|
|
25
|
+
|
|
26
|
+
var _ListItemText = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemText"));
|
|
27
|
+
|
|
28
|
+
var _withViewerLocales = require("../hoc/withViewerLocales");
|
|
29
|
+
|
|
30
|
+
var QualificationListItemQualificationEmpty = function QualificationListItemQualificationEmpty(_ref) {
|
|
31
|
+
var t = _ref.t,
|
|
32
|
+
onClick = _ref.onClick;
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_List.default, null, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
34
|
+
button: true,
|
|
35
|
+
onClick: onClick
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
37
|
+
icon: _LabelOutlined.default
|
|
38
|
+
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
39
|
+
style: {
|
|
40
|
+
color: 'var(--disabledTextColor)'
|
|
41
|
+
},
|
|
42
|
+
primaryTypographyProps: {
|
|
43
|
+
color: 'inherit'
|
|
44
|
+
},
|
|
45
|
+
secondaryTypographyProps: {
|
|
46
|
+
color: 'inherit'
|
|
47
|
+
},
|
|
48
|
+
primary: t('Viewer.panel.qualification.empty.primary'),
|
|
49
|
+
secondary: t('Viewer.panel.qualification.empty.secondary')
|
|
50
|
+
}), /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
51
|
+
icon: _Right.default,
|
|
52
|
+
color: "var(--secondaryTextColor)"
|
|
53
|
+
}))));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
QualificationListItemQualificationEmpty.propTypes = {
|
|
57
|
+
onClick: _propTypes.default.func
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var _default = exports.default = (0, _withViewerLocales.withViewerLocales)(QualificationListItemQualificationEmpty);
|
package/dist/Panel/Sharing.js
CHANGED
|
@@ -70,7 +70,8 @@ var Sharing = function Sharing(_ref) {
|
|
|
70
70
|
variant: 'h6'
|
|
71
71
|
}
|
|
72
72
|
}), /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
73
|
-
icon: _Right.default
|
|
73
|
+
icon: _Right.default,
|
|
74
|
+
color: "var(--secondaryTextColor)"
|
|
74
75
|
}))), /*#__PURE__*/_react.default.createElement(_List.default, null, /*#__PURE__*/_react.default.createElement(_cozySharing.LinkRecipientLite, {
|
|
75
76
|
permissions: permissions,
|
|
76
77
|
link: link
|
package/dist/Panel/Summary.js
CHANGED
|
@@ -121,7 +121,7 @@ var Summary = function Summary(_ref) {
|
|
|
121
121
|
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
122
122
|
icon: _Text.default
|
|
123
123
|
})), /*#__PURE__*/_react.default.createElement(_QualificationListItemText.default, {
|
|
124
|
-
primary: value
|
|
124
|
+
primary: value ? label : undefined,
|
|
125
125
|
secondary: value || label,
|
|
126
126
|
disabled: !value
|
|
127
127
|
}), value ? /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
@@ -134,7 +134,8 @@ var Summary = function Summary(_ref) {
|
|
|
134
134
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
135
135
|
icon: _Dots.default
|
|
136
136
|
}))) : /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
137
|
-
icon: _Right.default
|
|
137
|
+
icon: _Right.default,
|
|
138
|
+
color: "var(--secondaryTextColor)"
|
|
138
139
|
}))), showModal && /*#__PURE__*/_react.default.createElement(_SummaryDialog.default, {
|
|
139
140
|
file: file,
|
|
140
141
|
onClose: function onClose() {
|
|
@@ -44,7 +44,9 @@ var getPanelBlocksSpecs = exports.getPanelBlocksSpecs = function getPanelBlocksS
|
|
|
44
44
|
component: _Summary.default
|
|
45
45
|
},
|
|
46
46
|
qualifications: {
|
|
47
|
-
condition:
|
|
47
|
+
condition: function condition() {
|
|
48
|
+
return true;
|
|
49
|
+
},
|
|
48
50
|
component: _Qualification.default
|
|
49
51
|
},
|
|
50
52
|
konnector: {
|
package/dist/Panel/helpers.d.ts
CHANGED
|
@@ -3,3 +3,80 @@ export function makeDate(lang: string): string;
|
|
|
3
3
|
export function makeSize(bytes: number): string;
|
|
4
4
|
export function makePath(file: any): string;
|
|
5
5
|
export function makeHideDivider(formattedMetadataQualification: array, idx: number): boolean;
|
|
6
|
+
export namespace metadataByQualificationLabel {
|
|
7
|
+
const accommodation_proof: string[];
|
|
8
|
+
const bank_details: string[];
|
|
9
|
+
const bank_statement: string[];
|
|
10
|
+
const birth_certificate: never[];
|
|
11
|
+
const caf: string[];
|
|
12
|
+
const car_insurance: never[];
|
|
13
|
+
const condition_report: string[];
|
|
14
|
+
const diploma: string[];
|
|
15
|
+
const divorce: never[];
|
|
16
|
+
const driver_license: string[];
|
|
17
|
+
const electoral_card: string[];
|
|
18
|
+
const employment_center_certificate: string[];
|
|
19
|
+
const energy_invoice: string[];
|
|
20
|
+
const expense_claim: string[];
|
|
21
|
+
const family_record_book: never[];
|
|
22
|
+
const fidelity_card: string[];
|
|
23
|
+
const health_certificate: string[];
|
|
24
|
+
const health_insurance_card: string[];
|
|
25
|
+
const house_insurance: string[];
|
|
26
|
+
const identity_photo: string[];
|
|
27
|
+
const isp_invoice: string[];
|
|
28
|
+
const lease: string[];
|
|
29
|
+
const loan_agreement: string[];
|
|
30
|
+
const national_health_insurance_card: string[];
|
|
31
|
+
const national_health_insurance_right_certificate: string[];
|
|
32
|
+
const national_id_card: string[];
|
|
33
|
+
const note_activity_document: never[];
|
|
34
|
+
const note_family_document: never[];
|
|
35
|
+
const note_finance: never[];
|
|
36
|
+
const note_health_document: never[];
|
|
37
|
+
const note_house_document: never[];
|
|
38
|
+
const note_identity_document: never[];
|
|
39
|
+
const note_invoice: never[];
|
|
40
|
+
const note_transport_document: never[];
|
|
41
|
+
const note_work_document: never[];
|
|
42
|
+
const other_activity_document: string[];
|
|
43
|
+
const other_administrative_document: string[];
|
|
44
|
+
const other_bank_document: string[];
|
|
45
|
+
const other_family_document: string[];
|
|
46
|
+
const other_health_document: string[];
|
|
47
|
+
const other_house_document: string[];
|
|
48
|
+
const other_identity_document: string[];
|
|
49
|
+
const other_invoice: string[];
|
|
50
|
+
const other_revenue: string[];
|
|
51
|
+
const other_transport_document: string[];
|
|
52
|
+
const other_work_document: string[];
|
|
53
|
+
const pacs: string[];
|
|
54
|
+
const passport: string[];
|
|
55
|
+
const pay_sheet: string[];
|
|
56
|
+
const payment_proof_family_allowance: string[];
|
|
57
|
+
const phone_invoice: string[];
|
|
58
|
+
const pregnancy_medical_certificate: string[];
|
|
59
|
+
const prescription: string[];
|
|
60
|
+
const real_estate_tax: string[];
|
|
61
|
+
const rent_receipt: string[];
|
|
62
|
+
const residence_permit: string[];
|
|
63
|
+
const resume: string[];
|
|
64
|
+
const school_attendance_certificate: string[];
|
|
65
|
+
const school_insurance_certificate: string[];
|
|
66
|
+
const single_parent_benefit: string[];
|
|
67
|
+
const student_card: string[];
|
|
68
|
+
const tax_certificate: string[];
|
|
69
|
+
const tax_notice: string[];
|
|
70
|
+
const tax_return: string[];
|
|
71
|
+
const tax_timetable: string[];
|
|
72
|
+
const transport_card: string[];
|
|
73
|
+
const transport_invoice: string[];
|
|
74
|
+
const unemployment_benefit: string[];
|
|
75
|
+
const unfit_for_habitation_declaration: string[];
|
|
76
|
+
const vehicle_registration: string[];
|
|
77
|
+
const water_invoice: string[];
|
|
78
|
+
const work_contract: string[];
|
|
79
|
+
const work_disability_recognition: string[];
|
|
80
|
+
const work_quote: never[];
|
|
81
|
+
}
|
|
82
|
+
export function makeFormattedMetadataQualification(file: any): array;
|