@ossy/storage 3.0.2 → 3.0.4

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": "3.0.2",
4
+ "version": "3.0.4",
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": "f0a8af3c370bbaffe4f7388c14f9345a5c6c56e5"
33
+ "gitHead": "831c9816bee67c5e53d0a4be4f6401975f23d72a"
34
34
  }
@@ -9,7 +9,7 @@ import {
9
9
  identity,
10
10
  last,
11
11
  } from 'ramda'
12
- import { Text, Overlay, Switch, DropZone, Breadcrumbs, Guide, DelayedRender, useDocumentTitle, View, Button, ContextMenu, Dropdown, EmptyState, Page, Tags, useLocale, preloadStorageIcons } from '@ossy/design-system'
12
+ import { Text, Overlay, Switch, DropZone, Breadcrumbs, Guide, DelayedRender, useDocumentTitle, View, Button, ContextMenu, Dropdown, Page, Tags, useLocale, preloadStorageIcons } from '@ossy/design-system'
13
13
  import { useActivePath, ResourcePanel, ResourceList, ResourceDialogMove, useSelectedResourceId } from '@ossy/resources'
14
14
  import { useRouter, useSearchParams } from '@ossy/router-react'
15
15
 
@@ -127,7 +127,7 @@ export const ResourcesPage = () => {
127
127
  const onRemoveResource = resource => {
128
128
  setSelectedResourceId(resource.id)
129
129
 
130
- if (resource.type === 'directory') {
130
+ if (resource.type === '@ossy/platform/schema/directory' || resource.type === 'directory') {
131
131
  setOverlay(Overlays.RemoveDirectory)
132
132
  } else {
133
133
  removeResource(sdk, resource.id, resource.location)
@@ -158,7 +158,7 @@ export const ResourcesPage = () => {
158
158
  .filter(resource => !resource?.name?.startsWith?.('@ossy'))
159
159
  .map(resource => {
160
160
 
161
- if (resource.type === 'directory') {
161
+ if (resource.type === '@ossy/platform/schema/directory' || resource.type === 'directory') {
162
162
  const folderLocation = `${activePath}${resource.name}`
163
163
  return {
164
164
  ...resource,
@@ -232,8 +232,10 @@ export const ResourcesPage = () => {
232
232
 
233
233
  })
234
234
  .sort((a, b) => {
235
- if (a.type === 'directory' && b.type !== 'directory') return -1
236
- if (a.type !== 'directory' && b.type === 'directory') return 1
235
+ const aDir = a.type === '@ossy/platform/schema/directory' || a.type === 'directory'
236
+ const bDir = b.type === '@ossy/platform/schema/directory' || b.type === 'directory'
237
+ if (aDir && !bDir) return -1
238
+ if (!aDir && bDir) return 1
237
239
  }), [displayResources, activePath, storageHomeHref, openLocation, onMoveResource, onRemoveResource, setSelectedResourceId, t])
238
240
 
239
241
  return (
@@ -253,7 +255,6 @@ export const ResourcesPage = () => {
253
255
  </style>
254
256
 
255
257
  <Page
256
- inset="none"
257
258
  title="storage.resources.title"
258
259
  description="storage.resources.description"
259
260
  near={<Tags tags={[t('storage.resources.beta')]} size="s" />}
@@ -361,7 +362,16 @@ export const ResourcesPage = () => {
361
362
  <Switch.Case match={[ResourcesListStatus.Empty]}>
362
363
  {isCreatingFolder
363
364
  ? <ResourceList resources={[]} inlineFolder={inlineFolder} />
364
- : <EmptyState message={t('storage.resources.emptyDirectory')} />
365
+ : (
366
+ <Guide
367
+ data-region="content"
368
+ title={t('storage.resources.emptyTitle')}
369
+ titleVariant="heading-tertiary"
370
+ text={t('storage.resources.emptyText')}
371
+ align="left"
372
+ style={{ maxWidth: '350px', padding: 'var(--space-m)' }}
373
+ />
374
+ )
365
375
  }
366
376
  </Switch.Case>
367
377
 
@@ -11,7 +11,8 @@
11
11
  "storage.resources.newFolderDefault": "New folder",
12
12
  "storage.resources.errorTitle": "Something went wrong",
13
13
  "storage.resources.errorText": "We could not fetch the data to display",
14
- "storage.resources.emptyDirectory": "Empty directory",
14
+ "storage.resources.emptyTitle": "Empty folder",
15
+ "storage.resources.emptyText": "Create a folder or upload a file to get started.",
15
16
  "storage.resources.removeDirectoryTitle": "Remove directory",
16
17
  "storage.resources.removeDirectoryText": "Are you sure you want to remove this directory and everything in it?",
17
18
  "storage.resources.cancel": "Cancel",
@@ -11,7 +11,8 @@
11
11
  "storage.resources.newFolderDefault": "Ny mapp",
12
12
  "storage.resources.errorTitle": "Något gick fel",
13
13
  "storage.resources.errorText": "Vi kunde inte hämta data att visa",
14
- "storage.resources.emptyDirectory": "Tom katalog",
14
+ "storage.resources.emptyTitle": "Tom mapp",
15
+ "storage.resources.emptyText": "Skapa en mapp eller ladda upp en fil för att komma igång.",
15
16
  "storage.resources.removeDirectoryTitle": "Ta bort mapp",
16
17
  "storage.resources.removeDirectoryText": "Är du säker på att du vill ta bort den här mappen och allt innehåll?",
17
18
  "storage.resources.cancel": "Avbryt",