@scality/data-browser-library 1.0.0-preview.11
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/Editor.d.ts +12 -0
- package/dist/components/Editor.js +28 -0
- 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.d.ts +1 -0
- package/dist/components/__tests__/BucketList.test.js +415 -0
- package/dist/components/__tests__/BucketNotificationCreatePage.test.d.ts +1 -0
- package/dist/components/__tests__/BucketNotificationCreatePage.test.js +316 -0
- package/dist/components/__tests__/BucketOverview.test.d.ts +1 -0
- package/dist/components/__tests__/BucketOverview.test.js +769 -0
- package/dist/components/__tests__/BucketPolicyPage.test.d.ts +1 -0
- package/dist/components/__tests__/BucketPolicyPage.test.js +268 -0
- 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__/CreateFolderButton.test.d.ts +1 -0
- package/dist/components/__tests__/CreateFolderButton.test.js +147 -0
- package/dist/components/__tests__/DeleteBucketButton.test.d.ts +1 -0
- package/dist/components/__tests__/DeleteBucketButton.test.js +272 -0
- package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.d.ts +1 -0
- package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +196 -0
- package/dist/components/__tests__/DeleteObjectButton.test.d.ts +1 -0
- package/dist/components/__tests__/DeleteObjectButton.test.js +302 -0
- package/dist/components/__tests__/EmptyBucketButton.test.d.ts +1 -0
- package/dist/components/__tests__/EmptyBucketButton.test.js +302 -0
- package/dist/components/__tests__/MetadataSearch.test.d.ts +1 -0
- package/dist/components/__tests__/MetadataSearch.test.js +201 -0
- package/dist/components/__tests__/ObjectList.test.d.ts +1 -0
- package/dist/components/__tests__/ObjectList.test.js +283 -0
- package/dist/components/__tests__/UploadButton.test.d.ts +1 -0
- package/dist/components/__tests__/UploadButton.test.js +144 -0
- package/dist/components/buckets/BucketCreate.d.ts +49 -0
- package/dist/components/buckets/BucketCreate.js +237 -0
- package/dist/components/buckets/BucketDetails.d.ts +1 -0
- package/dist/components/buckets/BucketDetails.js +106 -0
- package/dist/components/buckets/BucketLifecycleFormPage.d.ts +15 -0
- package/dist/components/buckets/BucketLifecycleFormPage.js +1085 -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 +15 -0
- package/dist/components/buckets/BucketList.js +146 -0
- package/dist/components/buckets/BucketLocation.d.ts +3 -0
- package/dist/components/buckets/BucketLocation.js +16 -0
- package/dist/components/buckets/BucketOverview.d.ts +88 -0
- package/dist/components/buckets/BucketOverview.js +291 -0
- package/dist/components/buckets/BucketPage.d.ts +2 -0
- package/dist/components/buckets/BucketPage.js +47 -0
- package/dist/components/buckets/BucketPolicyButton.d.ts +7 -0
- package/dist/components/buckets/BucketPolicyButton.js +18 -0
- package/dist/components/buckets/BucketPolicyPage.d.ts +1 -0
- package/dist/components/buckets/BucketPolicyPage.js +236 -0
- 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/BucketVersioning.d.ts +4 -0
- package/dist/components/buckets/BucketVersioning.js +73 -0
- package/dist/components/buckets/DeleteBucketButton.d.ts +8 -0
- package/dist/components/buckets/DeleteBucketButton.js +78 -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/__tests__/BucketVersioning.test.d.ts +1 -0
- package/dist/components/buckets/__tests__/BucketVersioning.test.js +163 -0
- package/dist/components/buckets/notifications/BucketNotificationCreatePage.d.ts +1 -0
- package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +234 -0
- package/dist/components/buckets/notifications/EventsSection.d.ts +1 -0
- package/dist/components/buckets/notifications/EventsSection.js +123 -0
- package/dist/components/buckets/notifications/events.d.ts +12 -0
- package/dist/components/buckets/notifications/events.js +27 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/index.js +22 -0
- package/dist/components/layouts/ArrowNavigation.d.ts +4 -0
- package/dist/components/layouts/ArrowNavigation.js +16 -0
- package/dist/components/layouts/BrowserPageLayout.d.ts +12 -0
- package/dist/components/layouts/BrowserPageLayout.js +51 -0
- package/dist/components/objects/CreateFolderButton.d.ts +29 -0
- package/dist/components/objects/CreateFolderButton.js +118 -0
- package/dist/components/objects/DeleteObjectButton.d.ts +8 -0
- package/dist/components/objects/DeleteObjectButton.js +191 -0
- package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +2 -0
- package/dist/components/objects/ObjectDetails/ObjectMetadata.js +356 -0
- package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +3 -0
- package/dist/components/objects/ObjectDetails/ObjectSummary.js +241 -0
- package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +3 -0
- package/dist/components/objects/ObjectDetails/ObjectTags.js +272 -0
- package/dist/components/objects/ObjectDetails/index.d.ts +9 -0
- package/dist/components/objects/ObjectDetails/index.js +75 -0
- package/dist/components/objects/ObjectList.d.ts +40 -0
- package/dist/components/objects/ObjectList.js +453 -0
- 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/objects/ObjectPage.d.ts +1 -0
- package/dist/components/objects/ObjectPage.js +45 -0
- package/dist/components/objects/UploadButton.d.ts +34 -0
- package/dist/components/objects/UploadButton.js +229 -0
- package/dist/components/providers/DataBrowserProvider.d.ts +20 -0
- package/dist/components/providers/DataBrowserProvider.js +42 -0
- package/dist/components/search/MetadataSearch.d.ts +5 -0
- package/dist/components/search/MetadataSearch.js +162 -0
- package/dist/components/search/SearchHints.d.ts +8 -0
- package/dist/components/search/SearchHints.js +21 -0
- package/dist/components/ui/ArrayFieldActions.d.ts +36 -0
- package/dist/components/ui/ArrayFieldActions.js +43 -0
- package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +16 -0
- package/dist/components/ui/ConfirmDeleteRuleModal.js +43 -0
- package/dist/components/ui/DeleteObjectModalContent.d.ts +5 -0
- package/dist/components/ui/DeleteObjectModalContent.js +71 -0
- package/dist/components/ui/FilterFormSection.d.ts +44 -0
- package/dist/components/ui/FilterFormSection.js +159 -0
- package/dist/components/ui/Search.elements.d.ts +17 -0
- package/dist/components/ui/Search.elements.js +59 -0
- package/dist/components/ui/Table.elements.d.ts +36 -0
- package/dist/components/ui/Table.elements.js +87 -0
- package/dist/config/factory.d.ts +63 -0
- package/dist/config/factory.js +74 -0
- package/dist/config/types.d.ts +46 -0
- package/dist/config/types.js +0 -0
- package/dist/hooks/__tests__/useISVBucketDetection.test.d.ts +1 -0
- package/dist/hooks/__tests__/useISVBucketDetection.test.js +188 -0
- package/dist/hooks/__tests__/useIsBucketEmpty.test.d.ts +1 -0
- package/dist/hooks/__tests__/useIsBucketEmpty.test.js +122 -0
- package/dist/hooks/bucketConfiguration.d.ts +168 -0
- package/dist/hooks/bucketConfiguration.js +67 -0
- package/dist/hooks/bucketOperations.d.ts +36 -0
- package/dist/hooks/bucketOperations.js +12 -0
- package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.d.ts +1 -0
- package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +276 -0
- package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.d.ts +1 -0
- package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +259 -0
- package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.d.ts +1 -0
- package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +166 -0
- package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.d.ts +1 -0
- package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +200 -0
- package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.d.ts +1 -0
- package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +179 -0
- package/dist/hooks/factories/index.d.ts +18 -0
- package/dist/hooks/factories/index.js +5 -0
- package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +13 -0
- package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +76 -0
- package/dist/hooks/factories/useCreateS3LoginHook.d.ts +8 -0
- package/dist/hooks/factories/useCreateS3LoginHook.js +22 -0
- package/dist/hooks/factories/useCreateS3MutationHook.d.ts +5 -0
- package/dist/hooks/factories/useCreateS3MutationHook.js +50 -0
- package/dist/hooks/factories/useCreateS3QueryHook.d.ts +3 -0
- package/dist/hooks/factories/useCreateS3QueryHook.js +51 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.js +13 -0
- package/dist/hooks/loginOperations.d.ts +21 -0
- package/dist/hooks/loginOperations.js +9 -0
- package/dist/hooks/objectOperations.d.ts +190 -0
- package/dist/hooks/objectOperations.js +67 -0
- package/dist/hooks/presignedOperations.d.ts +73 -0
- package/dist/hooks/presignedOperations.js +72 -0
- package/dist/hooks/useBatchObjectLegalHold.d.ts +11 -0
- package/dist/hooks/useBatchObjectLegalHold.js +45 -0
- 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/useIsBucketEmpty.d.ts +7 -0
- package/dist/hooks/useIsBucketEmpty.js +36 -0
- package/dist/hooks/useLoginMutation.d.ts +21 -0
- package/dist/hooks/useLoginMutation.js +9 -0
- package/dist/hooks/useS3Client.d.ts +1 -0
- package/dist/hooks/useS3Client.js +13 -0
- package/dist/hooks/useTableRowSelection.d.ts +9 -0
- package/dist/hooks/useTableRowSelection.js +45 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/schemas/bucketPolicySchema.json +321 -0
- package/dist/test/msw/handlers/deleteBucket.d.ts +1 -0
- package/dist/test/msw/handlers/deleteBucket.js +14 -0
- package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -0
- package/dist/test/msw/handlers/getBucketAcl.js +96 -0
- package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -0
- package/dist/test/msw/handlers/getBucketLocation.js +23 -0
- package/dist/test/msw/handlers/getBucketPolicy.d.ts +11 -0
- package/dist/test/msw/handlers/getBucketPolicy.js +72 -0
- package/dist/test/msw/handlers/headObject.d.ts +1 -0
- package/dist/test/msw/handlers/headObject.js +17 -0
- package/dist/test/msw/handlers/listBuckets.d.ts +1 -0
- package/dist/test/msw/handlers/listBuckets.js +24 -0
- package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -0
- package/dist/test/msw/handlers/listObjectVersions.js +83 -0
- package/dist/test/msw/handlers/listObjects.d.ts +1 -0
- package/dist/test/msw/handlers/listObjects.js +66 -0
- package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -0
- package/dist/test/msw/handlers/objectLegalHold.js +24 -0
- package/dist/test/msw/handlers/objectRetention.d.ts +1 -0
- package/dist/test/msw/handlers/objectRetention.js +27 -0
- package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -0
- package/dist/test/msw/handlers/putBucketAcl.js +18 -0
- package/dist/test/msw/handlers/putObject.d.ts +1 -0
- package/dist/test/msw/handlers/putObject.js +16 -0
- package/dist/test/msw/handlers.d.ts +4 -0
- package/dist/test/msw/handlers.js +109 -0
- package/dist/test/msw/index.d.ts +2 -0
- package/dist/test/msw/index.js +3 -0
- package/dist/test/msw/server.d.ts +4 -0
- package/dist/test/msw/server.js +20 -0
- package/dist/test/msw/utils.d.ts +2 -0
- package/dist/test/msw/utils.js +13 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/test/setup.js +90 -0
- package/dist/test/testUtils.d.ts +181 -0
- package/dist/test/testUtils.js +310 -0
- package/dist/test/utils/errorHandling.test.d.ts +1 -0
- package/dist/test/utils/errorHandling.test.js +423 -0
- package/dist/types/index.d.ts +51 -0
- package/dist/types/index.js +0 -0
- package/dist/utils/constants.d.ts +12 -0
- package/dist/utils/constants.js +9 -0
- package/dist/utils/deletion/index.d.ts +2 -0
- package/dist/utils/deletion/index.js +2 -0
- package/dist/utils/deletion/messages.d.ts +5 -0
- package/dist/utils/deletion/messages.js +29 -0
- package/dist/utils/deletion/types.d.ts +11 -0
- package/dist/utils/deletion/types.js +0 -0
- package/dist/utils/errorHandling.d.ts +63 -0
- package/dist/utils/errorHandling.js +84 -0
- package/dist/utils/hooks.d.ts +2 -0
- package/dist/utils/hooks.js +26 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/proxyMiddleware.d.ts +18 -0
- package/dist/utils/proxyMiddleware.js +56 -0
- package/dist/utils/s3Client.d.ts +5 -0
- package/dist/utils/s3Client.js +36 -0
- package/dist/utils/s3RuleUtils.d.ts +53 -0
- package/dist/utils/s3RuleUtils.js +101 -0
- package/dist/utils/useFeatures.d.ts +1 -0
- package/dist/utils/useFeatures.js +7 -0
- package/package.json +84 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { joiResolver } from "@hookform/resolvers/joi";
|
|
3
|
+
import { Form, FormGroup, FormSection, Loader, Stack, Text, useToast } from "@scality/core-ui";
|
|
4
|
+
import { convertRemToPixels } from "@scality/core-ui/dist/components/tablev2/TableUtils";
|
|
5
|
+
import { Button, Input } from "@scality/core-ui/dist/next";
|
|
6
|
+
import joi from "joi";
|
|
7
|
+
import { useCallback } from "react";
|
|
8
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
9
|
+
import { useNavigate, useParams } from "react-router-dom";
|
|
10
|
+
import { useGetBucketNotification, useSetBucketNotification } from "../../../hooks/index.js";
|
|
11
|
+
import { EventsSection } from "./EventsSection.js";
|
|
12
|
+
const schema = joi.object({
|
|
13
|
+
ruleName: joi.string().required().messages({
|
|
14
|
+
"string.empty": "This field is required"
|
|
15
|
+
}),
|
|
16
|
+
queueArn: joi.string().required().pattern(/^arn:aws:sqs:[a-z0-9-]+:\d+:.+$/).messages({
|
|
17
|
+
"string.empty": "This field is required",
|
|
18
|
+
"string.pattern.base": "Must be a valid ARN (e.g., arn:aws:sqs:region:account-id:queue-name)"
|
|
19
|
+
}),
|
|
20
|
+
events: joi.array().min(1).required().messages({
|
|
21
|
+
"array.min": "At least one event must be selected"
|
|
22
|
+
}),
|
|
23
|
+
prefix: joi.string().allow("").optional(),
|
|
24
|
+
suffix: joi.string().allow("").optional()
|
|
25
|
+
});
|
|
26
|
+
function BucketNotificationCreatePage() {
|
|
27
|
+
const { bucketName } = useParams();
|
|
28
|
+
const navigate = useNavigate();
|
|
29
|
+
const { showToast } = useToast();
|
|
30
|
+
const { data: existingNotificationData, status: notificationStatus } = useGetBucketNotification({
|
|
31
|
+
Bucket: bucketName
|
|
32
|
+
});
|
|
33
|
+
const existingRuleNames = existingNotificationData?.QueueConfigurations?.map((config)=>config.Id) || [];
|
|
34
|
+
const dynamicSchema = schema.keys({
|
|
35
|
+
ruleName: joi.string().required().invalid(...existingRuleNames).messages({
|
|
36
|
+
"string.empty": "This field is required",
|
|
37
|
+
"any.invalid": "A rule with this name already exists"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
const methods = useForm({
|
|
41
|
+
resolver: joiResolver(dynamicSchema),
|
|
42
|
+
mode: "onChange",
|
|
43
|
+
defaultValues: {
|
|
44
|
+
ruleName: "",
|
|
45
|
+
queueArn: "",
|
|
46
|
+
events: [],
|
|
47
|
+
prefix: "",
|
|
48
|
+
suffix: ""
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const { mutate: setNotification, isPending: isSaving } = useSetBucketNotification();
|
|
52
|
+
const { handleSubmit, register, formState: { isValid, isDirty, errors } } = methods;
|
|
53
|
+
const handleCancel = useCallback(()=>{
|
|
54
|
+
navigate(`/buckets/${bucketName}`);
|
|
55
|
+
}, [
|
|
56
|
+
navigate,
|
|
57
|
+
bucketName
|
|
58
|
+
]);
|
|
59
|
+
const onSubmit = useCallback((data)=>{
|
|
60
|
+
if (!bucketName) return;
|
|
61
|
+
const filterRules = [
|
|
62
|
+
...data.prefix ? [
|
|
63
|
+
{
|
|
64
|
+
Name: "prefix",
|
|
65
|
+
Value: data.prefix
|
|
66
|
+
}
|
|
67
|
+
] : [],
|
|
68
|
+
...data.suffix ? [
|
|
69
|
+
{
|
|
70
|
+
Name: "suffix",
|
|
71
|
+
Value: data.suffix
|
|
72
|
+
}
|
|
73
|
+
] : []
|
|
74
|
+
];
|
|
75
|
+
const filteredEvents = data.events.filter((event)=>{
|
|
76
|
+
if (event.endsWith("*")) return true;
|
|
77
|
+
if (event.startsWith("s3:ObjectCreated:")) return !data.events.includes("s3:ObjectCreated:*");
|
|
78
|
+
if (event.startsWith("s3:ObjectRemoved:")) return !data.events.includes("s3:ObjectRemoved:*");
|
|
79
|
+
if (event.startsWith("s3:LifecycleExpiration:")) return !data.events.includes("s3:LifecycleExpiration:*");
|
|
80
|
+
return true;
|
|
81
|
+
});
|
|
82
|
+
const newQueueConfiguration = {
|
|
83
|
+
Id: data.ruleName,
|
|
84
|
+
QueueArn: data.queueArn,
|
|
85
|
+
Events: filteredEvents,
|
|
86
|
+
...filterRules.length > 0 && {
|
|
87
|
+
Filter: {
|
|
88
|
+
Key: {
|
|
89
|
+
FilterRules: filterRules
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
setNotification({
|
|
95
|
+
Bucket: bucketName,
|
|
96
|
+
NotificationConfiguration: {
|
|
97
|
+
QueueConfigurations: [
|
|
98
|
+
...existingNotificationData?.QueueConfigurations || [],
|
|
99
|
+
newQueueConfiguration
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
onSuccess: ()=>{
|
|
104
|
+
showToast({
|
|
105
|
+
open: true,
|
|
106
|
+
message: "Notification created successfully",
|
|
107
|
+
status: "success"
|
|
108
|
+
});
|
|
109
|
+
navigate(`/buckets/${bucketName}`);
|
|
110
|
+
},
|
|
111
|
+
onError: (error)=>{
|
|
112
|
+
const errorMessage = error instanceof Error ? error.message : "Failed to create notification";
|
|
113
|
+
showToast({
|
|
114
|
+
open: true,
|
|
115
|
+
message: errorMessage,
|
|
116
|
+
status: "error"
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}, [
|
|
121
|
+
bucketName,
|
|
122
|
+
setNotification,
|
|
123
|
+
navigate,
|
|
124
|
+
showToast,
|
|
125
|
+
existingNotificationData
|
|
126
|
+
]);
|
|
127
|
+
if ("pending" === notificationStatus) return /*#__PURE__*/ jsx(Loader, {
|
|
128
|
+
centered: true,
|
|
129
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
130
|
+
children: "Loading..."
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
return /*#__PURE__*/ jsx(FormProvider, {
|
|
134
|
+
...methods,
|
|
135
|
+
children: /*#__PURE__*/ jsxs(Form, {
|
|
136
|
+
layout: {
|
|
137
|
+
kind: "page",
|
|
138
|
+
title: "Create Bucket Notification"
|
|
139
|
+
},
|
|
140
|
+
requireMode: "partial",
|
|
141
|
+
onSubmit: handleSubmit(onSubmit),
|
|
142
|
+
rightActions: /*#__PURE__*/ jsxs(Stack, {
|
|
143
|
+
gap: "r16",
|
|
144
|
+
children: [
|
|
145
|
+
/*#__PURE__*/ jsx(Button, {
|
|
146
|
+
id: "cancel-btn",
|
|
147
|
+
variant: "outline",
|
|
148
|
+
type: "button",
|
|
149
|
+
label: "Cancel",
|
|
150
|
+
onClick: handleCancel,
|
|
151
|
+
disabled: isSaving
|
|
152
|
+
}),
|
|
153
|
+
/*#__PURE__*/ jsx(Button, {
|
|
154
|
+
id: "create-notification-btn",
|
|
155
|
+
type: "submit",
|
|
156
|
+
variant: "primary",
|
|
157
|
+
label: "Create",
|
|
158
|
+
disabled: !isDirty || !isValid || isSaving
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}),
|
|
162
|
+
children: [
|
|
163
|
+
/*#__PURE__*/ jsx(FormSection, {
|
|
164
|
+
forceLabelWidth: convertRemToPixels(13),
|
|
165
|
+
children: /*#__PURE__*/ jsx(FormGroup, {
|
|
166
|
+
label: "Rule name",
|
|
167
|
+
id: "ruleName",
|
|
168
|
+
direction: "horizontal",
|
|
169
|
+
error: errors?.ruleName?.message,
|
|
170
|
+
helpErrorPosition: "bottom",
|
|
171
|
+
labelHelpTooltip: /*#__PURE__*/ jsx(Fragment, {}),
|
|
172
|
+
required: true,
|
|
173
|
+
content: /*#__PURE__*/ jsx(Input, {
|
|
174
|
+
id: "ruleName",
|
|
175
|
+
...register("ruleName")
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
}),
|
|
179
|
+
/*#__PURE__*/ jsx(EventsSection, {}),
|
|
180
|
+
/*#__PURE__*/ jsx(FormSection, {
|
|
181
|
+
forceLabelWidth: convertRemToPixels(13),
|
|
182
|
+
children: /*#__PURE__*/ jsx(FormGroup, {
|
|
183
|
+
label: "Destination Queue",
|
|
184
|
+
id: "queueArn",
|
|
185
|
+
direction: "horizontal",
|
|
186
|
+
error: errors?.queueArn?.message,
|
|
187
|
+
helpErrorPosition: "bottom",
|
|
188
|
+
labelHelpTooltip: /*#__PURE__*/ jsx(Fragment, {}),
|
|
189
|
+
required: true,
|
|
190
|
+
content: /*#__PURE__*/ jsx(Input, {
|
|
191
|
+
id: "queueArn",
|
|
192
|
+
placeholder: "arn:aws:sqs:us-east-1:1xx:name",
|
|
193
|
+
...register("queueArn")
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ jsx(FormSection, {
|
|
198
|
+
title: {
|
|
199
|
+
name: "Filters"
|
|
200
|
+
},
|
|
201
|
+
children: /*#__PURE__*/ jsxs(Stack, {
|
|
202
|
+
direction: "horizontal",
|
|
203
|
+
gap: "r16",
|
|
204
|
+
children: [
|
|
205
|
+
/*#__PURE__*/ jsx(FormGroup, {
|
|
206
|
+
label: "Prefix",
|
|
207
|
+
id: "prefix",
|
|
208
|
+
direction: "horizontal",
|
|
209
|
+
content: /*#__PURE__*/ jsx(Input, {
|
|
210
|
+
id: "prefix",
|
|
211
|
+
placeholder: "",
|
|
212
|
+
size: "2/3",
|
|
213
|
+
...register("prefix")
|
|
214
|
+
})
|
|
215
|
+
}),
|
|
216
|
+
/*#__PURE__*/ jsx(FormGroup, {
|
|
217
|
+
label: "Suffix",
|
|
218
|
+
id: "suffix",
|
|
219
|
+
direction: "horizontal",
|
|
220
|
+
content: /*#__PURE__*/ jsx(Input, {
|
|
221
|
+
id: "suffix",
|
|
222
|
+
placeholder: "",
|
|
223
|
+
size: "2/3",
|
|
224
|
+
...register("suffix")
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export { BucketNotificationCreatePage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EventsSection(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox, FormGroup, FormSection, Stack, Text, Wrap } from "@scality/core-ui";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
5
|
+
import { objectCreationEvents, objectDeletionEvents, othersEvents } from "./events.js";
|
|
6
|
+
import { Box } from "@scality/core-ui/dist/next";
|
|
7
|
+
function EventsSection() {
|
|
8
|
+
const { control, formState: { errors } } = useFormContext();
|
|
9
|
+
const toggleEvent = useCallback((currentEvents, eventValue, onChange)=>{
|
|
10
|
+
const isWildcard = eventValue.endsWith("*");
|
|
11
|
+
const isSelected = currentEvents.includes(eventValue);
|
|
12
|
+
if (isWildcard) if (isSelected) {
|
|
13
|
+
const relatedEvents = eventValue.startsWith("s3:ObjectCreated") ? objectCreationEvents.events : eventValue.startsWith("s3:ObjectRemoved") ? objectDeletionEvents.events : eventValue.startsWith("s3:LifecycleExpiration") ? othersEvents.events.filter((e)=>e.startsWith("s3:LifecycleExpiration")) : [
|
|
14
|
+
eventValue
|
|
15
|
+
];
|
|
16
|
+
onChange(currentEvents.filter((e)=>!relatedEvents.includes(e)));
|
|
17
|
+
} else {
|
|
18
|
+
const relatedEvents = eventValue.startsWith("s3:ObjectCreated") ? objectCreationEvents.events : eventValue.startsWith("s3:ObjectRemoved") ? objectDeletionEvents.events : eventValue.startsWith("s3:LifecycleExpiration") ? othersEvents.events.filter((e)=>e.startsWith("s3:LifecycleExpiration")) : [
|
|
19
|
+
eventValue
|
|
20
|
+
];
|
|
21
|
+
const newEvents = [
|
|
22
|
+
...currentEvents.filter((e)=>!relatedEvents.includes(e)),
|
|
23
|
+
...relatedEvents
|
|
24
|
+
];
|
|
25
|
+
onChange(newEvents);
|
|
26
|
+
}
|
|
27
|
+
else onChange(isSelected ? currentEvents.filter((e)=>e !== eventValue) : [
|
|
28
|
+
...currentEvents,
|
|
29
|
+
eventValue
|
|
30
|
+
]);
|
|
31
|
+
}, []);
|
|
32
|
+
const isEventDisabled = (event, selectedEvents)=>{
|
|
33
|
+
if (event.endsWith("*")) return false;
|
|
34
|
+
if (event.startsWith("s3:ObjectCreated")) return selectedEvents.includes("s3:ObjectCreated:*");
|
|
35
|
+
if (event.startsWith("s3:ObjectRemoved")) return selectedEvents.includes("s3:ObjectRemoved:*");
|
|
36
|
+
if (event.startsWith("s3:LifecycleExpiration")) return selectedEvents.includes("s3:LifecycleExpiration:*");
|
|
37
|
+
return false;
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/ jsxs(FormSection, {
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ jsx(Wrap, {
|
|
42
|
+
children: /*#__PURE__*/ jsx(Box, {
|
|
43
|
+
display: "flex",
|
|
44
|
+
flexDirection: "row",
|
|
45
|
+
gap: "r8",
|
|
46
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
47
|
+
isEmphazed: true,
|
|
48
|
+
color: "textPrimary",
|
|
49
|
+
children: "Events"
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
/*#__PURE__*/ jsx(FormGroup, {
|
|
54
|
+
id: "events",
|
|
55
|
+
label: "",
|
|
56
|
+
direction: "vertical",
|
|
57
|
+
error: errors?.events?.message,
|
|
58
|
+
content: /*#__PURE__*/ jsx(Controller, {
|
|
59
|
+
control: control,
|
|
60
|
+
name: "events",
|
|
61
|
+
render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsxs(Stack, {
|
|
62
|
+
direction: "vertical",
|
|
63
|
+
gap: "r16",
|
|
64
|
+
children: [
|
|
65
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
66
|
+
direction: "vertical",
|
|
67
|
+
gap: "r8",
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ jsx(Text, {
|
|
70
|
+
color: "textPrimary",
|
|
71
|
+
children: objectCreationEvents.label
|
|
72
|
+
}),
|
|
73
|
+
objectCreationEvents.events.map((event)=>/*#__PURE__*/ jsx(Checkbox, {
|
|
74
|
+
id: event,
|
|
75
|
+
label: event,
|
|
76
|
+
checked: value.includes(event),
|
|
77
|
+
disabled: isEventDisabled(event, value),
|
|
78
|
+
onChange: ()=>toggleEvent(value, event, onChange)
|
|
79
|
+
}, event))
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
83
|
+
direction: "vertical",
|
|
84
|
+
gap: "r8",
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ jsx(Text, {
|
|
87
|
+
color: "textPrimary",
|
|
88
|
+
children: objectDeletionEvents.label
|
|
89
|
+
}),
|
|
90
|
+
objectDeletionEvents.events.map((event)=>/*#__PURE__*/ jsx(Checkbox, {
|
|
91
|
+
id: event,
|
|
92
|
+
label: event,
|
|
93
|
+
checked: value.includes(event),
|
|
94
|
+
disabled: isEventDisabled(event, value),
|
|
95
|
+
onChange: ()=>toggleEvent(value, event, onChange)
|
|
96
|
+
}, event))
|
|
97
|
+
]
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
100
|
+
direction: "vertical",
|
|
101
|
+
gap: "r8",
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ jsx(Text, {
|
|
104
|
+
color: "textPrimary",
|
|
105
|
+
children: othersEvents.label
|
|
106
|
+
}),
|
|
107
|
+
othersEvents.events.map((event)=>/*#__PURE__*/ jsx(Checkbox, {
|
|
108
|
+
id: event,
|
|
109
|
+
label: event,
|
|
110
|
+
checked: value.includes(event),
|
|
111
|
+
disabled: isEventDisabled(event, value),
|
|
112
|
+
onChange: ()=>toggleEvent(value, event, onChange)
|
|
113
|
+
}, event))
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
export { EventsSection };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const objectCreationEvents: {
|
|
2
|
+
label: string;
|
|
3
|
+
events: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare const objectDeletionEvents: {
|
|
6
|
+
label: string;
|
|
7
|
+
events: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const othersEvents: {
|
|
10
|
+
label: string;
|
|
11
|
+
events: string[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const objectCreationEvents = {
|
|
2
|
+
label: "Object creation",
|
|
3
|
+
events: [
|
|
4
|
+
"s3:ObjectCreated:*",
|
|
5
|
+
"s3:ObjectCreated:Put",
|
|
6
|
+
"s3:ObjectCreated:Copy",
|
|
7
|
+
"s3:ObjectCreated:CompleteMultipartUpload"
|
|
8
|
+
]
|
|
9
|
+
};
|
|
10
|
+
const objectDeletionEvents = {
|
|
11
|
+
label: "Object deletion",
|
|
12
|
+
events: [
|
|
13
|
+
"s3:ObjectRemoved:*",
|
|
14
|
+
"s3:ObjectRemoved:Delete",
|
|
15
|
+
"s3:ObjectRemoved:DeleteMarkerCreated"
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
const othersEvents = {
|
|
19
|
+
label: "Others",
|
|
20
|
+
events: [
|
|
21
|
+
"s3:Replication:OperationFailedReplication",
|
|
22
|
+
"s3:LifecycleExpiration:*",
|
|
23
|
+
"s3:LifecycleExpiration:DeleteMarkerCreated",
|
|
24
|
+
"s3:LifecycleExpiration:Delete"
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
export { objectCreationEvents, objectDeletionEvents, othersEvents };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { DeleteBucketButton } from "./buckets/DeleteBucketButton";
|
|
2
|
+
export { BucketList } from "./buckets/BucketList";
|
|
3
|
+
export { BucketOverview, BucketOverviewSection, BucketOverviewField, } from "./buckets/BucketOverview";
|
|
4
|
+
export { BucketPage } from "./buckets/BucketPage";
|
|
5
|
+
export { BucketPolicyPage } from "./buckets/BucketPolicyPage";
|
|
6
|
+
export { BucketLifecycleFormPage } from "./buckets/BucketLifecycleFormPage";
|
|
7
|
+
export { BucketReplicationFormPage } from "./buckets/BucketReplicationFormPage";
|
|
8
|
+
export { BucketNotificationCreatePage } from "./buckets/notifications/BucketNotificationCreatePage";
|
|
9
|
+
export { EmptyBucketButton } from "./buckets/EmptyBucketButton";
|
|
10
|
+
export { BucketCreate, baseBucketCreateSchema, bucketNameValidationSchema, bucketErrorMessage, type BucketCreateFormData, } from "./buckets/BucketCreate";
|
|
11
|
+
export { BucketVersioning } from "./buckets/BucketVersioning";
|
|
12
|
+
export { UploadButton } from "./objects/UploadButton";
|
|
13
|
+
export { CreateFolderButton } from "./objects/CreateFolderButton";
|
|
14
|
+
export { ObjectDetails } from "./objects/ObjectDetails";
|
|
15
|
+
export { ObjectList } from "./objects/ObjectList";
|
|
16
|
+
export { ObjectPage } from "./objects/ObjectPage";
|
|
17
|
+
export { ObjectLockSettings } from "./objects/ObjectLock/ObjectLockSettings";
|
|
18
|
+
export { EditRetentionButton } from "./objects/ObjectLock/EditRetentionButton";
|
|
19
|
+
export { MetadataSearch } from "./search/MetadataSearch";
|
|
20
|
+
export { ArrayFieldActions } from "./ui/ArrayFieldActions";
|
|
21
|
+
export { DataBrowserProvider, useDataBrowserContext, useDataBrowserTheme, } from "./providers/DataBrowserProvider";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DeleteBucketButton } from "./buckets/DeleteBucketButton.js";
|
|
2
|
+
import { BucketList } from "./buckets/BucketList.js";
|
|
3
|
+
import { BucketOverview, BucketOverviewField, BucketOverviewSection } from "./buckets/BucketOverview.js";
|
|
4
|
+
import { BucketPage } from "./buckets/BucketPage.js";
|
|
5
|
+
import { BucketPolicyPage } from "./buckets/BucketPolicyPage.js";
|
|
6
|
+
import { BucketLifecycleFormPage } from "./buckets/BucketLifecycleFormPage.js";
|
|
7
|
+
import { BucketReplicationFormPage } from "./buckets/BucketReplicationFormPage.js";
|
|
8
|
+
import { BucketNotificationCreatePage } from "./buckets/notifications/BucketNotificationCreatePage.js";
|
|
9
|
+
import { EmptyBucketButton } from "./buckets/EmptyBucketButton.js";
|
|
10
|
+
import { BucketCreate, baseBucketCreateSchema, bucketErrorMessage, bucketNameValidationSchema } from "./buckets/BucketCreate.js";
|
|
11
|
+
import { BucketVersioning } from "./buckets/BucketVersioning.js";
|
|
12
|
+
import { UploadButton } from "./objects/UploadButton.js";
|
|
13
|
+
import { CreateFolderButton } from "./objects/CreateFolderButton.js";
|
|
14
|
+
import { ObjectDetails } from "./objects/ObjectDetails/index.js";
|
|
15
|
+
import { ObjectList } from "./objects/ObjectList.js";
|
|
16
|
+
import { ObjectPage } from "./objects/ObjectPage.js";
|
|
17
|
+
import { ObjectLockSettings } from "./objects/ObjectLock/ObjectLockSettings.js";
|
|
18
|
+
import { EditRetentionButton } from "./objects/ObjectLock/EditRetentionButton.js";
|
|
19
|
+
import { MetadataSearch } from "./search/MetadataSearch.js";
|
|
20
|
+
import { ArrayFieldActions } from "./ui/ArrayFieldActions.js";
|
|
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 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "@scality/core-ui";
|
|
3
|
+
import { useNavigate } from "react-router-dom";
|
|
4
|
+
function ArrowNavigation({ path }) {
|
|
5
|
+
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)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export { ArrowNavigation as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { To } from "react-router-dom";
|
|
3
|
+
export declare const HeadTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
interface BrowserPageLayoutProps {
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
leftPanel: React.ReactNode;
|
|
7
|
+
rightPanel: React.ReactNode;
|
|
8
|
+
withArrowNavigation?: boolean;
|
|
9
|
+
arrowNavigationPath?: To;
|
|
10
|
+
}
|
|
11
|
+
export declare const BrowserPageLayout: React.FC<BrowserPageLayoutProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AppContainer, Icon, Stack, TwoPanelLayout } from "@scality/core-ui";
|
|
3
|
+
import { fontSize } from "@scality/core-ui/dist/style/theme";
|
|
4
|
+
import "react";
|
|
5
|
+
import styled_components from "styled-components";
|
|
6
|
+
import ArrowNavigation from "./ArrowNavigation.js";
|
|
7
|
+
const HeadTitle = styled_components.div`
|
|
8
|
+
display: flex;
|
|
9
|
+
color: ${(props)=>props.theme.textPrimary};
|
|
10
|
+
font-size: ${fontSize.large};
|
|
11
|
+
align-items: center;
|
|
12
|
+
`;
|
|
13
|
+
const BrowserPageLayout = ({ title, leftPanel, rightPanel, withArrowNavigation = false, arrowNavigationPath })=>/*#__PURE__*/ jsxs(AppContainer, {
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ jsx(AppContainer.OverallSummary, {
|
|
16
|
+
children: /*#__PURE__*/ jsxs(Stack, {
|
|
17
|
+
gap: "r20",
|
|
18
|
+
children: [
|
|
19
|
+
withArrowNavigation && arrowNavigationPath && /*#__PURE__*/ jsx(ArrowNavigation, {
|
|
20
|
+
path: arrowNavigationPath
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
23
|
+
name: "Account",
|
|
24
|
+
size: "2x",
|
|
25
|
+
withWrapper: true
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ jsx(HeadTitle, {
|
|
28
|
+
children: title
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ jsx(AppContainer.MainContent, {
|
|
34
|
+
background: "backgroundLevel1",
|
|
35
|
+
children: /*#__PURE__*/ jsx(TwoPanelLayout, {
|
|
36
|
+
panelsRatio: "65-35",
|
|
37
|
+
leftPanel: {
|
|
38
|
+
children: /*#__PURE__*/ jsx(Fragment, {
|
|
39
|
+
children: leftPanel
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
rightPanel: {
|
|
43
|
+
children: /*#__PURE__*/ jsx(Fragment, {
|
|
44
|
+
children: rightPanel
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
export { BrowserPageLayout, HeadTitle };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface CreateFolderButtonProps {
|
|
3
|
+
/**
|
|
4
|
+
* The S3 bucket name where folder will be created
|
|
5
|
+
*/
|
|
6
|
+
bucket: string;
|
|
7
|
+
/**
|
|
8
|
+
* The prefix/path where folder will be created within the bucket
|
|
9
|
+
*/
|
|
10
|
+
prefix?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Button label text
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Button variant
|
|
17
|
+
*/
|
|
18
|
+
variant?: "primary" | "secondary" | "outline";
|
|
19
|
+
/**
|
|
20
|
+
* Called when folder creation is successful
|
|
21
|
+
*/
|
|
22
|
+
onFolderSuccess?: (folderName: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Called when folder creation fails
|
|
25
|
+
*/
|
|
26
|
+
onFolderError?: (error: Error, folderName: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const CreateFolderButton: React.FC<CreateFolderButtonProps>;
|
|
29
|
+
export default CreateFolderButton;
|