cozy-ui 103.9.0 → 103.11.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 CHANGED
@@ -1,3 +1,20 @@
1
+ # [103.11.0](https://github.com/cozy/cozy-ui/compare/v103.10.0...v103.11.0) (2024-03-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * **ListItem:** Add `€` on net social amount and pay_sheet number values ([0c9f40f](https://github.com/cozy/cozy-ui/commit/0c9f40f))
7
+ * **ListItem:** Add translated pay_sheet flexsearchProps ([e19aa0e](https://github.com/cozy/cozy-ui/commit/e19aa0e))
8
+ * **ListItem:** Remove useless expanded attributes ([bd3dd4b](https://github.com/cozy/cozy-ui/commit/bd3dd4b)), closes [/github.com/cozy/mespapiers/blob/16c0b7bfc809518bd1e9fb2d54ad894ab77b74b0/src/helpers/migration/metadata.js#L17](https://github.com//github.com/cozy/mespapiers/blob/16c0b7bfc809518bd1e9fb2d54ad894ab77b74b0/src/helpers/migration/metadata.js/issues/L17)
9
+
10
+ # [103.10.0](https://github.com/cozy/cozy-ui/compare/v103.9.0...v103.10.0) (2024-03-05)
11
+
12
+
13
+ ### Features
14
+
15
+ * **Viewer:** Add `€` for net social amount and pay_sheet number value ([a8e6800](https://github.com/cozy/cozy-ui/commit/a8e6800))
16
+ * **Viewer:** Add translate for reference tax number ([99da6d6](https://github.com/cozy/cozy-ui/commit/99da6d6))
17
+
1
18
  # [103.9.0](https://github.com/cozy/cozy-ui/compare/v103.8.2...v103.9.0) (2024-03-04)
2
19
 
3
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "103.9.0",
3
+ "version": "103.11.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -8,7 +8,8 @@ export const normalizeExpandedAttribute = attr =>
8
8
  .replace('flexsearchProps.', '')
9
9
  .replace('translated.', '')
10
10
 
11
- // attributes not considered as expanded attributes
11
+ // attributes not considered as specific expanded attributes
12
+ // and then fallback to default expanded attributes
12
13
  export const notExpandedAttributes = {
13
14
  'io.cozy.contacts': ['fullname', 'civility', 'note'],
14
15
  'io.cozy.files': [
@@ -20,6 +21,7 @@ export const notExpandedAttributes = {
20
21
  'flexsearchProps:translated:vehicleRegistration',
21
22
  'flexsearchProps:translated:nationalIdCard',
22
23
  'flexsearchProps:translated:bankDetails',
24
+ 'flexsearchProps:translated:paySheet',
23
25
  'flexsearchProps:translated:passport',
24
26
  'flexsearchProps:translated:residencePermit'
25
27
  ]
@@ -30,13 +32,8 @@ export const defaultExpandedAttributes = {
30
32
  'io.cozy.contacts': ['email', 'phone', 'address', 'birthday'],
31
33
  'io.cozy.files': [
32
34
  'metadata.number',
33
- 'metadata.cafFileNumber',
34
- 'metadata.cardNumber',
35
- 'metadata.vinNumber',
36
- 'metadata.ibanNumber',
37
35
  'metadata.bicNumber',
38
36
  'metadata.netSocialAmount',
39
- 'metadata.passportNumber',
40
37
  'metadata.noticePeriod',
41
38
  'metadata.obtentionDate',
42
39
  'metadata.expirationDate',
@@ -183,7 +180,11 @@ export const getValueExtended = ({ attrKey, value, t }) => {
183
180
  return t('common.day', { smart_count: parseInt(value) })
184
181
  }
185
182
  }
186
- if (attrKey === 'metadata.refTaxIncome') {
183
+ if (
184
+ attrKey === 'metadata.refTaxIncome' ||
185
+ attrKey === 'metadata.netSocialAmount' ||
186
+ attrKey === 'metadata.number.pay_sheet'
187
+ ) {
187
188
  if (!isNaN(parseInt(value))) {
188
189
  return `${value} €`
189
190
  }
@@ -12,7 +12,13 @@ import QualificationListItemText from './QualificationListItemText'
12
12
  import { useI18n } from '../../providers/I18n'
13
13
  import MidEllipsis from '../../MidEllipsis'
14
14
 
15
- export const makeInformationValue = ({ name, value, t, scannerT }) => {
15
+ export const makeInformationValue = ({
16
+ name,
17
+ value,
18
+ qualificationLabel,
19
+ t,
20
+ scannerT
21
+ }) => {
16
22
  if (typeof value !== 'number' && !value) {
17
23
  return t('Viewer.panel.qualification.noInfo')
18
24
  }
@@ -25,7 +31,11 @@ export const makeInformationValue = ({ name, value, t, scannerT }) => {
25
31
  if (name === 'contractType') {
26
32
  return scannerT(`Scan.attributes.contractType.${value}`, { _: value })
27
33
  }
28
- if (name === 'refTaxIncome') {
34
+ if (
35
+ name === 'refTaxIncome' ||
36
+ name === 'netSocialAmount' ||
37
+ (name === 'number' && qualificationLabel === 'pay_sheet')
38
+ ) {
29
39
  return `${value} €`
30
40
  }
31
41
 
@@ -39,7 +49,13 @@ const QualificationListItemInformation = forwardRef(
39
49
  const { name, value } = formatedMetadataQualification
40
50
  const qualificationLabel = file.metadata.qualification.label
41
51
 
42
- const currentValue = makeInformationValue({ name, value, t, scannerT })
52
+ const currentValue = makeInformationValue({
53
+ name,
54
+ value,
55
+ qualificationLabel,
56
+ t,
57
+ scannerT
58
+ })
43
59
  const title =
44
60
  name === 'number'
45
61
  ? t(
@@ -88,6 +88,18 @@
88
88
  "pay_sheet": {
89
89
  "number": "Gross remuneration"
90
90
  },
91
+ "tax_return": {
92
+ "number": "Reference tax number"
93
+ },
94
+ "tax_notice": {
95
+ "number": "Reference tax number"
96
+ },
97
+ "real_estate_tax": {
98
+ "number": "Reference tax number"
99
+ },
100
+ "tax_timetable": {
101
+ "number": "Reference tax number"
102
+ },
91
103
  "country": "Beneficiary nationality",
92
104
  "refTaxIncome": "Reference tax income",
93
105
  "contractType": "Contract type",
@@ -88,6 +88,18 @@
88
88
  "pay_sheet": {
89
89
  "number": "Rémunération brute"
90
90
  },
91
+ "tax_return": {
92
+ "number": "Numéro fiscal de référence"
93
+ },
94
+ "tax_notice": {
95
+ "number": "Numéro fiscal de référence"
96
+ },
97
+ "real_estate_tax": {
98
+ "number": "Numéro fiscal de référence"
99
+ },
100
+ "tax_timetable": {
101
+ "number": "Numéro fiscal de référence"
102
+ },
91
103
  "country": "Nationalité du bénéficiaire",
92
104
  "refTaxIncome": "Revenu fiscal de référence",
93
105
  "contractType": "Type de contrat",
@@ -4,16 +4,17 @@ import get from 'lodash/get';
4
4
  import { formatDate } from "cozy-ui/transpiled/react/Viewer/helpers";
5
5
  export var normalizeExpandedAttribute = function normalizeExpandedAttribute(attr) {
6
6
  return attr.replaceAll(':', '.').replace('flexsearchProps.', '').replace('translated.', '');
7
- }; // attributes not considered as expanded attributes
7
+ }; // attributes not considered as specific expanded attributes
8
+ // and then fallback to default expanded attributes
8
9
 
9
10
  export var notExpandedAttributes = {
10
11
  'io.cozy.contacts': ['fullname', 'civility', 'note'],
11
- 'io.cozy.files': ['name', 'flexsearchProps:translated:qualificationLabel', 'flexsearchProps:translated:driverLicense', 'flexsearchProps:translated:paymentProofFamilyAllowance', 'flexsearchProps:translated:caf', 'flexsearchProps:translated:vehicleRegistration', 'flexsearchProps:translated:nationalIdCard', 'flexsearchProps:translated:bankDetails', 'flexsearchProps:translated:passport', 'flexsearchProps:translated:residencePermit']
12
+ 'io.cozy.files': ['name', 'flexsearchProps:translated:qualificationLabel', 'flexsearchProps:translated:driverLicense', 'flexsearchProps:translated:paymentProofFamilyAllowance', 'flexsearchProps:translated:caf', 'flexsearchProps:translated:vehicleRegistration', 'flexsearchProps:translated:nationalIdCard', 'flexsearchProps:translated:bankDetails', 'flexsearchProps:translated:paySheet', 'flexsearchProps:translated:passport', 'flexsearchProps:translated:residencePermit']
12
13
  }; // attributes that we want to display if no attribute of the document is related to the search
13
14
 
14
15
  export var defaultExpandedAttributes = {
15
16
  'io.cozy.contacts': ['email', 'phone', 'address', 'birthday'],
16
- 'io.cozy.files': ['metadata.number', 'metadata.cafFileNumber', 'metadata.cardNumber', 'metadata.vinNumber', 'metadata.ibanNumber', 'metadata.bicNumber', 'metadata.netSocialAmount', 'metadata.passportNumber', 'metadata.noticePeriod', 'metadata.obtentionDate', 'metadata.expirationDate', 'metadata.country', 'metadata.refTaxIncome', 'metadata.contractType']
17
+ 'io.cozy.files': ['metadata.number', 'metadata.bicNumber', 'metadata.netSocialAmount', 'metadata.noticePeriod', 'metadata.obtentionDate', 'metadata.expirationDate', 'metadata.country', 'metadata.refTaxIncome', 'metadata.contractType']
17
18
  };
18
19
  export var hasAllElement = function hasAllElement(arr1, arr2) {
19
20
  return arr1 === null || arr1 === void 0 ? void 0 : arr1.every(function (x) {
@@ -179,7 +180,7 @@ export var getValueExtended = function getValueExtended(_ref6) {
179
180
  }
180
181
  }
181
182
 
182
- if (attrKey === 'metadata.refTaxIncome') {
183
+ if (attrKey === 'metadata.refTaxIncome' || attrKey === 'metadata.netSocialAmount' || attrKey === 'metadata.number.pay_sheet') {
183
184
  if (!isNaN(parseInt(value))) {
184
185
  return "".concat(value, " \u20AC");
185
186
  }
@@ -12,6 +12,7 @@ import MidEllipsis from "cozy-ui/transpiled/react/MidEllipsis";
12
12
  export var makeInformationValue = function makeInformationValue(_ref) {
13
13
  var name = _ref.name,
14
14
  value = _ref.value,
15
+ qualificationLabel = _ref.qualificationLabel,
15
16
  t = _ref.t,
16
17
  scannerT = _ref.scannerT;
17
18
 
@@ -31,7 +32,7 @@ export var makeInformationValue = function makeInformationValue(_ref) {
31
32
  });
32
33
  }
33
34
 
34
- if (name === 'refTaxIncome') {
35
+ if (name === 'refTaxIncome' || name === 'netSocialAmount' || name === 'number' && qualificationLabel === 'pay_sheet') {
35
36
  return "".concat(value, " \u20AC");
36
37
  }
37
38
 
@@ -55,6 +56,7 @@ var QualificationListItemInformation = /*#__PURE__*/forwardRef(function (_ref2,
55
56
  var currentValue = makeInformationValue({
56
57
  name: name,
57
58
  value: value,
59
+ qualificationLabel: qualificationLabel,
58
60
  t: t,
59
61
  scannerT: scannerT
60
62
  });
@@ -89,6 +89,18 @@ var en = {
89
89
  pay_sheet: {
90
90
  number: "Gross remuneration"
91
91
  },
92
+ tax_return: {
93
+ number: "Reference tax number"
94
+ },
95
+ tax_notice: {
96
+ number: "Reference tax number"
97
+ },
98
+ real_estate_tax: {
99
+ number: "Reference tax number"
100
+ },
101
+ tax_timetable: {
102
+ number: "Reference tax number"
103
+ },
92
104
  country: "Beneficiary nationality",
93
105
  refTaxIncome: "Reference tax income",
94
106
  contractType: "Contract type",
@@ -227,6 +239,18 @@ var fr = {
227
239
  pay_sheet: {
228
240
  number: "R\xE9mun\xE9ration brute"
229
241
  },
242
+ tax_return: {
243
+ number: "Num\xE9ro fiscal de r\xE9f\xE9rence"
244
+ },
245
+ tax_notice: {
246
+ number: "Num\xE9ro fiscal de r\xE9f\xE9rence"
247
+ },
248
+ real_estate_tax: {
249
+ number: "Num\xE9ro fiscal de r\xE9f\xE9rence"
250
+ },
251
+ tax_timetable: {
252
+ number: "Num\xE9ro fiscal de r\xE9f\xE9rence"
253
+ },
230
254
  country: "Nationalit\xE9 du b\xE9n\xE9ficiaire",
231
255
  refTaxIncome: "Revenu fiscal de r\xE9f\xE9rence",
232
256
  contractType: "Type de contrat",