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

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 (40) hide show
  1. package/dist/components/DataBrowserUI.d.ts +20 -0
  2. package/dist/components/DataBrowserUI.js +64 -0
  3. package/dist/components/__tests__/BucketDetails.test.d.ts +1 -0
  4. package/dist/components/__tests__/BucketDetails.test.js +421 -0
  5. package/dist/components/__tests__/BucketList.test.js +389 -164
  6. package/dist/components/__tests__/BucketOverview.test.js +19 -63
  7. package/dist/components/__tests__/ObjectList.test.js +719 -219
  8. package/dist/components/buckets/BucketDetails.d.ts +40 -0
  9. package/dist/components/buckets/BucketDetails.js +194 -86
  10. package/dist/components/buckets/BucketList.d.ts +5 -6
  11. package/dist/components/buckets/BucketList.js +152 -97
  12. package/dist/components/buckets/BucketOverview.d.ts +6 -0
  13. package/dist/components/buckets/BucketOverview.js +363 -179
  14. package/dist/components/buckets/BucketPage.js +1 -5
  15. package/dist/components/buckets/BucketVersioning.js +3 -0
  16. package/dist/components/buckets/EmptyBucketButton.js +1 -1
  17. package/dist/components/index.d.ts +2 -1
  18. package/dist/components/index.js +2 -1
  19. package/dist/components/layouts/ArrowNavigation.js +20 -8
  20. package/dist/components/objects/CreateFolderButton.js +1 -1
  21. package/dist/components/objects/ObjectDetails/ObjectSummary.js +287 -157
  22. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.d.ts +1 -0
  23. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +516 -0
  24. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.d.ts +1 -0
  25. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.js +813 -0
  26. package/dist/components/objects/ObjectDetails/index.d.ts +16 -0
  27. package/dist/components/objects/ObjectDetails/index.js +132 -46
  28. package/dist/components/objects/ObjectList.d.ts +7 -5
  29. package/dist/components/objects/ObjectList.js +566 -286
  30. package/dist/components/objects/UploadButton.js +1 -1
  31. package/dist/config/types.d.ts +117 -0
  32. package/dist/contexts/DataBrowserUICustomizationContext.d.ts +27 -0
  33. package/dist/contexts/DataBrowserUICustomizationContext.js +13 -0
  34. package/dist/test/testUtils.d.ts +64 -0
  35. package/dist/test/testUtils.js +100 -1
  36. package/dist/types/index.d.ts +5 -3
  37. package/dist/utils/constants.d.ts +7 -0
  38. package/dist/utils/constants.js +8 -1
  39. package/dist/utils/useFeatures.js +1 -1
  40. package/package.json +2 -2
@@ -12,10 +12,11 @@ export { BucketVersioning } from "./buckets/BucketVersioning";
12
12
  export { UploadButton } from "./objects/UploadButton";
13
13
  export { CreateFolderButton } from "./objects/CreateFolderButton";
14
14
  export { ObjectDetails } from "./objects/ObjectDetails";
15
- export { ObjectList } from "./objects/ObjectList";
15
+ export { ObjectList, type TableItem } from "./objects/ObjectList";
16
16
  export { ObjectPage } from "./objects/ObjectPage";
17
17
  export { ObjectLockSettings } from "./objects/ObjectLock/ObjectLockSettings";
18
18
  export { EditRetentionButton } from "./objects/ObjectLock/EditRetentionButton";
19
19
  export { MetadataSearch } from "./search/MetadataSearch";
20
20
  export { ArrayFieldActions } from "./ui/ArrayFieldActions";
21
21
  export { DataBrowserProvider, useDataBrowserContext, useDataBrowserTheme, } from "./providers/DataBrowserProvider";
22
+ export { DataBrowserUI } from "./DataBrowserUI";
@@ -19,4 +19,5 @@ import { EditRetentionButton } from "./objects/ObjectLock/EditRetentionButton.js
19
19
  import { MetadataSearch } from "./search/MetadataSearch.js";
20
20
  import { ArrayFieldActions } from "./ui/ArrayFieldActions.js";
21
21
  import { DataBrowserProvider, useDataBrowserContext, useDataBrowserTheme } from "./providers/DataBrowserProvider.js";
22
- export { ArrayFieldActions, BucketCreate, BucketLifecycleFormPage, BucketList, BucketNotificationCreatePage, BucketOverview, BucketOverviewField, BucketOverviewSection, BucketPage, BucketPolicyPage, BucketReplicationFormPage, BucketVersioning, CreateFolderButton, DataBrowserProvider, DeleteBucketButton, EditRetentionButton, EmptyBucketButton, MetadataSearch, ObjectDetails, ObjectList, ObjectLockSettings, ObjectPage, UploadButton, baseBucketCreateSchema, bucketErrorMessage, bucketNameValidationSchema, useDataBrowserContext, useDataBrowserTheme };
22
+ import { DataBrowserUI } from "./DataBrowserUI.js";
23
+ export { ArrayFieldActions, BucketCreate, BucketLifecycleFormPage, BucketList, BucketNotificationCreatePage, BucketOverview, BucketOverviewField, BucketOverviewSection, BucketPage, BucketPolicyPage, BucketReplicationFormPage, BucketVersioning, CreateFolderButton, DataBrowserProvider, DataBrowserUI, DeleteBucketButton, EditRetentionButton, EmptyBucketButton, MetadataSearch, ObjectDetails, ObjectList, ObjectLockSettings, ObjectPage, UploadButton, baseBucketCreateSchema, bucketErrorMessage, bucketNameValidationSchema, useDataBrowserContext, useDataBrowserTheme };
@@ -1,16 +1,28 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Icon } from "@scality/core-ui";
3
3
  import { useNavigate } from "react-router-dom";
4
+ import styled_components from "styled-components";
5
+ const IconWrapper = styled_components.div`
6
+ display: inline-block;
7
+ cursor: pointer;
8
+
9
+ svg {
10
+ color: ${(props)=>props.theme.textPrimary};
11
+ transition: color 0.2s ease;
12
+ }
13
+
14
+ &:hover svg {
15
+ color: ${(props)=>props.theme.textSecondary};
16
+ }
17
+ `;
4
18
  function ArrowNavigation({ path }) {
5
19
  const navigate = useNavigate();
6
- return /*#__PURE__*/ jsx(Icon, {
7
- name: "Arrow-left",
8
- size: "2x",
9
- color: "textPrimary",
10
- style: {
11
- cursor: "pointer"
12
- },
13
- onClick: ()=>navigate(path)
20
+ return /*#__PURE__*/ jsx(IconWrapper, {
21
+ onClick: ()=>navigate(path),
22
+ children: /*#__PURE__*/ jsx(Icon, {
23
+ name: "Arrow-left",
24
+ size: "2x"
25
+ })
14
26
  });
15
27
  }
16
28
  export { ArrowNavigation as default };
@@ -75,7 +75,7 @@ const CreateFolderButton = ({ bucket, prefix = "", label = "Folder", variant = "
75
75
  }),
76
76
  /*#__PURE__*/ jsx(Button, {
77
77
  disabled: isLoading || isEmpty || hasInvalidFormat,
78
- variant: "secondary",
78
+ variant: "primary",
79
79
  onClick: handleSave,
80
80
  label: "Save",
81
81
  tooltip: hasInvalidFormat ? {
@@ -1,10 +1,13 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment as external_react_Fragment, useCallback, useMemo } from "react";
2
3
  import { ConstrainedText, FormattedDateTime, Icon, Loader, PrettyBytes, Toggle, spacing, useToast } from "@scality/core-ui";
3
4
  import { useObjectLegalHold, useObjectMetadata, useObjectRetention, useSetObjectLegalHold } from "../../../hooks/index.js";
4
5
  import { Body, ExtraCell, Group, GroupContent, GroupName, GroupValues, Key, Row, Table, TableContainer, Value } from "../../ui/Table.elements.js";
5
6
  import { CopyButton } from "@scality/core-ui/dist/components/buttonv2/CopyButton.component";
7
+ import { useDataBrowserUICustomization } from "../../../contexts/DataBrowserUICustomizationContext.js";
6
8
  import { Box } from "@scality/core-ui/dist/next";
7
9
  const ObjectSummary = ({ bucketName, objectKey, versionId })=>{
10
+ const { extraObjectSummaryInformation, extraObjectSummaryDataProtection } = useDataBrowserUICustomization();
8
11
  const { data: metadata, status: metadataStatus } = useObjectMetadata({
9
12
  Bucket: bucketName,
10
13
  Key: objectKey,
@@ -31,7 +34,7 @@ const ObjectSummary = ({ bucketName, objectKey, versionId })=>{
31
34
  const isLegalHoldEnabled = legalHoldData?.LegalHold?.Status === "ON";
32
35
  const hasRetention = retentionData?.Retention?.Mode;
33
36
  const isObjectLockAvailable = hasRetention || "pending" === retentionStatus || "success" === legalHoldStatus;
34
- const handleLegalHoldChange = ()=>{
37
+ const handleLegalHoldChange = useCallback(()=>{
35
38
  setLegalHold({
36
39
  Bucket: bucketName,
37
40
  Key: objectKey,
@@ -57,7 +60,281 @@ const ObjectSummary = ({ bucketName, objectKey, versionId })=>{
57
60
  });
58
61
  }
59
62
  });
60
- };
63
+ }, [
64
+ bucketName,
65
+ objectKey,
66
+ versionId,
67
+ isLegalHoldEnabled,
68
+ setLegalHold,
69
+ showToast
70
+ ]);
71
+ const informationFields = useMemo(()=>{
72
+ const defaultFields = {
73
+ name: {
74
+ id: "name",
75
+ label: "Name",
76
+ node: /*#__PURE__*/ jsxs(Row, {
77
+ children: [
78
+ /*#__PURE__*/ jsx(Key, {
79
+ children: "Name"
80
+ }),
81
+ /*#__PURE__*/ jsx(Value, {
82
+ width: "15rem",
83
+ children: /*#__PURE__*/ jsx(ConstrainedText, {
84
+ text: objectKey,
85
+ lineClamp: 2
86
+ })
87
+ })
88
+ ]
89
+ }, "name")
90
+ },
91
+ versionId: {
92
+ id: "versionId",
93
+ label: "Version ID",
94
+ node: /*#__PURE__*/ jsxs(Row, {
95
+ children: [
96
+ /*#__PURE__*/ jsx(Key, {
97
+ children: "Version ID"
98
+ }),
99
+ /*#__PURE__*/ jsx(Value, {
100
+ children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : /*#__PURE__*/ jsxs(GroupValues, {
101
+ children: [
102
+ /*#__PURE__*/ jsx(Box, {
103
+ flex: "1",
104
+ minWidth: "0",
105
+ children: /*#__PURE__*/ jsx(ConstrainedText, {
106
+ text: metadata?.VersionId || versionId || "N/A",
107
+ lineClamp: 1
108
+ })
109
+ }),
110
+ /*#__PURE__*/ jsx(ExtraCell, {
111
+ marginLeft: spacing.f8,
112
+ children: /*#__PURE__*/ jsx(CopyButton, {
113
+ textToCopy: metadata?.VersionId || versionId || ""
114
+ })
115
+ })
116
+ ]
117
+ })
118
+ })
119
+ ]
120
+ }, "versionId")
121
+ },
122
+ size: {
123
+ id: "size",
124
+ label: "Size",
125
+ node: /*#__PURE__*/ jsxs(Row, {
126
+ children: [
127
+ /*#__PURE__*/ jsx(Key, {
128
+ children: "Size"
129
+ }),
130
+ /*#__PURE__*/ jsx(Value, {
131
+ children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : /*#__PURE__*/ jsx(PrettyBytes, {
132
+ bytes: metadata?.ContentLength || 0
133
+ })
134
+ })
135
+ ]
136
+ }, "size")
137
+ },
138
+ lastModified: {
139
+ id: "lastModified",
140
+ label: "Modified On",
141
+ node: /*#__PURE__*/ jsxs(Row, {
142
+ children: [
143
+ /*#__PURE__*/ jsx(Key, {
144
+ children: "Modified On"
145
+ }),
146
+ /*#__PURE__*/ jsx(Value, {
147
+ children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : metadata?.LastModified ? /*#__PURE__*/ jsx(FormattedDateTime, {
148
+ value: metadata.LastModified,
149
+ format: "date-time-second"
150
+ }) : "N/A"
151
+ })
152
+ ]
153
+ }, "lastModified")
154
+ },
155
+ etag: {
156
+ id: "etag",
157
+ label: "ETag",
158
+ node: /*#__PURE__*/ jsxs(Row, {
159
+ children: [
160
+ /*#__PURE__*/ jsx(Key, {
161
+ children: "ETag"
162
+ }),
163
+ /*#__PURE__*/ jsx(Value, {
164
+ children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : /*#__PURE__*/ jsxs(GroupValues, {
165
+ children: [
166
+ /*#__PURE__*/ jsx(Box, {
167
+ flex: "1",
168
+ minWidth: "0",
169
+ children: /*#__PURE__*/ jsx(ConstrainedText, {
170
+ text: metadata.ETag?.replace(/^"|"$/g, "") || "N/A",
171
+ lineClamp: 1
172
+ })
173
+ }),
174
+ /*#__PURE__*/ jsx(ExtraCell, {
175
+ marginLeft: spacing.f8,
176
+ children: /*#__PURE__*/ jsx(CopyButton, {
177
+ textToCopy: metadata.ETag?.replace(/^"|"$/g, "") || ""
178
+ })
179
+ })
180
+ ]
181
+ })
182
+ })
183
+ ]
184
+ }, "etag")
185
+ },
186
+ location: {
187
+ id: "location",
188
+ label: "Location",
189
+ node: /*#__PURE__*/ jsxs(Row, {
190
+ children: [
191
+ /*#__PURE__*/ jsx(Key, {
192
+ children: "Location"
193
+ }),
194
+ /*#__PURE__*/ jsx(Value, {
195
+ children: "default"
196
+ })
197
+ ]
198
+ }, "location")
199
+ }
200
+ };
201
+ const extraFields = [];
202
+ extraObjectSummaryInformation?.forEach((fieldConfig)=>{
203
+ const RenderComponent = fieldConfig.render;
204
+ const fieldItem = {
205
+ id: fieldConfig.id,
206
+ label: fieldConfig.label,
207
+ node: /*#__PURE__*/ jsxs(Row, {
208
+ children: [
209
+ fieldConfig.label && /*#__PURE__*/ jsx(Key, {
210
+ children: fieldConfig.label
211
+ }),
212
+ /*#__PURE__*/ jsx(Value, {
213
+ children: /*#__PURE__*/ jsx(RenderComponent, {
214
+ entityName: objectKey
215
+ })
216
+ })
217
+ ]
218
+ }, fieldConfig.id)
219
+ };
220
+ if (defaultFields[fieldConfig.id]) defaultFields[fieldConfig.id] = fieldItem;
221
+ else extraFields.push(fieldItem);
222
+ });
223
+ return [
224
+ defaultFields.name,
225
+ defaultFields.versionId,
226
+ defaultFields.size,
227
+ defaultFields.lastModified,
228
+ defaultFields.etag,
229
+ defaultFields.location,
230
+ ...extraFields
231
+ ];
232
+ }, [
233
+ objectKey,
234
+ versionId,
235
+ metadata?.VersionId,
236
+ metadata?.ContentLength,
237
+ metadata?.LastModified,
238
+ metadata?.ETag,
239
+ metadataStatus,
240
+ extraObjectSummaryInformation
241
+ ]);
242
+ const dataProtectionFields = useMemo(()=>{
243
+ const defaultFields = {
244
+ lock: {
245
+ id: "lock",
246
+ label: "Lock",
247
+ node: /*#__PURE__*/ jsxs(Row, {
248
+ children: [
249
+ /*#__PURE__*/ jsx(Key, {
250
+ children: "Lock"
251
+ }),
252
+ /*#__PURE__*/ jsx(Value, {
253
+ children: "pending" === retentionStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === retentionStatus ? "No Retention" : retentionData?.Retention?.Mode ? /*#__PURE__*/ jsxs(Fragment, {
254
+ children: [
255
+ retentionData.Retention.Mode,
256
+ " until",
257
+ " ",
258
+ retentionData.Retention.RetainUntilDate ? /*#__PURE__*/ jsx(FormattedDateTime, {
259
+ format: "date-time-second",
260
+ value: new Date(retentionData.Retention.RetainUntilDate)
261
+ }) : "N/A"
262
+ ]
263
+ }) : "No Retention"
264
+ })
265
+ ]
266
+ }, "lock")
267
+ },
268
+ legalHold: {
269
+ id: "legalHold",
270
+ label: "Legal Hold",
271
+ node: /*#__PURE__*/ jsxs(Row, {
272
+ children: [
273
+ /*#__PURE__*/ jsx(Key, {
274
+ children: "Legal Hold"
275
+ }),
276
+ /*#__PURE__*/ jsx(Value, {
277
+ children: "pending" === legalHoldStatus ? /*#__PURE__*/ jsx(Loader, {}) : isObjectLockAvailable ? /*#__PURE__*/ jsxs(Box, {
278
+ display: "flex",
279
+ alignItems: "center",
280
+ gap: spacing.r8,
281
+ children: [
282
+ /*#__PURE__*/ jsx(Toggle, {
283
+ id: "legalHoldToggle",
284
+ disabled: isUpdatingLegalHold,
285
+ toggle: isLegalHoldEnabled,
286
+ label: isLegalHoldEnabled ? "Active" : "Inactive",
287
+ onChange: handleLegalHoldChange
288
+ }),
289
+ isLegalHoldEnabled && /*#__PURE__*/ jsx(Icon, {
290
+ name: "Rebalance"
291
+ })
292
+ ]
293
+ }) : "N/A"
294
+ })
295
+ ]
296
+ }, "legalHold")
297
+ }
298
+ };
299
+ const extraFields = [];
300
+ extraObjectSummaryDataProtection?.forEach((fieldConfig)=>{
301
+ const RenderComponent = fieldConfig.render;
302
+ const fieldItem = {
303
+ id: fieldConfig.id,
304
+ label: fieldConfig.label,
305
+ node: /*#__PURE__*/ jsxs(Row, {
306
+ children: [
307
+ fieldConfig.label && /*#__PURE__*/ jsx(Key, {
308
+ children: fieldConfig.label
309
+ }),
310
+ /*#__PURE__*/ jsx(Value, {
311
+ children: /*#__PURE__*/ jsx(RenderComponent, {
312
+ entityName: objectKey
313
+ })
314
+ })
315
+ ]
316
+ }, fieldConfig.id)
317
+ };
318
+ if (defaultFields[fieldConfig.id]) defaultFields[fieldConfig.id] = fieldItem;
319
+ else extraFields.push(fieldItem);
320
+ });
321
+ return [
322
+ defaultFields.lock,
323
+ defaultFields.legalHold,
324
+ ...extraFields
325
+ ];
326
+ }, [
327
+ objectKey,
328
+ retentionStatus,
329
+ retentionData?.Retention?.Mode,
330
+ retentionData?.Retention?.RetainUntilDate,
331
+ legalHoldStatus,
332
+ isObjectLockAvailable,
333
+ isLegalHoldEnabled,
334
+ isUpdatingLegalHold,
335
+ handleLegalHoldChange,
336
+ extraObjectSummaryDataProtection
337
+ ]);
61
338
  return /*#__PURE__*/ jsx(TableContainer, {
62
339
  children: /*#__PURE__*/ jsx(Table, {
63
340
  children: /*#__PURE__*/ jsxs(Body, {
@@ -67,112 +344,10 @@ const ObjectSummary = ({ bucketName, objectKey, versionId })=>{
67
344
  /*#__PURE__*/ jsx(GroupName, {
68
345
  children: "Information"
69
346
  }),
70
- /*#__PURE__*/ jsxs(GroupContent, {
71
- children: [
72
- /*#__PURE__*/ jsxs(Row, {
73
- children: [
74
- /*#__PURE__*/ jsx(Key, {
75
- children: "Name"
76
- }),
77
- /*#__PURE__*/ jsx(Value, {
78
- width: "15rem",
79
- children: /*#__PURE__*/ jsx(ConstrainedText, {
80
- text: objectKey,
81
- lineClamp: 2
82
- })
83
- })
84
- ]
85
- }),
86
- /*#__PURE__*/ jsxs(Row, {
87
- children: [
88
- /*#__PURE__*/ jsx(Key, {
89
- children: "Version ID"
90
- }),
91
- /*#__PURE__*/ jsx(Value, {
92
- children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : /*#__PURE__*/ jsxs(GroupValues, {
93
- children: [
94
- /*#__PURE__*/ jsx(Box, {
95
- flex: "1",
96
- minWidth: "0",
97
- children: /*#__PURE__*/ jsx(ConstrainedText, {
98
- text: metadata?.VersionId || versionId || "N/A",
99
- lineClamp: 1
100
- })
101
- }),
102
- /*#__PURE__*/ jsx(ExtraCell, {
103
- marginLeft: spacing.f8,
104
- children: /*#__PURE__*/ jsx(CopyButton, {
105
- textToCopy: metadata?.VersionId || versionId || ""
106
- })
107
- })
108
- ]
109
- })
110
- })
111
- ]
112
- }),
113
- /*#__PURE__*/ jsxs(Row, {
114
- children: [
115
- /*#__PURE__*/ jsx(Key, {
116
- children: "Size"
117
- }),
118
- /*#__PURE__*/ jsx(Value, {
119
- children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : /*#__PURE__*/ jsx(PrettyBytes, {
120
- bytes: metadata?.ContentLength || 0
121
- })
122
- })
123
- ]
124
- }),
125
- /*#__PURE__*/ jsxs(Row, {
126
- children: [
127
- /*#__PURE__*/ jsx(Key, {
128
- children: "Modified On"
129
- }),
130
- /*#__PURE__*/ jsx(Value, {
131
- children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : metadata?.LastModified ? /*#__PURE__*/ jsx(FormattedDateTime, {
132
- value: metadata.LastModified,
133
- format: "date-time-second"
134
- }) : "N/A"
135
- })
136
- ]
137
- }),
138
- /*#__PURE__*/ jsxs(Row, {
139
- children: [
140
- /*#__PURE__*/ jsx(Key, {
141
- children: "ETag"
142
- }),
143
- /*#__PURE__*/ jsx(Value, {
144
- children: "pending" === metadataStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === metadataStatus ? "Error" : /*#__PURE__*/ jsxs(GroupValues, {
145
- children: [
146
- /*#__PURE__*/ jsx(Box, {
147
- flex: "1",
148
- minWidth: "0",
149
- children: /*#__PURE__*/ jsx(ConstrainedText, {
150
- text: metadata.ETag?.replace(/^"|"$/g, "") || "N/A",
151
- lineClamp: 1
152
- })
153
- }),
154
- /*#__PURE__*/ jsx(ExtraCell, {
155
- marginLeft: spacing.f8,
156
- children: /*#__PURE__*/ jsx(CopyButton, {
157
- textToCopy: metadata.ETag?.replace(/^"|"$/g, "") || ""
158
- })
159
- })
160
- ]
161
- })
162
- })
163
- ]
164
- }),
165
- /*#__PURE__*/ jsxs(Row, {
166
- children: [
167
- /*#__PURE__*/ jsx(Key, {
168
- children: "Location"
169
- }),
170
- /*#__PURE__*/ jsx(Value, {
171
- children: "default"
172
- })
173
- ]
174
- })
175
- ]
347
+ /*#__PURE__*/ jsx(GroupContent, {
348
+ children: informationFields.map((field)=>/*#__PURE__*/ jsx(external_react_Fragment, {
349
+ children: field.node
350
+ }, field.id))
176
351
  })
177
352
  ]
178
353
  }),
@@ -181,55 +356,10 @@ const ObjectSummary = ({ bucketName, objectKey, versionId })=>{
181
356
  /*#__PURE__*/ jsx(GroupName, {
182
357
  children: "Data protection"
183
358
  }),
184
- /*#__PURE__*/ jsxs(GroupContent, {
185
- children: [
186
- /*#__PURE__*/ jsxs(Row, {
187
- children: [
188
- /*#__PURE__*/ jsx(Key, {
189
- children: "Lock"
190
- }),
191
- /*#__PURE__*/ jsx(Value, {
192
- children: "pending" === retentionStatus ? /*#__PURE__*/ jsx(Loader, {}) : "error" === retentionStatus ? "No Retention" : retentionData?.Retention?.Mode ? /*#__PURE__*/ jsxs(Fragment, {
193
- children: [
194
- retentionData.Retention.Mode,
195
- " until",
196
- " ",
197
- retentionData.Retention.RetainUntilDate ? /*#__PURE__*/ jsx(FormattedDateTime, {
198
- format: "date-time-second",
199
- value: new Date(retentionData.Retention.RetainUntilDate)
200
- }) : "N/A"
201
- ]
202
- }) : "No Retention"
203
- })
204
- ]
205
- }),
206
- /*#__PURE__*/ jsxs(Row, {
207
- children: [
208
- /*#__PURE__*/ jsx(Key, {
209
- children: "Legal Hold"
210
- }),
211
- /*#__PURE__*/ jsx(Value, {
212
- children: "pending" === legalHoldStatus ? /*#__PURE__*/ jsx(Loader, {}) : isObjectLockAvailable ? /*#__PURE__*/ jsxs(Box, {
213
- display: "flex",
214
- alignItems: "center",
215
- gap: spacing.r8,
216
- children: [
217
- /*#__PURE__*/ jsx(Toggle, {
218
- id: "legalHoldToggle",
219
- disabled: isUpdatingLegalHold,
220
- toggle: isLegalHoldEnabled,
221
- label: isLegalHoldEnabled ? "Active" : "Inactive",
222
- onChange: handleLegalHoldChange
223
- }),
224
- isLegalHoldEnabled && /*#__PURE__*/ jsx(Icon, {
225
- name: "Rebalance"
226
- })
227
- ]
228
- }) : "N/A"
229
- })
230
- ]
231
- })
232
- ]
359
+ /*#__PURE__*/ jsx(GroupContent, {
360
+ children: dataProtectionFields.map((field)=>/*#__PURE__*/ jsx(external_react_Fragment, {
361
+ children: field.node
362
+ }, field.id))
233
363
  })
234
364
  ]
235
365
  })