cozy-ui-plus 3.1.2 → 4.0.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 +10 -0
- package/dist/AppSections/Sections.js +5 -7
- package/dist/AppSections/components/AppsSection.js +2 -2
- package/dist/AppTile/index.js +3 -3
- package/dist/Contacts/AddModal/ContactAddressDialog/index.js +4 -4
- package/dist/Contacts/AddModal/ContactForm/FieldInput.js +3 -3
- package/dist/Contacts/AddModal/ContactForm/FieldInputAccordion.js +4 -4
- package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +4 -4
- package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +4 -4
- package/dist/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.js +3 -3
- package/dist/Contacts/AddModal/ContactForm/TextFieldSelect.js +4 -4
- package/dist/Contacts/AddModal/ContactForm/index.js +4 -4
- package/dist/Contacts/AddModal/CustomLabelDialog/index.js +4 -4
- package/dist/Contacts/AddModal/index.js +4 -4
- package/dist/Contacts/GroupsSelect/GroupCreation.js +3 -3
- package/dist/Contacts/GroupsSelect/GroupsSelectProvider.js +3 -3
- package/dist/Contacts/GroupsSelect/SelectBox/Control.js +4 -4
- package/dist/Contacts/GroupsSelect/useGroupSelect.js +4 -4
- package/dist/Contacts/Header/GroupsSelection.js +4 -4
- package/dist/Contacts/Header/ImportDropdown.js +4 -4
- package/dist/Contacts/Header/index.js +4 -4
- package/dist/ContactsList/Contacts/ContactIdentity.js +4 -4
- package/dist/ContactsList/ContactsList.js +3 -3
- package/dist/ContactsList/locales/withContactsListLocales.js +2 -4
- package/dist/ContactsListModal/ContactsListContent.js +3 -3
- package/dist/ContactsListModal/ContactsListModal.js +3 -3
- package/dist/ContactsListModal/withContactsListLocales.js +2 -4
- package/dist/Dialogs/AuthentificationDialog/index.js +2 -2
- package/dist/Dialogs/AuthentificationDialog/withSpecificDialogsLocales.js +2 -4
- package/dist/FilePicker/FilePickerBodyItem.js +3 -3
- package/dist/FilePicker/FilePickerFooter.js +3 -3
- package/dist/FilePicker/docs/DemoProvider.js +3 -3
- package/dist/ListItem/ExpandedAttributes/ExpandedAttribute.js +3 -3
- package/dist/ListItem/ExpandedAttributes/index.js +3 -3
- package/dist/ListItem/ListItemBase/Renaming/RenameDialog.js +3 -3
- package/dist/ListItem/ListItemFile/ExpirationAnnotation.js +3 -3
- package/dist/ListItem/ListItemFile/SecondaryText.js +3 -3
- package/dist/ListItem/hoc/withListItemLocales.js +2 -4
- package/dist/Paywall/Paywall.js +3 -3
- package/dist/Paywall/locales/withPaywallLocales.js +2 -4
- package/dist/Qualification/QualificationGrid/index.js +3 -3
- package/dist/Qualification/QualificationGrid/locales/withLocales.js +2 -4
- package/dist/Qualification/QualificationModal/index.js +4 -4
- package/dist/Storage/StorageButton.js +4 -4
- package/dist/Storage/StorageProgress.js +4 -4
- package/dist/UploadQueue/Item.js +3 -3
- package/dist/UploadQueue/Pending.js +3 -3
- package/dist/UploadQueue/RemainingTime.js +3 -3
- package/dist/UploadQueue/index.js +4 -6
- package/dist/test/I18n.d.ts +1 -1
- package/package.json +7 -5
- package/src/AppSections/Readme.md +1 -1
- package/src/AppSections/Sections.jsx +1 -2
- package/src/AppSections/components/AppsSection.jsx +1 -1
- package/src/AppSections/helpers.spec.js +1 -1
- package/src/AppTile/AppTile.spec.jsx +1 -2
- package/src/AppTile/Readme.md +1 -1
- package/src/AppTile/index.jsx +1 -1
- package/src/Contacts/AddModal/ContactAddressDialog/index.jsx +1 -1
- package/src/Contacts/AddModal/ContactForm/FieldInput.jsx +1 -2
- package/src/Contacts/AddModal/ContactForm/FieldInputAccordion.jsx +1 -1
- package/src/Contacts/AddModal/ContactForm/FieldInputArray.jsx +1 -1
- package/src/Contacts/AddModal/ContactForm/FieldInputLayout.jsx +1 -1
- package/src/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.jsx +1 -2
- package/src/Contacts/AddModal/ContactForm/TextFieldSelect.jsx +1 -1
- package/src/Contacts/AddModal/ContactForm/index.jsx +1 -1
- package/src/Contacts/AddModal/CustomLabelDialog/index.jsx +1 -1
- package/src/Contacts/AddModal/index.jsx +1 -1
- package/src/Contacts/GroupsSelect/GroupCreation.jsx +1 -1
- package/src/Contacts/GroupsSelect/GroupsSelectProvider.jsx +1 -2
- package/src/Contacts/GroupsSelect/SelectBox/Control.jsx +1 -1
- package/src/Contacts/GroupsSelect/useGroupSelect.jsx +1 -1
- package/src/Contacts/Header/GroupsSelection.jsx +1 -1
- package/src/Contacts/Header/ImportDropdown.jsx +1 -1
- package/src/Contacts/Header/index.jsx +1 -1
- package/src/ContactsList/Contacts/ContactIdentity.jsx +1 -1
- package/src/ContactsList/ContactsList.jsx +1 -1
- package/src/ContactsList/locales/withContactsListLocales.jsx +1 -1
- package/src/ContactsListModal/ContactsListContent.jsx +1 -1
- package/src/ContactsListModal/ContactsListModal.jsx +1 -1
- package/src/ContactsListModal/Readme.md +1 -1
- package/src/ContactsListModal/withContactsListLocales.jsx +1 -1
- package/src/Dialogs/AuthentificationDialog/index.jsx +1 -1
- package/src/Dialogs/AuthentificationDialog/withSpecificDialogsLocales.jsx +1 -1
- package/src/FilePicker/FilePickerBodyItem.jsx +1 -1
- package/src/FilePicker/FilePickerFooter.jsx +1 -1
- package/src/FilePicker/docs/DemoProvider.jsx +1 -1
- package/src/ListItem/ExpandedAttributes/ExpandedAttribute.jsx +1 -1
- package/src/ListItem/ExpandedAttributes/index.jsx +1 -1
- package/src/ListItem/ListItemBase/Renaming/RenameDialog.jsx +1 -1
- package/src/ListItem/ListItemFile/ExpirationAnnotation.jsx +1 -1
- package/src/ListItem/ListItemFile/SecondaryText.jsx +1 -1
- package/src/ListItem/hoc/withListItemLocales.jsx +1 -1
- package/src/Paywall/Paywall.jsx +1 -1
- package/src/Paywall/locales/withPaywallLocales.jsx +1 -1
- package/src/Qualification/QualificationGrid/index.jsx +1 -1
- package/src/Qualification/QualificationGrid/locales/withLocales.jsx +1 -1
- package/src/Qualification/QualificationModal/index.jsx +1 -1
- package/src/Storage/StorageButton.jsx +1 -1
- package/src/Storage/StorageProgress.jsx +1 -1
- package/src/UploadQueue/Item.jsx +1 -1
- package/src/UploadQueue/Pending.jsx +1 -1
- package/src/UploadQueue/RemainingTime.jsx +1 -1
- package/src/UploadQueue/index.jsx +1 -2
- package/src/UploadQueue/index.spec.jsx +48 -34
- package/test/I18n.js +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { useI18n, useExtendI18n } from 'twake-i18n'
|
|
2
3
|
|
|
3
4
|
import { useInstanceInfo } from 'cozy-client'
|
|
4
5
|
import { makeDiskInfos } from 'cozy-client/dist/models/instance'
|
|
@@ -6,7 +7,6 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
|
6
7
|
import CloudIcon from 'cozy-ui/transpiled/react/Icons/Cloud'
|
|
7
8
|
import LinearProgress from 'cozy-ui/transpiled/react/LinearProgress'
|
|
8
9
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
9
|
-
import { useI18n, useExtendI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
10
10
|
|
|
11
11
|
import { locales } from './locales'
|
|
12
12
|
|
package/src/UploadQueue/Item.jsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { translate } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import { splitFilename } from 'cozy-client/dist/models/file'
|
|
5
6
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
@@ -8,7 +9,6 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
8
9
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
9
10
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
10
11
|
import { Img } from 'cozy-ui/transpiled/react/deprecated/Media'
|
|
11
|
-
import { translate } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
12
12
|
|
|
13
13
|
import FileUploadProgress from './FileUploadProgress'
|
|
14
14
|
import Pending from './Pending'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { translate } from 'twake-i18n'
|
|
2
3
|
|
|
3
4
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
4
|
-
import { translate } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
5
5
|
|
|
6
6
|
const Pending = translate()(props => (
|
|
7
7
|
<Typography variant="subtitle1" color="primary">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { useI18n } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
5
|
-
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
6
|
|
|
7
7
|
import { numberOfReferencesForPluralForm } from './helpers'
|
|
8
8
|
import { formatRemainingTime } from './index'
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import React, { Component } from 'react'
|
|
3
|
+
import { formatLocallyDistanceToNow, withLocales } from 'twake-i18n'
|
|
3
4
|
|
|
4
5
|
import LinearProgress from 'cozy-ui/transpiled/react/LinearProgress'
|
|
5
6
|
import List from 'cozy-ui/transpiled/react/List'
|
|
6
7
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
7
8
|
import Button from 'cozy-ui/transpiled/react/deprecated/Button'
|
|
8
|
-
import { formatLocallyDistanceToNow } from 'cozy-ui/transpiled/react/providers/I18n/format'
|
|
9
|
-
import withLocales from 'cozy-ui/transpiled/react/providers/I18n/withLocales'
|
|
10
9
|
import { withStyles } from 'cozy-ui/transpiled/react/styles'
|
|
11
10
|
|
|
12
11
|
import Item from './Item'
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { render } from '@testing-library/react'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import DemoProvider from 'cozy-ui/transpiled/react/providers/DemoProvider'
|
|
5
5
|
|
|
6
6
|
import { UploadQueue, formatRemainingTime } from '.'
|
|
7
|
-
|
|
8
|
-
jest.mock('cozy-ui/transpiled/react/providers/I18n/withLocales', () =>
|
|
9
|
-
jest.fn().mockImplementation(() => x => x)
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
jest.mock('cozy-ui/transpiled/react/providers/I18n', () => ({
|
|
13
|
-
translate: jest.fn().mockImplementation(() => x => x),
|
|
14
|
-
useI18n: jest.fn(),
|
|
15
|
-
DEFAULT_LANG: 'en'
|
|
16
|
-
}))
|
|
7
|
+
import localeEn from './locales/en.json'
|
|
17
8
|
|
|
18
9
|
describe('UploadQueue', () => {
|
|
19
10
|
describe('formatRemainingTime', () => {
|
|
@@ -25,13 +16,6 @@ describe('UploadQueue', () => {
|
|
|
25
16
|
})
|
|
26
17
|
|
|
27
18
|
describe('UploadQueue', () => {
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
useI18n.mockReturnValue({
|
|
30
|
-
t: (key, format) =>
|
|
31
|
-
format ? `${key} ${format.time} ${format.smart_count}` : key
|
|
32
|
-
})
|
|
33
|
-
})
|
|
34
|
-
|
|
35
19
|
it('should set singular value when "1 minute remaining"', () => {
|
|
36
20
|
const item = {
|
|
37
21
|
file: { name: 'file' },
|
|
@@ -41,11 +25,15 @@ describe('UploadQueue', () => {
|
|
|
41
25
|
getMimeTypeIcon: 'getMimeTypeIcon'
|
|
42
26
|
}
|
|
43
27
|
|
|
44
|
-
const { container } = render(
|
|
28
|
+
const { container } = render(
|
|
29
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
30
|
+
<UploadQueue queue={[item]} />
|
|
31
|
+
</DemoProvider>
|
|
32
|
+
)
|
|
45
33
|
|
|
46
34
|
expect(
|
|
47
35
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
48
|
-
).toHaveTextContent('
|
|
36
|
+
).toHaveTextContent('1 minute remaining')
|
|
49
37
|
})
|
|
50
38
|
|
|
51
39
|
it('should set singular value when "moins d 1 minute remaining"', () => {
|
|
@@ -57,11 +45,15 @@ describe('UploadQueue', () => {
|
|
|
57
45
|
getMimeTypeIcon: 'getMimeTypeIcon'
|
|
58
46
|
}
|
|
59
47
|
|
|
60
|
-
const { container } = render(
|
|
48
|
+
const { container } = render(
|
|
49
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
50
|
+
<UploadQueue queue={[item]} />
|
|
51
|
+
</DemoProvider>
|
|
52
|
+
)
|
|
61
53
|
|
|
62
54
|
expect(
|
|
63
55
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
64
|
-
).toHaveTextContent('
|
|
56
|
+
).toHaveTextContent('less than a minute remaining')
|
|
65
57
|
})
|
|
66
58
|
|
|
67
59
|
it('should set plural value when "44 minutes remainings"', () => {
|
|
@@ -73,11 +65,15 @@ describe('UploadQueue', () => {
|
|
|
73
65
|
getMimeTypeIcon: 'getMimeTypeIcon'
|
|
74
66
|
}
|
|
75
67
|
|
|
76
|
-
const { container } = render(
|
|
68
|
+
const { container } = render(
|
|
69
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
70
|
+
<UploadQueue queue={[item]} />
|
|
71
|
+
</DemoProvider>
|
|
72
|
+
)
|
|
77
73
|
|
|
78
74
|
expect(
|
|
79
75
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
80
|
-
).toHaveTextContent('
|
|
76
|
+
).toHaveTextContent('44 minutes remaining')
|
|
81
77
|
})
|
|
82
78
|
|
|
83
79
|
it('should set singular value when "1 hour remaining" - low limit', () => {
|
|
@@ -89,11 +85,15 @@ describe('UploadQueue', () => {
|
|
|
89
85
|
getMimeTypeIcon: 'getMimeTypeIcon'
|
|
90
86
|
}
|
|
91
87
|
|
|
92
|
-
const { container } = render(
|
|
88
|
+
const { container } = render(
|
|
89
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
90
|
+
<UploadQueue queue={[item]} />
|
|
91
|
+
</DemoProvider>
|
|
92
|
+
)
|
|
93
93
|
|
|
94
94
|
expect(
|
|
95
95
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
96
|
-
).toHaveTextContent('
|
|
96
|
+
).toHaveTextContent('about 1 hour remaining')
|
|
97
97
|
})
|
|
98
98
|
|
|
99
99
|
it('should set singular value when "about 1 hour remaining" - high limit', () => {
|
|
@@ -105,11 +105,15 @@ describe('UploadQueue', () => {
|
|
|
105
105
|
getMimeTypeIcon: 'getMimeTypeIcon'
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const { container } = render(
|
|
108
|
+
const { container } = render(
|
|
109
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
110
|
+
<UploadQueue queue={[item]} />
|
|
111
|
+
</DemoProvider>
|
|
112
|
+
)
|
|
109
113
|
|
|
110
114
|
expect(
|
|
111
115
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
112
|
-
).toHaveTextContent('
|
|
116
|
+
).toHaveTextContent('about 1 hour remaining')
|
|
113
117
|
})
|
|
114
118
|
|
|
115
119
|
it('should set plural value when more than "2 hours remainings"', () => {
|
|
@@ -121,11 +125,15 @@ describe('UploadQueue', () => {
|
|
|
121
125
|
getMimeTypeIcon: 'getMimeTypeIcon'
|
|
122
126
|
}
|
|
123
127
|
|
|
124
|
-
const { container } = render(
|
|
128
|
+
const { container } = render(
|
|
129
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
130
|
+
<UploadQueue queue={[item]} />
|
|
131
|
+
</DemoProvider>
|
|
132
|
+
)
|
|
125
133
|
|
|
126
134
|
expect(
|
|
127
135
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
128
|
-
).toHaveTextContent('
|
|
136
|
+
).toHaveTextContent('about 2 hours remaining')
|
|
129
137
|
})
|
|
130
138
|
|
|
131
139
|
it('should not update time and bar everytime loaded/remaining time update', () => {
|
|
@@ -138,22 +146,28 @@ describe('UploadQueue', () => {
|
|
|
138
146
|
})
|
|
139
147
|
|
|
140
148
|
const { rerender, getAllByRole, container } = render(
|
|
141
|
-
<
|
|
149
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
150
|
+
<UploadQueue queue={[item(5371, 1234)]} />
|
|
151
|
+
</DemoProvider>
|
|
142
152
|
)
|
|
143
153
|
|
|
144
154
|
expect(
|
|
145
155
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
146
|
-
).toHaveTextContent('
|
|
156
|
+
).toHaveTextContent('about 2 hours remaining')
|
|
147
157
|
expect(getAllByRole('progressbar')[1]).toHaveAttribute(
|
|
148
158
|
'aria-valuenow',
|
|
149
159
|
'25'
|
|
150
160
|
)
|
|
151
161
|
|
|
152
|
-
rerender(
|
|
162
|
+
rerender(
|
|
163
|
+
<DemoProvider dictRequire={() => localeEn}>
|
|
164
|
+
<UploadQueue queue={[item(1, 5677)]} />
|
|
165
|
+
</DemoProvider>
|
|
166
|
+
)
|
|
153
167
|
|
|
154
168
|
expect(
|
|
155
169
|
container.getElementsByClassName('u-flex-shrink')[0]
|
|
156
|
-
).toHaveTextContent('
|
|
170
|
+
).toHaveTextContent('about 2 hours remaining')
|
|
157
171
|
expect(getAllByRole('progressbar')[1]).toHaveAttribute(
|
|
158
172
|
'aria-valuenow',
|
|
159
173
|
'25'
|