cozy-ui 127.13.0 → 127.14.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 +15 -0
- package/assets/icons/ui/assign-admin.svg +1 -0
- package/assets/icons/ui/assign-moderator.svg +1 -0
- package/package.json +1 -1
- package/react/Contacts/GroupsSelect/styles.styl +2 -1
- package/react/ContactsList/ContactCell.jsx +1 -1
- package/react/ContactsList/Contacts/ContactIdentity.jsx +1 -5
- package/react/ContactsList/ContactsList.jsx +1 -3
- package/react/ContactsList/helpers.js +10 -11
- package/react/ContactsList/helpers.spec.js +2 -11
- package/react/ContactsList/locales/en.json +4 -6
- package/react/ContactsList/locales/fr.json +5 -7
- package/react/Icon/Readme.md +5 -1
- package/react/Icons/AssignAdmin.jsx +22 -0
- package/react/Icons/AssignModerator.jsx +13 -0
- package/transpiled/react/Contacts/GroupsSelect/GroupCreation.js +5 -1
- package/transpiled/react/ContactsList/ContactCell.js +1 -1
- package/transpiled/react/ContactsList/Contacts/ContactIdentity.js +1 -1
- package/transpiled/react/ContactsList/ContactsList.js +1 -4
- package/transpiled/react/ContactsList/helpers.js +10 -10
- package/transpiled/react/ContactsList/locales/withContactsListLocales.js +8 -12
- package/transpiled/react/Icon/icons-sprite.d.ts +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/AssignAdmin.d.ts +2 -0
- package/transpiled/react/Icons/AssignAdmin.js +18 -0
- package/transpiled/react/Icons/AssignModerator.d.ts +2 -0
- package/transpiled/react/Icons/AssignModerator.js +12 -0
- package/transpiled/react/stylesheet.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [127.14.0](https://github.com/cozy/cozy-ui/compare/v127.13.1...v127.14.0) (2025-08-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Icons:** Add `AssignAdmin` and `AssignModerator` ([a66dedf](https://github.com/cozy/cozy-ui/commit/a66dedf))
|
|
7
|
+
|
|
8
|
+
## [127.13.1](https://github.com/cozy/cozy-ui/compare/v127.13.0...v127.13.1) (2025-08-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **ContactsList:** Revert moving locales inside `ContactsList` attribute ([eba17b6](https://github.com/cozy/cozy-ui/commit/eba17b6))
|
|
14
|
+
* **GroupsSelect:** Styles wasn't build correctly ([dc9d3ce](https://github.com/cozy/cozy-ui/commit/dc9d3ce))
|
|
15
|
+
|
|
1
16
|
# [127.13.0](https://github.com/cozy/cozy-ui/compare/v127.12.0...v127.13.0) (2025-08-21)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M11.2 10.896a.896.896 0 1 0 0-1.792.896.896 0 0 0 0 1.792Z"/><path fill-rule="evenodd" d="M11.2 11.6c-.584 0-1.752.288-1.792.864a2.19 2.19 0 0 0 1.792.936 2.19 2.19 0 0 0 1.792-.936c-.04-.576-1.208-.864-1.792-.864Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M12 6.472V2.616L6 0 0 2.616v3.928c0 3.632 2.56 7.032 6 7.856.44-.104.864-.256 1.28-.44A4.778 4.778 0 0 0 11.2 16c2.648 0 4.8-2.152 4.8-4.8a4.798 4.798 0 0 0-4-4.728ZM6.4 11.2c0 .448.064.888.184 1.296a5.27 5.27 0 0 1-.584.24c-2.536-.8-4.4-3.392-4.4-6.192v-2.88L6 1.744l4.4 1.92v2.808a4.798 4.798 0 0 0-4 4.728Zm4.8 3.2a3.2 3.2 0 1 1 0-6.4 3.2 3.2 0 1 1 0 6.4Z" clip-rule="evenodd"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16"><path d="M1.6 7.272v-3.76l4.8-1.8 4.8 1.8v2.952c.568.08 1.104.248 1.6.48V2.4L6.4 0 0 2.4v4.872C0 11.312 2.728 15.08 6.4 16c.024-.008.04-.016.064-.016a5.658 5.658 0 0 1-1.4-2.272C3.008 12.424 1.6 9.936 1.6 7.272Z"/><path d="M10.4 8c-2.208 0-4 1.792-4 4s1.792 4 4 4 4-1.792 4-4-1.792-4-4-4Zm2.4 4.4h-2v2H10v-2H8v-.8h2v-2h.8v2h2v.8Z"/></svg>
|
package/package.json
CHANGED
|
@@ -14,11 +14,7 @@ const MyselfMarker = () => {
|
|
|
14
14
|
useExtendI18n(locales)
|
|
15
15
|
const { t } = useI18n()
|
|
16
16
|
|
|
17
|
-
return (
|
|
18
|
-
<span className={`${styles['contact-myself']}`}>
|
|
19
|
-
({t('ContactsList.me')})
|
|
20
|
-
</span>
|
|
21
|
-
)
|
|
17
|
+
return <span className={`${styles['contact-myself']}`}>({t('me')})</span>
|
|
22
18
|
}
|
|
23
19
|
|
|
24
20
|
const ContactIdentity = ({ contact }) => {
|
|
@@ -4,15 +4,13 @@ import React from 'react'
|
|
|
4
4
|
import ContactRow from './ContactRow'
|
|
5
5
|
import { sortContacts, categorizeContacts, sortHeaders } from './helpers'
|
|
6
6
|
import withContactsListLocales from './locales/withContactsListLocales'
|
|
7
|
-
import { locales } from './locales/withContactsListLocales'
|
|
8
7
|
import List from '../List'
|
|
9
8
|
import ListSubheader from '../ListSubheader'
|
|
10
9
|
import { Table } from '../deprecated/Table'
|
|
11
10
|
import useBreakpoints from '../providers/Breakpoints'
|
|
12
|
-
import { useI18n
|
|
11
|
+
import { useI18n } from '../providers/I18n'
|
|
13
12
|
|
|
14
13
|
const ContactsList = ({ contacts, onItemClick, ...rest }) => {
|
|
15
|
-
useExtendI18n(locales)
|
|
16
14
|
const { t } = useI18n()
|
|
17
15
|
const sortedContacts = sortContacts(contacts)
|
|
18
16
|
const categorizedContacts = categorizeContacts(sortedContacts, t)
|
|
@@ -32,10 +32,10 @@ export const sortContacts = contacts => contacts.sort(sortLastNameFirst)
|
|
|
32
32
|
* @returns {string} header
|
|
33
33
|
*/
|
|
34
34
|
const makeHeader = (contact, t) => {
|
|
35
|
-
if (contact.me) return t('
|
|
35
|
+
if (contact.me) return t('me')
|
|
36
36
|
|
|
37
37
|
const name = buildLastNameFirst(contact)
|
|
38
|
-
return name[0] || t('
|
|
38
|
+
return name[0] || t('empty')
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -45,8 +45,8 @@ const makeHeader = (contact, t) => {
|
|
|
45
45
|
* @returns {string} header
|
|
46
46
|
*/
|
|
47
47
|
const makeHeaderForIndexedContacts = (contact, t) => {
|
|
48
|
-
if (contact.me) return t('
|
|
49
|
-
if (contact.cozyMetadata?.favorite) return t('
|
|
48
|
+
if (contact.me) return t('me')
|
|
49
|
+
if (contact.cozyMetadata?.favorite) return t('favorite')
|
|
50
50
|
|
|
51
51
|
const index = get(contact, 'indexes.byFamilyNameGivenNameEmailCozyUrl', '')
|
|
52
52
|
const hasIndex = index !== null && index.length > 0
|
|
@@ -58,7 +58,7 @@ const makeHeaderForIndexedContacts = (contact, t) => {
|
|
|
58
58
|
return firstLetterWithoutAccent
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
return t('
|
|
61
|
+
return t('empty')
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -89,8 +89,7 @@ export const categorizeContacts = (contacts, t) =>
|
|
|
89
89
|
export const sortHeaders = (categorized, t) => {
|
|
90
90
|
const headers = Object.keys(categorized)
|
|
91
91
|
const notEmptyAndMyselfHeaders = headers.filter(
|
|
92
|
-
header =>
|
|
93
|
-
header !== t('ContactsList.empty') && header !== t('ContactsList.me')
|
|
92
|
+
header => header !== t('empty') && header !== t('me')
|
|
94
93
|
)
|
|
95
94
|
const notEmptyAndMyselfSorted = notEmptyAndMyselfHeaders.slice().sort()
|
|
96
95
|
|
|
@@ -99,11 +98,11 @@ export const sortHeaders = (categorized, t) => {
|
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
const headersSorted = []
|
|
102
|
-
if (headers.includes(t('
|
|
103
|
-
headersSorted.push(t('
|
|
101
|
+
if (headers.includes(t('me'))) {
|
|
102
|
+
headersSorted.push(t('me'))
|
|
104
103
|
}
|
|
105
|
-
if (headers.includes(t('
|
|
106
|
-
headersSorted.push(t('
|
|
104
|
+
if (headers.includes(t('empty'))) {
|
|
105
|
+
headersSorted.push(t('empty'))
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
return headersSorted.concat(notEmptyAndMyselfSorted)
|
|
@@ -103,7 +103,7 @@ describe('sortHeaders', () => {
|
|
|
103
103
|
|
|
104
104
|
const sortedHeaders = sortHeaders(contacts, t)
|
|
105
105
|
|
|
106
|
-
expect(sortedHeaders).toEqual(['
|
|
106
|
+
expect(sortedHeaders).toEqual(['me', 'empty', 'B', 'F', 'H'])
|
|
107
107
|
})
|
|
108
108
|
})
|
|
109
109
|
|
|
@@ -143,16 +143,7 @@ describe('makeGroupLabelsAndCounts', () => {
|
|
|
143
143
|
const res = makeGroupLabelsAndCounts(contacts, t)
|
|
144
144
|
|
|
145
145
|
expect(res).toStrictEqual({
|
|
146
|
-
groupLabels: [
|
|
147
|
-
'A',
|
|
148
|
-
'C',
|
|
149
|
-
'B',
|
|
150
|
-
'X',
|
|
151
|
-
'Z',
|
|
152
|
-
'ContactsList.empty',
|
|
153
|
-
'ContactsList.me',
|
|
154
|
-
'E'
|
|
155
|
-
],
|
|
146
|
+
groupLabels: ['A', 'C', 'B', 'X', 'Z', 'empty', 'me', 'E'],
|
|
156
147
|
groupCounts: [3, 5, 2, 1, 1, 4, 1, 1]
|
|
157
148
|
})
|
|
158
149
|
})
|
package/react/Icon/Readme.md
CHANGED
|
@@ -71,6 +71,8 @@ import Answer from 'cozy-ui/transpiled/react/Icons/Answer'
|
|
|
71
71
|
import Apple from 'cozy-ui/transpiled/react/Icons/Apple'
|
|
72
72
|
import Archive from 'cozy-ui/transpiled/react/Icons/Archive'
|
|
73
73
|
import ArrowUp from 'cozy-ui/transpiled/react/Icons/ArrowUp'
|
|
74
|
+
import AssignAdmin from 'cozy-ui/transpiled/react/Icons/AssignAdmin'
|
|
75
|
+
import AssignModerator from 'cozy-ui/transpiled/react/Icons/AssignModerator'
|
|
74
76
|
import Assistant from 'cozy-ui/transpiled/react/Icons/Assistant'
|
|
75
77
|
import Attachment from 'cozy-ui/transpiled/react/Icons/Attachment'
|
|
76
78
|
import Attention from 'cozy-ui/transpiled/react/Icons/Attention'
|
|
@@ -352,6 +354,8 @@ const icons = [
|
|
|
352
354
|
Apple,
|
|
353
355
|
Archive,
|
|
354
356
|
ArrowUp,
|
|
357
|
+
AssignAdmin,
|
|
358
|
+
AssignModerator,
|
|
355
359
|
Assistant,
|
|
356
360
|
Attachment,
|
|
357
361
|
Attention,
|
|
@@ -988,7 +992,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
988
992
|
|
|
989
993
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
990
994
|
let i = 0
|
|
991
|
-
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
|
|
995
|
+
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','assign-admin','assign-moderator','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
|
|
992
996
|
;
|
|
993
997
|
|
|
994
998
|
<Grid container spacing={2}>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/assign-admin.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgAssignAdmin(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg {...props}>
|
|
7
|
+
<path d="M11.2 10.896a.896.896 0 100-1.792.896.896 0 000 1.792z" />
|
|
8
|
+
<path
|
|
9
|
+
fillRule="evenodd"
|
|
10
|
+
d="M11.2 11.6c-.584 0-1.752.288-1.792.864a2.19 2.19 0 001.792.936 2.19 2.19 0 001.792-.936c-.04-.576-1.208-.864-1.792-.864z"
|
|
11
|
+
clipRule="evenodd"
|
|
12
|
+
/>
|
|
13
|
+
<path
|
|
14
|
+
fillRule="evenodd"
|
|
15
|
+
d="M12 6.472V2.616L6 0 0 2.616v3.928c0 3.632 2.56 7.032 6 7.856.44-.104.864-.256 1.28-.44A4.778 4.778 0 0011.2 16c2.648 0 4.8-2.152 4.8-4.8a4.798 4.798 0 00-4-4.728zM6.4 11.2c0 .448.064.888.184 1.296a5.27 5.27 0 01-.584.24c-2.536-.8-4.4-3.392-4.4-6.192v-2.88L6 1.744l4.4 1.92v2.808a4.798 4.798 0 00-4 4.728zm4.8 3.2a3.2 3.2 0 110-6.4 3.2 3.2 0 110 6.4z"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default SvgAssignAdmin
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/assign-moderator.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgAssignModerator(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg {...props}>
|
|
7
|
+
<path d="M1.6 7.272v-3.76l4.8-1.8 4.8 1.8v2.952c.568.08 1.104.248 1.6.48V2.4L6.4 0 0 2.4v4.872C0 11.312 2.728 15.08 6.4 16c.024-.008.04-.016.064-.016a5.658 5.658 0 01-1.4-2.272C3.008 12.424 1.6 9.936 1.6 7.272z" />
|
|
8
|
+
<path d="M10.4 8c-2.208 0-4 1.792-4 4s1.792 4 4 4 4-1.792 4-4-1.792-4-4-4zm2.4 4.4h-2v2H10v-2H8v-.8h2v-2h.8v2h2v.8z" />
|
|
9
|
+
</svg>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default SvgAssignModerator
|
|
@@ -14,7 +14,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
14
14
|
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import React, { Component } from 'react';
|
|
17
|
-
var styles = {
|
|
17
|
+
var styles = {
|
|
18
|
+
"container": "styles__container___1ById",
|
|
19
|
+
"contact-group-creation-divider": "styles__contact-group-creation-divider___3txmu",
|
|
20
|
+
"contact-group-create-div-icon": "styles__contact-group-create-div-icon___aUC-_"
|
|
21
|
+
};
|
|
18
22
|
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
19
23
|
import PlusIcon from "cozy-ui/transpiled/react/Icons/Plus";
|
|
20
24
|
import Input from "cozy-ui/transpiled/react/Input";
|
|
@@ -41,7 +41,7 @@ var Cell = function Cell(_ref) {
|
|
|
41
41
|
|
|
42
42
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
43
43
|
ref: actionsRef,
|
|
44
|
-
"arial-label": t('
|
|
44
|
+
"arial-label": t('menu'),
|
|
45
45
|
onClick: function onClick() {
|
|
46
46
|
return setShowActions(true);
|
|
47
47
|
}
|
|
@@ -28,7 +28,7 @@ var MyselfMarker = function MyselfMarker() {
|
|
|
28
28
|
|
|
29
29
|
return /*#__PURE__*/React.createElement("span", {
|
|
30
30
|
className: "".concat(styles['contact-myself'])
|
|
31
|
-
}, "(", t('
|
|
31
|
+
}, "(", t('me'), ")");
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
var ContactIdentity = function ContactIdentity(_ref) {
|
|
@@ -5,20 +5,17 @@ import React from 'react';
|
|
|
5
5
|
import ContactRow from "cozy-ui/transpiled/react/ContactsList/ContactRow";
|
|
6
6
|
import { sortContacts, categorizeContacts, sortHeaders } from "cozy-ui/transpiled/react/ContactsList/helpers";
|
|
7
7
|
import withContactsListLocales from "cozy-ui/transpiled/react/ContactsList/locales/withContactsListLocales";
|
|
8
|
-
import { locales } from "cozy-ui/transpiled/react/ContactsList/locales/withContactsListLocales";
|
|
9
8
|
import List from "cozy-ui/transpiled/react/List";
|
|
10
9
|
import ListSubheader from "cozy-ui/transpiled/react/ListSubheader";
|
|
11
10
|
import { Table } from "cozy-ui/transpiled/react/deprecated/Table";
|
|
12
11
|
import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
|
|
13
|
-
import { useI18n
|
|
12
|
+
import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
|
|
14
13
|
|
|
15
14
|
var ContactsList = function ContactsList(_ref) {
|
|
16
15
|
var contacts = _ref.contacts,
|
|
17
16
|
onItemClick = _ref.onItemClick,
|
|
18
17
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
18
|
|
|
20
|
-
useExtendI18n(locales);
|
|
21
|
-
|
|
22
19
|
var _useI18n = useI18n(),
|
|
23
20
|
t = _useI18n.t;
|
|
24
21
|
|
|
@@ -25,9 +25,9 @@ export var sortContacts = function sortContacts(contacts) {
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
var makeHeader = function makeHeader(contact, t) {
|
|
28
|
-
if (contact.me) return t('
|
|
28
|
+
if (contact.me) return t('me');
|
|
29
29
|
var name = buildLastNameFirst(contact);
|
|
30
|
-
return name[0] || t('
|
|
30
|
+
return name[0] || t('empty');
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Build header for a contact (first letter of indexes.byFamilyNameGivenNameEmailCozyUrl)
|
|
@@ -40,8 +40,8 @@ var makeHeader = function makeHeader(contact, t) {
|
|
|
40
40
|
var makeHeaderForIndexedContacts = function makeHeaderForIndexedContacts(contact, t) {
|
|
41
41
|
var _contact$cozyMetadata;
|
|
42
42
|
|
|
43
|
-
if (contact.me) return t('
|
|
44
|
-
if ((_contact$cozyMetadata = contact.cozyMetadata) !== null && _contact$cozyMetadata !== void 0 && _contact$cozyMetadata.favorite) return t('
|
|
43
|
+
if (contact.me) return t('me');
|
|
44
|
+
if ((_contact$cozyMetadata = contact.cozyMetadata) !== null && _contact$cozyMetadata !== void 0 && _contact$cozyMetadata.favorite) return t('favorite');
|
|
45
45
|
var index = get(contact, 'indexes.byFamilyNameGivenNameEmailCozyUrl', '');
|
|
46
46
|
var hasIndex = index !== null && index.length > 0;
|
|
47
47
|
|
|
@@ -50,7 +50,7 @@ var makeHeaderForIndexedContacts = function makeHeaderForIndexedContacts(contact
|
|
|
50
50
|
return firstLetterWithoutAccent;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
return t('
|
|
53
|
+
return t('empty');
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* @typedef {Object.<string, Object>} CategorizedContactsResult
|
|
@@ -83,7 +83,7 @@ export var categorizeContacts = function categorizeContacts(contacts, t) {
|
|
|
83
83
|
export var sortHeaders = function sortHeaders(categorized, t) {
|
|
84
84
|
var headers = Object.keys(categorized);
|
|
85
85
|
var notEmptyAndMyselfHeaders = headers.filter(function (header) {
|
|
86
|
-
return header !== t('
|
|
86
|
+
return header !== t('empty') && header !== t('me');
|
|
87
87
|
});
|
|
88
88
|
var notEmptyAndMyselfSorted = notEmptyAndMyselfHeaders.slice().sort();
|
|
89
89
|
|
|
@@ -93,12 +93,12 @@ export var sortHeaders = function sortHeaders(categorized, t) {
|
|
|
93
93
|
|
|
94
94
|
var headersSorted = [];
|
|
95
95
|
|
|
96
|
-
if (headers.includes(t('
|
|
97
|
-
headersSorted.push(t('
|
|
96
|
+
if (headers.includes(t('me'))) {
|
|
97
|
+
headersSorted.push(t('me'));
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
if (headers.includes(t('
|
|
101
|
-
headersSorted.push(t('
|
|
100
|
+
if (headers.includes(t('empty'))) {
|
|
101
|
+
headersSorted.push(t('empty'));
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
return headersSorted.concat(notEmptyAndMyselfSorted);
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
var en = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
menu: "Menu"
|
|
7
|
-
}
|
|
2
|
+
empty: "EMPTY",
|
|
3
|
+
me: "me",
|
|
4
|
+
favorite: "favorites",
|
|
5
|
+
menu: "Menu"
|
|
8
6
|
};
|
|
9
7
|
var fr = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
menu: "Menu"
|
|
15
|
-
}
|
|
8
|
+
empty: "VIDE",
|
|
9
|
+
me: "moi",
|
|
10
|
+
favorite: "favoris",
|
|
11
|
+
menu: "Menu"
|
|
16
12
|
};
|
|
17
13
|
import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
|
|
18
14
|
export var locales = {
|