@ossy/distribution 1.9.7 → 1.10.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/package.json +2 -2
- package/src/Definition.js +1 -7
- package/src/distribution.page.jsx +19 -31
- package/src/en.translations.json +11 -0
- package/src/sv.translations.json +11 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/distribution",
|
|
3
3
|
"description": "Analytics module — workspace analytics for website traffic",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.10.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"module": "./src/index.js",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"@ossy/sdk-react": "*",
|
|
28
28
|
"react": "*"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "d9d31182be64a448d575da432af2830d909ad4b9"
|
|
31
31
|
}
|
package/src/Definition.js
CHANGED
|
@@ -2,12 +2,6 @@ export const Definition = {
|
|
|
2
2
|
id: 'distribution',
|
|
3
3
|
title: 'Distribution',
|
|
4
4
|
description: 'Distribution channels and external publishing integrations.',
|
|
5
|
-
|
|
6
|
-
id: 'distribution',
|
|
7
|
-
enabled: true
|
|
8
|
-
},
|
|
5
|
+
icon: 'share',
|
|
9
6
|
statuses: ['beta'],
|
|
10
|
-
actions: ['distribution.publish', 'distribution.unpublish'],
|
|
11
|
-
views: ['home.page', 'distribution.integrations'],
|
|
12
|
-
tasks: ['distribution.sync']
|
|
13
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import { useRouter } from '@ossy/router-react'
|
|
3
|
-
import { Title, Text, View, Tags, Button, Switch } from '@ossy/design-system'
|
|
3
|
+
import { Title, Text, View, Tags, Button, Switch, useLocale } from '@ossy/design-system'
|
|
4
4
|
import { AsyncStatus } from '@ossy/sdk-react'
|
|
5
5
|
import { Definition } from '@ossy/distribution'
|
|
6
6
|
import { moduleStatusTags } from './moduleStatus.js'
|
|
@@ -13,31 +13,19 @@ export const metadata = {
|
|
|
13
13
|
},
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
{
|
|
18
|
-
name: 'Pinterest',
|
|
19
|
-
description: 'Share your images on Pinterest',
|
|
20
|
-
icon: 'details-more',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'X',
|
|
24
|
-
description: 'Share your images on X',
|
|
25
|
-
icon: 'screen-shot',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'LinkedIn',
|
|
29
|
-
description: 'Share your images on LinkedIn',
|
|
30
|
-
icon: 'arrows-expand-up-right',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'Gmail',
|
|
34
|
-
description: 'Send and read emails',
|
|
35
|
-
icon: 'arrows-expand-up-right',
|
|
36
|
-
}
|
|
37
|
-
]
|
|
16
|
+
const integrationKeys = ['pinterest', 'x', 'linkedin', 'gmail']
|
|
38
17
|
|
|
39
18
|
export const DistributionPage = () => {
|
|
40
19
|
const router = useRouter()
|
|
20
|
+
const { t } = useLocale()
|
|
21
|
+
|
|
22
|
+
const integrations = integrationKeys.map((key) => ({
|
|
23
|
+
key,
|
|
24
|
+
name: key === 'x' ? 'X' : key.charAt(0).toUpperCase() + key.slice(1),
|
|
25
|
+
description: t(`distribution.home.integration.${key}.description`),
|
|
26
|
+
icon: key === 'pinterest' ? 'details-more' : key === 'x' ? 'screen-shot' : 'arrows-expand-up-right',
|
|
27
|
+
}))
|
|
28
|
+
|
|
41
29
|
return (
|
|
42
30
|
<View gap="m" surface="primary" style={{ padding: 'var(--space-m) var(--space-l)', height: '100%', overflowY: 'auto' }}>
|
|
43
31
|
|
|
@@ -45,39 +33,39 @@ export const DistributionPage = () => {
|
|
|
45
33
|
|
|
46
34
|
<View layout="row" justifyContent="space-between" alignItems="center">
|
|
47
35
|
<View layout='row' gap="s" alignItems="center">
|
|
48
|
-
<Title>{
|
|
36
|
+
<Title>{t('distribution.home.title')}</Title>
|
|
49
37
|
{moduleStatusTags(Definition).length > 0 && (
|
|
50
38
|
<Tags tags={moduleStatusTags(Definition)} size="s" />
|
|
51
39
|
)}
|
|
52
40
|
</View>
|
|
53
41
|
<Button variant="cta" disabled={true} prefix="add">
|
|
54
|
-
|
|
42
|
+
{t('distribution.home.addIntegration')}
|
|
55
43
|
</Button>
|
|
56
44
|
</View>
|
|
57
45
|
|
|
58
46
|
<Text style={{ maxWidth: '400px' }}>
|
|
59
|
-
{
|
|
47
|
+
{t('distribution.home.description')}
|
|
60
48
|
</Text>
|
|
61
49
|
|
|
62
50
|
</View>
|
|
63
51
|
|
|
64
52
|
<View gap="m" inset="s">
|
|
65
|
-
<Title variant="secondary">
|
|
53
|
+
<Title variant="secondary">{t('distribution.home.integrations')}</Title>
|
|
66
54
|
<Switch on={AsyncStatus.Success}>
|
|
67
55
|
|
|
68
56
|
<Switch.Case match={[AsyncStatus.NotInitialized, AsyncStatus.Loading]}>
|
|
69
|
-
<Text>
|
|
57
|
+
<Text>{t('design-system.loading')}</Text>
|
|
70
58
|
</Switch.Case>
|
|
71
59
|
|
|
72
60
|
<Switch.Case match={[AsyncStatus.Error, AsyncStatus.AuthenticationError]}>
|
|
73
|
-
<Text>
|
|
61
|
+
<Text>{t('design-system.errorLoadingProfile')}</Text>
|
|
74
62
|
</Switch.Case>
|
|
75
63
|
|
|
76
64
|
<Switch.Case match={[AsyncStatus.Success]}>
|
|
77
65
|
<View gap="m" layout="row-wrap">
|
|
78
66
|
{integrations.map(service => (
|
|
79
67
|
<View
|
|
80
|
-
key={service.
|
|
68
|
+
key={service.key}
|
|
81
69
|
roundness="m"
|
|
82
70
|
surface="primary"
|
|
83
71
|
selectable
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"distribution.home.documentTitle": "Distribution",
|
|
3
|
+
"distribution.home.title": "Distribution",
|
|
4
|
+
"distribution.home.description": "Distribution channels and external publishing integrations.",
|
|
5
|
+
"distribution.home.addIntegration": "Add integration",
|
|
6
|
+
"distribution.home.integrations": "Integrations",
|
|
7
|
+
"distribution.home.integration.pinterest.description": "Share your images on Pinterest",
|
|
8
|
+
"distribution.home.integration.x.description": "Share your images on X",
|
|
9
|
+
"distribution.home.integration.linkedin.description": "Share your images on LinkedIn",
|
|
10
|
+
"distribution.home.integration.gmail.description": "Send and read emails"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"distribution.home.documentTitle": "Distribution",
|
|
3
|
+
"distribution.home.title": "Distribution",
|
|
4
|
+
"distribution.home.description": "Distributionskanaler och externa publiceringsintegrationer.",
|
|
5
|
+
"distribution.home.addIntegration": "Lägg till integration",
|
|
6
|
+
"distribution.home.integrations": "Integrationer",
|
|
7
|
+
"distribution.home.integration.pinterest.description": "Dela dina bilder på Pinterest",
|
|
8
|
+
"distribution.home.integration.x.description": "Dela dina bilder på X",
|
|
9
|
+
"distribution.home.integration.linkedin.description": "Dela dina bilder på LinkedIn",
|
|
10
|
+
"distribution.home.integration.gmail.description": "Skicka och läs e-post"
|
|
11
|
+
}
|