cozy-sharing 33.3.4 → 33.4.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 +17 -0
- package/dist/SharingProvider.js +176 -84
- package/dist/SharingProvider.spec.js +353 -54
- package/dist/components/Avatar/MemberAvatar.js +21 -5
- package/dist/components/Avatar/MemberAvatar.spec.js +77 -0
- package/dist/components/FederatedFolder/FederatedFolderModal.js +70 -7
- package/dist/components/FederatedFolder/FederatedFolderModal.spec.js +234 -85
- package/dist/components/Recipient/OwnerRecipientDefault.js +8 -1
- package/dist/components/Recipient/OwnerRecipientDefaultLite.js +5 -1
- package/package.json +4 -4
- package/src/SharingProvider.jsx +49 -7
- package/src/SharingProvider.spec.jsx +204 -0
- package/src/components/Avatar/MemberAvatar.jsx +19 -4
- package/src/components/Avatar/MemberAvatar.spec.jsx +80 -0
- package/src/components/FederatedFolder/FederatedFolderModal.jsx +44 -3
- package/src/components/FederatedFolder/FederatedFolderModal.spec.jsx +87 -2
- package/src/components/Recipient/OwnerRecipientDefault.jsx +8 -0
- package/src/components/Recipient/OwnerRecipientDefaultLite.jsx +5 -0
|
@@ -5,6 +5,13 @@ import { useClient, useQuery, hasQueryBeenLoaded } from 'cozy-client'
|
|
|
5
5
|
import MemberRecipient from './MemberRecipient'
|
|
6
6
|
import { buildInstanceSettingsQuery } from '../../queries/queries'
|
|
7
7
|
|
|
8
|
+
// When the owner is not part of a sharing's members (eg. the folder only has
|
|
9
|
+
// a link), there is no per-sharing avatar to reference. The instance's public
|
|
10
|
+
// avatar still holds the owner's picture. fallback=initials makes the stack
|
|
11
|
+
// serve a generated initials avatar (instead of the app icon) when no picture
|
|
12
|
+
// has been uploaded, matching how avatars are rendered everywhere else.
|
|
13
|
+
const OWNER_PUBLIC_AVATAR_PATH = '/public/avatar?fallback=initials'
|
|
14
|
+
|
|
8
15
|
const OwnerRecipientDefault = () => {
|
|
9
16
|
const client = useClient()
|
|
10
17
|
|
|
@@ -20,6 +27,7 @@ const OwnerRecipientDefault = () => {
|
|
|
20
27
|
isOwner={true}
|
|
21
28
|
status="owner"
|
|
22
29
|
instance={client.options.uri}
|
|
30
|
+
avatarPath={OWNER_PUBLIC_AVATAR_PATH}
|
|
23
31
|
public_name={instanceSettingsResult?.data?.attributes?.public_name}
|
|
24
32
|
/>
|
|
25
33
|
)
|
|
@@ -6,6 +6,10 @@ import MemberRecipientLite from './MemberRecipientLite'
|
|
|
6
6
|
import withLocales from '../../hoc/withLocales'
|
|
7
7
|
import { buildInstanceSettingsQuery } from '../../queries/queries'
|
|
8
8
|
|
|
9
|
+
// See OwnerRecipientDefault: show the instance public avatar (with an initials
|
|
10
|
+
// fallback) when the owner has no per-sharing avatar to reference.
|
|
11
|
+
const OWNER_PUBLIC_AVATAR_PATH = '/public/avatar?fallback=initials'
|
|
12
|
+
|
|
9
13
|
const OwnerRecipientDefaultLite = () => {
|
|
10
14
|
const client = useClient()
|
|
11
15
|
|
|
@@ -21,6 +25,7 @@ const OwnerRecipientDefaultLite = () => {
|
|
|
21
25
|
recipient={{
|
|
22
26
|
status: 'owner',
|
|
23
27
|
instance: client.options.uri,
|
|
28
|
+
avatarPath: OWNER_PUBLIC_AVATAR_PATH,
|
|
24
29
|
public_name: instanceSettingsResult?.data?.attributes?.public_name
|
|
25
30
|
}}
|
|
26
31
|
isOwner={true}
|