cozy-viewer 9.0.1 → 9.0.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/CHANGELOG.md +13 -0
- package/dist/Panel/Qualification.js +3 -9
- package/dist/Panel/QualificationListItemQualification.js +5 -3
- package/dist/Panel/QualificationListItemText.d.ts +3 -1
- package/dist/Panel/QualificationListItemText.js +12 -4
- package/dist/Panel/Summary.js +3 -0
- package/dist/Panel/helpers.d.ts +2 -0
- package/dist/Panel/helpers.js +29 -7
- package/package.json +3 -3
- package/src/Panel/Qualification.jsx +5 -5
- package/src/Panel/QualificationListItemQualification.jsx +13 -4
- package/src/Panel/QualificationListItemText.jsx +9 -2
- package/src/Panel/Summary.jsx +1 -0
- package/src/Panel/helpers.js +23 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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.2](https://github.com/cozy/cozy-libs/compare/cozy-viewer@9.0.1...cozy-viewer@9.0.2) (2024-12-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **Viewer:** Qualification was editable for file fetched by konnectors ([2ae0af3](https://github.com/cozy/cozy-libs/commit/2ae0af3ae4a20946cd84755135aef50df5945782))
|
|
12
|
+
* **Viewer:** Remove referencedDate metadata for invoices ([8d3b206](https://github.com/cozy/cozy-libs/commit/8d3b2069ab3f08639e2deb61375baf9478ff4020))
|
|
13
|
+
* **Viewer:** Summary now show multiline text correctly ([628bee2](https://github.com/cozy/cozy-libs/commit/628bee2d1a0c30fbb5a7d283a5cb67da5386e1e5))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## [9.0.1](https://github.com/cozy/cozy-libs/compare/cozy-viewer@9.0.0...cozy-viewer@9.0.1) (2024-12-13)
|
|
7
20
|
|
|
8
21
|
|
|
@@ -55,16 +55,10 @@ var ComponentFromMetadataQualificationType = {
|
|
|
55
55
|
bills: _QualificationListItemInformation.default
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
var isExpirationAlertHidden = function isExpirationAlertHidden(file) {
|
|
59
|
-
var _file$metadata$hideEx, _file$metadata;
|
|
60
|
-
|
|
61
|
-
return (_file$metadata$hideEx = file === null || file === void 0 || (_file$metadata = file.metadata) === null || _file$metadata === void 0 ? void 0 : _file$metadata.hideExpirationAlert) !== null && _file$metadata$hideEx !== void 0 ? _file$metadata$hideEx : false;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
58
|
var Qualification = function Qualification(_ref) {
|
|
65
59
|
var file = _ref.file;
|
|
66
|
-
var _file$
|
|
67
|
-
metadata = _file$
|
|
60
|
+
var _file$metadata = file.metadata,
|
|
61
|
+
metadata = _file$metadata === void 0 ? {} : _file$metadata;
|
|
68
62
|
var actionBtnRef = (0, _react.useRef)([]);
|
|
69
63
|
|
|
70
64
|
var _useState = (0, _react.useState)(false),
|
|
@@ -114,7 +108,7 @@ var Qualification = function Qualification(_ref) {
|
|
|
114
108
|
return (_actionBtnRef$current = actionBtnRef.current[idx]) !== null && _actionBtnRef$current !== void 0 ? _actionBtnRef$current : /*#__PURE__*/(0, _react.createRef)();
|
|
115
109
|
});
|
|
116
110
|
}, [formattedMetadataQualification]);
|
|
117
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _paper.isExpiringSoon)(file) && !isExpirationAlertHidden(file) && /*#__PURE__*/_react.default.createElement(_ExpirationAlert.default, {
|
|
111
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _paper.isExpiringSoon)(file) && !(0, _helpers.isExpirationAlertHidden)(file) && /*#__PURE__*/_react.default.createElement(_ExpirationAlert.default, {
|
|
118
112
|
file: file
|
|
119
113
|
}), (0, _file.hasQualifications)(file) ? /*#__PURE__*/_react.default.createElement(_QualificationListItemQualification.default, {
|
|
120
114
|
file: file,
|
|
@@ -29,6 +29,8 @@ var _QualificationIconStack = _interopRequireDefault(require("cozy-ui/transpiled
|
|
|
29
29
|
|
|
30
30
|
var _I18n = require("cozy-ui/transpiled/react/providers/I18n");
|
|
31
31
|
|
|
32
|
+
var _helpers = require("./helpers");
|
|
33
|
+
|
|
32
34
|
var QualificationListItemQualification = function QualificationListItemQualification(_ref) {
|
|
33
35
|
var file = _ref.file,
|
|
34
36
|
onClick = _ref.onClick;
|
|
@@ -44,8 +46,8 @@ var QualificationListItemQualification = function QualificationListItemQualifica
|
|
|
44
46
|
return /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
45
47
|
size: "large",
|
|
46
48
|
divider: true,
|
|
47
|
-
button:
|
|
48
|
-
onClick: onClick
|
|
49
|
+
button: (0, _helpers.canEditQualification)(file),
|
|
50
|
+
onClick: (0, _helpers.canEditQualification)(file) ? onClick : undefined
|
|
49
51
|
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_QualificationIconStack.default, {
|
|
50
52
|
qualification: value
|
|
51
53
|
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
@@ -55,7 +57,7 @@ var QualificationListItemQualification = function QualificationListItemQualifica
|
|
|
55
57
|
primaryTypographyProps: {
|
|
56
58
|
variant: 'h6'
|
|
57
59
|
}
|
|
58
|
-
}), /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
60
|
+
}), (0, _helpers.canEditQualification)(file) && /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
59
61
|
icon: _Right.default,
|
|
60
62
|
color: "var(--secondaryTextColor)"
|
|
61
63
|
})));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export default QualificationListItemText;
|
|
2
|
-
declare function QualificationListItemText({ primary, secondary, disabled }: {
|
|
2
|
+
declare function QualificationListItemText({ primary, secondary, disabled, ...props }: {
|
|
3
|
+
[x: string]: any;
|
|
3
4
|
primary: any;
|
|
4
5
|
secondary: any;
|
|
5
6
|
disabled: any;
|
|
@@ -8,6 +9,7 @@ declare namespace QualificationListItemText {
|
|
|
8
9
|
namespace propTypes {
|
|
9
10
|
const primary: PropTypes.Requireable<string>;
|
|
10
11
|
const secondary: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
12
|
+
const disabled: PropTypes.Requireable<boolean>;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
import PropTypes from "prop-types";
|
|
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
10
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
15
|
|
|
12
16
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -15,11 +19,14 @@ var _ListItemText = _interopRequireDefault(require("cozy-ui/transpiled/react/Lis
|
|
|
15
19
|
|
|
16
20
|
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
17
21
|
|
|
22
|
+
var _excluded = ["primary", "secondary", "disabled"];
|
|
23
|
+
|
|
18
24
|
var QualificationListItemText = function QualificationListItemText(_ref) {
|
|
19
25
|
var primary = _ref.primary,
|
|
20
26
|
secondary = _ref.secondary,
|
|
21
|
-
disabled = _ref.disabled
|
|
22
|
-
|
|
27
|
+
disabled = _ref.disabled,
|
|
28
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_ListItemText.default, (0, _extends2.default)({}, props, {
|
|
23
30
|
disableTypography: true,
|
|
24
31
|
primary: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
25
32
|
variant: "caption"
|
|
@@ -31,12 +38,13 @@ var QualificationListItemText = function QualificationListItemText(_ref) {
|
|
|
31
38
|
color: 'var(--disabledTextColor)'
|
|
32
39
|
} : undefined
|
|
33
40
|
}, secondary)
|
|
34
|
-
});
|
|
41
|
+
}));
|
|
35
42
|
};
|
|
36
43
|
|
|
37
44
|
QualificationListItemText.propTypes = {
|
|
38
45
|
primary: _propTypes.default.string,
|
|
39
|
-
secondary: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
46
|
+
secondary: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired,
|
|
47
|
+
disabled: _propTypes.default.bool
|
|
40
48
|
};
|
|
41
49
|
|
|
42
50
|
var _default = exports.default = QualificationListItemText;
|
package/dist/Panel/Summary.js
CHANGED
|
@@ -121,6 +121,9 @@ 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
|
+
style: {
|
|
125
|
+
wordBreak: 'break-word'
|
|
126
|
+
},
|
|
124
127
|
primary: value ? label : undefined,
|
|
125
128
|
secondary: value || label,
|
|
126
129
|
disabled: !value
|
package/dist/Panel/helpers.d.ts
CHANGED
|
@@ -80,3 +80,5 @@ export namespace metadataByQualificationLabel {
|
|
|
80
80
|
const work_quote: never[];
|
|
81
81
|
}
|
|
82
82
|
export function makeFormattedMetadataQualification(file: any): array;
|
|
83
|
+
export function isExpirationAlertHidden(file: any): boolean;
|
|
84
|
+
export function canEditQualification(file: any): boolean;
|
package/dist/Panel/helpers.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.metadataByQualificationLabel = exports.makeSize = exports.makePath = exports.makeHideDivider = exports.makeFormattedMetadataQualification = exports.makeFormat = exports.makeDate = void 0;
|
|
8
|
+
exports.metadataByQualificationLabel = exports.makeSize = exports.makePath = exports.makeHideDivider = exports.makeFormattedMetadataQualification = exports.makeFormat = exports.makeDate = exports.isExpirationAlertHidden = exports.canEditQualification = void 0;
|
|
9
9
|
|
|
10
10
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
11
11
|
|
|
@@ -91,7 +91,7 @@ var metadataByQualificationLabel = exports.metadataByQualificationLabel = {
|
|
|
91
91
|
driver_license: ['number', 'country', 'AObtentionDate', 'BObtentionDate', 'CObtentionDate', 'DObtentionDate', 'expirationDate', 'noticePeriod'],
|
|
92
92
|
electoral_card: ['referencedDate'],
|
|
93
93
|
employment_center_certificate: ['referencedDate'],
|
|
94
|
-
energy_invoice: ['issueDate'
|
|
94
|
+
energy_invoice: ['issueDate'],
|
|
95
95
|
expense_claim: ['referencedDate'],
|
|
96
96
|
family_record_book: [],
|
|
97
97
|
fidelity_card: ['number', 'expirationDate', 'noticePeriod'],
|
|
@@ -99,7 +99,7 @@ var metadataByQualificationLabel = exports.metadataByQualificationLabel = {
|
|
|
99
99
|
health_insurance_card: ['expirationDate', 'noticePeriod'],
|
|
100
100
|
house_insurance: ['referencedDate'],
|
|
101
101
|
identity_photo: ['shootingDate'],
|
|
102
|
-
isp_invoice: ['issueDate'
|
|
102
|
+
isp_invoice: ['issueDate'],
|
|
103
103
|
lease: ['date'],
|
|
104
104
|
loan_agreement: ['issueDate'],
|
|
105
105
|
national_health_insurance_card: ['number', 'issueDate'],
|
|
@@ -121,7 +121,7 @@ var metadataByQualificationLabel = exports.metadataByQualificationLabel = {
|
|
|
121
121
|
other_health_document: ['date'],
|
|
122
122
|
other_house_document: ['date'],
|
|
123
123
|
other_identity_document: ['date'],
|
|
124
|
-
other_invoice: ['issueDate'
|
|
124
|
+
other_invoice: ['issueDate'],
|
|
125
125
|
other_revenue: ['referencedDate'],
|
|
126
126
|
other_transport_document: ['date'],
|
|
127
127
|
other_work_document: ['date'],
|
|
@@ -129,7 +129,7 @@ var metadataByQualificationLabel = exports.metadataByQualificationLabel = {
|
|
|
129
129
|
passport: ['country', 'number', 'expirationDate', 'noticePeriod'],
|
|
130
130
|
pay_sheet: ['number', 'netSocialAmount', 'employerName', 'referencedDate'],
|
|
131
131
|
payment_proof_family_allowance: ['number', 'issueDate'],
|
|
132
|
-
phone_invoice: ['issueDate'
|
|
132
|
+
phone_invoice: ['issueDate'],
|
|
133
133
|
pregnancy_medical_certificate: ['referencedDate'],
|
|
134
134
|
prescription: ['referencedDate'],
|
|
135
135
|
real_estate_tax: ['number', 'referencedDate'],
|
|
@@ -145,11 +145,11 @@ var metadataByQualificationLabel = exports.metadataByQualificationLabel = {
|
|
|
145
145
|
tax_return: ['number', 'referencedDate'],
|
|
146
146
|
tax_timetable: ['number', 'referencedDate'],
|
|
147
147
|
transport_card: ['expirationDate', 'noticePeriod'],
|
|
148
|
-
transport_invoice: ['issueDate'
|
|
148
|
+
transport_invoice: ['issueDate'],
|
|
149
149
|
unemployment_benefit: ['referencedDate'],
|
|
150
150
|
unfit_for_habitation_declaration: ['issueDate'],
|
|
151
151
|
vehicle_registration: ['vehicle.licenseNumber', 'number', 'vehicle.confidentialNumber'],
|
|
152
|
-
water_invoice: ['issueDate'
|
|
152
|
+
water_invoice: ['issueDate'],
|
|
153
153
|
work_contract: ['contractType', 'date'],
|
|
154
154
|
work_disability_recognition: ['referencedDate'],
|
|
155
155
|
work_quote: []
|
|
@@ -184,4 +184,26 @@ var makeFormattedMetadataQualification = exports.makeFormattedMetadataQualificat
|
|
|
184
184
|
name: 'contact',
|
|
185
185
|
value: null
|
|
186
186
|
}]);
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
*
|
|
190
|
+
* @param {import("cozy-client/types").IOCozyFile} file - io.cozy.file
|
|
191
|
+
* @returns {boolean}
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
var isExpirationAlertHidden = exports.isExpirationAlertHidden = function isExpirationAlertHidden(file) {
|
|
196
|
+
var _file$metadata$hideEx, _file$metadata2;
|
|
197
|
+
|
|
198
|
+
return (_file$metadata$hideEx = file === null || file === void 0 || (_file$metadata2 = file.metadata) === null || _file$metadata2 === void 0 ? void 0 : _file$metadata2.hideExpirationAlert) !== null && _file$metadata$hideEx !== void 0 ? _file$metadata$hideEx : false;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
* @param {import("cozy-client/types").IOCozyFile} file - io.cozy.file
|
|
203
|
+
* @returns {boolean}
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
var canEditQualification = exports.canEditQualification = function canEditQualification(file) {
|
|
208
|
+
return !(0, _file.isFromKonnector)(file);
|
|
187
209
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-viewer",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "Cozy-Viewer provides a component to show files in a viewer.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"babel-preset-cozy-app": "^2.8.1",
|
|
28
28
|
"cozy-client": "^51.6.0",
|
|
29
29
|
"cozy-device-helper": "2.0.0",
|
|
30
|
-
"cozy-harvest-lib": "^31.0.
|
|
30
|
+
"cozy-harvest-lib": "^31.0.19",
|
|
31
31
|
"cozy-intent": "^2.29.1",
|
|
32
32
|
"cozy-logger": "^1.16.1",
|
|
33
33
|
"cozy-sharing": "^16.17.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": ">=16.12.0",
|
|
61
61
|
"react-dom": ">=16.12.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "7c5659170ea8b99787117605811f998a7203a03a"
|
|
64
64
|
}
|
|
@@ -17,7 +17,11 @@ import QualificationListItemInformation from './QualificationListItemInformation
|
|
|
17
17
|
import QualificationListItemOther from './QualificationListItemOther'
|
|
18
18
|
import QualificationListItemQualification from './QualificationListItemQualification'
|
|
19
19
|
import QualificationListItemQualificationEmpty from './QualificationListItemQualificationEmpty'
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
makeHideDivider,
|
|
22
|
+
makeFormattedMetadataQualification,
|
|
23
|
+
isExpirationAlertHidden
|
|
24
|
+
} from './helpers'
|
|
21
25
|
import ExpirationAlert from '../components/ExpirationAlert'
|
|
22
26
|
import { withViewerLocales } from '../hoc/withViewerLocales'
|
|
23
27
|
|
|
@@ -29,10 +33,6 @@ const ComponentFromMetadataQualificationType = {
|
|
|
29
33
|
bills: QualificationListItemInformation
|
|
30
34
|
}
|
|
31
35
|
|
|
32
|
-
const isExpirationAlertHidden = file => {
|
|
33
|
-
return file?.metadata?.hideExpirationAlert ?? false
|
|
34
|
-
}
|
|
35
|
-
|
|
36
36
|
const Qualification = ({ file }) => {
|
|
37
37
|
const { metadata = {} } = file
|
|
38
38
|
const actionBtnRef = useRef([])
|
|
@@ -11,6 +11,8 @@ import MidEllipsis from 'cozy-ui/transpiled/react/MidEllipsis'
|
|
|
11
11
|
import QualificationIconStack from 'cozy-ui/transpiled/react/QualificationIconStack'
|
|
12
12
|
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
13
13
|
|
|
14
|
+
import { canEditQualification } from './helpers'
|
|
15
|
+
|
|
14
16
|
const QualificationListItemQualification = ({ file, onClick }) => {
|
|
15
17
|
const { lang } = useI18n()
|
|
16
18
|
const value = file.metadata.qualification.label
|
|
@@ -21,7 +23,12 @@ const QualificationListItemQualification = ({ file, onClick }) => {
|
|
|
21
23
|
})
|
|
22
24
|
|
|
23
25
|
return (
|
|
24
|
-
<ListItem
|
|
26
|
+
<ListItem
|
|
27
|
+
size="large"
|
|
28
|
+
divider
|
|
29
|
+
button={canEditQualification(file)}
|
|
30
|
+
onClick={canEditQualification(file) ? onClick : undefined}
|
|
31
|
+
>
|
|
25
32
|
<ListItemIcon>
|
|
26
33
|
<QualificationIconStack qualification={value} />
|
|
27
34
|
</ListItemIcon>
|
|
@@ -29,9 +36,11 @@ const QualificationListItemQualification = ({ file, onClick }) => {
|
|
|
29
36
|
primary={<MidEllipsis text={formattedValue} />}
|
|
30
37
|
primaryTypographyProps={{ variant: 'h6' }}
|
|
31
38
|
/>
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
39
|
+
{canEditQualification(file) && (
|
|
40
|
+
<ListItemIcon>
|
|
41
|
+
<Icon icon={RightIcon} color="var(--secondaryTextColor)" />
|
|
42
|
+
</ListItemIcon>
|
|
43
|
+
)}
|
|
35
44
|
</ListItem>
|
|
36
45
|
)
|
|
37
46
|
}
|
|
@@ -4,9 +4,15 @@ import React from 'react'
|
|
|
4
4
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
5
5
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
6
6
|
|
|
7
|
-
const QualificationListItemText = ({
|
|
7
|
+
const QualificationListItemText = ({
|
|
8
|
+
primary,
|
|
9
|
+
secondary,
|
|
10
|
+
disabled,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
8
13
|
return (
|
|
9
14
|
<ListItemText
|
|
15
|
+
{...props}
|
|
10
16
|
disableTypography
|
|
11
17
|
primary={<Typography variant="caption">{primary}</Typography>}
|
|
12
18
|
secondary={
|
|
@@ -24,7 +30,8 @@ const QualificationListItemText = ({ primary, secondary, disabled }) => {
|
|
|
24
30
|
|
|
25
31
|
QualificationListItemText.propTypes = {
|
|
26
32
|
primary: PropTypes.string,
|
|
27
|
-
secondary: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
|
|
33
|
+
secondary: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
34
|
+
disabled: PropTypes.bool
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
export default QualificationListItemText
|
package/src/Panel/Summary.jsx
CHANGED
package/src/Panel/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import get from 'lodash/get'
|
|
2
2
|
|
|
3
|
-
import { splitFilename } from 'cozy-client/dist/models/file'
|
|
3
|
+
import { splitFilename, isFromKonnector } from 'cozy-client/dist/models/file'
|
|
4
4
|
import { KNOWN_BILLS_ATTRIBUTES_NAMES } from 'cozy-client/dist/models/paper'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -84,7 +84,7 @@ export const metadataByQualificationLabel = {
|
|
|
84
84
|
],
|
|
85
85
|
electoral_card: ['referencedDate'],
|
|
86
86
|
employment_center_certificate: ['referencedDate'],
|
|
87
|
-
energy_invoice: ['issueDate'
|
|
87
|
+
energy_invoice: ['issueDate'],
|
|
88
88
|
expense_claim: ['referencedDate'],
|
|
89
89
|
family_record_book: [],
|
|
90
90
|
fidelity_card: ['number', 'expirationDate', 'noticePeriod'],
|
|
@@ -92,7 +92,7 @@ export const metadataByQualificationLabel = {
|
|
|
92
92
|
health_insurance_card: ['expirationDate', 'noticePeriod'],
|
|
93
93
|
house_insurance: ['referencedDate'],
|
|
94
94
|
identity_photo: ['shootingDate'],
|
|
95
|
-
isp_invoice: ['issueDate'
|
|
95
|
+
isp_invoice: ['issueDate'],
|
|
96
96
|
lease: ['date'],
|
|
97
97
|
loan_agreement: ['issueDate'],
|
|
98
98
|
national_health_insurance_card: ['number', 'issueDate'],
|
|
@@ -114,7 +114,7 @@ export const metadataByQualificationLabel = {
|
|
|
114
114
|
other_health_document: ['date'],
|
|
115
115
|
other_house_document: ['date'],
|
|
116
116
|
other_identity_document: ['date'],
|
|
117
|
-
other_invoice: ['issueDate'
|
|
117
|
+
other_invoice: ['issueDate'],
|
|
118
118
|
other_revenue: ['referencedDate'],
|
|
119
119
|
other_transport_document: ['date'],
|
|
120
120
|
other_work_document: ['date'],
|
|
@@ -122,7 +122,7 @@ export const metadataByQualificationLabel = {
|
|
|
122
122
|
passport: ['country', 'number', 'expirationDate', 'noticePeriod'],
|
|
123
123
|
pay_sheet: ['number', 'netSocialAmount', 'employerName', 'referencedDate'],
|
|
124
124
|
payment_proof_family_allowance: ['number', 'issueDate'],
|
|
125
|
-
phone_invoice: ['issueDate'
|
|
125
|
+
phone_invoice: ['issueDate'],
|
|
126
126
|
pregnancy_medical_certificate: ['referencedDate'],
|
|
127
127
|
prescription: ['referencedDate'],
|
|
128
128
|
real_estate_tax: ['number', 'referencedDate'],
|
|
@@ -138,7 +138,7 @@ export const metadataByQualificationLabel = {
|
|
|
138
138
|
tax_return: ['number', 'referencedDate'],
|
|
139
139
|
tax_timetable: ['number', 'referencedDate'],
|
|
140
140
|
transport_card: ['expirationDate', 'noticePeriod'],
|
|
141
|
-
transport_invoice: ['issueDate'
|
|
141
|
+
transport_invoice: ['issueDate'],
|
|
142
142
|
unemployment_benefit: ['referencedDate'],
|
|
143
143
|
unfit_for_habitation_declaration: ['issueDate'],
|
|
144
144
|
vehicle_registration: [
|
|
@@ -146,7 +146,7 @@ export const metadataByQualificationLabel = {
|
|
|
146
146
|
'number',
|
|
147
147
|
'vehicle.confidentialNumber'
|
|
148
148
|
],
|
|
149
|
-
water_invoice: ['issueDate'
|
|
149
|
+
water_invoice: ['issueDate'],
|
|
150
150
|
work_contract: ['contractType', 'date'],
|
|
151
151
|
work_disability_recognition: ['referencedDate'],
|
|
152
152
|
work_quote: []
|
|
@@ -184,3 +184,19 @@ export const makeFormattedMetadataQualification = file => {
|
|
|
184
184
|
.concat(billsMetadataArray)
|
|
185
185
|
.concat([{ name: 'contact', value: null }])
|
|
186
186
|
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
*
|
|
190
|
+
* @param {import("cozy-client/types").IOCozyFile} file - io.cozy.file
|
|
191
|
+
* @returns {boolean}
|
|
192
|
+
*/
|
|
193
|
+
export const isExpirationAlertHidden = file => {
|
|
194
|
+
return file?.metadata?.hideExpirationAlert ?? false
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @param {import("cozy-client/types").IOCozyFile} file - io.cozy.file
|
|
200
|
+
* @returns {boolean}
|
|
201
|
+
*/
|
|
202
|
+
export const canEditQualification = file => !isFromKonnector(file)
|