@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.
- package/dist/components/__tests__/BucketCreate.test.d.ts +1 -0
- package/dist/components/__tests__/BucketCreate.test.js +408 -0
- package/dist/components/__tests__/BucketLifecycleFormPage.test.d.ts +1 -0
- package/dist/components/__tests__/BucketLifecycleFormPage.test.js +618 -0
- package/dist/components/__tests__/BucketLifecycleList.test.d.ts +1 -0
- package/dist/components/__tests__/BucketLifecycleList.test.js +325 -0
- package/dist/components/__tests__/BucketList.test.js +190 -0
- package/dist/components/__tests__/BucketOverview.test.js +298 -8
- package/dist/components/__tests__/BucketReplicationFormPage.test.d.ts +1 -0
- package/dist/components/__tests__/BucketReplicationFormPage.test.js +1757 -0
- package/dist/components/__tests__/BucketReplicationList.test.d.ts +1 -0
- package/dist/components/__tests__/BucketReplicationList.test.js +344 -0
- package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.d.ts +1 -0
- package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +196 -0
- package/dist/components/__tests__/EmptyBucketButton.test.d.ts +1 -0
- package/dist/components/__tests__/EmptyBucketButton.test.js +302 -0
- package/dist/components/buckets/BucketCreate.d.ts +49 -0
- package/dist/components/buckets/BucketCreate.js +237 -0
- package/dist/components/buckets/BucketDetails.js +62 -10
- package/dist/components/buckets/BucketLifecycleFormPage.d.ts +15 -0
- package/dist/components/buckets/BucketLifecycleFormPage.js +1070 -0
- package/dist/components/buckets/BucketLifecycleList.d.ts +10 -0
- package/dist/components/buckets/BucketLifecycleList.js +270 -0
- package/dist/components/buckets/BucketList.d.ts +5 -2
- package/dist/components/buckets/BucketList.js +38 -28
- package/dist/components/buckets/BucketOverview.d.ts +65 -4
- package/dist/components/buckets/BucketOverview.js +261 -179
- package/dist/components/buckets/BucketPage.js +1 -1
- package/dist/components/buckets/BucketReplicationFormPage.d.ts +1 -0
- package/dist/components/buckets/BucketReplicationFormPage.js +834 -0
- package/dist/components/buckets/BucketReplicationList.d.ts +11 -0
- package/dist/components/buckets/BucketReplicationList.js +189 -0
- package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +18 -0
- package/dist/components/buckets/DeleteBucketConfigRuleButton.js +53 -0
- package/dist/components/buckets/EmptyBucketButton.d.ts +5 -0
- package/dist/components/buckets/EmptyBucketButton.js +232 -0
- package/dist/components/buckets/EmptyBucketSummary.d.ts +9 -0
- package/dist/components/buckets/EmptyBucketSummary.js +60 -0
- package/dist/components/buckets/EmptyBucketSummaryList.d.ts +13 -0
- package/dist/components/buckets/EmptyBucketSummaryList.js +140 -0
- package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +8 -8
- package/dist/components/index.d.ts +8 -1
- package/dist/components/index.js +9 -2
- package/dist/components/objects/ObjectLock/EditRetentionButton.d.ts +4 -0
- package/dist/components/objects/ObjectLock/EditRetentionButton.js +32 -0
- package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.d.ts +3 -0
- package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +211 -0
- package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +9 -0
- package/dist/components/objects/ObjectLock/ObjectLockSettings.js +158 -0
- package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +8 -0
- package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +39 -0
- package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.d.ts +1 -0
- package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +204 -0
- package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.d.ts +1 -0
- package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +374 -0
- package/dist/components/ui/ArrayFieldActions.d.ts +36 -0
- package/dist/components/ui/ArrayFieldActions.js +38 -0
- package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +16 -0
- package/dist/components/ui/ConfirmDeleteRuleModal.js +43 -0
- package/dist/components/ui/FilterFormSection.d.ts +44 -0
- package/dist/components/ui/FilterFormSection.js +159 -0
- package/dist/config/factory.d.ts +13 -2
- package/dist/config/factory.js +9 -6
- package/dist/hooks/__tests__/useISVBucketDetection.test.d.ts +1 -0
- package/dist/hooks/__tests__/useISVBucketDetection.test.js +188 -0
- package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +44 -1
- package/dist/hooks/factories/useCreateS3QueryHook.js +22 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +5 -1
- package/dist/hooks/useDeleteBucketConfigRule.d.ts +26 -0
- package/dist/hooks/useDeleteBucketConfigRule.js +46 -0
- package/dist/hooks/useEmptyBucket.d.ts +27 -0
- package/dist/hooks/useEmptyBucket.js +116 -0
- package/dist/hooks/useISVBucketDetection.d.ts +15 -0
- package/dist/hooks/useISVBucketDetection.js +27 -0
- package/dist/hooks/useTableRowSelection.d.ts +9 -0
- package/dist/hooks/useTableRowSelection.js +45 -0
- package/dist/test/setup.js +8 -0
- package/dist/test/testUtils.d.ts +99 -17
- package/dist/test/testUtils.js +64 -16
- package/dist/test/utils/errorHandling.test.js +39 -1
- package/dist/utils/constants.d.ts +12 -0
- package/dist/utils/constants.js +9 -0
- package/dist/utils/errorHandling.d.ts +9 -0
- package/dist/utils/errorHandling.js +6 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/s3RuleUtils.d.ts +53 -0
- package/dist/utils/s3RuleUtils.js +101 -0
- 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__*/
|
|
41
|
+
children: /*#__PURE__*/ jsxs(BucketOverview, {
|
|
26
42
|
bucketName: bucketName,
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
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: "
|
|
83
|
+
label: "Replication",
|
|
37
84
|
path: "",
|
|
38
85
|
query: {
|
|
39
86
|
...queryObject,
|
|
40
|
-
tab: "
|
|
87
|
+
tab: "replication"
|
|
41
88
|
},
|
|
42
89
|
withoutPadding: true,
|
|
43
|
-
children: /*#__PURE__*/ jsx(
|
|
44
|
-
|
|
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;
|