@scality/data-browser-library 1.0.0-preview.13 → 1.0.0-preview.16

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.
Files changed (212) hide show
  1. package/dist/components/DataBrowserUI.d.ts +6 -14
  2. package/dist/components/DataBrowserUI.js +79 -55
  3. package/dist/components/Editor.d.ts +1 -1
  4. package/dist/components/Editor.js +3 -3
  5. package/dist/components/__tests__/BucketCreate.test.js +102 -102
  6. package/dist/components/__tests__/BucketDetails.test.js +122 -123
  7. package/dist/components/__tests__/BucketLifecycleFormPage.test.js +177 -177
  8. package/dist/components/__tests__/BucketLifecycleList.test.js +85 -85
  9. package/dist/components/__tests__/BucketList.test.js +175 -176
  10. package/dist/components/__tests__/BucketNotificationCreatePage.test.js +84 -84
  11. package/dist/components/__tests__/BucketOverview.test.js +257 -201
  12. package/dist/components/__tests__/BucketPolicyPage.test.js +62 -62
  13. package/dist/components/__tests__/BucketReplicationFormPage.test.js +542 -542
  14. package/dist/components/__tests__/BucketReplicationList.test.js +106 -106
  15. package/dist/components/__tests__/CreateFolderButton.test.js +56 -56
  16. package/dist/components/__tests__/DeleteBucketButton.test.js +62 -62
  17. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +47 -47
  18. package/dist/components/__tests__/DeleteObjectButton.test.js +63 -63
  19. package/dist/components/__tests__/EmptyBucketButton.test.js +56 -56
  20. package/dist/components/__tests__/MetadataSearch.test.js +65 -65
  21. package/dist/components/__tests__/ObjectList.test.js +252 -251
  22. package/dist/components/__tests__/UploadButton.test.js +45 -45
  23. package/dist/components/buckets/BucketCreate.d.ts +2 -2
  24. package/dist/components/buckets/BucketCreate.js +41 -41
  25. package/dist/components/buckets/BucketDetails.d.ts +2 -2
  26. package/dist/components/buckets/BucketDetails.js +48 -36
  27. package/dist/components/buckets/BucketLifecycleFormPage.js +161 -160
  28. package/dist/components/buckets/BucketLifecycleList.d.ts +2 -2
  29. package/dist/components/buckets/BucketLifecycleList.js +46 -46
  30. package/dist/components/buckets/BucketList.d.ts +2 -2
  31. package/dist/components/buckets/BucketList.js +28 -27
  32. package/dist/components/buckets/BucketLocation.js +3 -3
  33. package/dist/components/buckets/BucketOverview.d.ts +1 -1
  34. package/dist/components/buckets/BucketOverview.js +64 -65
  35. package/dist/components/buckets/BucketPage.js +19 -11
  36. package/dist/components/buckets/BucketPolicyButton.js +2 -2
  37. package/dist/components/buckets/BucketPolicyPage.js +27 -25
  38. package/dist/components/buckets/BucketReplicationFormPage.js +133 -132
  39. package/dist/components/buckets/BucketReplicationList.d.ts +2 -2
  40. package/dist/components/buckets/BucketReplicationList.js +41 -41
  41. package/dist/components/buckets/BucketVersioning.js +11 -11
  42. package/dist/components/buckets/DeleteBucketButton.js +5 -5
  43. package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +2 -2
  44. package/dist/components/buckets/DeleteBucketConfigRuleButton.js +1 -1
  45. package/dist/components/buckets/EmptyBucketButton.js +19 -19
  46. package/dist/components/buckets/EmptyBucketSummary.d.ts +1 -1
  47. package/dist/components/buckets/EmptyBucketSummary.js +1 -1
  48. package/dist/components/buckets/EmptyBucketSummaryList.js +22 -22
  49. package/dist/components/buckets/__tests__/BucketVersioning.test.js +45 -45
  50. package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +34 -33
  51. package/dist/components/buckets/notifications/EventsSection.js +144 -28
  52. package/dist/components/buckets/notifications/__tests__/events.test.d.ts +1 -0
  53. package/dist/components/buckets/notifications/__tests__/events.test.js +56 -0
  54. package/dist/components/buckets/notifications/events.d.ts +71 -7
  55. package/dist/components/buckets/notifications/events.js +98 -16
  56. package/dist/components/index.d.ts +24 -22
  57. package/dist/components/index.js +5 -3
  58. package/dist/components/layouts/ArrowNavigation.d.ts +1 -2
  59. package/dist/components/layouts/ArrowNavigation.js +3 -3
  60. package/dist/components/layouts/BrowserPageLayout.d.ts +2 -3
  61. package/dist/components/layouts/BrowserPageLayout.js +1 -1
  62. package/dist/components/objects/CreateFolderButton.d.ts +2 -2
  63. package/dist/components/objects/CreateFolderButton.js +9 -9
  64. package/dist/components/objects/DeleteObjectButton.d.ts +1 -1
  65. package/dist/components/objects/DeleteObjectButton.js +20 -20
  66. package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +1 -1
  67. package/dist/components/objects/ObjectDetails/ObjectMetadata.js +56 -56
  68. package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +1 -1
  69. package/dist/components/objects/ObjectDetails/ObjectSummary.js +39 -39
  70. package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +1 -1
  71. package/dist/components/objects/ObjectDetails/ObjectTags.js +25 -25
  72. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +119 -119
  73. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.js +211 -211
  74. package/dist/components/objects/ObjectDetails/index.d.ts +1 -1
  75. package/dist/components/objects/ObjectDetails/index.js +30 -30
  76. package/dist/components/objects/ObjectList.d.ts +5 -5
  77. package/dist/components/objects/ObjectList.js +113 -112
  78. package/dist/components/objects/ObjectLock/EditRetentionButton.js +3 -3
  79. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +14 -14
  80. package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +1 -1
  81. package/dist/components/objects/ObjectLock/ObjectLockSettings.js +29 -28
  82. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +1 -1
  83. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +6 -6
  84. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +50 -50
  85. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +77 -77
  86. package/dist/components/objects/ObjectPage.js +5 -4
  87. package/dist/components/objects/UploadButton.d.ts +3 -3
  88. package/dist/components/objects/UploadButton.js +5 -5
  89. package/dist/components/providers/DataBrowserProvider.d.ts +23 -12
  90. package/dist/components/providers/DataBrowserProvider.js +60 -38
  91. package/dist/components/providers/QueryProvider.d.ts +9 -0
  92. package/dist/components/providers/QueryProvider.js +22 -0
  93. package/dist/components/search/MetadataSearch.js +26 -25
  94. package/dist/components/search/SearchHints.js +1 -1
  95. package/dist/components/ui/ArrayFieldActions.js +4 -4
  96. package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +1 -1
  97. package/dist/components/ui/ConfirmDeleteRuleModal.js +1 -1
  98. package/dist/components/ui/DeleteObjectModalContent.d.ts +1 -1
  99. package/dist/components/ui/DeleteObjectModalContent.js +12 -12
  100. package/dist/components/ui/FilterFormSection.d.ts +2 -2
  101. package/dist/components/ui/FilterFormSection.js +29 -29
  102. package/dist/components/ui/Search.elements.d.ts +1 -1
  103. package/dist/components/ui/Search.elements.js +7 -7
  104. package/dist/components/ui/Table.elements.js +5 -5
  105. package/dist/config/factory.d.ts +23 -10
  106. package/dist/config/factory.js +22 -7
  107. package/dist/config/types.d.ts +20 -3
  108. package/dist/contexts/DataBrowserUICustomizationContext.d.ts +2 -2
  109. package/dist/hooks/__tests__/useISVBucketDetection.test.js +42 -42
  110. package/dist/hooks/__tests__/useIsBucketEmpty.test.js +25 -25
  111. package/dist/hooks/bucketConfiguration.d.ts +1 -1
  112. package/dist/hooks/bucketConfiguration.js +48 -48
  113. package/dist/hooks/bucketOperations.d.ts +1 -1
  114. package/dist/hooks/bucketOperations.js +6 -6
  115. package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +78 -78
  116. package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +78 -78
  117. package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +42 -42
  118. package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +61 -61
  119. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +63 -63
  120. package/dist/hooks/factories/index.d.ts +4 -4
  121. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +2 -2
  122. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +15 -12
  123. package/dist/hooks/factories/useCreateS3LoginHook.d.ts +2 -2
  124. package/dist/hooks/factories/useCreateS3MutationHook.d.ts +3 -3
  125. package/dist/hooks/factories/useCreateS3MutationHook.js +6 -1
  126. package/dist/hooks/factories/useCreateS3QueryHook.d.ts +2 -2
  127. package/dist/hooks/factories/useCreateS3QueryHook.js +8 -5
  128. package/dist/hooks/index.d.ts +16 -13
  129. package/dist/hooks/index.js +4 -1
  130. package/dist/hooks/loginOperations.d.ts +1 -1
  131. package/dist/hooks/loginOperations.js +1 -1
  132. package/dist/hooks/objectOperations.d.ts +2 -2
  133. package/dist/hooks/objectOperations.js +49 -49
  134. package/dist/hooks/presignedOperations.d.ts +2 -2
  135. package/dist/hooks/presignedOperations.js +3 -3
  136. package/dist/hooks/useBatchObjectLegalHold.js +7 -4
  137. package/dist/hooks/useDataBrowserNavigate.d.ts +28 -0
  138. package/dist/hooks/useDataBrowserNavigate.js +24 -0
  139. package/dist/hooks/useDeleteBucketConfigRule.d.ts +2 -2
  140. package/dist/hooks/useDeleteBucketConfigRule.js +4 -4
  141. package/dist/hooks/useEmptyBucket.js +10 -10
  142. package/dist/hooks/useFeatures.d.ts +7 -0
  143. package/dist/hooks/useFeatures.js +8 -0
  144. package/dist/hooks/useISVBucketDetection.js +5 -5
  145. package/dist/hooks/useIsBucketEmpty.js +4 -4
  146. package/dist/hooks/useLoginMutation.d.ts +1 -1
  147. package/dist/hooks/useLoginMutation.js +1 -1
  148. package/dist/hooks/useS3Client.d.ts +6 -0
  149. package/dist/hooks/useS3Client.js +3 -2
  150. package/dist/hooks/useS3ConfigSwitch.d.ts +11 -0
  151. package/dist/hooks/useS3ConfigSwitch.js +37 -0
  152. package/dist/hooks/useSupportedNotificationEvents.d.ts +6 -0
  153. package/dist/hooks/useSupportedNotificationEvents.js +8 -0
  154. package/dist/index.d.ts +6 -6
  155. package/dist/test/msw/handlers/deleteBucket.d.ts +1 -1
  156. package/dist/test/msw/handlers/deleteBucket.js +20 -10
  157. package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -1
  158. package/dist/test/msw/handlers/getBucketAcl.js +29 -17
  159. package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -1
  160. package/dist/test/msw/handlers/getBucketLocation.js +29 -15
  161. package/dist/test/msw/handlers/getBucketPolicy.d.ts +1 -1
  162. package/dist/test/msw/handlers/getBucketPolicy.js +52 -32
  163. package/dist/test/msw/handlers/headObject.d.ts +1 -1
  164. package/dist/test/msw/handlers/headObject.js +31 -13
  165. package/dist/test/msw/handlers/listBuckets.d.ts +1 -1
  166. package/dist/test/msw/handlers/listBuckets.js +5 -3
  167. package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -1
  168. package/dist/test/msw/handlers/listObjectVersions.js +38 -26
  169. package/dist/test/msw/handlers/listObjects.d.ts +1 -1
  170. package/dist/test/msw/handlers/listObjects.js +35 -23
  171. package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -1
  172. package/dist/test/msw/handlers/objectLegalHold.js +31 -16
  173. package/dist/test/msw/handlers/objectRetention.d.ts +1 -1
  174. package/dist/test/msw/handlers/objectRetention.js +31 -17
  175. package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -1
  176. package/dist/test/msw/handlers/putBucketAcl.js +29 -14
  177. package/dist/test/msw/handlers/putObject.d.ts +1 -1
  178. package/dist/test/msw/handlers/putObject.js +27 -12
  179. package/dist/test/msw/handlers.d.ts +3 -3
  180. package/dist/test/msw/handlers.js +72 -49
  181. package/dist/test/msw/index.d.ts +2 -2
  182. package/dist/test/msw/server.d.ts +1 -1
  183. package/dist/test/msw/server.js +1 -1
  184. package/dist/test/msw/utils.js +2 -2
  185. package/dist/test/setup.d.ts +1 -1
  186. package/dist/test/setup.js +19 -19
  187. package/dist/test/testUtils.d.ts +9 -15
  188. package/dist/test/testUtils.js +73 -91
  189. package/dist/test/utils/errorHandling.test.js +119 -119
  190. package/dist/types/index.d.ts +6 -31
  191. package/dist/utils/__tests__/s3ConfigIdentifier.test.d.ts +1 -0
  192. package/dist/utils/__tests__/s3ConfigIdentifier.test.js +429 -0
  193. package/dist/utils/constants.js +8 -8
  194. package/dist/utils/deletion/index.d.ts +2 -2
  195. package/dist/utils/deletion/messages.d.ts +1 -1
  196. package/dist/utils/deletion/messages.js +4 -4
  197. package/dist/utils/errorHandling.d.ts +3 -3
  198. package/dist/utils/errorHandling.js +6 -6
  199. package/dist/utils/hooks.js +8 -8
  200. package/dist/utils/index.d.ts +5 -4
  201. package/dist/utils/index.js +2 -0
  202. package/dist/utils/proxyMiddleware.d.ts +1 -1
  203. package/dist/utils/proxyMiddleware.js +6 -11
  204. package/dist/utils/s3Client.d.ts +2 -2
  205. package/dist/utils/s3Client.js +1 -1
  206. package/dist/utils/s3ConfigIdentifier.d.ts +68 -0
  207. package/dist/utils/s3ConfigIdentifier.js +55 -0
  208. package/dist/utils/s3RuleUtils.d.ts +5 -5
  209. package/dist/utils/s3RuleUtils.js +17 -17
  210. package/package.json +2 -2
  211. package/dist/utils/useFeatures.d.ts +0 -1
  212. package/dist/utils/useFeatures.js +0 -7
@@ -2,44 +2,44 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { ConstrainedText, FormattedDateTime, Icon, Link, PrettyBytes, Text, Toggle, Wrap, spacing, useToast } from "@scality/core-ui";
3
3
  import { Box, Table } from "@scality/core-ui/dist/next";
4
4
  import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";
5
- import { useQueryClient } from "@tanstack/react-query";
6
5
  import { useDataBrowserUICustomization } from "../../contexts/DataBrowserUICustomizationContext.js";
6
+ import { useInvalidateQueries } from "../providers/DataBrowserProvider.js";
7
7
  import { useSearchObjects, useSearchObjectsVersions } from "../../hooks/index.js";
8
8
  import { useGetPresignedDownload } from "../../hooks/presignedOperations.js";
9
9
  import { useBatchObjectLegalHold } from "../../hooks/useBatchObjectLegalHold.js";
10
10
  import { useQueryParams } from "../../utils/hooks.js";
11
- import { useFeatures } from "../../utils/useFeatures.js";
11
+ import { useFeatures } from "../../hooks/useFeatures.js";
12
12
  import CreateFolderButton from "./CreateFolderButton.js";
13
13
  import MetadataSearch from "../search/MetadataSearch.js";
14
14
  import UploadButton from "./UploadButton.js";
15
15
  import DeleteObjectButton from "./DeleteObjectButton.js";
16
16
  const DEFAULT_PAGE_SIZE = 20;
17
- const SEARCH_QUERY_PARAM = "search";
18
- const NAME_COLUMN_FLEX = "2";
19
- const VERSION_ID_COLUMN_FLEX = "1.5";
20
- const LAST_MODIFIED_COLUMN_FLEX = "1";
21
- const SIZE_COLUMN_FLEX = "1";
22
- const STORAGE_CLASS_COLUMN_FLEX = "1";
23
- const isObjectLike = (item)=>"folder" !== item.type;
17
+ const SEARCH_QUERY_PARAM = 'search';
18
+ const NAME_COLUMN_FLEX = '2';
19
+ const VERSION_ID_COLUMN_FLEX = '1.5';
20
+ const LAST_MODIFIED_COLUMN_FLEX = '1';
21
+ const SIZE_COLUMN_FLEX = '1';
22
+ const STORAGE_CLASS_COLUMN_FLEX = '1';
23
+ const isObjectLike = (item)=>'folder' !== item.type;
24
24
  const getVersionTextColor = (row)=>{
25
25
  const isLatest = row.original.IsLatest;
26
- const isVersion = "version" === row.original.type;
27
- return !isLatest && isVersion ? "infoPrimary" : "textPrimary";
26
+ const isVersion = 'version' === row.original.type;
27
+ return !isLatest && isVersion ? 'infoPrimary' : 'textPrimary';
28
28
  };
29
29
  const removePrefix = (path, prefix)=>{
30
30
  if (!prefix) return path;
31
31
  if (path.startsWith(prefix)) return path.slice(prefix.length);
32
32
  return path;
33
33
  };
34
- const createLegalHoldKey = (key, versionId)=>`${key}:${versionId ?? "null"}`;
34
+ const createLegalHoldKey = (key, versionId)=>`${key}:${versionId ?? 'null'}`;
35
35
  const downloadFile = (url, filename, onCleanup)=>{
36
36
  try {
37
37
  new URL(url);
38
- const link = document.createElement("a");
38
+ const link = document.createElement('a');
39
39
  link.href = url;
40
40
  link.download = filename;
41
- link.style.display = "none";
42
- link.rel = "noopener noreferrer";
41
+ link.style.display = 'none';
42
+ link.rel = 'noopener noreferrer';
43
43
  document.body.appendChild(link);
44
44
  link.click();
45
45
  const timeoutId = setTimeout(()=>{
@@ -47,32 +47,32 @@ const downloadFile = (url, filename, onCleanup)=>{
47
47
  }, 100);
48
48
  onCleanup?.(timeoutId);
49
49
  } catch (error) {
50
- console.error("Invalid download URL:", url, error);
51
- throw new Error("Failed to initiate download: Invalid URL");
50
+ console.error('Invalid download URL:', url, error);
51
+ throw new Error('Failed to initiate download: Invalid URL');
52
52
  }
53
53
  };
54
54
  const createNameColumn = (onPrefixChange, onDownload)=>({
55
- Header: "Name",
56
- accessor: "displayName",
57
- id: "name",
55
+ Header: 'Name',
56
+ accessor: 'displayName',
57
+ id: 'name',
58
58
  sortType: (rowA, rowB)=>{
59
- const aIsFolder = "folder" === rowA.original.type;
60
- const bIsFolder = "folder" === rowB.original.type;
59
+ const aIsFolder = 'folder' === rowA.original.type;
60
+ const bIsFolder = 'folder' === rowB.original.type;
61
61
  if (aIsFolder && !bIsFolder) return -1;
62
62
  if (!aIsFolder && bIsFolder) return 1;
63
- const aName = String(rowA.values.displayName || "");
64
- const bName = String(rowB.values.displayName || "");
65
- return aName.localeCompare(bName, "en", {
66
- sensitivity: "base"
63
+ const aName = String(rowA.values.displayName || '');
64
+ const bName = String(rowB.values.displayName || '');
65
+ return aName.localeCompare(bName, 'en', {
66
+ sensitivity: 'base'
67
67
  });
68
68
  },
69
69
  Cell: ({ value, row })=>{
70
- const isFolder = "folder" === row.original.type;
71
- const isVersion = "version" === row.original.type;
72
- const isDeleteMarker = "deleteMarker" === row.original.type;
70
+ const isFolder = 'folder' === row.original.type;
71
+ const isVersion = 'version' === row.original.type;
72
+ const isDeleteMarker = 'deleteMarker' === row.original.type;
73
73
  const isLatest = row.original.IsLatest;
74
74
  let iconName;
75
- iconName = isFolder ? "Folder" : isDeleteMarker ? "Deletion-marker" : "File";
75
+ iconName = isFolder ? 'Folder' : isDeleteMarker ? 'Deletion-marker' : 'File';
76
76
  const shouldIndent = isVersion && !isLatest;
77
77
  const isLegalHoldEnabled = isObjectLike(row.original) && Boolean(row.original.isLegalHoldEnabled);
78
78
  return /*#__PURE__*/ jsx(ConstrainedText, {
@@ -100,7 +100,7 @@ const createNameColumn = (onPrefixChange, onDownload)=>({
100
100
  children: /*#__PURE__*/ jsx(Link, {
101
101
  onClick: (e)=>{
102
102
  e.stopPropagation();
103
- if (isFolder) onPrefixChange?.(row.original.Key ?? "");
103
+ if (isFolder) onPrefixChange?.(row.original.Key ?? '');
104
104
  else onDownload?.(row.original);
105
105
  },
106
106
  children: value
@@ -113,22 +113,22 @@ const createNameColumn = (onPrefixChange, onDownload)=>({
113
113
  },
114
114
  cellStyle: {
115
115
  flex: NAME_COLUMN_FLEX,
116
- width: "unset"
116
+ width: 'unset'
117
117
  }
118
118
  });
119
119
  const createVersionIdColumn = ()=>({
120
- Header: "Version ID",
121
- accessor: "VersionId",
122
- id: "versionId",
120
+ Header: 'Version ID',
121
+ accessor: 'VersionId',
122
+ id: 'versionId',
123
123
  Cell: ({ row })=>{
124
- const isFolder = "folder" === row.original.type;
125
- const isDeleteMarker = "deleteMarker" === row.original.type;
124
+ const isFolder = 'folder' === row.original.type;
125
+ const isDeleteMarker = 'deleteMarker' === row.original.type;
126
126
  const isLatest = row.original.IsLatest;
127
127
  if (isFolder || isDeleteMarker) return /*#__PURE__*/ jsx(Text, {
128
128
  children: "-"
129
129
  });
130
- const versionId = "version" === row.original.type ? row.original.VersionId ?? "-" : "-";
131
- const textColor = isLatest ? void 0 : "infoPrimary";
130
+ const versionId = 'version' === row.original.type ? row.original.VersionId ?? '-' : '-';
131
+ const textColor = isLatest ? void 0 : 'infoPrimary';
132
132
  return /*#__PURE__*/ jsx(ConstrainedText, {
133
133
  text: versionId,
134
134
  lineClamp: 1,
@@ -137,18 +137,18 @@ const createVersionIdColumn = ()=>({
137
137
  },
138
138
  cellStyle: {
139
139
  flex: VERSION_ID_COLUMN_FLEX,
140
- textAlign: "left",
140
+ textAlign: 'left',
141
141
  paddingRight: spacing.r16,
142
- width: "unset",
143
- maxWidth: "8rem"
142
+ width: 'unset',
143
+ maxWidth: '8rem'
144
144
  }
145
145
  });
146
146
  const createLastModifiedColumn = ()=>({
147
- Header: "Modified on",
148
- accessor: "LastModified",
149
- id: "lastModified",
147
+ Header: 'Modified on',
148
+ accessor: 'LastModified',
149
+ id: 'lastModified',
150
150
  Cell: ({ value, row })=>{
151
- if ("folder" === row.original.type || null == value) return /*#__PURE__*/ jsx(Text, {
151
+ if ('folder' === row.original.type || null == value) return /*#__PURE__*/ jsx(Text, {
152
152
  children: "-"
153
153
  });
154
154
  return /*#__PURE__*/ jsx(Text, {
@@ -161,18 +161,18 @@ const createLastModifiedColumn = ()=>({
161
161
  },
162
162
  cellStyle: {
163
163
  flex: LAST_MODIFIED_COLUMN_FLEX,
164
- textAlign: "right",
164
+ textAlign: 'right',
165
165
  paddingRight: spacing.r16,
166
- width: "unset",
167
- minWidth: "10rem"
166
+ width: 'unset',
167
+ minWidth: '10rem'
168
168
  }
169
169
  });
170
170
  const createSizeColumn = ()=>({
171
- Header: "Size",
172
- accessor: "Size",
173
- id: "size",
171
+ Header: 'Size',
172
+ accessor: 'Size',
173
+ id: 'size',
174
174
  Cell: ({ value, row })=>{
175
- if ("folder" === row.original.type || null == value) return /*#__PURE__*/ jsx(Text, {
175
+ if ('folder' === row.original.type || null == value) return /*#__PURE__*/ jsx(Text, {
176
176
  children: "-"
177
177
  });
178
178
  return /*#__PURE__*/ jsx(Box, {
@@ -189,15 +189,15 @@ const createSizeColumn = ()=>({
189
189
  },
190
190
  cellStyle: {
191
191
  flex: SIZE_COLUMN_FLEX,
192
- textAlign: "right",
192
+ textAlign: 'right',
193
193
  paddingRight: spacing.r16,
194
- width: "unset"
194
+ width: 'unset'
195
195
  }
196
196
  });
197
197
  const createStorageClassColumn = ()=>({
198
- Header: "Storage Location",
199
- accessor: "StorageClass",
200
- id: "storageClass",
198
+ Header: 'Storage Location',
199
+ accessor: 'StorageClass',
200
+ id: 'storageClass',
201
201
  Cell: ({ value, row })=>{
202
202
  if (null == value) return /*#__PURE__*/ jsx(Text, {
203
203
  children: "-"
@@ -207,15 +207,15 @@ const createStorageClassColumn = ()=>({
207
207
  justifyContent: "flex-end",
208
208
  children: /*#__PURE__*/ jsx(Text, {
209
209
  color: getVersionTextColor(row),
210
- children: "STANDARD" === value ? "default" : value
210
+ children: 'STANDARD' === value ? 'default' : value
211
211
  })
212
212
  });
213
213
  },
214
214
  cellStyle: {
215
215
  flex: STORAGE_CLASS_COLUMN_FLEX,
216
- textAlign: "right",
216
+ textAlign: 'right',
217
217
  paddingRight: spacing.r16,
218
- width: "unset"
218
+ width: 'unset'
219
219
  }
220
220
  });
221
221
  const buildCustomColumn = (columnConfig)=>({
@@ -228,8 +228,9 @@ const buildCustomColumn = (columnConfig)=>({
228
228
  });
229
229
  },
230
230
  cellStyle: {
231
- width: columnConfig.width ?? "unset",
232
- flex: columnConfig.width ? void 0 : "1"
231
+ width: columnConfig.width ?? 'unset',
232
+ flex: columnConfig.width ? void 0 : '1',
233
+ ...columnConfig.cellStyle
233
234
  }
234
235
  });
235
236
  function createOverrideMap(customItems) {
@@ -240,10 +241,10 @@ function createOverrideMap(customItems) {
240
241
  }
241
242
  const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
242
243
  const { extraObjectListColumns, extraObjectListActions } = useDataBrowserUICustomization();
243
- const queryClient = useQueryClient();
244
+ const invalidateQueries = useInvalidateQueries();
244
245
  const [showVersions, setShowVersions] = useState(false);
245
- const isMetadataSearchEnabled = useFeatures("metadatasearch");
246
- const metadataSearchQuery = useQueryParams().get("metadatasearch");
246
+ const isMetadataSearchEnabled = useFeatures('metadatasearch');
247
+ const metadataSearchQuery = useQueryParams().get('metadatasearch');
247
248
  const [selectedObjects, setSelectedObjects] = useState([]);
248
249
  const { mutateAsync: getPresignedDownload } = useGetPresignedDownload();
249
250
  const downloadingRef = useRef(new Set());
@@ -272,14 +273,14 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
272
273
  onPrefixChangeRef.current(newPrefix);
273
274
  }, []);
274
275
  const handleDownload = useCallback(async (object)=>{
275
- if (!object.Key) return void console.warn("Cannot download object: missing Key");
276
+ if (!object.Key) return void console.warn('Cannot download object: missing Key');
276
277
  const versionId = isObjectLike(object) ? object.VersionId : void 0;
277
278
  const downloadKey = versionId ? `${object.Key}:${versionId}` : object.Key;
278
279
  if (downloadingRef.current.has(downloadKey)) return void console.debug(`Download already in progress for: ${object.Key}`);
279
280
  downloadingRef.current.add(downloadKey);
280
281
  try {
281
- const rawFilename = object.displayName || object.Key.split("/").pop() || "download";
282
- const sanitized = rawFilename.replace(/["\r\n\t]/g, "");
282
+ const rawFilename = object.displayName || object.Key.split('/').pop() || 'download';
283
+ const sanitized = rawFilename.replace(/["\r\n\t]/g, '');
283
284
  const encoded = encodeURIComponent(sanitized);
284
285
  const result = await getPresignedDownload({
285
286
  Bucket: bucketName,
@@ -289,16 +290,16 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
289
290
  VersionId: versionId
290
291
  } : {}
291
292
  });
292
- if (!result?.Url) throw new Error("Failed to generate presigned URL: No URL returned");
293
+ if (!result?.Url) throw new Error('Failed to generate presigned URL: No URL returned');
293
294
  downloadFile(result.Url, sanitized, (timeoutId)=>{
294
295
  downloadTimeoutsRef.current.set(`${downloadKey}_link`, timeoutId);
295
296
  });
296
297
  } catch (error) {
297
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
298
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
298
299
  showToast({
299
300
  open: true,
300
301
  message: errorMessage,
301
- status: "error"
302
+ status: 'error'
302
303
  });
303
304
  } finally{
304
305
  const timeoutId = setTimeout(()=>{
@@ -318,7 +319,7 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
318
319
  Bucket: bucketName,
319
320
  Prefix: prefix,
320
321
  MaxKeys: DEFAULT_PAGE_SIZE,
321
- Delimiter: "/"
322
+ Delimiter: '/'
322
323
  };
323
324
  if (isMetadataSearchEnabled && metadataSearchQuery) return {
324
325
  ...baseParams,
@@ -403,11 +404,11 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
403
404
  pages.forEach((page)=>{
404
405
  if (page.CommonPrefixes) page.CommonPrefixes.forEach((cp)=>{
405
406
  if (cp.Prefix) {
406
- const folderName = removePrefix(cp.Prefix, prefix).replace(/\/$/, "");
407
+ const folderName = removePrefix(cp.Prefix, prefix).replace(/\/$/, '');
407
408
  folders.push({
408
409
  Key: cp.Prefix,
409
- displayName: folderName + "/",
410
- type: "folder"
410
+ displayName: folderName + '/',
411
+ type: 'folder'
411
412
  });
412
413
  }
413
414
  });
@@ -422,7 +423,7 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
422
423
  return {
423
424
  ...obj,
424
425
  displayName: removePrefix(obj.Key, prefix),
425
- type: "object",
426
+ type: 'object',
426
427
  isLegalHoldEnabled
427
428
  };
428
429
  }, [
@@ -438,14 +439,14 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
438
439
  const itemsByKey = {};
439
440
  listVersionsQuery.data.pages.forEach((page)=>{
440
441
  if (page.Versions) page.Versions.forEach((version)=>{
441
- if (version.Key && !version.Key.endsWith("/")) {
442
+ if (version.Key && !version.Key.endsWith('/')) {
442
443
  objectsWithVersions.add(version.Key);
443
444
  if (!itemsByKey[version.Key]) itemsByKey[version.Key] = [];
444
445
  itemsByKey[version.Key].push(version);
445
446
  }
446
447
  });
447
448
  if (page.DeleteMarkers) page.DeleteMarkers.forEach((marker)=>{
448
- if (marker.Key && !marker.Key.endsWith("/")) {
449
+ if (marker.Key && !marker.Key.endsWith('/')) {
449
450
  objectsWithVersions.add(marker.Key);
450
451
  if (!itemsByKey[marker.Key]) itemsByKey[marker.Key] = [];
451
452
  itemsByKey[marker.Key].push({
@@ -455,8 +456,8 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
455
456
  }
456
457
  });
457
458
  });
458
- Object.keys(itemsByKey).sort((a, b)=>a.localeCompare(b, "en", {
459
- sensitivity: "base"
459
+ Object.keys(itemsByKey).sort((a, b)=>a.localeCompare(b, 'en', {
460
+ sensitivity: 'base'
460
461
  })).forEach((key)=>{
461
462
  const allItems = itemsByKey[key];
462
463
  allItems.sort((a, b)=>{
@@ -468,16 +469,16 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
468
469
  });
469
470
  allItems.forEach((item)=>{
470
471
  if (!item.Key) return;
471
- if (item.Key.endsWith("/")) return;
472
+ if (item.Key.endsWith('/')) return;
472
473
  const baseName = removePrefix(item.Key, prefix);
473
474
  const isLatest = item.IsLatest;
474
- const isDeleteMarker = "isDeleteMarker" in item && item.isDeleteMarker;
475
+ const isDeleteMarker = 'isDeleteMarker' in item && item.isDeleteMarker;
475
476
  const legalHoldKey = createLegalHoldKey(item.Key, item.VersionId);
476
477
  const isLegalHoldEnabled = legalHoldData?.[legalHoldKey]?.isLegalHoldEnabled ?? false;
477
478
  if (isDeleteMarker) items.push({
478
479
  ...item,
479
480
  displayName: baseName,
480
- type: "deleteMarker",
481
+ type: 'deleteMarker',
481
482
  IsLatest: isLatest,
482
483
  isDeleteMarker: true,
483
484
  isLegalHoldEnabled
@@ -485,7 +486,7 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
485
486
  else items.push({
486
487
  ...item,
487
488
  displayName: baseName,
488
- type: "version",
489
+ type: 'version',
489
490
  IsLatest: isLatest,
490
491
  isLegalHoldEnabled
491
492
  });
@@ -494,14 +495,14 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
494
495
  }
495
496
  if (listObjectsQuery.data?.pages) listObjectsQuery.data.pages.forEach((page)=>{
496
497
  if (page.Contents) page.Contents.forEach((obj)=>{
497
- if (obj.Key && !obj.Key.endsWith("/") && !objectsWithVersions.has(obj.Key)) items.push(createObjectItem(obj, legalHoldData));
498
+ if (obj.Key && !obj.Key.endsWith('/') && !objectsWithVersions.has(obj.Key)) items.push(createObjectItem(obj, legalHoldData));
498
499
  });
499
500
  });
500
501
  } else {
501
502
  folders = data?.pages ? processFolders(data.pages) : [];
502
503
  if (data?.pages) data.pages.forEach((page)=>{
503
504
  if (page.Contents) page.Contents.forEach((obj)=>{
504
- if (obj.Key && !obj.Key.endsWith("/")) items.push(createObjectItem(obj, legalHoldData));
505
+ if (obj.Key && !obj.Key.endsWith('/')) items.push(createObjectItem(obj, legalHoldData));
505
506
  });
506
507
  });
507
508
  }
@@ -539,14 +540,14 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
539
540
  const getColumn = (id)=>customColumnsMap.get(id) || defaultColumnsMap[id];
540
541
  const extraColumns = customColumns.filter((col)=>col.id && !(col.id in defaultColumnsMap));
541
542
  const finalColumns = [
542
- getColumn("name"),
543
+ getColumn('name'),
543
544
  ...showVersions ? [
544
- getColumn("versionId")
545
+ getColumn('versionId')
545
546
  ] : [],
546
547
  ...extraColumns,
547
- getColumn("lastModified"),
548
- getColumn("size"),
549
- getColumn("storageClass")
548
+ getColumn('lastModified'),
549
+ getColumn('size'),
550
+ getColumn('storageClass')
550
551
  ];
551
552
  return finalColumns;
552
553
  }, [
@@ -559,32 +560,32 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
559
560
  storageClassColumn
560
561
  ]);
561
562
  const handleUploadSuccess = useCallback(()=>{
562
- queryClient.invalidateQueries({
563
+ invalidateQueries({
563
564
  queryKey: [
564
- "ListObjects"
565
+ 'ListObjects'
565
566
  ]
566
567
  });
567
- queryClient.invalidateQueries({
568
+ invalidateQueries({
568
569
  queryKey: [
569
- "ListObjectVersions"
570
+ 'ListObjectVersions'
570
571
  ]
571
572
  });
572
573
  }, [
573
- queryClient
574
+ invalidateQueries
574
575
  ]);
575
576
  const handleFolderSuccess = useCallback(()=>{
576
- queryClient.invalidateQueries({
577
+ invalidateQueries({
577
578
  queryKey: [
578
- "ListObjects"
579
+ 'ListObjects'
579
580
  ]
580
581
  });
581
- queryClient.invalidateQueries({
582
+ invalidateQueries({
582
583
  queryKey: [
583
- "ListObjectVersions"
584
+ 'ListObjectVersions'
584
585
  ]
585
586
  });
586
587
  }, [
587
- queryClient
588
+ invalidateQueries
588
589
  ]);
589
590
  const handleUploadError = useCallback(()=>{}, []);
590
591
  const handleFolderError = useCallback(()=>{}, []);
@@ -620,15 +621,15 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
620
621
  const actions = useMemo(()=>{
621
622
  const defaultActionsMap = {
622
623
  upload: {
623
- id: "upload",
624
+ id: 'upload',
624
625
  render: renderUploadAction
625
626
  },
626
627
  createFolder: {
627
- id: "createFolder",
628
+ id: 'createFolder',
628
629
  render: renderCreateFolderAction
629
630
  },
630
631
  delete: {
631
- id: "delete",
632
+ id: 'delete',
632
633
  render: renderDeleteAction
633
634
  }
634
635
  };
@@ -640,9 +641,9 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
640
641
  const getAction = (id)=>customActionsMap.get(id) || defaultActionsMap[id];
641
642
  const extraActions = customActions.filter((action)=>!(action.id in defaultActionsMap));
642
643
  return [
643
- getAction("upload"),
644
- getAction("createFolder"),
645
- getAction("delete"),
644
+ getAction('upload'),
645
+ getAction('createFolder'),
646
+ getAction('delete'),
646
647
  ...extraActions
647
648
  ];
648
649
  }, [
@@ -672,11 +673,11 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
672
673
  }, [
673
674
  tableData
674
675
  ]);
675
- const tableStatus = isLoading ? "loading" : error ? "error" : "success";
676
+ const tableStatus = isLoading ? 'loading' : error ? 'error' : 'success';
676
677
  const entityName = useMemo(()=>({
677
678
  en: {
678
- singular: "object",
679
- plural: "objects"
679
+ singular: 'object',
680
+ plural: 'objects'
680
681
  }
681
682
  }), []);
682
683
  return /*#__PURE__*/ jsxs(Table, {
@@ -712,7 +713,7 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange })=>{
712
713
  toggle: showVersions,
713
714
  onChange: (e)=>setShowVersions(e.target.checked),
714
715
  label: "List Versions",
715
- "aria-label": showVersions ? "Hide object versions" : "Show object versions",
716
+ "aria-label": showVersions ? 'Hide object versions' : 'Show object versions',
716
717
  "aria-pressed": showVersions
717
718
  })
718
719
  ]
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useISVBucketStatus } from "../../../hooks/index.js";
3
3
  import { Icon } from "@scality/core-ui";
4
4
  import { Button } from "@scality/core-ui/dist/next";
5
- import { useNavigate } from "react-router-dom";
5
+ import { useDataBrowserNavigate } from "../../../hooks/useDataBrowserNavigate.js";
6
6
  const EditRetentionButton = ({ bucketName })=>{
7
- const navigate = useNavigate();
7
+ const navigate = useDataBrowserNavigate();
8
8
  const { isVeeamBucket, isCommvaultBucket, isISVManaged, isLoading } = useISVBucketStatus(bucketName);
9
- const tooltipOverlay = isCommvaultBucket ? "Edition is disabled as it is managed by Commvault." : isVeeamBucket ? "Edition is disabled as it is managed by Veeam." : void 0;
9
+ const tooltipOverlay = isCommvaultBucket ? 'Edition is disabled as it is managed by Commvault.' : isVeeamBucket ? 'Edition is disabled as it is managed by Veeam.' : void 0;
10
10
  return /*#__PURE__*/ jsx(Button, {
11
11
  id: "edit-retention-btn",
12
12
  variant: "outline",
@@ -5,14 +5,14 @@ import { Controller, useFormContext } from "react-hook-form";
5
5
  import { Input, Select } from "@scality/core-ui/dist/next";
6
6
  function ObjectLockRetentionSettings({ isEditRetentionSettings = false }) {
7
7
  const { control, register, watch, formState: { errors }, setValue } = useFormContext();
8
- const isDefaultRetentionEnabled = watch("isDefaultRetentionEnabled");
9
- const isObjectLockEnabled = watch("isObjectLockEnabled");
8
+ const isDefaultRetentionEnabled = watch('isDefaultRetentionEnabled');
9
+ const isObjectLockEnabled = watch('isObjectLockEnabled');
10
10
  const matchVersioning = (checked)=>{
11
- if (checked) setValue("isVersioning", true);
11
+ if (checked) setValue('isVersioning', true);
12
12
  };
13
13
  return /*#__PURE__*/ jsxs(FormSection, {
14
14
  title: isEditRetentionSettings ? void 0 : {
15
- name: "Object-lock"
15
+ name: 'Object-lock'
16
16
  },
17
17
  forceLabelWidth: convertRemToPixels(17.5),
18
18
  children: [
@@ -21,9 +21,9 @@ function ObjectLockRetentionSettings({ isEditRetentionSettings = false }) {
21
21
  label: "Object-lock",
22
22
  content: /*#__PURE__*/ jsx(Checkbox, {
23
23
  id: "isObjectLockEnabled",
24
- label: isObjectLockEnabled ? "Enabled" : "Disabled",
24
+ label: isObjectLockEnabled ? 'Enabled' : 'Disabled',
25
25
  disabled: isEditRetentionSettings && isObjectLockEnabled,
26
- ...register("isObjectLockEnabled", {
26
+ ...register('isObjectLockEnabled', {
27
27
  onChange (e) {
28
28
  matchVersioning(e.target.checked);
29
29
  }
@@ -84,8 +84,8 @@ function ObjectLockRetentionSettings({ isEditRetentionSettings = false }) {
84
84
  }),
85
85
  content: /*#__PURE__*/ jsx(Checkbox, {
86
86
  id: "isDefaultRetentionEnabled",
87
- label: isDefaultRetentionEnabled ? "Active" : "Inactive",
88
- ...register("isDefaultRetentionEnabled")
87
+ label: isDefaultRetentionEnabled ? 'Active' : 'Inactive',
88
+ ...register('isDefaultRetentionEnabled')
89
89
  })
90
90
  }),
91
91
  /*#__PURE__*/ jsx(FormGroup, {
@@ -111,7 +111,7 @@ function ObjectLockRetentionSettings({ isEditRetentionSettings = false }) {
111
111
  type: "radio",
112
112
  value: "GOVERNANCE",
113
113
  disabled: !isDefaultRetentionEnabled,
114
- ...register("retentionMode")
114
+ ...register('retentionMode')
115
115
  }),
116
116
  /*#__PURE__*/ jsx("label", {
117
117
  htmlFor: "locktype-governance",
@@ -134,7 +134,7 @@ function ObjectLockRetentionSettings({ isEditRetentionSettings = false }) {
134
134
  type: "radio",
135
135
  value: "COMPLIANCE",
136
136
  disabled: !isDefaultRetentionEnabled,
137
- ...register("retentionMode")
137
+ ...register('retentionMode')
138
138
  }),
139
139
  /*#__PURE__*/ jsx("label", {
140
140
  htmlFor: "locktype-compliance",
@@ -180,21 +180,21 @@ function ObjectLockRetentionSettings({ isEditRetentionSettings = false }) {
180
180
  /*#__PURE__*/ jsx(Controller, {
181
181
  control: control,
182
182
  name: "retentionPeriodFrequencyChoice",
183
- defaultValue: "DAYS",
183
+ defaultValue: 'DAYS',
184
184
  render: ({ field: { onChange, value: retentionPeriodFrequencyChoice } })=>/*#__PURE__*/ jsxs(Select, {
185
185
  id: "retentionPeriodFrequencyChoice",
186
186
  onChange: onChange,
187
187
  placeholder: "retentionPeriodFrequencyChoice",
188
188
  value: retentionPeriodFrequencyChoice,
189
189
  disabled: !isDefaultRetentionEnabled,
190
- size: "1/3",
190
+ size: '1/3',
191
191
  children: [
192
192
  /*#__PURE__*/ jsx(Select.Option, {
193
- value: "DAYS",
193
+ value: 'DAYS',
194
194
  children: "Days"
195
195
  }),
196
196
  /*#__PURE__*/ jsx(Select.Option, {
197
- value: "YEARS",
197
+ value: 'YEARS',
198
198
  children: "Years"
199
199
  })
200
200
  ]
@@ -1,4 +1,4 @@
1
- import Joi from "joi";
1
+ import Joi from 'joi';
2
2
  export declare const objectLockRetentionSettingsValidationRules: {
3
3
  isObjectLockEnabled: Joi.BooleanSchema<boolean>;
4
4
  isDefaultRetentionEnabled: Joi.BooleanSchema<boolean>;