cozy-sharing 29.0.0 → 30.0.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/CHANGELOG.md +16 -0
- package/dist/components/ShareByEmail.spec.js +6 -6
- package/dist/components/SharingBanner/components/PublicBanner.js +28 -22
- package/dist/components/SharingBanner/components/PublicBanner.spec.js +3 -2
- package/dist/styles/publicBanner.styl +4 -4
- package/dist/stylesheet.css +7 -28
- package/locales/en.json +3 -3
- package/locales/fr.json +3 -3
- package/locales/ru.json +3 -3
- package/locales/vi.json +3 -3
- package/package.json +5 -5
- package/src/components/ShareByEmail.spec.jsx +20 -32
- package/src/components/SharingBanner/components/PublicBanner.jsx +50 -42
- package/src/components/SharingBanner/components/PublicBanner.spec.jsx +9 -6
- package/src/styles/publicBanner.styl +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [30.0.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@30.0.0...cozy-sharing@30.0.1) (2026-03-25)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- Small locales adjustments ([c743965](https://github.com/cozy/cozy-libs/commit/c7439654ddc291e452168f6635e82cf28c388d7c))
|
|
11
|
+
|
|
12
|
+
# [30.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@29.0.0...cozy-sharing@30.0.0) (2026-03-24)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- Upgrade cozy-ui and cozy-ui-plus in cozy-search and cozy-sharing ([f5fd252](https://github.com/cozy/cozy-libs/commit/f5fd2520150e276c8b55feeb1b994ba33d0a114b))
|
|
17
|
+
|
|
18
|
+
### BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
- You must have `cozy-ui >= 138.1.0 and cozy-ui-plus >= 6.0.0`
|
|
21
|
+
|
|
6
22
|
# [29.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@28.11.3...cozy-sharing@29.0.0) (2026-03-24)
|
|
7
23
|
|
|
8
24
|
### Features
|
|
@@ -76,14 +76,14 @@ describe('ShareByEmailComponent', function () {
|
|
|
76
76
|
sharingDesc: sharingDesc
|
|
77
77
|
});
|
|
78
78
|
act(function () {
|
|
79
|
-
fireEvent.change(screen.getByPlaceholderText('Add contacts
|
|
79
|
+
fireEvent.change(screen.getByPlaceholderText('Add contacts'), {
|
|
80
80
|
target: {
|
|
81
81
|
value: 'quentin@cozycloud.cc'
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
act(function () {
|
|
86
|
-
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts
|
|
86
|
+
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts'), {
|
|
87
87
|
key: 'Enter',
|
|
88
88
|
code: 'Enter',
|
|
89
89
|
charCode: 13
|
|
@@ -141,14 +141,14 @@ describe('ShareByEmailComponent', function () {
|
|
|
141
141
|
}]
|
|
142
142
|
});
|
|
143
143
|
act(function () {
|
|
144
|
-
fireEvent.change(screen.getByPlaceholderText('Add contacts
|
|
144
|
+
fireEvent.change(screen.getByPlaceholderText('Add contacts'), {
|
|
145
145
|
target: {
|
|
146
146
|
value: 'john@gmail.com'
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
150
|
act(function () {
|
|
151
|
-
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts
|
|
151
|
+
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts'), {
|
|
152
152
|
key: 'Enter',
|
|
153
153
|
code: 'Enter',
|
|
154
154
|
charCode: 13
|
|
@@ -201,14 +201,14 @@ describe('ShareByEmailComponent', function () {
|
|
|
201
201
|
createContact: createContact
|
|
202
202
|
});
|
|
203
203
|
act(function () {
|
|
204
|
-
fireEvent.change(screen.getByPlaceholderText('Add contacts
|
|
204
|
+
fireEvent.change(screen.getByPlaceholderText('Add contacts'), {
|
|
205
205
|
target: {
|
|
206
206
|
value: 'quentin@cozycloud.cc'
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
});
|
|
210
210
|
act(function () {
|
|
211
|
-
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts
|
|
211
|
+
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts'), {
|
|
212
212
|
key: 'Enter',
|
|
213
213
|
code: 'Enter',
|
|
214
214
|
charCode: 13
|
|
@@ -4,8 +4,10 @@ import React from 'react';
|
|
|
4
4
|
import snarkdown from 'snarkdown';
|
|
5
5
|
import { useClient } from 'cozy-client';
|
|
6
6
|
import flag from 'cozy-flags';
|
|
7
|
-
import
|
|
7
|
+
import Alert from 'cozy-ui/transpiled/react/Alert';
|
|
8
|
+
import Avatar from 'cozy-ui/transpiled/react/Avatar';
|
|
8
9
|
import Button from 'cozy-ui/transpiled/react/Buttons';
|
|
10
|
+
import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints';
|
|
9
11
|
import { useI18n } from 'twake-i18n';
|
|
10
12
|
import CozyHomeLinkIcon from './CozyHomeLinkIcon';
|
|
11
13
|
var styles = {
|
|
@@ -36,7 +38,7 @@ var PublicBannerCozyToCozyContent = function PublicBannerCozyToCozyContent(_ref)
|
|
|
36
38
|
userBoldName = _beginning$1$split$1$2[0],
|
|
37
39
|
ending = _beginning$1$split$1$2[1];
|
|
38
40
|
|
|
39
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
+
return /*#__PURE__*/React.createElement(Avatar, {
|
|
40
42
|
className: styles['bannermarkdown']
|
|
41
43
|
}, beginning[0], /*#__PURE__*/React.createElement("img", {
|
|
42
44
|
src: avatarURL,
|
|
@@ -61,6 +63,9 @@ var SharingBannerCozyToCozy = function SharingBannerCozyToCozy(_ref2) {
|
|
|
61
63
|
var _useI18n2 = useI18n(),
|
|
62
64
|
t = _useI18n2.t;
|
|
63
65
|
|
|
66
|
+
var _useBreakpoints = useBreakpoints(),
|
|
67
|
+
isMobile = _useBreakpoints.isMobile;
|
|
68
|
+
|
|
64
69
|
var action = function action() {
|
|
65
70
|
return openExternalLink(addSharingLink);
|
|
66
71
|
};
|
|
@@ -78,24 +83,23 @@ var SharingBannerCozyToCozy = function SharingBannerCozyToCozy(_ref2) {
|
|
|
78
83
|
icon: 'to-the-cloud',
|
|
79
84
|
action: action
|
|
80
85
|
};
|
|
81
|
-
return /*#__PURE__*/React.createElement(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
buttonOne: /*#__PURE__*/React.createElement(Button, {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Alert, {
|
|
87
|
+
color: "var(--defaultBackgroundColor)",
|
|
88
|
+
square: true,
|
|
89
|
+
block: isMobile,
|
|
90
|
+
action: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
87
91
|
variant: "text",
|
|
88
92
|
label: buttonOne.label,
|
|
89
93
|
icon: buttonOne.icon,
|
|
90
94
|
onClick: buttonOne.action
|
|
91
|
-
}),
|
|
92
|
-
buttonTwo: /*#__PURE__*/React.createElement(Button, {
|
|
95
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
93
96
|
variant: "text",
|
|
94
97
|
label: t('Share.banner.close'),
|
|
95
98
|
onClick: onClose
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
}))
|
|
100
|
+
}, /*#__PURE__*/React.createElement(PublicBannerCozyToCozyContent, {
|
|
101
|
+
sharing: sharing
|
|
102
|
+
}));
|
|
99
103
|
};
|
|
100
104
|
|
|
101
105
|
var SharingBannerByLinkText = function SharingBannerByLinkText() {
|
|
@@ -122,6 +126,9 @@ var SharingBannerByLink = function SharingBannerByLink(_ref3) {
|
|
|
122
126
|
var _useI18n4 = useI18n(),
|
|
123
127
|
t = _useI18n4.t;
|
|
124
128
|
|
|
129
|
+
var _useBreakpoints2 = useBreakpoints(),
|
|
130
|
+
isMobile = _useBreakpoints2.isMobile;
|
|
131
|
+
|
|
125
132
|
var HOME_LINK_HREF = flag('signup.url');
|
|
126
133
|
var canNotCreateTwakeFromPublicSharingLink = flag('drive.twake-creation-from-public-sharing.disabled');
|
|
127
134
|
|
|
@@ -129,10 +136,11 @@ var SharingBannerByLink = function SharingBannerByLink(_ref3) {
|
|
|
129
136
|
return null;
|
|
130
137
|
}
|
|
131
138
|
|
|
132
|
-
return /*#__PURE__*/React.createElement(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
139
|
+
return /*#__PURE__*/React.createElement(Alert, {
|
|
140
|
+
color: "var(--defaultBackgroundColor)",
|
|
141
|
+
square: true,
|
|
142
|
+
block: isMobile,
|
|
143
|
+
action: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
136
144
|
component: "a",
|
|
137
145
|
variant: "text",
|
|
138
146
|
label: t('Share.create-cozy', {
|
|
@@ -140,14 +148,12 @@ var SharingBannerByLink = function SharingBannerByLink(_ref3) {
|
|
|
140
148
|
}),
|
|
141
149
|
icon: CozyHomeLinkIcon,
|
|
142
150
|
href: HOME_LINK_HREF
|
|
143
|
-
}),
|
|
144
|
-
buttonTwo: /*#__PURE__*/React.createElement(Button, {
|
|
151
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
145
152
|
variant: "text",
|
|
146
153
|
label: t('Share.banner.close'),
|
|
147
154
|
onClick: onClose
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
});
|
|
155
|
+
}))
|
|
156
|
+
}, /*#__PURE__*/React.createElement(SharingBannerByLinkText, null));
|
|
151
157
|
};
|
|
152
158
|
|
|
153
159
|
SharingBannerCozyToCozy.propTypes = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { render } from '@testing-library/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useClient } from 'cozy-client';
|
|
4
|
+
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints';
|
|
4
5
|
import { useI18n } from 'twake-i18n';
|
|
5
6
|
import { SharingBannerCozyToCozy } from './PublicBanner';
|
|
6
7
|
jest.mock('twake-i18n');
|
|
@@ -33,12 +34,12 @@ describe('PublicBanner', function () {
|
|
|
33
34
|
}
|
|
34
35
|
}; // When
|
|
35
36
|
|
|
36
|
-
var _render = render( /*#__PURE__*/React.createElement(SharingBannerCozyToCozy, {
|
|
37
|
+
var _render = render( /*#__PURE__*/React.createElement(BreakpointsProvider, null, /*#__PURE__*/React.createElement(SharingBannerCozyToCozy, {
|
|
37
38
|
sharing: sharing,
|
|
38
39
|
isSharingShortcutCreated: true,
|
|
39
40
|
addSharingLink: "discoveryLink",
|
|
40
41
|
onClose: function onClose() {}
|
|
41
|
-
})),
|
|
42
|
+
}))),
|
|
42
43
|
container = _render.container; // Then
|
|
43
44
|
|
|
44
45
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
@require 'components/avatar'
|
|
2
|
-
@require 'components/circle'
|
|
3
1
|
.bannermarkdown
|
|
4
2
|
display inline-block
|
|
3
|
+
background-color var(--paleGrey)
|
|
4
|
+
color var(--silver)
|
|
5
|
+
position relative
|
|
6
|
+
|
|
5
7
|
img
|
|
6
|
-
@extend $avatar
|
|
7
|
-
@extend $circle
|
|
8
8
|
width rem(16)
|
|
9
9
|
height rem(16)
|
|
10
10
|
min-width rem(16)
|
package/dist/stylesheet.css
CHANGED
|
@@ -518,39 +518,18 @@ input[type=text] {
|
|
|
518
518
|
}
|
|
519
519
|
/* imported from publicBanner.styl */
|
|
520
520
|
|
|
521
|
-
.publicBanner__bannermarkdown___1dR1E
|
|
521
|
+
.publicBanner__bannermarkdown___1dR1E {
|
|
522
|
+
display: inline-block;
|
|
522
523
|
background-color: var(--paleGrey);
|
|
523
524
|
color: var(--silver);
|
|
524
525
|
position: relative;
|
|
525
526
|
}
|
|
526
|
-
.publicBanner__bannermarkdown___1dR1E img svg {
|
|
527
|
-
width: 50%;
|
|
528
|
-
height: 50%;
|
|
529
|
-
}
|
|
530
|
-
.publicBanner__bannermarkdown___1dR1E img {
|
|
531
|
-
--circleSize: 2.5rem;
|
|
532
|
-
width: var(--circleSize);
|
|
533
|
-
height: var(--circleSize);
|
|
534
|
-
min-width: var(--circleSize);
|
|
535
|
-
min-height: var(--circleSize);
|
|
536
|
-
font-size: calc(var(--circleSize) / 2.28);
|
|
537
|
-
display: inline-flex;
|
|
538
|
-
align-items: center;
|
|
539
|
-
justify-content: center;
|
|
540
|
-
border-radius: 50%;
|
|
541
|
-
overflow: hidden;
|
|
542
|
-
background-color: var(--dodgerBlue);
|
|
543
|
-
color: var(--white);
|
|
544
|
-
}
|
|
545
|
-
.publicBanner__bannermarkdown___1dR1E {
|
|
546
|
-
display: inline-block;
|
|
547
|
-
}
|
|
548
527
|
.publicBanner__bannermarkdown___1dR1E img {
|
|
549
|
-
width:
|
|
550
|
-
height:
|
|
551
|
-
min-width:
|
|
552
|
-
min-height:
|
|
553
|
-
font-size:
|
|
528
|
+
width: rem(16);
|
|
529
|
+
height: rem(16);
|
|
530
|
+
min-width: rem(16);
|
|
531
|
+
min-height: rem(16);
|
|
532
|
+
font-size: rem(7);
|
|
554
533
|
vertical-align: text-bottom;
|
|
555
534
|
}
|
|
556
535
|
/* imported from tooltip.styl */
|
package/locales/en.json
CHANGED
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
},
|
|
130
130
|
"shareByEmail": {
|
|
131
131
|
"subtitle": "By email",
|
|
132
|
-
"emailPlaceholder": "Add contacts
|
|
132
|
+
"emailPlaceholder": "Add contacts",
|
|
133
133
|
"send": "Send",
|
|
134
134
|
"singleContactSuccess": "You sent an invite to %{email}.",
|
|
135
135
|
"contactSuccess": "You sent an invite to %{smart_count} contact. |||| You sent an invite to %{smart_count} contacts.",
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
"shareTitle": "Share \"%{name}\"",
|
|
470
470
|
"successNotification": "Folder has been shared",
|
|
471
471
|
"errorNotification": "Error while sharing folder",
|
|
472
|
-
"addPeople": "Add people to the shared folder
|
|
472
|
+
"addPeople": "Add people to the shared folder",
|
|
473
473
|
"add": "Add"
|
|
474
474
|
},
|
|
475
475
|
"SharedDrive": {
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
"cancel": "Cancel",
|
|
481
481
|
"create": "Create",
|
|
482
482
|
"save": "Save",
|
|
483
|
-
"addPeople": "Add people to the shared drive
|
|
483
|
+
"addPeople": "Add people to the shared drive",
|
|
484
484
|
"successNotification": "Shared drive has been added",
|
|
485
485
|
"errorNotification": "Error during shared drive creation",
|
|
486
486
|
"successNotificationUpdate": "Your shared drive has been modified",
|
package/locales/fr.json
CHANGED
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
},
|
|
127
127
|
"shareByEmail": {
|
|
128
128
|
"subtitle": "Par email",
|
|
129
|
-
"emailPlaceholder": "Ajouter des contacts
|
|
129
|
+
"emailPlaceholder": "Ajouter des contacts",
|
|
130
130
|
"send": "Envoyer",
|
|
131
131
|
"singleContactSuccess": "Vous avez envoyé une invitation à %{email}.",
|
|
132
132
|
"contactSuccess": "Vous avez invité %{smart_count} contact. |||| Vous avez invité %{smart_count} contacts.",
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
"shareTitle": "Partager \"%{name}\"",
|
|
468
468
|
"successNotification": "Le dossier a été partagé",
|
|
469
469
|
"errorNotification": "Erreur lors du partage du dossier",
|
|
470
|
-
"addPeople": "Ajouter des utilisateurs au dossier partagé
|
|
470
|
+
"addPeople": "Ajouter des utilisateurs au dossier partagé",
|
|
471
471
|
"add": "Ajouter"
|
|
472
472
|
},
|
|
473
473
|
"SharedDrive": {
|
|
@@ -478,7 +478,7 @@
|
|
|
478
478
|
"cancel": "Annuler",
|
|
479
479
|
"create": "Créer",
|
|
480
480
|
"save": "Enregistrer",
|
|
481
|
-
"addPeople": "Ajouter des utilisateurs au drive partagé
|
|
481
|
+
"addPeople": "Ajouter des utilisateurs au drive partagé",
|
|
482
482
|
"successNotification": "Le drive partagé a été ajouté",
|
|
483
483
|
"errorNotification": "Erreur lors de la création du drive partagé",
|
|
484
484
|
"successNotificationUpdate": "Votre drive partagé a été modifié",
|
package/locales/ru.json
CHANGED
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
},
|
|
130
130
|
"shareByEmail": {
|
|
131
131
|
"subtitle": "По электронной почте",
|
|
132
|
-
"emailPlaceholder": "Добавить контакты
|
|
132
|
+
"emailPlaceholder": "Добавить контакты",
|
|
133
133
|
"send": "Отправить",
|
|
134
134
|
"singleContactSuccess": "Вы отправили приглашение на %{email}.",
|
|
135
135
|
"contactSuccess": "Вы отправили приглашение %{smart_count} контакту. |||| Вы отправили приглашение %{smart_count} контактам.",
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
"shareTitle": "Поделиться \"%{name}\"",
|
|
470
470
|
"successNotification": "Папка была расшарена",
|
|
471
471
|
"errorNotification": "Ошибка при расшаривании папки",
|
|
472
|
-
"addPeople": "Добавить людей в общую
|
|
472
|
+
"addPeople": "Добавить людей в общую папку",
|
|
473
473
|
"add": "Добавить"
|
|
474
474
|
},
|
|
475
475
|
"SharedDrive": {
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
"cancel": "Отмена",
|
|
481
481
|
"create": "Создать",
|
|
482
482
|
"save": "Сохранить",
|
|
483
|
-
"addPeople": "Добавить людей в общий
|
|
483
|
+
"addPeople": "Добавить людей в общий диск",
|
|
484
484
|
"successNotification": "Общий диск добавлен",
|
|
485
485
|
"errorNotification": "Ошибка при создании общего диска",
|
|
486
486
|
"successNotificationUpdate": "Ваш общий диск был изменён",
|
package/locales/vi.json
CHANGED
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
},
|
|
130
130
|
"shareByEmail": {
|
|
131
131
|
"subtitle": "Bằng email",
|
|
132
|
-
"emailPlaceholder": "Thêm liên hệ
|
|
132
|
+
"emailPlaceholder": "Thêm liên hệ",
|
|
133
133
|
"send": "Gửi",
|
|
134
134
|
"singleContactSuccess": "Bạn đã gửi lời mời đến %{email}.",
|
|
135
135
|
"contactSuccess": "Bạn đã gửi lời mời đến %{smart_count} liên hệ. |||| Bạn đã gửi lời mời đến %{smart_count} liên hệ.",
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
"shareTitle": "Chia sẻ \"%{name}\"",
|
|
468
468
|
"successNotification": "Thư mục đã được chia sẻ",
|
|
469
469
|
"errorNotification": "Lỗi khi chia sẻ thư mục",
|
|
470
|
-
"addPeople": "Thêm người vào thư mục được chia
|
|
470
|
+
"addPeople": "Thêm người vào thư mục được chia sẻ",
|
|
471
471
|
"add": "Thêm"
|
|
472
472
|
},
|
|
473
473
|
"SharedDrive": {
|
|
@@ -478,7 +478,7 @@
|
|
|
478
478
|
"cancel": "Hủy",
|
|
479
479
|
"create": "Tạo",
|
|
480
480
|
"save": "Lưu",
|
|
481
|
-
"addPeople": "Thêm người vào ổ đĩa được chia
|
|
481
|
+
"addPeople": "Thêm người vào ổ đĩa được chia sẻ",
|
|
482
482
|
"successNotification": "Ổ đĩa được chia sẻ đã được thêm",
|
|
483
483
|
"errorNotification": "Lỗi trong quá trình tạo ổ đĩa được chia sẻ",
|
|
484
484
|
"successNotificationUpdate": "Ổ đĩa được chia sẻ của bạn đã được sửa đổi",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "30.0.1",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"cozy-device-helper": "^3.7.1",
|
|
59
59
|
"cozy-intent": "^2.31.1",
|
|
60
60
|
"cozy-minilog": "^3.10.1",
|
|
61
|
-
"cozy-ui": "^
|
|
61
|
+
"cozy-ui": "^138.1.0",
|
|
62
62
|
"cozy-ui-plus": "^6.0.0",
|
|
63
63
|
"jest": "30.3.0",
|
|
64
64
|
"jest-environment-jsdom": "30.3.0",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"cozy-flags": ">=4.8.1",
|
|
75
75
|
"cozy-intent": ">=2.29.1",
|
|
76
76
|
"cozy-minilog": ">=3.9.1",
|
|
77
|
-
"cozy-ui": ">=
|
|
78
|
-
"cozy-ui-plus": ">=
|
|
77
|
+
"cozy-ui": ">=138.1.0",
|
|
78
|
+
"cozy-ui-plus": ">=6.0.0",
|
|
79
79
|
"prop-types": ">=15.7.2",
|
|
80
80
|
"react": ">=16.12.0",
|
|
81
81
|
"react-router": ">=5.0.1",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"sideEffects": [
|
|
85
85
|
"*.css"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "32c42c7b2beb61697f0d0826b81d354f2de5d272"
|
|
88
88
|
}
|
|
@@ -72,20 +72,17 @@ describe('ShareByEmailComponent', () => {
|
|
|
72
72
|
setup({ sharingDesc })
|
|
73
73
|
|
|
74
74
|
act(() => {
|
|
75
|
-
fireEvent.change(screen.getByPlaceholderText('Add contacts
|
|
75
|
+
fireEvent.change(screen.getByPlaceholderText('Add contacts'), {
|
|
76
76
|
target: { value: 'quentin@cozycloud.cc' }
|
|
77
77
|
})
|
|
78
78
|
})
|
|
79
79
|
|
|
80
80
|
act(() => {
|
|
81
|
-
fireEvent.keyPress(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
charCode: 13
|
|
87
|
-
}
|
|
88
|
-
)
|
|
81
|
+
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts'), {
|
|
82
|
+
key: 'Enter',
|
|
83
|
+
code: 'Enter',
|
|
84
|
+
charCode: 13
|
|
85
|
+
})
|
|
89
86
|
})
|
|
90
87
|
|
|
91
88
|
act(() => {
|
|
@@ -131,20 +128,17 @@ describe('ShareByEmailComponent', () => {
|
|
|
131
128
|
})
|
|
132
129
|
|
|
133
130
|
act(() => {
|
|
134
|
-
fireEvent.change(screen.getByPlaceholderText('Add contacts
|
|
131
|
+
fireEvent.change(screen.getByPlaceholderText('Add contacts'), {
|
|
135
132
|
target: { value: 'john@gmail.com' }
|
|
136
133
|
})
|
|
137
134
|
})
|
|
138
135
|
|
|
139
136
|
act(() => {
|
|
140
|
-
fireEvent.keyPress(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
charCode: 13
|
|
146
|
-
}
|
|
147
|
-
)
|
|
137
|
+
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts'), {
|
|
138
|
+
key: 'Enter',
|
|
139
|
+
code: 'Enter',
|
|
140
|
+
charCode: 13
|
|
141
|
+
})
|
|
148
142
|
})
|
|
149
143
|
|
|
150
144
|
act(() => {
|
|
@@ -180,23 +174,17 @@ describe('ShareByEmailComponent', () => {
|
|
|
180
174
|
setup({ sharingDesc, createContact })
|
|
181
175
|
|
|
182
176
|
act(() => {
|
|
183
|
-
fireEvent.change(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
target: { value: 'quentin@cozycloud.cc' }
|
|
187
|
-
}
|
|
188
|
-
)
|
|
177
|
+
fireEvent.change(screen.getByPlaceholderText('Add contacts'), {
|
|
178
|
+
target: { value: 'quentin@cozycloud.cc' }
|
|
179
|
+
})
|
|
189
180
|
})
|
|
190
181
|
|
|
191
182
|
act(() => {
|
|
192
|
-
fireEvent.keyPress(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
charCode: 13
|
|
198
|
-
}
|
|
199
|
-
)
|
|
183
|
+
fireEvent.keyPress(screen.getByPlaceholderText('Add contacts'), {
|
|
184
|
+
key: 'Enter',
|
|
185
|
+
code: 'Enter',
|
|
186
|
+
charCode: 13
|
|
187
|
+
})
|
|
200
188
|
})
|
|
201
189
|
|
|
202
190
|
await waitFor(() => {
|
|
@@ -4,8 +4,10 @@ import snarkdown from 'snarkdown'
|
|
|
4
4
|
|
|
5
5
|
import { useClient } from 'cozy-client'
|
|
6
6
|
import flag from 'cozy-flags'
|
|
7
|
-
import
|
|
7
|
+
import Alert from 'cozy-ui/transpiled/react/Alert'
|
|
8
|
+
import Avatar from 'cozy-ui/transpiled/react/Avatar'
|
|
8
9
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
10
|
+
import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
9
11
|
import { useI18n } from 'twake-i18n'
|
|
10
12
|
|
|
11
13
|
import CozyHomeLinkIcon from './CozyHomeLinkIcon'
|
|
@@ -32,11 +34,11 @@ const PublicBannerCozyToCozyContent = ({ sharing }) => {
|
|
|
32
34
|
.split('</strong>')
|
|
33
35
|
|
|
34
36
|
return (
|
|
35
|
-
<
|
|
37
|
+
<Avatar className={styles['bannermarkdown']}>
|
|
36
38
|
{beginning[0]}
|
|
37
39
|
<img src={avatarURL} alt="avatar" /> <strong>{userBoldName}</strong>
|
|
38
40
|
{ending}
|
|
39
|
-
</
|
|
41
|
+
</Avatar>
|
|
40
42
|
)
|
|
41
43
|
}
|
|
42
44
|
PublicBannerCozyToCozyContent.propTypes = {
|
|
@@ -52,6 +54,7 @@ const SharingBannerCozyToCozy = ({
|
|
|
52
54
|
onClose
|
|
53
55
|
}) => {
|
|
54
56
|
const { t } = useI18n()
|
|
57
|
+
const { isMobile } = useBreakpoints()
|
|
55
58
|
|
|
56
59
|
const action = () => openExternalLink(addSharingLink)
|
|
57
60
|
const buttonOne = isSharingShortcutCreated
|
|
@@ -66,26 +69,28 @@ const SharingBannerCozyToCozy = ({
|
|
|
66
69
|
action
|
|
67
70
|
}
|
|
68
71
|
return (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
<Alert
|
|
73
|
+
color="var(--defaultBackgroundColor)"
|
|
74
|
+
square
|
|
75
|
+
block={isMobile}
|
|
76
|
+
action={
|
|
77
|
+
<>
|
|
78
|
+
<Button
|
|
79
|
+
variant="text"
|
|
80
|
+
label={buttonOne.label}
|
|
81
|
+
icon={buttonOne.icon}
|
|
82
|
+
onClick={buttonOne.action}
|
|
83
|
+
/>
|
|
84
|
+
<Button
|
|
85
|
+
variant="text"
|
|
86
|
+
label={t('Share.banner.close')}
|
|
87
|
+
onClick={onClose}
|
|
88
|
+
/>
|
|
89
|
+
</>
|
|
86
90
|
}
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
>
|
|
92
|
+
<PublicBannerCozyToCozyContent sharing={sharing} />
|
|
93
|
+
</Alert>
|
|
89
94
|
)
|
|
90
95
|
}
|
|
91
96
|
|
|
@@ -111,6 +116,7 @@ const SharingBannerByLinkText = () => {
|
|
|
111
116
|
|
|
112
117
|
const SharingBannerByLink = ({ onClose }) => {
|
|
113
118
|
const { t } = useI18n()
|
|
119
|
+
const { isMobile } = useBreakpoints()
|
|
114
120
|
|
|
115
121
|
const HOME_LINK_HREF = flag('signup.url')
|
|
116
122
|
const canNotCreateTwakeFromPublicSharingLink = flag(
|
|
@@ -122,27 +128,29 @@ const SharingBannerByLink = ({ onClose }) => {
|
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
return (
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
<Alert
|
|
132
|
+
color="var(--defaultBackgroundColor)"
|
|
133
|
+
square
|
|
134
|
+
block={isMobile}
|
|
135
|
+
action={
|
|
136
|
+
<>
|
|
137
|
+
<Button
|
|
138
|
+
component="a"
|
|
139
|
+
variant="text"
|
|
140
|
+
label={t('Share.create-cozy', { smart_count: 2 })}
|
|
141
|
+
icon={CozyHomeLinkIcon}
|
|
142
|
+
href={HOME_LINK_HREF}
|
|
143
|
+
/>
|
|
144
|
+
<Button
|
|
145
|
+
variant="text"
|
|
146
|
+
label={t('Share.banner.close')}
|
|
147
|
+
onClick={onClose}
|
|
148
|
+
/>
|
|
149
|
+
</>
|
|
136
150
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
label={t('Share.banner.close')}
|
|
141
|
-
onClick={onClose}
|
|
142
|
-
/>
|
|
143
|
-
}
|
|
144
|
-
inline
|
|
145
|
-
/>
|
|
151
|
+
>
|
|
152
|
+
<SharingBannerByLinkText />
|
|
153
|
+
</Alert>
|
|
146
154
|
)
|
|
147
155
|
}
|
|
148
156
|
SharingBannerCozyToCozy.propTypes = {
|
|
@@ -2,6 +2,7 @@ import { render } from '@testing-library/react'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import { useClient } from 'cozy-client'
|
|
5
|
+
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
5
6
|
import { useI18n } from 'twake-i18n'
|
|
6
7
|
|
|
7
8
|
import { SharingBannerCozyToCozy } from './PublicBanner'
|
|
@@ -31,12 +32,14 @@ describe('PublicBanner', () => {
|
|
|
31
32
|
|
|
32
33
|
// When
|
|
33
34
|
const { container } = render(
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
<BreakpointsProvider>
|
|
36
|
+
<SharingBannerCozyToCozy
|
|
37
|
+
sharing={sharing}
|
|
38
|
+
isSharingShortcutCreated={true}
|
|
39
|
+
addSharingLink="discoveryLink"
|
|
40
|
+
onClose={() => {}}
|
|
41
|
+
/>
|
|
42
|
+
</BreakpointsProvider>
|
|
40
43
|
)
|
|
41
44
|
|
|
42
45
|
// Then
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
@require 'components/avatar'
|
|
2
|
-
@require 'components/circle'
|
|
3
1
|
.bannermarkdown
|
|
4
2
|
display inline-block
|
|
3
|
+
background-color var(--paleGrey)
|
|
4
|
+
color var(--silver)
|
|
5
|
+
position relative
|
|
6
|
+
|
|
5
7
|
img
|
|
6
|
-
@extend $avatar
|
|
7
|
-
@extend $circle
|
|
8
8
|
width rem(16)
|
|
9
9
|
height rem(16)
|
|
10
10
|
min-width rem(16)
|