cozy-client 47.0.0 → 47.1.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/dist/CozyClient.js +1 -1
- package/dist/models/paper.js +13 -4
- package/dist/models/paper.spec.js +9 -0
- package/package.json +2 -2
package/dist/CozyClient.js
CHANGED
|
@@ -2782,7 +2782,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
2782
2782
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
2783
2783
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
2784
2784
|
|
|
2785
|
-
CozyClient.version = "47.
|
|
2785
|
+
CozyClient.version = "47.1.1";
|
|
2786
2786
|
|
|
2787
2787
|
_microee.default.mixin(CozyClient);
|
|
2788
2788
|
|
package/dist/models/paper.js
CHANGED
|
@@ -19,10 +19,14 @@ var _fr = _interopRequireDefault(require("date-fns/locale/fr"));
|
|
|
19
19
|
|
|
20
20
|
var _locales = require("./document/locales");
|
|
21
21
|
|
|
22
|
+
var _locales2 = require("./country/locales");
|
|
23
|
+
|
|
22
24
|
var _contact = require("./contact");
|
|
23
25
|
|
|
24
26
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
25
27
|
|
|
28
|
+
var _countries = require("./country/countries");
|
|
29
|
+
|
|
26
30
|
/**
|
|
27
31
|
* @typedef {import("../types").IOCozyFile} IOCozyFile
|
|
28
32
|
*/
|
|
@@ -422,20 +426,21 @@ var formatInformationMetadataValue = function formatInformationMetadataValue(val
|
|
|
422
426
|
var lang = _ref5.lang,
|
|
423
427
|
name = _ref5.name,
|
|
424
428
|
qualificationLabel = _ref5.qualificationLabel;
|
|
425
|
-
var
|
|
429
|
+
var tDoc = (0, _locales.getLocalizer)(lang);
|
|
430
|
+
var tCountry = (0, _locales2.getLocalizer)(lang);
|
|
426
431
|
|
|
427
432
|
if (typeof value !== 'number' && !value) {
|
|
428
|
-
return
|
|
433
|
+
return tDoc('Scan.qualification.noInfo');
|
|
429
434
|
}
|
|
430
435
|
|
|
431
436
|
if (name === 'noticePeriod') {
|
|
432
|
-
return "".concat(value, " ").concat(
|
|
437
|
+
return "".concat(value, " ").concat(tDoc('Scan.qualification.information.day', {
|
|
433
438
|
smart_count: value
|
|
434
439
|
}));
|
|
435
440
|
}
|
|
436
441
|
|
|
437
442
|
if (name === 'contractType') {
|
|
438
|
-
return
|
|
443
|
+
return tDoc("Scan.attributes.contractType.".concat(value), {
|
|
439
444
|
_: value
|
|
440
445
|
});
|
|
441
446
|
}
|
|
@@ -444,6 +449,10 @@ var formatInformationMetadataValue = function formatInformationMetadataValue(val
|
|
|
444
449
|
return "".concat(value, " \u20AC");
|
|
445
450
|
}
|
|
446
451
|
|
|
452
|
+
if (name === 'country' && (0, _countries.checkCountryCode)(value)) {
|
|
453
|
+
return tCountry("nationalities.".concat(value));
|
|
454
|
+
}
|
|
455
|
+
|
|
447
456
|
return value;
|
|
448
457
|
};
|
|
449
458
|
/**
|
|
@@ -249,5 +249,14 @@ describe('Expiration', () => {
|
|
|
249
249
|
|
|
250
250
|
expect(res).toEqual('metadataValue')
|
|
251
251
|
})
|
|
252
|
+
|
|
253
|
+
it('should return nationality', () => {
|
|
254
|
+
const res = paperModel.formatInformationMetadataValue('FR', {
|
|
255
|
+
name: 'country',
|
|
256
|
+
lang: 'en'
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
expect(res).toEqual('French')
|
|
260
|
+
})
|
|
252
261
|
})
|
|
253
262
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "47.
|
|
3
|
+
"version": "47.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.node.js",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
|
|
76
76
|
},
|
|
77
77
|
"sideEffects": false,
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "54801076e3cfb57c7ab4db021871c23cd07c0130"
|
|
79
79
|
}
|