@ossy/storage 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/storage",
3
3
  "description": "Analytics module — workspace analytics for website traffic",
4
- "version": "1.9.7",
4
+ "version": "1.10.0",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "module": "./src/index.js",
@@ -30,5 +30,5 @@
30
30
  "ramda": "*",
31
31
  "react": "*"
32
32
  },
33
- "gitHead": "f65df0cd6da864c314c4f424112e05e8e2dec0ff"
33
+ "gitHead": "d9d31182be64a448d575da432af2830d909ad4b9"
34
34
  }
package/src/Definition.js CHANGED
@@ -2,12 +2,6 @@ export const Definition = {
2
2
  id: 'storage',
3
3
  title: 'Storage',
4
4
  description: 'Storage views and resource browsing inside workspaces.',
5
- module: {
6
- id: 'storage',
7
- enabled: true
8
- },
5
+ icon: 'software-upload',
9
6
  statuses: ['beta'],
10
- actions: ['resources.create-directory', 'resources.move', 'resources.rename', 'resources.remove'],
11
- views: ['home.page', 'resources.list', 'resources.search', 'resources.get'],
12
- tasks: ['resources.upload-named-version']
13
7
  }
@@ -22,6 +22,7 @@ import {
22
22
  Title,
23
23
  Tags,
24
24
  EmptyState,
25
+ useLocale,
25
26
  } from '@ossy/design-system'
26
27
  import { useActivePath, ResourcePanel, ResourceList, ResourceDialogMove } from '@ossy/resources'
27
28
  import { useRouter } from '@ossy/router-react'
@@ -48,6 +49,7 @@ const Overlays = {
48
49
 
49
50
  export const ResourcesPage = () => {
50
51
  const router = useRouter()
52
+ const { t } = useLocale()
51
53
  const { workspace } = useWorkspace()
52
54
  const [overlay, setOverlay] = useState(Overlays.None)
53
55
  const [selectedResourceId, setSelectedResourceId] = useState()
@@ -63,7 +65,7 @@ export const ResourcesPage = () => {
63
65
  } = useResources(activePath)
64
66
 
65
67
  const [isCreatingFolder, setIsCreatingFolder] = useState(false)
66
- const [newFolderName, setNewFolderName] = useState('New folder')
68
+ const [newFolderName, setNewFolderName] = useState(() => t('storage.resources.newFolderDefault'))
67
69
 
68
70
  const onCreateFolderSave = (name) => {
69
71
  const folderName = (name || '').trim()
@@ -74,7 +76,7 @@ export const ResourcesPage = () => {
74
76
  createDirectory({ name: folderName, location: activePath })
75
77
  .finally(() => {
76
78
  setIsCreatingFolder(false)
77
- setNewFolderName('New folder')
79
+ setNewFolderName(t('storage.resources.newFolderDefault'))
78
80
  })
79
81
  }
80
82
 
@@ -168,7 +170,7 @@ export const ResourcesPage = () => {
168
170
  event.stopPropagation()
169
171
  onRemoveResource(resource)
170
172
  }}
171
- >Remove
173
+ >{t('storage.resources.contextRemove')}
172
174
  </ContextMenu.Item>
173
175
  ]
174
176
  }
@@ -199,7 +201,7 @@ export const ResourcesPage = () => {
199
201
  }
200
202
  }
201
203
  >
202
- Move
204
+ {t('storage.resources.move')}
203
205
  </ContextMenu.Item>,
204
206
  <ContextMenu.Separator key="separator"></ContextMenu.Separator>,
205
207
  <ContextMenu.Item
@@ -240,9 +242,9 @@ export const ResourcesPage = () => {
240
242
 
241
243
  <View layout="row" inset="m" justifyContent="space-between" alignItems="center" surface="primary" roundness="s" style={{ flexShrink: 0 }}>
242
244
  <View layout='row' gap="s" alignItems="center">
243
- <Title>Storage</Title>
245
+ <Title>{t('storage.resources.title')}</Title>
244
246
 
245
- <Tags size="s" tags={['Beta']} />
247
+ <Tags size="s" tags={[t('storage.resources.beta')]} />
246
248
  </View>
247
249
  </View>
248
250
 
@@ -278,23 +280,23 @@ export const ResourcesPage = () => {
278
280
  { activePath !== '/' && getActivePath() }
279
281
  </Breadcrumbs>
280
282
 
281
- <Dropdown trigger={<Button prefix="add" variant="command" style={{ height: '32px' }}>Add</Button>}>
283
+ <Dropdown trigger={<Button prefix="add" variant="command" style={{ height: '32px' }}>{t('storage.resources.add')}</Button>}>
282
284
  <View inset="xs" surface="primary" roundness="s">
283
285
  <ContextMenu roundness="s" surface="primary">
284
286
  <ContextMenu.Item
285
287
  prefix="folder-add"
286
288
  onClick={() => {
287
289
  setIsCreatingFolder(true)
288
- setNewFolderName('New folder')
290
+ setNewFolderName(t('storage.resources.newFolderDefault'))
289
291
  }}
290
292
  >
291
- Create folder
293
+ {t('storage.resources.createFolder')}
292
294
  </ContextMenu.Item>
293
295
  <ContextMenu.Item
294
296
  prefix="software-upload"
295
297
  href={router.getHref(`@upload-media?location=${activePath}`)}
296
298
  >
297
- Upload file
299
+ {t('storage.resources.uploadFile')}
298
300
  </ContextMenu.Item>
299
301
  </ContextMenu>
300
302
  </View>
@@ -309,8 +311,8 @@ export const ResourcesPage = () => {
309
311
  <View layout="off-center" style={{ height: '100%' }}>
310
312
  <Guide
311
313
  slot="content"
312
- title="Something went wrong"
313
- text="We could not fetch the data to display"
314
+ title={t('storage.resources.errorTitle')}
315
+ text={t('storage.resources.errorText')}
314
316
  style={{ width: '100vw', maxWidth: '350px' }}
315
317
  />
316
318
  </View>
@@ -352,7 +354,7 @@ export const ResourcesPage = () => {
352
354
  <Switch.Case match={[ResourcesListStatus.Empty]}>
353
355
  {isCreatingFolder
354
356
  ? <ResourceList resources={[]} inlineFolder={inlineFolder} />
355
- : <EmptyState message="Empty directory" />
357
+ : <EmptyState message={t('storage.resources.emptyDirectory')} />
356
358
  }
357
359
  </Switch.Case>
358
360
 
@@ -379,11 +381,11 @@ export const ResourcesPage = () => {
379
381
  <View surface="primary" roundness="s">
380
382
  <View surface="primary" inset="l" roundness="s">
381
383
  <Guide
382
- title="Remove directory"
383
- text="Are you sure you want to remove this directory and everything in it?"
384
+ title={t('storage.resources.removeDirectoryTitle')}
385
+ text={t('storage.resources.removeDirectoryText')}
384
386
  actions={[
385
- { label: 'Cancel', variant: "command", onClick: () => setOverlay(Overlays.None) },
386
- { label: 'Remove', variant: 'command-danger', onClick: () => {
387
+ { label: t('storage.resources.cancel'), variant: "command", onClick: () => setOverlay(Overlays.None) },
388
+ { label: t('storage.resources.remove'), variant: 'command-danger', onClick: () => {
387
389
  removeResource(selectedResourceId)
388
390
  setOverlay(Overlays.None)
389
391
  }}
@@ -0,0 +1,20 @@
1
+ {
2
+ "storage.home.documentTitle": "Storage – Ossy",
3
+ "storage.home.cover.title": "Storage",
4
+ "storage.home.cover.text": "Managing content should be easy",
5
+ "storage.resources.title": "Storage",
6
+ "storage.resources.beta": "Beta",
7
+ "storage.resources.add": "Add",
8
+ "storage.resources.createFolder": "Create folder",
9
+ "storage.resources.uploadFile": "Upload file",
10
+ "storage.resources.newFolderDefault": "New folder",
11
+ "storage.resources.errorTitle": "Something went wrong",
12
+ "storage.resources.errorText": "We could not fetch the data to display",
13
+ "storage.resources.emptyDirectory": "Empty directory",
14
+ "storage.resources.removeDirectoryTitle": "Remove directory",
15
+ "storage.resources.removeDirectoryText": "Are you sure you want to remove this directory and everything in it?",
16
+ "storage.resources.cancel": "Cancel",
17
+ "storage.resources.remove": "Remove",
18
+ "storage.resources.move": "Move",
19
+ "storage.resources.contextRemove": "Remove"
20
+ }
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
+ import { useLocale } from '@ossy/design-system'
2
3
  import { ResourcesPage } from './ResourcesPage.jsx'
3
4
  import { useApp } from '@ossy/app/shell'
4
- import { cover } from './cover.js'
5
5
  import { features } from './features.js'
6
6
  import SalesSection from './SalesSection.jsx'
7
7
 
@@ -13,7 +13,17 @@ export const metadata = {
13
13
  },
14
14
  }
15
15
 
16
- export default () => {
17
- const app = useApp()
18
- return app?.isAuthenticated ? <ResourcesPage /> : <SalesSection cover={cover} features={features} />
16
+ function StorageSalesSection () {
17
+ const { t } = useLocale()
18
+ const cover = {
19
+ title: t('storage.home.cover.title'),
20
+ titleVariant: 'primary',
21
+ text: t('storage.home.cover.text'),
22
+ }
23
+ return <SalesSection cover={cover} features={features} />
24
+ }
25
+
26
+ export default function StorageHomePage () {
27
+ const app = useApp()
28
+ return app?.isAuthenticated ? <ResourcesPage /> : <StorageSalesSection />
19
29
  }
@@ -0,0 +1,20 @@
1
+ {
2
+ "storage.home.documentTitle": "Storage",
3
+ "storage.home.cover.title": "Storage",
4
+ "storage.home.cover.text": "Det ska vara enkelt att hantera innehåll",
5
+ "storage.resources.title": "Storage",
6
+ "storage.resources.beta": "Beta",
7
+ "storage.resources.add": "Lägg till",
8
+ "storage.resources.createFolder": "Skapa mapp",
9
+ "storage.resources.uploadFile": "Ladda upp fil",
10
+ "storage.resources.newFolderDefault": "Ny mapp",
11
+ "storage.resources.errorTitle": "Något gick fel",
12
+ "storage.resources.errorText": "Vi kunde inte hämta data att visa",
13
+ "storage.resources.emptyDirectory": "Tom katalog",
14
+ "storage.resources.removeDirectoryTitle": "Ta bort mapp",
15
+ "storage.resources.removeDirectoryText": "Är du säker på att du vill ta bort den här mappen och allt innehåll?",
16
+ "storage.resources.cancel": "Avbryt",
17
+ "storage.resources.remove": "Ta bort",
18
+ "storage.resources.move": "Flytta",
19
+ "storage.resources.contextRemove": "Ta bort"
20
+ }