@scality/data-browser-library 1.0.0-preview.7 → 1.0.0-preview.9

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 (90) hide show
  1. package/dist/components/__tests__/BucketCreate.test.d.ts +1 -0
  2. package/dist/components/__tests__/BucketCreate.test.js +408 -0
  3. package/dist/components/__tests__/BucketLifecycleFormPage.test.d.ts +1 -0
  4. package/dist/components/__tests__/BucketLifecycleFormPage.test.js +618 -0
  5. package/dist/components/__tests__/BucketLifecycleList.test.d.ts +1 -0
  6. package/dist/components/__tests__/BucketLifecycleList.test.js +325 -0
  7. package/dist/components/__tests__/BucketList.test.js +190 -0
  8. package/dist/components/__tests__/BucketOverview.test.js +298 -8
  9. package/dist/components/__tests__/BucketReplicationFormPage.test.d.ts +1 -0
  10. package/dist/components/__tests__/BucketReplicationFormPage.test.js +1757 -0
  11. package/dist/components/__tests__/BucketReplicationList.test.d.ts +1 -0
  12. package/dist/components/__tests__/BucketReplicationList.test.js +344 -0
  13. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.d.ts +1 -0
  14. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +196 -0
  15. package/dist/components/__tests__/EmptyBucketButton.test.d.ts +1 -0
  16. package/dist/components/__tests__/EmptyBucketButton.test.js +302 -0
  17. package/dist/components/buckets/BucketCreate.d.ts +49 -0
  18. package/dist/components/buckets/BucketCreate.js +237 -0
  19. package/dist/components/buckets/BucketDetails.js +62 -10
  20. package/dist/components/buckets/BucketLifecycleFormPage.d.ts +15 -0
  21. package/dist/components/buckets/BucketLifecycleFormPage.js +1070 -0
  22. package/dist/components/buckets/BucketLifecycleList.d.ts +10 -0
  23. package/dist/components/buckets/BucketLifecycleList.js +270 -0
  24. package/dist/components/buckets/BucketList.d.ts +5 -2
  25. package/dist/components/buckets/BucketList.js +38 -28
  26. package/dist/components/buckets/BucketOverview.d.ts +65 -4
  27. package/dist/components/buckets/BucketOverview.js +261 -179
  28. package/dist/components/buckets/BucketPage.js +1 -1
  29. package/dist/components/buckets/BucketReplicationFormPage.d.ts +1 -0
  30. package/dist/components/buckets/BucketReplicationFormPage.js +834 -0
  31. package/dist/components/buckets/BucketReplicationList.d.ts +11 -0
  32. package/dist/components/buckets/BucketReplicationList.js +189 -0
  33. package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +18 -0
  34. package/dist/components/buckets/DeleteBucketConfigRuleButton.js +53 -0
  35. package/dist/components/buckets/EmptyBucketButton.d.ts +5 -0
  36. package/dist/components/buckets/EmptyBucketButton.js +232 -0
  37. package/dist/components/buckets/EmptyBucketSummary.d.ts +9 -0
  38. package/dist/components/buckets/EmptyBucketSummary.js +60 -0
  39. package/dist/components/buckets/EmptyBucketSummaryList.d.ts +13 -0
  40. package/dist/components/buckets/EmptyBucketSummaryList.js +140 -0
  41. package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +8 -8
  42. package/dist/components/index.d.ts +8 -1
  43. package/dist/components/index.js +9 -2
  44. package/dist/components/objects/ObjectLock/EditRetentionButton.d.ts +4 -0
  45. package/dist/components/objects/ObjectLock/EditRetentionButton.js +32 -0
  46. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.d.ts +3 -0
  47. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +211 -0
  48. package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +9 -0
  49. package/dist/components/objects/ObjectLock/ObjectLockSettings.js +158 -0
  50. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +8 -0
  51. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +39 -0
  52. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.d.ts +1 -0
  53. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +204 -0
  54. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.d.ts +1 -0
  55. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +374 -0
  56. package/dist/components/ui/ArrayFieldActions.d.ts +36 -0
  57. package/dist/components/ui/ArrayFieldActions.js +38 -0
  58. package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +16 -0
  59. package/dist/components/ui/ConfirmDeleteRuleModal.js +43 -0
  60. package/dist/components/ui/FilterFormSection.d.ts +44 -0
  61. package/dist/components/ui/FilterFormSection.js +159 -0
  62. package/dist/config/factory.d.ts +13 -2
  63. package/dist/config/factory.js +9 -6
  64. package/dist/hooks/__tests__/useISVBucketDetection.test.d.ts +1 -0
  65. package/dist/hooks/__tests__/useISVBucketDetection.test.js +188 -0
  66. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +44 -1
  67. package/dist/hooks/factories/useCreateS3QueryHook.js +22 -1
  68. package/dist/hooks/index.d.ts +4 -0
  69. package/dist/hooks/index.js +5 -1
  70. package/dist/hooks/useDeleteBucketConfigRule.d.ts +26 -0
  71. package/dist/hooks/useDeleteBucketConfigRule.js +46 -0
  72. package/dist/hooks/useEmptyBucket.d.ts +27 -0
  73. package/dist/hooks/useEmptyBucket.js +116 -0
  74. package/dist/hooks/useISVBucketDetection.d.ts +15 -0
  75. package/dist/hooks/useISVBucketDetection.js +27 -0
  76. package/dist/hooks/useTableRowSelection.d.ts +9 -0
  77. package/dist/hooks/useTableRowSelection.js +45 -0
  78. package/dist/test/setup.js +8 -0
  79. package/dist/test/testUtils.d.ts +99 -17
  80. package/dist/test/testUtils.js +64 -16
  81. package/dist/test/utils/errorHandling.test.js +39 -1
  82. package/dist/utils/constants.d.ts +12 -0
  83. package/dist/utils/constants.js +9 -0
  84. package/dist/utils/errorHandling.d.ts +9 -0
  85. package/dist/utils/errorHandling.js +6 -1
  86. package/dist/utils/index.d.ts +2 -0
  87. package/dist/utils/index.js +2 -0
  88. package/dist/utils/s3RuleUtils.d.ts +53 -0
  89. package/dist/utils/s3RuleUtils.js +101 -0
  90. package/package.json +1 -1
@@ -4,11 +4,27 @@ import { useNavigate, useParams } from "react-router-dom";
4
4
  import { Tabs } from "@scality/core-ui/dist/next";
5
5
  import { BucketOverview } from "./BucketOverview.js";
6
6
  import { DeleteBucketButton } from "./DeleteBucketButton.js";
7
+ import { EmptyBucketButton } from "./EmptyBucketButton.js";
8
+ import { BucketLifecycleList } from "./BucketLifecycleList.js";
9
+ import { BucketReplicationList } from "./BucketReplicationList.js";
10
+ import { useGetBucketLifecycle, useGetBucketReplication } from "../../hooks/bucketConfiguration.js";
11
+ import { isNotFoundError } from "../../utils/errorHandling.js";
7
12
  function BucketDetails() {
8
13
  const query = useQueryParams();
9
14
  const queryObject = Object.fromEntries(query.entries());
10
15
  const { bucketName } = useParams();
11
16
  const navigate = useNavigate();
17
+ const { data: lifecycleData, status: lifecycleStatus, error: lifecycleError } = useGetBucketLifecycle({
18
+ Bucket: bucketName
19
+ });
20
+ const { data: replicationData, status: replicationStatus, error: replicationError } = useGetBucketReplication({
21
+ Bucket: bucketName
22
+ });
23
+ const lifecycleRules = lifecycleData?.Rules || [];
24
+ const replicationRules = replicationData?.ReplicationConfiguration?.Rules || [];
25
+ const replicationRole = replicationData?.ReplicationConfiguration?.Role || "";
26
+ const effectiveLifecycleStatus = isNotFoundError(lifecycleError) ? "success" : "pending" === lifecycleStatus ? "loading" : "error" === lifecycleStatus ? "error" : "success";
27
+ const effectiveReplicationStatus = isNotFoundError(replicationError) ? "success" : "pending" === replicationStatus ? "loading" : "error" === replicationStatus ? "error" : "success";
12
28
  if (!bucketName) return /*#__PURE__*/ jsx("div", {
13
29
  children: "No bucket selected"
14
30
  });
@@ -22,26 +38,62 @@ function BucketDetails() {
22
38
  ...queryObject,
23
39
  tab: ""
24
40
  },
25
- children: /*#__PURE__*/ jsx(BucketOverview, {
41
+ children: /*#__PURE__*/ jsxs(BucketOverview, {
26
42
  bucketName: bucketName,
27
- renderDeleteButton: ()=>/*#__PURE__*/ jsx(DeleteBucketButton, {
28
- bucketName: bucketName
43
+ children: [
44
+ /*#__PURE__*/ jsx(BucketOverview.Actions, {
45
+ renderDeleteButton: ()=>/*#__PURE__*/ jsx(DeleteBucketButton, {
46
+ bucketName: bucketName
47
+ }),
48
+ renderEmptyButton: ()=>/*#__PURE__*/ jsx(EmptyBucketButton, {
49
+ bucketName: bucketName
50
+ })
29
51
  }),
30
- onEditPolicy: ()=>{
31
- navigate(`/buckets/${bucketName}/policy`);
32
- }
52
+ /*#__PURE__*/ jsxs(BucketOverview.Sections, {
53
+ children: [
54
+ /*#__PURE__*/ jsx(BucketOverview.GeneralSection, {}),
55
+ /*#__PURE__*/ jsx(BucketOverview.DataProtectionSection, {}),
56
+ /*#__PURE__*/ jsx(BucketOverview.PermissionsSection, {
57
+ onEditPolicy: ()=>{
58
+ navigate(`/buckets/${bucketName}/policy`);
59
+ }
60
+ })
61
+ ]
62
+ })
63
+ ]
64
+ })
65
+ }),
66
+ /*#__PURE__*/ jsx(Tabs.Tab, {
67
+ label: "Lifecycle",
68
+ path: "",
69
+ query: {
70
+ ...queryObject,
71
+ tab: "lifecycle"
72
+ },
73
+ withoutPadding: true,
74
+ children: /*#__PURE__*/ jsx(BucketLifecycleList, {
75
+ bucketName: bucketName,
76
+ lifecycleRules: lifecycleRules,
77
+ lifecycleStatus: effectiveLifecycleStatus,
78
+ onCreateRule: ()=>navigate(`/buckets/${bucketName}/lifecycle/create`),
79
+ onEditRule: (ruleId)=>navigate(`/buckets/${bucketName}/lifecycle/edit/${encodeURIComponent(ruleId)}`)
33
80
  })
34
81
  }),
35
82
  /*#__PURE__*/ jsx(Tabs.Tab, {
36
- label: "Workflow",
83
+ label: "Replication",
37
84
  path: "",
38
85
  query: {
39
86
  ...queryObject,
40
- tab: "workflow"
87
+ tab: "replication"
41
88
  },
42
89
  withoutPadding: true,
43
- children: /*#__PURE__*/ jsx(Fragment, {
44
- children: "Workflow"
90
+ children: /*#__PURE__*/ jsx(BucketReplicationList, {
91
+ bucketName: bucketName,
92
+ replicationRules: replicationRules,
93
+ replicationRole: replicationRole,
94
+ replicationStatus: effectiveReplicationStatus,
95
+ onCreateRule: ()=>navigate(`/buckets/${bucketName}/replication/create`),
96
+ onEditRule: (ruleId)=>navigate(`/buckets/${bucketName}/replication/edit/${encodeURIComponent(ruleId)}`)
45
97
  })
46
98
  })
47
99
  ]
@@ -0,0 +1,15 @@
1
+ /**
2
+ * BucketLifecycleFormPage - Form for creating and editing S3 bucket lifecycle rules
3
+ *
4
+ * Features:
5
+ * - Create new or edit existing lifecycle rules
6
+ * - Support for all AWS S3 lifecycle actions (transitions, expirations, etc.)
7
+ * - Comprehensive validation based on AWS S3 requirements
8
+ * - Filter options: prefix, tags, or combination
9
+ * - Current and noncurrent version management
10
+ * - Abort incomplete multipart upload configuration
11
+ *
12
+ * AWS S3 Lifecycle Documentation:
13
+ * https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html
14
+ */
15
+ export declare function BucketLifecycleFormPage(): import("react/jsx-runtime").JSX.Element;