cozy-client 46.7.0 → 46.8.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/dist/CozyClient.js
CHANGED
|
@@ -2705,7 +2705,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
2705
2705
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
2706
2706
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
2707
2707
|
|
|
2708
|
-
CozyClient.version = "46.
|
|
2708
|
+
CozyClient.version = "46.8.0";
|
|
2709
2709
|
|
|
2710
2710
|
_microee.default.mixin(CozyClient);
|
|
2711
2711
|
|
package/dist/models/contact.js
CHANGED
|
@@ -30,7 +30,7 @@ var getPrimaryOrFirst = function getPrimaryOrFirst(property) {
|
|
|
30
30
|
/**
|
|
31
31
|
* Returns the initials of the contact.
|
|
32
32
|
*
|
|
33
|
-
* @param {
|
|
33
|
+
* @param {import('../types').IOCozyContact} contact - A contact
|
|
34
34
|
* @returns {string} - the contact's initials
|
|
35
35
|
*/
|
|
36
36
|
|
|
@@ -38,7 +38,9 @@ var getPrimaryOrFirst = function getPrimaryOrFirst(property) {
|
|
|
38
38
|
exports.getPrimaryOrFirst = getPrimaryOrFirst;
|
|
39
39
|
|
|
40
40
|
var getInitials = function getInitials(contact) {
|
|
41
|
-
|
|
41
|
+
var _contact$name, _contact$name2;
|
|
42
|
+
|
|
43
|
+
if (contact !== null && contact !== void 0 && (_contact$name = contact.name) !== null && _contact$name !== void 0 && _contact$name.givenName || contact !== null && contact !== void 0 && (_contact$name2 = contact.name) !== null && _contact$name2 !== void 0 && _contact$name2.familyName) {
|
|
42
44
|
return ['givenName', 'familyName'].map(function (part) {
|
|
43
45
|
return (0, _get.default)(contact, ['name', part, 0], '');
|
|
44
46
|
}).join('').toUpperCase();
|
|
@@ -98,6 +98,23 @@ describe('getInitials', () => {
|
|
|
98
98
|
expect(result).toEqual('A')
|
|
99
99
|
})
|
|
100
100
|
|
|
101
|
+
it('should return the first letter of the primary email if contact has empty familyName and givenName', () => {
|
|
102
|
+
const contact = {
|
|
103
|
+
name: {
|
|
104
|
+
familyName: '',
|
|
105
|
+
givenName: ''
|
|
106
|
+
},
|
|
107
|
+
email: [
|
|
108
|
+
{
|
|
109
|
+
address: 'arya.stark@thenorth.westeros',
|
|
110
|
+
primary: true
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
const result = getInitials(contact)
|
|
115
|
+
expect(result).toEqual('A')
|
|
116
|
+
})
|
|
117
|
+
|
|
101
118
|
it('should return the first letter of the cozy domain if contact has empty name, an empty email but has a cozy url', () => {
|
|
102
119
|
const contact = {
|
|
103
120
|
name: {},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"mechanic_invoice": "Facture de réparation |||| Factures de réparation",
|
|
63
63
|
"motivation_letter": "Lettre de motivation |||| Lettres de motivation",
|
|
64
64
|
"national_health_insurance_card": "Carte vitale |||| Cartes vitales",
|
|
65
|
-
"national_health_insurance_right_certificate": "Attestation de droits de l'Assurance Maladie
|
|
65
|
+
"national_health_insurance_right_certificate": "Attestation de droits de l'Assurance Maladie |||| Attestations de droits de l'Assurance Maladie",
|
|
66
66
|
"national_id_card": "Carte d'identité |||| Cartes d'identité",
|
|
67
67
|
"note_identity_document": "Note Identité |||| Notes Identité",
|
|
68
68
|
"note_family_document": "Note Famille |||| Notes Famille",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.8.0",
|
|
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": "adc2786ac0ebde0b64aff738930aef5ab67423a2"
|
|
79
79
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const CONTACTS_DOCTYPE: "io.cozy.contacts";
|
|
2
2
|
export function getPrimaryOrFirst(property: any): (obj: any) => any;
|
|
3
|
-
export function getInitials(contact:
|
|
3
|
+
export function getInitials(contact: import('../types').IOCozyContact): string;
|
|
4
4
|
export function getPrimaryEmail(contact: object): string;
|
|
5
5
|
export function getPrimaryCozy(contact: object): string;
|
|
6
6
|
export function getPrimaryCozyDomain(contact: object): string;
|