@ossy/storage 3.8.0 → 3.9.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": "3.8.0",
4
+ "version": "3.9.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": "14548dfc2019e7258e8c75db527acbf66fe829bd"
33
+ "gitHead": "f404be69becb27a1fd853a6ff1903554e76e7d17"
34
34
  }
@@ -6,6 +6,7 @@ import {
6
6
  filterDownloadableResources,
7
7
  isDownloadableResource,
8
8
  isMultiSelectGesture,
9
+ isShareableResource,
9
10
  moveResource,
10
11
  removeResource,
11
12
  resourceDownloadHref,
@@ -22,7 +23,7 @@ import {
22
23
  last,
23
24
  } from 'ramda'
24
25
  import { Text, Overlay, Switch, DropZone, Breadcrumbs, Guide, DelayedRender, useDocumentTitle, View, Button, ContextMenu, Dropdown, Page, Tags, useLocale, preloadStorageIcons } from '@ossy/design-system'
25
- import { useActivePath, ResourcePanel, ResourceList, ResourceGrid, ResourceDialogMove, useSelectedResourceId } from '@ossy/resources'
26
+ import { useActivePath, ResourcePanel, ResourceList, ResourceGrid, ResourceDialogMove, ResourceShareDialog, useSelectedResourceId } from '@ossy/resources'
26
27
  import { useRouter, useSearchParams } from '@ossy/router-react'
27
28
 
28
29
  const Path = ({ path, ...props }) => (
@@ -43,7 +44,8 @@ const Overlays = {
43
44
  None: 'None',
44
45
  Removedirectory : 'RemoveDirectory',
45
46
  RemoveBatch: 'RemoveBatch',
46
- MoveResource: 'MoveResource'
47
+ MoveResource: 'MoveResource',
48
+ ShareResource: 'ShareResource',
47
49
  }
48
50
 
49
51
  const ViewMode = {
@@ -315,6 +317,20 @@ export const ResourcesPage = () => {
315
317
  >
316
318
  View
317
319
  </ContextMenu.Item>,
320
+ ...(isShareableResource(resource)
321
+ ? [
322
+ <ContextMenu.Item
323
+ key="share"
324
+ prefix="share"
325
+ onClick={() => {
326
+ setSelectedResourceId(resource.id)
327
+ setOverlay(Overlays.ShareResource)
328
+ }}
329
+ >
330
+ {t('storage.resources.share')}
331
+ </ContextMenu.Item>,
332
+ ]
333
+ : []),
318
334
  ...(downloadHref
319
335
  ? [
320
336
  <ContextMenu.Item
@@ -343,7 +359,7 @@ export const ResourcesPage = () => {
343
359
  variant="command-danger"
344
360
  prefix="trash-empty"
345
361
  onClick={() => onRemoveResource(resource)}
346
- >Remove
362
+ >{t('storage.resources.contextRemove')}
347
363
  </ContextMenu.Item>
348
364
  ]
349
365
  }
@@ -818,6 +834,12 @@ export const ResourcesPage = () => {
818
834
  )
819
835
  }
820
836
 
837
+ <ResourceShareDialog
838
+ resourceId={selectedResourceId}
839
+ isVisible={overlay === Overlays.ShareResource}
840
+ onClose={() => setOverlay(Overlays.None)}
841
+ />
842
+
821
843
  </Page>
822
844
  </>
823
845
  )
@@ -20,6 +20,7 @@
20
20
  "storage.resources.cancel": "Cancel",
21
21
  "storage.resources.remove": "Remove",
22
22
  "storage.resources.move": "Move",
23
+ "storage.resources.share": "Share",
23
24
  "storage.resources.download": "Download",
24
25
  "storage.resources.downloadSelected": "Download selected",
25
26
  "storage.resources.removeSelected": "Remove selected",
@@ -20,6 +20,7 @@
20
20
  "storage.resources.cancel": "Avbryt",
21
21
  "storage.resources.remove": "Ta bort",
22
22
  "storage.resources.move": "Flytta",
23
+ "storage.resources.share": "Dela",
23
24
  "storage.resources.download": "Ladda ner",
24
25
  "storage.resources.downloadSelected": "Ladda ner markerade",
25
26
  "storage.resources.removeSelected": "Ta bort markerade",