cozy-client 46.6.1 → 46.7.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
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.7.1";
|
|
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: {},
|
|
@@ -134,6 +134,14 @@
|
|
|
134
134
|
"alternate": "Alternate",
|
|
135
135
|
"internship": "Internship",
|
|
136
136
|
"other": "Other"
|
|
137
|
+
},
|
|
138
|
+
"noticePeriod": {
|
|
139
|
+
"oneWeek": "1 week before",
|
|
140
|
+
"oneMonth": "1 month before",
|
|
141
|
+
"threeMonth": "3 months before",
|
|
142
|
+
"oneYear": "1 year before",
|
|
143
|
+
"custom": "Custom",
|
|
144
|
+
"noAlert": "Do not be alerted"
|
|
137
145
|
}
|
|
138
146
|
},
|
|
139
147
|
"themes": {
|
|
@@ -134,6 +134,14 @@
|
|
|
134
134
|
"alternate": "Alternance",
|
|
135
135
|
"internship": "Stage",
|
|
136
136
|
"other": "Autre"
|
|
137
|
+
},
|
|
138
|
+
"noticePeriod": {
|
|
139
|
+
"oneWeek": "1 semaine avant",
|
|
140
|
+
"oneMonth": "1 mois avant",
|
|
141
|
+
"threeMonth": "3 mois avant",
|
|
142
|
+
"oneYear": "1 an avant",
|
|
143
|
+
"custom": "Personnalisé",
|
|
144
|
+
"noAlert": "Ne pas être alerté"
|
|
137
145
|
}
|
|
138
146
|
},
|
|
139
147
|
"themes": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.7.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": "462bc3a07416daf84b5b14beac5e1f06000d162a"
|
|
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;
|