@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,159 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormGroup, FormSection, Stack, Text } from "@scality/core-ui";
|
|
3
|
+
import { convertRemToPixels } from "@scality/core-ui/dist/components/tablev2/TableUtils";
|
|
4
|
+
import { Box, Input, Select } from "@scality/core-ui/dist/next";
|
|
5
|
+
import { ArrayFieldActions } from "./ArrayFieldActions.js";
|
|
6
|
+
const filterTypeOptions = [
|
|
7
|
+
{
|
|
8
|
+
value: "none",
|
|
9
|
+
label: "All objects"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
value: "prefix",
|
|
13
|
+
label: "Prefix filter"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
value: "tags",
|
|
17
|
+
label: "Tags filter"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "and",
|
|
21
|
+
label: "Prefix and tags filter"
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
const shouldShowPrefix = (filterType)=>"prefix" === filterType || "and" === filterType;
|
|
25
|
+
const shouldShowTags = (filterType)=>"tags" === filterType || "and" === filterType;
|
|
26
|
+
function FilterFormSection({ filterType, onFilterTypeChange, prefixRegister, tagFields, tagKeyRegister, tagValueRegister, getTagKeyValue, getTagValueValue, appendTag, removeTag, errors, forceLabelWidth = convertRemToPixels(15) }) {
|
|
27
|
+
return /*#__PURE__*/ jsxs(FormSection, {
|
|
28
|
+
title: {
|
|
29
|
+
name: "Filter"
|
|
30
|
+
},
|
|
31
|
+
forceLabelWidth: forceLabelWidth,
|
|
32
|
+
children: [
|
|
33
|
+
/*#__PURE__*/ jsx(FormGroup, {
|
|
34
|
+
label: "Filter",
|
|
35
|
+
id: "filterType",
|
|
36
|
+
direction: "horizontal",
|
|
37
|
+
content: /*#__PURE__*/ jsx(Select, {
|
|
38
|
+
id: "filterType",
|
|
39
|
+
value: filterType,
|
|
40
|
+
onChange: onFilterTypeChange,
|
|
41
|
+
children: filterTypeOptions.map((option)=>/*#__PURE__*/ jsx(Select.Option, {
|
|
42
|
+
value: option.value,
|
|
43
|
+
children: option.label
|
|
44
|
+
}, option.value))
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
shouldShowPrefix(filterType) ? /*#__PURE__*/ jsx(FormGroup, {
|
|
48
|
+
label: "Prefix",
|
|
49
|
+
id: "prefix",
|
|
50
|
+
direction: "horizontal",
|
|
51
|
+
error: errors?.prefix?.message,
|
|
52
|
+
helpErrorPosition: "bottom",
|
|
53
|
+
required: "prefix" === filterType,
|
|
54
|
+
content: /*#__PURE__*/ jsx(Input, {
|
|
55
|
+
id: "prefix",
|
|
56
|
+
placeholder: "folder/",
|
|
57
|
+
...prefixRegister
|
|
58
|
+
})
|
|
59
|
+
}) : /*#__PURE__*/ jsx(Fragment, {}),
|
|
60
|
+
shouldShowTags(filterType) ? /*#__PURE__*/ jsx(FormGroup, {
|
|
61
|
+
label: "Tags",
|
|
62
|
+
id: "tags",
|
|
63
|
+
direction: "horizontal",
|
|
64
|
+
error: errors?.tags?.message,
|
|
65
|
+
helpErrorPosition: "bottom",
|
|
66
|
+
required: true,
|
|
67
|
+
content: /*#__PURE__*/ jsxs(Stack, {
|
|
68
|
+
direction: "vertical",
|
|
69
|
+
gap: "r8",
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
72
|
+
gap: "r8",
|
|
73
|
+
children: [
|
|
74
|
+
/*#__PURE__*/ jsx(Box, {
|
|
75
|
+
flex: "1",
|
|
76
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
77
|
+
color: "textSecondary",
|
|
78
|
+
children: "Key"
|
|
79
|
+
})
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ jsx(Box, {
|
|
82
|
+
flex: "1",
|
|
83
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
84
|
+
color: "textSecondary",
|
|
85
|
+
children: "Value"
|
|
86
|
+
})
|
|
87
|
+
}),
|
|
88
|
+
/*#__PURE__*/ jsx(Box, {
|
|
89
|
+
width: "80px"
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
}),
|
|
93
|
+
tagFields.map((field, index)=>/*#__PURE__*/ jsxs(Stack, {
|
|
94
|
+
gap: "r8",
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ jsx(Input, {
|
|
97
|
+
id: `tag-key-${index}`,
|
|
98
|
+
placeholder: "Key",
|
|
99
|
+
size: "1/2",
|
|
100
|
+
...tagKeyRegister(index)
|
|
101
|
+
}),
|
|
102
|
+
/*#__PURE__*/ jsx(Input, {
|
|
103
|
+
id: `tag-value-${index}`,
|
|
104
|
+
placeholder: "Value",
|
|
105
|
+
size: "1/2",
|
|
106
|
+
...tagValueRegister(index)
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ jsx(ArrayFieldActions, {
|
|
109
|
+
showAdd: index === tagFields.length - 1,
|
|
110
|
+
onRemove: ()=>removeTag(index),
|
|
111
|
+
onAdd: ()=>appendTag({
|
|
112
|
+
key: "",
|
|
113
|
+
value: ""
|
|
114
|
+
}),
|
|
115
|
+
canRemove: tagFields.length > 1,
|
|
116
|
+
canAdd: !!getTagKeyValue(index) && !!getTagValueValue(index),
|
|
117
|
+
removeLabel: "Remove tag",
|
|
118
|
+
addLabel: "Add tag"
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
}, field.id))
|
|
122
|
+
]
|
|
123
|
+
})
|
|
124
|
+
}) : /*#__PURE__*/ jsx(Fragment, {})
|
|
125
|
+
]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const createFilterValidationSchema = (Joi)=>({
|
|
129
|
+
filterType: Joi.string().valid("none", "prefix", "tags", "and").required(),
|
|
130
|
+
prefix: Joi.when("filterType", {
|
|
131
|
+
is: "prefix",
|
|
132
|
+
then: Joi.string().required().min(1).messages({
|
|
133
|
+
"string.empty": "Prefix is required when using prefix filter",
|
|
134
|
+
"string.min": "Prefix is required when using prefix filter"
|
|
135
|
+
}),
|
|
136
|
+
otherwise: Joi.when("filterType", {
|
|
137
|
+
is: "and",
|
|
138
|
+
then: Joi.string().allow("").optional(),
|
|
139
|
+
otherwise: Joi.any()
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
tags: Joi.when("filterType", {
|
|
143
|
+
is: Joi.valid("tags", "and"),
|
|
144
|
+
then: Joi.array().items(Joi.object({
|
|
145
|
+
key: Joi.string().required().max(128).messages({
|
|
146
|
+
"string.empty": "Tag key is required",
|
|
147
|
+
"string.max": "Tag key must not exceed 128 characters"
|
|
148
|
+
}),
|
|
149
|
+
value: Joi.string().required().max(256).messages({
|
|
150
|
+
"string.empty": "Tag value is required",
|
|
151
|
+
"string.max": "Tag value must not exceed 256 characters"
|
|
152
|
+
})
|
|
153
|
+
})).min(1).messages({
|
|
154
|
+
"array.min": "At least one tag is required when using tag filter"
|
|
155
|
+
}),
|
|
156
|
+
otherwise: Joi.array().optional()
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
export { FilterFormSection, createFilterValidationSchema };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IconColor, IconName } from "@scality/core-ui/dist/components/icon/Icon.component";
|
|
2
|
+
export declare const SearchContainer: import("styled-components").StyledComponent<"form", any, {
|
|
3
|
+
isHidden?: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const SearchInputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const HintsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const HintItem: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const HintsTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
type SearchIcon = {
|
|
10
|
+
name: IconName;
|
|
11
|
+
color: IconColor;
|
|
12
|
+
};
|
|
13
|
+
export declare const searchIcon: ({ isMetadata, isError, }: {
|
|
14
|
+
isMetadata: boolean;
|
|
15
|
+
isError: boolean;
|
|
16
|
+
}) => SearchIcon;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { spacing } from "@scality/core-ui/dist/spacing";
|
|
2
|
+
import styled_components from "styled-components";
|
|
3
|
+
const SearchContainer = styled_components.form`
|
|
4
|
+
flex: 1 0 auto;
|
|
5
|
+
display: flex;
|
|
6
|
+
max-width: 600px;
|
|
7
|
+
margin-right: ${spacing.r20};
|
|
8
|
+
visibility: ${(props)=>props.isHidden ? "hidden" : "visible"};
|
|
9
|
+
gap: ${spacing.r8};
|
|
10
|
+
`;
|
|
11
|
+
const SearchInputContainer = styled_components.div`
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
margin-right: ${spacing.r4};
|
|
16
|
+
align-items: center;
|
|
17
|
+
`;
|
|
18
|
+
const HintsContainer = styled_components.div`
|
|
19
|
+
position: absolute;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
background-color: ${(props)=>props.theme.backgroundLevel1};
|
|
22
|
+
padding: ${spacing.r16};
|
|
23
|
+
margin-top: ${spacing.r40};
|
|
24
|
+
`;
|
|
25
|
+
const HintItem = styled_components.div`
|
|
26
|
+
padding: ${spacing.r8} ${spacing.r12};
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
color: ${(props)=>props.theme.textPrimary};
|
|
29
|
+
font-size: 0.875rem;
|
|
30
|
+
transition: background-color 0.2s ease;
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
background: ${(props)=>props.theme.backgroundLevel2};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:last-child {
|
|
37
|
+
border-bottom: none;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
const HintsTitle = styled_components.div`
|
|
41
|
+
font-style: italic;
|
|
42
|
+
padding: ${spacing.r2} 0px ${spacing.r8} ${spacing.r8};
|
|
43
|
+
color: ${(props)=>props.theme.textSecondary};
|
|
44
|
+
`;
|
|
45
|
+
const searchIcon = ({ isMetadata, isError })=>{
|
|
46
|
+
if (isError) return {
|
|
47
|
+
name: "Close",
|
|
48
|
+
color: "statusCritical"
|
|
49
|
+
};
|
|
50
|
+
if (isMetadata) return {
|
|
51
|
+
name: "Check",
|
|
52
|
+
color: "statusHealthy"
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
name: "Search",
|
|
56
|
+
color: "textSecondary"
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export { HintItem, HintsContainer, HintsTitle, SearchContainer, SearchInputContainer, searchIcon };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const Table: ({ children, ...props }: {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const Body: ({ children, ...props }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Group: ({ children, ...props }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const GroupName: ({ children, ...props }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const GroupContent: ({ children, ...props }: {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Row: ({ children, ...props }: {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const Key: import("styled-components").StyledComponent<"div", any, {
|
|
20
|
+
principal?: boolean;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
} & {
|
|
23
|
+
size?: string;
|
|
24
|
+
}, never>;
|
|
25
|
+
export declare const Value: import("styled-components").StyledComponent<"div", any, {
|
|
26
|
+
width?: string;
|
|
27
|
+
}, never>;
|
|
28
|
+
export declare const TableContainer: ({ children, ...props }: {
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const GroupValues: import("styled-components").StyledComponent<"div", any, {
|
|
32
|
+
size?: string;
|
|
33
|
+
}, never>;
|
|
34
|
+
export declare const ExtraCell: import("styled-components").StyledComponent<"div", any, {
|
|
35
|
+
marginLeft?: string;
|
|
36
|
+
}, never>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, spacing } from "@scality/core-ui";
|
|
3
|
+
import { Box } from "@scality/core-ui/dist/next";
|
|
4
|
+
import styled_components from "styled-components";
|
|
5
|
+
const Table = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
6
|
+
height: "100%",
|
|
7
|
+
overflow: "auto",
|
|
8
|
+
width: "100%",
|
|
9
|
+
...props,
|
|
10
|
+
children: children
|
|
11
|
+
});
|
|
12
|
+
const Body = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
13
|
+
display: "flex",
|
|
14
|
+
flexDirection: "column",
|
|
15
|
+
...props,
|
|
16
|
+
children: children
|
|
17
|
+
});
|
|
18
|
+
const Group = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
19
|
+
marginBottom: spacing.r28,
|
|
20
|
+
...props,
|
|
21
|
+
children: children
|
|
22
|
+
});
|
|
23
|
+
const GroupName = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
24
|
+
marginBottom: spacing.r10,
|
|
25
|
+
...props,
|
|
26
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
27
|
+
isEmphazed: true,
|
|
28
|
+
color: "textPrimary",
|
|
29
|
+
children: children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
const GroupContent = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
...props,
|
|
36
|
+
children: children
|
|
37
|
+
});
|
|
38
|
+
const Row = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
39
|
+
position: "relative",
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexDirection: "row",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
marginBottom: spacing.r8,
|
|
44
|
+
minHeight: spacing.r28,
|
|
45
|
+
...props,
|
|
46
|
+
children: children
|
|
47
|
+
});
|
|
48
|
+
const RawKey = styled_components.div`
|
|
49
|
+
color: ${(props)=>props.principal ? props.theme.textPrimary : props.theme?.textSecondary};
|
|
50
|
+
font-weight: ${(props)=>props.principal ? "bold" : "normal"};
|
|
51
|
+
${(props)=>props.required ? `
|
|
52
|
+
&:after {
|
|
53
|
+
content: '*';
|
|
54
|
+
}
|
|
55
|
+
` : ""}
|
|
56
|
+
`;
|
|
57
|
+
const Key = styled_components(RawKey)`
|
|
58
|
+
&& {
|
|
59
|
+
flex: ${(props)=>props.size || "0.35"};
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
const Value = styled_components.div`
|
|
64
|
+
flex: 0.65;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
color: ${(props)=>props.theme?.textPrimary};
|
|
68
|
+
width: ${(props)=>props.width};
|
|
69
|
+
`;
|
|
70
|
+
const TableContainer = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
71
|
+
display: "flex",
|
|
72
|
+
flexDirection: "column",
|
|
73
|
+
height: "100%",
|
|
74
|
+
...props,
|
|
75
|
+
children: children
|
|
76
|
+
});
|
|
77
|
+
const GroupValues = styled_components.div`
|
|
78
|
+
display: flex;
|
|
79
|
+
flex: ${(props)=>props.size || "0.65"};
|
|
80
|
+
justify-content: space-between;
|
|
81
|
+
align-items: center;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
`;
|
|
84
|
+
const ExtraCell = styled_components.div`
|
|
85
|
+
margin-left: ${(props)=>props.marginLeft || "1.429rem"};
|
|
86
|
+
`;
|
|
87
|
+
export { Body, ExtraCell, Group, GroupContent, GroupName, GroupValues, Key, Row, Table, TableContainer, Value };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { S3ClientConfiguration } from "./types";
|
|
2
|
+
import type { S3BrowserConfig, S3Credentials } from "../types";
|
|
3
|
+
import { CoreUIThemeName } from "@scality/core-ui/dist/style/theme";
|
|
4
|
+
interface RuntimeConfig {
|
|
5
|
+
s3: {
|
|
6
|
+
endpoint?: string;
|
|
7
|
+
region: string;
|
|
8
|
+
forcePathStyle?: boolean;
|
|
9
|
+
};
|
|
10
|
+
theme?: CoreUIThemeName;
|
|
11
|
+
basePath?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Configuration factory that uses build-time constants
|
|
15
|
+
* No runtime environment detection or hardcoded values
|
|
16
|
+
*/
|
|
17
|
+
export declare class S3ConfigurationFactory {
|
|
18
|
+
/**
|
|
19
|
+
* Load runtime configuration from config.json
|
|
20
|
+
* Should be called at app startup
|
|
21
|
+
*/
|
|
22
|
+
static loadRuntimeConfig(configUrl: string): Promise<RuntimeConfig | null>;
|
|
23
|
+
private static getBuildTimeConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Create S3 client configuration based on build-time settings
|
|
26
|
+
*/
|
|
27
|
+
static createClientConfiguration(credentials: S3Credentials): S3BrowserConfig & {
|
|
28
|
+
credentials: S3Credentials;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Create proxy middleware configuration
|
|
32
|
+
*/
|
|
33
|
+
static createProxyConfiguration(): S3ClientConfiguration;
|
|
34
|
+
/**
|
|
35
|
+
* Check if proxy middleware should be enabled
|
|
36
|
+
*/
|
|
37
|
+
static shouldUseProxyMiddleware(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get build-time environment info for debugging
|
|
40
|
+
*/
|
|
41
|
+
static getBuildInfo(): {
|
|
42
|
+
environment: string;
|
|
43
|
+
useProxy: boolean;
|
|
44
|
+
s3Endpoint: string;
|
|
45
|
+
proxyEndpoint: string | undefined;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Convenience functions for common use cases
|
|
50
|
+
*/
|
|
51
|
+
export declare const createS3Config: (credentials: S3Credentials) => S3BrowserConfig & {
|
|
52
|
+
credentials: S3Credentials;
|
|
53
|
+
};
|
|
54
|
+
export declare const shouldUseProxy: () => boolean;
|
|
55
|
+
export declare const getProxyConfig: () => S3ClientConfiguration;
|
|
56
|
+
export declare const getBuildInfo: () => {
|
|
57
|
+
environment: string;
|
|
58
|
+
useProxy: boolean;
|
|
59
|
+
s3Endpoint: string;
|
|
60
|
+
proxyEndpoint: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
export declare const loadRuntimeConfig: (configUrl: string) => Promise<RuntimeConfig | null>;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
let runtimeConfig = null;
|
|
2
|
+
class S3ConfigurationFactory {
|
|
3
|
+
static async loadRuntimeConfig(configUrl) {
|
|
4
|
+
try {
|
|
5
|
+
const response = await fetch(configUrl);
|
|
6
|
+
if (response.ok) {
|
|
7
|
+
const data = await response.json();
|
|
8
|
+
runtimeConfig = data;
|
|
9
|
+
if (runtimeConfig?.s3?.endpoint === "origin") runtimeConfig.s3.endpoint = window.location.origin;
|
|
10
|
+
console.log("Loaded runtime configuration:", runtimeConfig);
|
|
11
|
+
return data;
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.warn("Could not load runtime config, using build-time config:", error);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
static getBuildTimeConfig() {
|
|
20
|
+
return {
|
|
21
|
+
s3: __S3_CONFIG__,
|
|
22
|
+
dev: __DEV_CONFIG__,
|
|
23
|
+
isDevelopment: __IS_DEVELOPMENT__,
|
|
24
|
+
isProduction: __IS_PRODUCTION__
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
static createClientConfiguration(credentials) {
|
|
28
|
+
const buildConfig = this.getBuildTimeConfig();
|
|
29
|
+
const s3Config = buildConfig.isProduction && runtimeConfig?.s3 ? runtimeConfig.s3 : buildConfig.s3;
|
|
30
|
+
const baseConfig = {
|
|
31
|
+
credentials,
|
|
32
|
+
region: s3Config.region,
|
|
33
|
+
forcePathStyle: s3Config.forcePathStyle ?? true,
|
|
34
|
+
endpoint: s3Config.endpoint
|
|
35
|
+
};
|
|
36
|
+
if (buildConfig.isDevelopment && buildConfig.dev.useProxy && buildConfig.dev.proxyEndpoint) baseConfig.endpoint = buildConfig.dev.proxyEndpoint;
|
|
37
|
+
return baseConfig;
|
|
38
|
+
}
|
|
39
|
+
static createProxyConfiguration() {
|
|
40
|
+
const buildConfig = this.getBuildTimeConfig();
|
|
41
|
+
const config = {
|
|
42
|
+
endpoint: buildConfig.s3.endpoint,
|
|
43
|
+
region: buildConfig.s3.region,
|
|
44
|
+
forcePathStyle: buildConfig.s3.forcePathStyle,
|
|
45
|
+
useProxy: buildConfig.isDevelopment && buildConfig.dev.useProxy
|
|
46
|
+
};
|
|
47
|
+
if (config.useProxy) config.proxyConfig = {
|
|
48
|
+
realHost: buildConfig.s3.realHost,
|
|
49
|
+
proxyBasePath: buildConfig.dev.proxyBasePath,
|
|
50
|
+
proxyHost: buildConfig.dev.proxyHost,
|
|
51
|
+
proxyPort: buildConfig.dev.proxyPort
|
|
52
|
+
};
|
|
53
|
+
return config;
|
|
54
|
+
}
|
|
55
|
+
static shouldUseProxyMiddleware() {
|
|
56
|
+
const buildConfig = this.getBuildTimeConfig();
|
|
57
|
+
return buildConfig.isDevelopment && buildConfig.dev.useProxy;
|
|
58
|
+
}
|
|
59
|
+
static getBuildInfo() {
|
|
60
|
+
const buildConfig = this.getBuildTimeConfig();
|
|
61
|
+
return {
|
|
62
|
+
environment: buildConfig.isDevelopment ? "development" : "production",
|
|
63
|
+
useProxy: buildConfig.dev.useProxy,
|
|
64
|
+
s3Endpoint: buildConfig.s3.endpoint,
|
|
65
|
+
proxyEndpoint: buildConfig.dev.proxyEndpoint
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const createS3Config = (credentials)=>S3ConfigurationFactory.createClientConfiguration(credentials);
|
|
70
|
+
const shouldUseProxy = ()=>S3ConfigurationFactory.shouldUseProxyMiddleware();
|
|
71
|
+
const getProxyConfig = ()=>S3ConfigurationFactory.createProxyConfiguration();
|
|
72
|
+
const getBuildInfo = ()=>S3ConfigurationFactory.getBuildInfo();
|
|
73
|
+
const loadRuntimeConfig = (configUrl)=>S3ConfigurationFactory.loadRuntimeConfig(configUrl);
|
|
74
|
+
export { S3ConfigurationFactory, createS3Config, getBuildInfo, getProxyConfig, loadRuntimeConfig, shouldUseProxy };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time configuration types injected by RSBuild
|
|
3
|
+
*/
|
|
4
|
+
export interface S3Configuration {
|
|
5
|
+
endpoint: string;
|
|
6
|
+
region: string;
|
|
7
|
+
realHost: string;
|
|
8
|
+
forcePathStyle: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface DevelopmentConfiguration {
|
|
11
|
+
useProxy: boolean;
|
|
12
|
+
proxyEndpoint?: string;
|
|
13
|
+
proxyBasePath: string;
|
|
14
|
+
proxyHost: string;
|
|
15
|
+
proxyPort: number;
|
|
16
|
+
}
|
|
17
|
+
export interface BuildTimeConfig {
|
|
18
|
+
s3: S3Configuration;
|
|
19
|
+
dev: DevelopmentConfiguration;
|
|
20
|
+
isDevelopment: boolean;
|
|
21
|
+
isProduction: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Runtime configuration for S3 client
|
|
25
|
+
*/
|
|
26
|
+
export interface S3ClientConfiguration {
|
|
27
|
+
endpoint: string;
|
|
28
|
+
region: string;
|
|
29
|
+
forcePathStyle: boolean;
|
|
30
|
+
useProxy: boolean;
|
|
31
|
+
proxyConfig?: {
|
|
32
|
+
realHost: string;
|
|
33
|
+
proxyBasePath: string;
|
|
34
|
+
proxyHost: string;
|
|
35
|
+
proxyPort: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Global type declarations for build-time constants
|
|
40
|
+
*/
|
|
41
|
+
declare global {
|
|
42
|
+
const __S3_CONFIG__: S3Configuration;
|
|
43
|
+
const __DEV_CONFIG__: DevelopmentConfiguration;
|
|
44
|
+
const __IS_DEVELOPMENT__: boolean;
|
|
45
|
+
const __IS_PRODUCTION__: boolean;
|
|
46
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|