@scality/data-browser-library 1.0.0-preview.9 → 1.0.3
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/DataBrowserUI.d.ts +12 -0
- package/dist/components/DataBrowserUI.js +99 -0
- package/dist/components/Editor.d.ts +1 -1
- package/dist/components/Editor.js +3 -3
- package/dist/components/__tests__/BucketAccessor.test.js +214 -0
- package/dist/components/__tests__/BucketCorsPage.test.d.ts +1 -0
- package/dist/components/__tests__/BucketCorsPage.test.js +263 -0
- package/dist/components/__tests__/BucketCreate.test.js +271 -105
- package/dist/components/__tests__/BucketDetails.test.d.ts +1 -0
- package/dist/components/__tests__/BucketDetails.test.js +421 -0
- package/dist/components/__tests__/BucketLifecycleFormPage.test.d.ts +13 -0
- package/dist/components/__tests__/BucketLifecycleFormPage.test.js +178 -178
- package/dist/components/__tests__/BucketLifecycleList.test.js +85 -85
- package/dist/components/__tests__/BucketList.test.js +463 -239
- package/dist/components/__tests__/BucketNotificationFormPage.test.d.ts +1 -0
- package/dist/components/__tests__/BucketNotificationFormPage.test.js +348 -0
- package/dist/components/__tests__/BucketNotificationList.test.d.ts +1 -0
- package/dist/components/__tests__/BucketNotificationList.test.js +379 -0
- package/dist/components/__tests__/BucketOverview.test.js +281 -266
- package/dist/components/__tests__/BucketPolicyPage.test.js +151 -99
- package/dist/components/__tests__/BucketReplicationFormPage.test.d.ts +15 -0
- package/dist/components/__tests__/BucketReplicationFormPage.test.js +544 -544
- package/dist/components/__tests__/BucketReplicationList.test.js +106 -106
- package/dist/components/__tests__/CreateFolderButton.test.js +56 -56
- package/dist/components/__tests__/DeleteBucketButton.test.js +64 -64
- package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +47 -47
- package/dist/components/__tests__/DeleteObjectButton.test.js +64 -64
- package/dist/components/__tests__/EmptyBucketButton.test.js +59 -59
- package/dist/components/__tests__/MetadataSearch.test.js +65 -65
- package/dist/components/__tests__/ObjectList.test.js +741 -240
- package/dist/components/__tests__/UploadButton.test.js +45 -45
- package/dist/components/breadcrumb/Breadcrumb.d.ts +6 -0
- package/dist/components/breadcrumb/Breadcrumb.js +37 -0
- package/dist/components/breadcrumb/DataBrowserBreadcrumb.d.ts +1 -0
- package/dist/components/breadcrumb/DataBrowserBreadcrumb.js +10 -0
- package/dist/components/breadcrumb/__tests__/Breadcrumb.test.d.ts +1 -0
- package/dist/components/breadcrumb/__tests__/Breadcrumb.test.js +196 -0
- package/dist/components/breadcrumb/__tests__/DataBrowserBreadcrumb.test.d.ts +1 -0
- package/dist/components/breadcrumb/__tests__/DataBrowserBreadcrumb.test.js +153 -0
- package/dist/components/breadcrumb/__tests__/useBreadcrumbPaths.test.d.ts +1 -0
- package/dist/components/breadcrumb/__tests__/useBreadcrumbPaths.test.js +134 -0
- package/dist/components/breadcrumb/index.d.ts +8 -0
- package/dist/components/breadcrumb/index.js +4 -0
- package/dist/components/breadcrumb/useBreadcrumbPaths.d.ts +2 -0
- package/dist/components/breadcrumb/useBreadcrumbPaths.js +82 -0
- package/dist/components/buckets/BucketAccessor.d.ts +2 -0
- package/dist/components/buckets/BucketAccessor.js +125 -0
- package/dist/components/buckets/BucketConfigEditButton.d.ts +8 -0
- package/dist/components/buckets/{BucketPolicyButton.js → BucketConfigEditButton.js} +9 -5
- package/dist/components/buckets/BucketCorsPage.d.ts +1 -0
- package/dist/components/buckets/BucketCorsPage.js +234 -0
- package/dist/components/buckets/BucketCreate.d.ts +3 -2
- package/dist/components/buckets/BucketCreate.js +93 -47
- package/dist/components/buckets/BucketDetails.d.ts +42 -0
- package/dist/components/buckets/BucketDetails.js +249 -85
- package/dist/components/buckets/BucketLifecycleFormPage.js +225 -191
- package/dist/components/buckets/BucketLifecycleList.d.ts +2 -2
- package/dist/components/buckets/BucketLifecycleList.js +59 -61
- package/dist/components/buckets/BucketList.d.ts +7 -8
- package/dist/components/buckets/BucketList.js +158 -101
- package/dist/components/buckets/BucketLocation.js +4 -4
- package/dist/components/buckets/BucketOverview.d.ts +22 -2
- package/dist/components/buckets/BucketOverview.js +394 -187
- package/dist/components/buckets/BucketPage.js +43 -21
- package/dist/components/buckets/BucketPolicyPage.js +155 -127
- package/dist/components/buckets/BucketReplicationFormPage.js +134 -133
- package/dist/components/buckets/BucketReplicationList.d.ts +2 -2
- package/dist/components/buckets/BucketReplicationList.js +48 -45
- package/dist/components/buckets/BucketVersioning.d.ts +4 -0
- package/dist/components/buckets/BucketVersioning.js +76 -0
- package/dist/components/buckets/DeleteBucketButton.js +8 -8
- package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +2 -2
- package/dist/components/buckets/DeleteBucketConfigRuleButton.js +2 -2
- package/dist/components/buckets/EmptyBucketButton.js +24 -24
- package/dist/components/buckets/EmptyBucketSummary.d.ts +2 -2
- package/dist/components/buckets/EmptyBucketSummary.js +1 -1
- package/dist/components/buckets/EmptyBucketSummaryList.d.ts +1 -1
- package/dist/components/buckets/EmptyBucketSummaryList.js +22 -22
- 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/BucketNotificationFormPage.d.ts +1 -0
- package/dist/components/buckets/notifications/BucketNotificationFormPage.js +316 -0
- package/dist/components/buckets/notifications/BucketNotificationList.d.ts +10 -0
- package/dist/components/buckets/notifications/BucketNotificationList.js +267 -0
- package/dist/components/buckets/notifications/EventsSection.js +145 -29
- package/dist/components/buckets/notifications/__tests__/events.test.d.ts +1 -0
- package/dist/components/buckets/notifications/__tests__/events.test.js +56 -0
- package/dist/components/buckets/notifications/events.d.ts +71 -7
- package/dist/components/buckets/notifications/events.js +98 -16
- package/dist/components/index.d.ts +27 -20
- package/dist/components/index.js +17 -10
- package/dist/components/layouts/ArrowNavigation.d.ts +3 -0
- package/dist/components/layouts/ArrowNavigation.js +28 -0
- package/dist/components/layouts/BrowserPageLayout.d.ts +5 -1
- package/dist/components/layouts/BrowserPageLayout.js +10 -5
- package/dist/components/objects/CreateFolderButton.d.ts +2 -2
- package/dist/components/objects/CreateFolderButton.js +12 -12
- package/dist/components/objects/DeleteObjectButton.d.ts +1 -1
- package/dist/components/objects/DeleteObjectButton.js +19 -21
- package/dist/components/objects/GetPresignedUrlButton.d.ts +7 -0
- package/dist/components/objects/GetPresignedUrlButton.js +255 -0
- package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +2 -2
- package/dist/components/objects/ObjectDetails/ObjectMetadata.js +289 -230
- package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +2 -2
- package/dist/components/objects/ObjectDetails/ObjectSummary.js +540 -138
- package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +2 -2
- package/dist/components/objects/ObjectDetails/ObjectTags.js +103 -123
- package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.d.ts +1 -0
- package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +516 -0
- package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.d.ts +1 -0
- package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.js +1064 -0
- package/dist/components/objects/ObjectDetails/formUtils.d.ts +15 -0
- package/dist/components/objects/ObjectDetails/formUtils.js +7 -0
- package/dist/components/objects/ObjectDetails/index.d.ts +18 -2
- package/dist/components/objects/ObjectDetails/index.js +152 -40
- package/dist/components/objects/ObjectList.d.ts +12 -10
- package/dist/components/objects/ObjectList.js +590 -263
- package/dist/components/objects/ObjectLock/EditRetentionButton.js +4 -4
- package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +15 -15
- package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +1 -1
- package/dist/components/objects/ObjectLock/ObjectLockSettings.js +32 -31
- package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +1 -1
- package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +6 -6
- package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +51 -51
- package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +78 -78
- package/dist/components/objects/ObjectPage.js +12 -8
- package/dist/components/objects/UploadButton.d.ts +3 -3
- package/dist/components/objects/UploadButton.js +10 -10
- package/dist/components/objects/__tests__/GetPresignedUrlButton.test.d.ts +1 -0
- package/dist/components/objects/__tests__/GetPresignedUrlButton.test.js +531 -0
- package/dist/components/providers/DataBrowserProvider.d.ts +23 -12
- package/dist/components/providers/DataBrowserProvider.js +60 -38
- package/dist/components/providers/QueryProvider.d.ts +9 -0
- package/dist/components/providers/QueryProvider.js +21 -0
- package/dist/components/search/MetadataSearch.js +29 -28
- package/dist/components/search/SearchHints.js +1 -1
- package/dist/components/ui/ArrayFieldActions.js +12 -7
- package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +2 -2
- package/dist/components/ui/ConfirmDeleteRuleModal.js +6 -1
- package/dist/components/ui/DeleteObjectModalContent.d.ts +1 -1
- package/dist/components/ui/DeleteObjectModalContent.js +12 -12
- package/dist/components/ui/FilterFormSection.d.ts +2 -2
- package/dist/components/ui/FilterFormSection.js +29 -29
- package/dist/components/ui/Search.elements.d.ts +2 -2
- package/dist/components/ui/Search.elements.js +7 -7
- package/dist/components/ui/Table.elements.d.ts +2 -1
- package/dist/components/ui/Table.elements.js +18 -12
- package/dist/config/__tests__/factory.test.d.ts +1 -0
- package/dist/config/__tests__/factory.test.js +311 -0
- package/dist/config/factory.d.ts +10 -56
- package/dist/config/factory.js +23 -71
- package/dist/config/types.d.ts +212 -34
- package/dist/contexts/DataBrowserUICustomizationContext.d.ts +27 -0
- package/dist/contexts/DataBrowserUICustomizationContext.js +13 -0
- package/dist/hooks/__tests__/useAccessibleBuckets.test.d.ts +1 -0
- package/dist/hooks/__tests__/useAccessibleBuckets.test.js +145 -0
- package/dist/hooks/__tests__/useISVBucketDetection.test.js +45 -45
- package/dist/hooks/__tests__/useIsBucketEmpty.test.js +27 -27
- package/dist/hooks/__tests__/useLoginMutation.test.d.ts +1 -0
- package/dist/hooks/__tests__/useLoginMutation.test.js +194 -0
- package/dist/hooks/bucketConfiguration.d.ts +8 -1
- package/dist/hooks/bucketConfiguration.js +52 -51
- package/dist/hooks/bucketOperations.d.ts +10 -1
- package/dist/hooks/bucketOperations.js +10 -9
- package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +80 -80
- package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +80 -80
- package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +44 -44
- package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +63 -63
- package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +65 -65
- package/dist/hooks/factories/index.d.ts +4 -4
- package/dist/hooks/factories/index.js +2 -2
- package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +2 -2
- package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +16 -13
- package/dist/hooks/factories/useCreateS3LoginHook.d.ts +2 -2
- package/dist/hooks/factories/useCreateS3LoginHook.js +1 -1
- package/dist/hooks/factories/useCreateS3MutationHook.d.ts +3 -3
- package/dist/hooks/factories/useCreateS3MutationHook.js +7 -2
- package/dist/hooks/factories/useCreateS3QueryHook.d.ts +2 -2
- package/dist/hooks/factories/useCreateS3QueryHook.js +11 -6
- package/dist/hooks/index.d.ts +19 -12
- package/dist/hooks/index.js +16 -9
- package/dist/hooks/loginOperations.d.ts +1 -1
- package/dist/hooks/loginOperations.js +1 -1
- package/dist/hooks/objectOperations.d.ts +2 -2
- package/dist/hooks/objectOperations.js +50 -49
- package/dist/hooks/presignedOperations.d.ts +4 -4
- package/dist/hooks/presignedOperations.js +5 -5
- package/dist/hooks/useAccessibleBuckets.d.ts +11 -0
- package/dist/hooks/useAccessibleBuckets.js +115 -0
- package/dist/hooks/useBatchObjectLegalHold.d.ts +11 -0
- package/dist/hooks/useBatchObjectLegalHold.js +48 -0
- package/dist/hooks/useBucketConfigEditor.d.ts +31 -0
- package/dist/hooks/useBucketConfigEditor.js +82 -0
- package/dist/hooks/useDataBrowserNavigate.d.ts +28 -0
- package/dist/hooks/useDataBrowserNavigate.js +24 -0
- package/dist/hooks/useDeleteBucketConfigRule.d.ts +2 -2
- package/dist/hooks/useDeleteBucketConfigRule.js +4 -4
- package/dist/hooks/useEmptyBucket.js +11 -11
- package/dist/hooks/useFeatures.d.ts +7 -0
- package/dist/hooks/useFeatures.js +8 -0
- package/dist/hooks/useISVBucketDetection.js +6 -6
- package/dist/hooks/useIsBucketEmpty.js +4 -4
- package/dist/hooks/useLimitedAccessFlow.d.ts +48 -0
- package/dist/hooks/useLimitedAccessFlow.js +23 -0
- package/dist/hooks/useS3Client.d.ts +6 -0
- package/dist/hooks/useS3Client.js +3 -2
- package/dist/hooks/useS3ConfigSwitch.d.ts +11 -0
- package/dist/hooks/useS3ConfigSwitch.js +37 -0
- package/dist/hooks/useSupportedNotificationEvents.d.ts +6 -0
- package/dist/hooks/useSupportedNotificationEvents.js +8 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/schemas/bucketPolicySchema.json +3 -13
- package/dist/test/msw/handlers/deleteBucket.d.ts +1 -1
- package/dist/test/msw/handlers/deleteBucket.js +20 -10
- package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -1
- package/dist/test/msw/handlers/getBucketAcl.js +29 -17
- package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -1
- package/dist/test/msw/handlers/getBucketLocation.js +29 -15
- package/dist/test/msw/handlers/getBucketPolicy.d.ts +1 -1
- package/dist/test/msw/handlers/getBucketPolicy.js +52 -32
- package/dist/test/msw/handlers/headObject.d.ts +1 -1
- package/dist/test/msw/handlers/headObject.js +31 -13
- package/dist/test/msw/handlers/listBuckets.d.ts +1 -1
- package/dist/test/msw/handlers/listBuckets.js +5 -3
- package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -1
- package/dist/test/msw/handlers/listObjectVersions.js +38 -26
- package/dist/test/msw/handlers/listObjects.d.ts +1 -1
- package/dist/test/msw/handlers/listObjects.js +35 -23
- package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -1
- package/dist/test/msw/handlers/objectLegalHold.js +32 -17
- package/dist/test/msw/handlers/objectRetention.d.ts +1 -1
- package/dist/test/msw/handlers/objectRetention.js +31 -17
- package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -1
- package/dist/test/msw/handlers/putBucketAcl.js +29 -14
- package/dist/test/msw/handlers/putObject.d.ts +1 -1
- package/dist/test/msw/handlers/putObject.js +27 -12
- package/dist/test/msw/handlers.d.ts +3 -3
- package/dist/test/msw/handlers.js +77 -54
- package/dist/test/msw/index.d.ts +2 -2
- package/dist/test/msw/index.js +1 -1
- package/dist/test/msw/server.d.ts +1 -1
- package/dist/test/msw/server.js +1 -1
- package/dist/test/msw/utils.js +2 -2
- package/dist/test/setup.d.ts +1 -1
- package/dist/test/setup.js +13 -30
- package/dist/test/testUtils.d.ts +85 -33
- package/dist/test/testUtils.js +176 -111
- package/dist/test/utils/errorHandling.test.js +119 -119
- package/dist/types/index.d.ts +50 -37
- package/dist/types/monaco.d.ts +13 -0
- package/dist/types/monaco.js +0 -0
- package/dist/utils/__tests__/proxyMiddleware.test.d.ts +1 -0
- package/dist/utils/__tests__/proxyMiddleware.test.js +579 -0
- package/dist/utils/__tests__/s3Client.test.d.ts +1 -0
- package/dist/utils/__tests__/s3Client.test.js +340 -0
- package/dist/utils/__tests__/s3ConfigIdentifier.test.d.ts +1 -0
- package/dist/utils/__tests__/s3ConfigIdentifier.test.js +437 -0
- package/dist/utils/constants.d.ts +10 -0
- package/dist/utils/constants.js +19 -9
- package/dist/utils/deletion/index.d.ts +2 -2
- package/dist/utils/deletion/index.js +1 -1
- package/dist/utils/deletion/messages.d.ts +1 -1
- package/dist/utils/deletion/messages.js +4 -4
- package/dist/utils/errorHandling.d.ts +3 -3
- package/dist/utils/errorHandling.js +6 -6
- package/dist/utils/hooks.js +8 -8
- package/dist/utils/index.d.ts +5 -4
- package/dist/utils/index.js +4 -2
- package/dist/utils/proxyMiddleware.d.ts +32 -13
- package/dist/utils/proxyMiddleware.js +90 -36
- package/dist/utils/s3Client.d.ts +14 -4
- package/dist/utils/s3Client.js +5 -26
- package/dist/utils/s3ConfigIdentifier.d.ts +79 -0
- package/dist/utils/s3ConfigIdentifier.js +57 -0
- package/dist/utils/s3RuleUtils.d.ts +5 -5
- package/dist/utils/s3RuleUtils.js +17 -17
- package/package.json +10 -8
- package/dist/components/__tests__/BucketNotificationCreatePage.test.js +0 -316
- package/dist/components/buckets/BucketPolicyButton.d.ts +0 -7
- package/dist/components/buckets/notifications/BucketNotificationCreatePage.d.ts +0 -1
- package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +0 -234
- package/dist/hooks/useLoginMutation.d.ts +0 -21
- package/dist/hooks/useLoginMutation.js +0 -9
- package/dist/utils/useFeatures.d.ts +0 -1
- package/dist/utils/useFeatures.js +0 -7
- /package/dist/components/__tests__/{BucketNotificationCreatePage.test.d.ts → BucketAccessor.test.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ReplicationRule } from
|
|
1
|
+
import type { ReplicationRule } from '@aws-sdk/client-s3';
|
|
2
2
|
interface BucketReplicationListProps {
|
|
3
3
|
bucketName: string;
|
|
4
4
|
replicationRules: ReplicationRule[];
|
|
5
5
|
replicationRole: string;
|
|
6
|
-
replicationStatus?:
|
|
6
|
+
replicationStatus?: 'idle' | 'loading' | 'error' | 'success';
|
|
7
7
|
onCreateRule?: () => void;
|
|
8
8
|
onEditRule?: (ruleId: string) => void;
|
|
9
9
|
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ConstrainedText, Icon,
|
|
2
|
+
import { ConstrainedText, Icon, spacing } from "@scality/core-ui";
|
|
3
3
|
import { Box, Button, Table } from "@scality/core-ui/dist/next";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { useDeleteBucketReplication, useSetBucketReplication } from "../../hooks/bucketConfiguration.js";
|
|
6
|
-
import { DeleteBucketConfigRuleButton } from "./DeleteBucketConfigRuleButton.js";
|
|
7
6
|
import { useTableRowSelection } from "../../hooks/useTableRowSelection.js";
|
|
7
|
+
import { DeleteBucketConfigRuleButton } from "./DeleteBucketConfigRuleButton.js";
|
|
8
8
|
function BucketReplicationList({ bucketName, replicationRules, replicationRole, replicationStatus, onCreateRule, onEditRule }) {
|
|
9
9
|
const updateReplicationMutation = useSetBucketReplication();
|
|
10
10
|
const deleteReplicationMutation = useDeleteBucketReplication();
|
|
11
11
|
const columns = useMemo(()=>[
|
|
12
12
|
{
|
|
13
|
-
Header:
|
|
14
|
-
accessor:
|
|
15
|
-
id:
|
|
13
|
+
Header: 'Rule ID',
|
|
14
|
+
accessor: 'ID',
|
|
15
|
+
id: 'id',
|
|
16
16
|
Cell: ({ value })=>/*#__PURE__*/ jsx(ConstrainedText, {
|
|
17
|
-
text: value ||
|
|
17
|
+
text: value || '-',
|
|
18
18
|
lineClamp: 2
|
|
19
19
|
}),
|
|
20
20
|
cellStyle: {
|
|
21
|
-
flex:
|
|
22
|
-
width:
|
|
21
|
+
flex: '1',
|
|
22
|
+
width: 'unset'
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
Header:
|
|
27
|
-
accessor:
|
|
28
|
-
id:
|
|
26
|
+
Header: 'Status',
|
|
27
|
+
accessor: 'Status',
|
|
28
|
+
id: 'status',
|
|
29
29
|
Cell: ({ value })=>{
|
|
30
|
-
const statusText =
|
|
30
|
+
const statusText = 'Enabled' === value ? 'Active' : 'Disabled' === value ? 'Inactive' : value;
|
|
31
31
|
return /*#__PURE__*/ jsx("span", {
|
|
32
|
-
children: statusText ||
|
|
32
|
+
children: statusText || '-'
|
|
33
33
|
});
|
|
34
34
|
},
|
|
35
35
|
cellStyle: {
|
|
36
|
-
width:
|
|
37
|
-
flex:
|
|
36
|
+
width: 'unset',
|
|
37
|
+
flex: '0.5'
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
Header:
|
|
42
|
-
accessor:
|
|
43
|
-
id:
|
|
41
|
+
Header: 'Priority',
|
|
42
|
+
accessor: 'Priority',
|
|
43
|
+
id: 'priority',
|
|
44
44
|
Cell: ({ value })=>/*#__PURE__*/ jsx("span", {
|
|
45
|
-
children: void 0 !== value ? value :
|
|
45
|
+
children: void 0 !== value ? value : 'None'
|
|
46
46
|
}),
|
|
47
47
|
cellStyle: {
|
|
48
|
-
width:
|
|
49
|
-
flex:
|
|
50
|
-
textAlign:
|
|
48
|
+
width: 'unset',
|
|
49
|
+
flex: '0.5',
|
|
50
|
+
textAlign: 'right',
|
|
51
51
|
paddingRight: spacing.r16
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
Header:
|
|
56
|
-
accessor:
|
|
57
|
-
id:
|
|
55
|
+
Header: 'Destination',
|
|
56
|
+
accessor: 'Destination',
|
|
57
|
+
id: 'destination',
|
|
58
58
|
Cell: ({ row })=>{
|
|
59
59
|
const rule = row.original.Rule;
|
|
60
60
|
const destination = rule.Destination;
|
|
61
|
-
const bucketArn = destination?.Bucket ||
|
|
61
|
+
const bucketArn = destination?.Bucket || '';
|
|
62
62
|
const accountMatch = bucketArn.match(/arn:aws:s3:::([^:]+):([^:]+)/);
|
|
63
63
|
let bucketName;
|
|
64
64
|
let accountId;
|
|
@@ -66,7 +66,7 @@ function BucketReplicationList({ bucketName, replicationRules, replicationRole,
|
|
|
66
66
|
accountId = accountMatch[1];
|
|
67
67
|
bucketName = accountMatch[2];
|
|
68
68
|
} else {
|
|
69
|
-
const parts = bucketArn.split(
|
|
69
|
+
const parts = bucketArn.split(':::');
|
|
70
70
|
bucketName = parts[parts.length - 1] || bucketArn;
|
|
71
71
|
accountId = null;
|
|
72
72
|
}
|
|
@@ -76,26 +76,26 @@ function BucketReplicationList({ bucketName, replicationRules, replicationRole,
|
|
|
76
76
|
const details = [];
|
|
77
77
|
if (shortAccountId) details.push(`account: ${shortAccountId}`);
|
|
78
78
|
if (storageClass) details.push(storageClass);
|
|
79
|
-
if (details.length > 0) displayText += ` (${details.join(
|
|
79
|
+
if (details.length > 0) displayText += ` (${details.join(', ')})`;
|
|
80
80
|
return /*#__PURE__*/ jsx(ConstrainedText, {
|
|
81
|
-
text: displayText ||
|
|
81
|
+
text: displayText || '-',
|
|
82
82
|
lineClamp: 2
|
|
83
83
|
});
|
|
84
84
|
},
|
|
85
85
|
cellStyle: {
|
|
86
|
-
width:
|
|
87
|
-
flex:
|
|
86
|
+
width: 'unset',
|
|
87
|
+
flex: '1.5'
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
Header:
|
|
92
|
-
accessor:
|
|
93
|
-
id:
|
|
91
|
+
Header: '',
|
|
92
|
+
accessor: 'ID',
|
|
93
|
+
id: 'operations',
|
|
94
94
|
cellStyle: {
|
|
95
|
-
flex:
|
|
96
|
-
textAlign:
|
|
95
|
+
flex: '0.5',
|
|
96
|
+
textAlign: 'right',
|
|
97
97
|
paddingRight: spacing.r16,
|
|
98
|
-
width:
|
|
98
|
+
width: 'unset'
|
|
99
99
|
},
|
|
100
100
|
Cell: ({ value })=>/*#__PURE__*/ jsxs(Box, {
|
|
101
101
|
display: "flex",
|
|
@@ -114,7 +114,7 @@ function BucketReplicationList({ bucketName, replicationRules, replicationRole,
|
|
|
114
114
|
},
|
|
115
115
|
"aria-label": "Edit rule",
|
|
116
116
|
tooltip: {
|
|
117
|
-
overlay:
|
|
117
|
+
overlay: 'Edit rule'
|
|
118
118
|
}
|
|
119
119
|
}),
|
|
120
120
|
/*#__PURE__*/ jsx(DeleteBucketConfigRuleButton, {
|
|
@@ -145,10 +145,10 @@ function BucketReplicationList({ bucketName, replicationRules, replicationRole,
|
|
|
145
145
|
deleteReplicationMutation
|
|
146
146
|
]);
|
|
147
147
|
const tableData = useMemo(()=>replicationRules.map((rule)=>({
|
|
148
|
-
ID: rule.ID ||
|
|
149
|
-
Status: rule.Status ||
|
|
148
|
+
ID: rule.ID || '-',
|
|
149
|
+
Status: rule.Status || '-',
|
|
150
150
|
Priority: rule.Priority,
|
|
151
|
-
Destination: rule.Destination?.Bucket ||
|
|
151
|
+
Destination: rule.Destination?.Bucket || '-',
|
|
152
152
|
Rule: rule
|
|
153
153
|
})), [
|
|
154
154
|
replicationRules
|
|
@@ -161,12 +161,14 @@ function BucketReplicationList({ bucketName, replicationRules, replicationRole,
|
|
|
161
161
|
defaultSortingKey: "priority",
|
|
162
162
|
entityName: {
|
|
163
163
|
en: {
|
|
164
|
-
singular:
|
|
165
|
-
plural:
|
|
164
|
+
singular: 'replication rule',
|
|
165
|
+
plural: 'replication rules'
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
children: [
|
|
169
|
-
/*#__PURE__*/ jsx(
|
|
169
|
+
/*#__PURE__*/ jsx(Box, {
|
|
170
|
+
display: "flex",
|
|
171
|
+
justifyContent: "flex-end",
|
|
170
172
|
padding: spacing.r16,
|
|
171
173
|
children: /*#__PURE__*/ jsx(Button, {
|
|
172
174
|
icon: /*#__PURE__*/ jsx(Icon, {
|
|
@@ -174,7 +176,8 @@ function BucketReplicationList({ bucketName, replicationRules, replicationRole,
|
|
|
174
176
|
}),
|
|
175
177
|
label: "Create Rule",
|
|
176
178
|
variant: "primary",
|
|
177
|
-
onClick: onCreateRule
|
|
179
|
+
onClick: onCreateRule,
|
|
180
|
+
type: "button"
|
|
178
181
|
})
|
|
179
182
|
}),
|
|
180
183
|
/*#__PURE__*/ jsx(Table.SingleSelectableContent, {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SmallerText, Toggle, Tooltip, useToast } from "@scality/core-ui";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { useGetBucketObjectLockConfiguration, useGetBucketVersioning, useISVBucketStatus, useSetBucketVersioning } from "../../hooks/index.js";
|
|
5
|
+
import { useBucketOverviewContext } from "./BucketOverview.js";
|
|
6
|
+
function BucketVersioning({ tooltipOverlay }) {
|
|
7
|
+
const { bucketName } = useBucketOverviewContext();
|
|
8
|
+
const { data: versioningData, status: versioningStatus, error: versioningError } = useGetBucketVersioning({
|
|
9
|
+
Bucket: bucketName
|
|
10
|
+
});
|
|
11
|
+
const { data: objectLockData, status: objectLockStatus } = useGetBucketObjectLockConfiguration({
|
|
12
|
+
Bucket: bucketName
|
|
13
|
+
});
|
|
14
|
+
const { isVeeamBucket } = useISVBucketStatus(bucketName);
|
|
15
|
+
const { mutate: changeBucketVersioning } = useSetBucketVersioning();
|
|
16
|
+
const { showToast } = useToast();
|
|
17
|
+
const isObjectLockEnabled = objectLockData?.ObjectLockConfiguration?.ObjectLockEnabled === 'Enabled';
|
|
18
|
+
const isVersioningEnabled = versioningData?.Status === 'Enabled';
|
|
19
|
+
const updateBucketVersioning = useCallback((isVersioning)=>{
|
|
20
|
+
changeBucketVersioning({
|
|
21
|
+
Bucket: bucketName,
|
|
22
|
+
VersioningConfiguration: {
|
|
23
|
+
Status: isVersioning ? 'Enabled' : 'Suspended'
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
onSuccess: ()=>{
|
|
27
|
+
showToast({
|
|
28
|
+
open: true,
|
|
29
|
+
message: isVersioning ? 'Bucket versioning enabled' : 'Bucket versioning suspended',
|
|
30
|
+
status: 'success'
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
onError: (error)=>{
|
|
34
|
+
showToast({
|
|
35
|
+
open: true,
|
|
36
|
+
message: error instanceof Error ? error.message : 'Failed to update bucket versioning',
|
|
37
|
+
status: 'error'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, [
|
|
42
|
+
bucketName,
|
|
43
|
+
changeBucketVersioning,
|
|
44
|
+
showToast
|
|
45
|
+
]);
|
|
46
|
+
if (isObjectLockEnabled) return /*#__PURE__*/ jsxs(Fragment, {
|
|
47
|
+
children: [
|
|
48
|
+
"Enabled",
|
|
49
|
+
/*#__PURE__*/ jsx("br", {}),
|
|
50
|
+
/*#__PURE__*/ jsx(SmallerText, {
|
|
51
|
+
children: "Versioning cannot be suspended because Object-lock is enabled for this bucket."
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
56
|
+
overlay: tooltipOverlay ? tooltipOverlay : isVeeamBucket ? /*#__PURE__*/ jsx(Fragment, {
|
|
57
|
+
children: "Enabling versioning is not possible due to the bucket being managed by Veeam."
|
|
58
|
+
}) : 'error' === versioningStatus ? /*#__PURE__*/ jsx(Fragment, {
|
|
59
|
+
children: versioningError?.message
|
|
60
|
+
}) : null,
|
|
61
|
+
overlayStyle: {
|
|
62
|
+
maxWidth: '16.5rem'
|
|
63
|
+
},
|
|
64
|
+
children: /*#__PURE__*/ jsx(Toggle, {
|
|
65
|
+
id: "versioningToggle",
|
|
66
|
+
disabled: 'pending' === versioningStatus || 'pending' === objectLockStatus || 'error' === versioningStatus || isVeeamBucket,
|
|
67
|
+
toggle: isVersioningEnabled,
|
|
68
|
+
label: isVersioningEnabled ? 'Active' : 'Inactive',
|
|
69
|
+
onChange: ()=>{
|
|
70
|
+
updateBucketVersioning(!isVersioningEnabled);
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const buckets_BucketVersioning = BucketVersioning;
|
|
76
|
+
export { BucketVersioning, buckets_BucketVersioning as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { useIsBucketEmpty } from "../../hooks/useIsBucketEmpty.js";
|
|
4
|
-
import { useDeleteBucket } from "../../hooks/bucketOperations.js";
|
|
5
2
|
import { Icon, Loader, Modal, Stack, Tooltip, Wrap } from "@scality/core-ui";
|
|
6
3
|
import { Button } from "@scality/core-ui/dist/next";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { useDeleteBucket } from "../../hooks/bucketOperations.js";
|
|
6
|
+
import { useIsBucketEmpty } from "../../hooks/useIsBucketEmpty.js";
|
|
7
7
|
const DeleteBucketButton = ({ bucketName, onDeleteSuccess, onDeleteError, disabled = false })=>{
|
|
8
8
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
|
9
9
|
const { isEmpty, isLoading } = useIsBucketEmpty(bucketName);
|
|
@@ -20,7 +20,7 @@ const DeleteBucketButton = ({ bucketName, onDeleteSuccess, onDeleteError, disabl
|
|
|
20
20
|
onDeleteSuccess?.(bucketName);
|
|
21
21
|
},
|
|
22
22
|
onError: (error)=>{
|
|
23
|
-
onDeleteError?.(error instanceof Error ? error : new Error(
|
|
23
|
+
onDeleteError?.(error instanceof Error ? error : new Error('Delete failed'));
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
};
|
|
@@ -28,9 +28,9 @@ const DeleteBucketButton = ({ bucketName, onDeleteSuccess, onDeleteError, disabl
|
|
|
28
28
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
29
29
|
children: [
|
|
30
30
|
/*#__PURE__*/ jsx(Tooltip, {
|
|
31
|
-
overlay: isLoading ?
|
|
31
|
+
overlay: isLoading ? 'Checking bucket...' : 'Bucket is not empty',
|
|
32
32
|
overlayStyle: {
|
|
33
|
-
display: isEmpty ?
|
|
33
|
+
display: isEmpty ? 'none' : void 0
|
|
34
34
|
},
|
|
35
35
|
children: /*#__PURE__*/ jsx(Button, {
|
|
36
36
|
icon: /*#__PURE__*/ jsx(Icon, {
|
|
@@ -56,10 +56,10 @@ const DeleteBucketButton = ({ bucketName, onDeleteSuccess, onDeleteError, disabl
|
|
|
56
56
|
label: "Cancel"
|
|
57
57
|
}),
|
|
58
58
|
/*#__PURE__*/ jsx(Button, {
|
|
59
|
-
disabled:
|
|
59
|
+
disabled: 'pending' === status,
|
|
60
60
|
variant: "danger",
|
|
61
61
|
onClick: approve,
|
|
62
|
-
icon:
|
|
62
|
+
icon: 'pending' === status && /*#__PURE__*/ jsx(Loader, {
|
|
63
63
|
size: "larger"
|
|
64
64
|
}),
|
|
65
65
|
label: "Delete"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { UseMutationResult } from
|
|
1
|
+
import type { UseMutationResult } from '@tanstack/react-query';
|
|
2
2
|
interface DeleteBucketConfigRuleButtonProps<TRule extends {
|
|
3
3
|
ID?: string;
|
|
4
4
|
}> {
|
|
5
5
|
bucketName: string;
|
|
6
6
|
ruleId: string;
|
|
7
7
|
rules: TRule[];
|
|
8
|
-
ruleType:
|
|
8
|
+
ruleType: 'lifecycle' | 'replication' | 'notification';
|
|
9
9
|
updateMutation: UseMutationResult<any, any, any, unknown>;
|
|
10
10
|
deleteMutation: UseMutationResult<any, any, any, unknown>;
|
|
11
11
|
buildUpdateInput: (remainingRules: TRule[]) => Record<string, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { Icon } from "@scality/core-ui";
|
|
4
3
|
import { Button } from "@scality/core-ui/dist/next";
|
|
4
|
+
import { useState } from "react";
|
|
5
5
|
import { useDeleteBucketConfigRule } from "../../hooks/useDeleteBucketConfigRule.js";
|
|
6
6
|
import { ConfirmDeleteRuleModal } from "../ui/ConfirmDeleteRuleModal.js";
|
|
7
7
|
function DeleteBucketConfigRuleButton({ bucketName, ruleId, rules, ruleType, updateMutation, deleteMutation, buildUpdateInput, successMessage, errorMessage }) {
|
|
@@ -36,7 +36,7 @@ function DeleteBucketConfigRuleButton({ bucketName, ruleId, rules, ruleType, upd
|
|
|
36
36
|
},
|
|
37
37
|
"aria-label": "Delete rule",
|
|
38
38
|
tooltip: {
|
|
39
|
-
overlay:
|
|
39
|
+
overlay: 'Delete rule'
|
|
40
40
|
}
|
|
41
41
|
}),
|
|
42
42
|
/*#__PURE__*/ jsx(ConfirmDeleteRuleModal, {
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Banner, Icon, Loader, Modal, Stack, Text, Tooltip, Wrap } from "@scality/core-ui";
|
|
3
|
-
import { Box, Button } from "@scality/core-ui/dist/next";
|
|
4
3
|
import { Input } from "@scality/core-ui/dist/components/inputv2/inputv2";
|
|
4
|
+
import { Box, Button } from "@scality/core-ui/dist/next";
|
|
5
5
|
import { useMemo, useState } from "react";
|
|
6
|
-
import { useIsBucketEmpty } from "../../hooks/useIsBucketEmpty.js";
|
|
7
|
-
import { useEmptyBucket } from "../../hooks/useEmptyBucket.js";
|
|
8
|
-
import { useGetBucketObjectLockConfiguration } from "../../hooks/bucketConfiguration.js";
|
|
9
6
|
import styled_components from "styled-components";
|
|
7
|
+
import { useGetBucketObjectLockConfiguration } from "../../hooks/bucketConfiguration.js";
|
|
8
|
+
import { useEmptyBucket } from "../../hooks/useEmptyBucket.js";
|
|
9
|
+
import { useIsBucketEmpty } from "../../hooks/useIsBucketEmpty.js";
|
|
10
10
|
import { EmptyBucketSummary } from "./EmptyBucketSummary.js";
|
|
11
11
|
const MAX_OBJECTS_TO_DELETE = 20000;
|
|
12
12
|
const CustomListItem = styled_components.li`
|
|
13
13
|
padding: 0.5rem;
|
|
14
14
|
`;
|
|
15
15
|
const emptyBucketInfosList = [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
'Emptying a bucket removes all contents and cannot be reversed.',
|
|
17
|
+
'New objects added during the empty action may also be removed.',
|
|
18
|
+
'Adjust workflows linked to this bucket to avoid adding objects during the emptying action.'
|
|
19
19
|
];
|
|
20
20
|
const RetentionText = ()=>/*#__PURE__*/ jsx(Text, {
|
|
21
21
|
children: "If some of the objects you are trying to delete are locked in governance mode, confirming the deletion will effectively delete them as the governance retention will be bypassed."
|
|
22
22
|
});
|
|
23
23
|
const LifecycleText = ()=>/*#__PURE__*/ jsx(Text, {
|
|
24
|
-
children: "The action of emptying can erase a maximum of 20
|
|
24
|
+
children: "The action of emptying can erase a maximum of 20 000 objects. For buckets with a substantial number of objects, an expiration workflow (lifecycle rule) could provide an effective alternative to emptying the bucket."
|
|
25
25
|
});
|
|
26
26
|
const EmptyBucketButton = ({ bucketName })=>{
|
|
27
|
-
const [confirmText, setConfirmText] = useState(
|
|
27
|
+
const [confirmText, setConfirmText] = useState('');
|
|
28
28
|
const [isEmptyModalOpen, setIsEmptyModalOpen] = useState(false);
|
|
29
29
|
const [showSummary, setShowSummary] = useState(false);
|
|
30
30
|
const { isEmpty, isLoading: isCheckingEmpty } = useIsBucketEmpty(bucketName);
|
|
31
31
|
const { data: objectLockData } = useGetBucketObjectLockConfiguration({
|
|
32
32
|
Bucket: bucketName
|
|
33
33
|
});
|
|
34
|
-
const isObjectLockEnabled = objectLockData?.ObjectLockConfiguration?.ObjectLockEnabled ===
|
|
34
|
+
const isObjectLockEnabled = objectLockData?.ObjectLockConfiguration?.ObjectLockEnabled === 'Enabled';
|
|
35
35
|
const { emptyBucket, isEmptying, error, result, reset } = useEmptyBucket({
|
|
36
36
|
maxObjects: MAX_OBJECTS_TO_DELETE,
|
|
37
37
|
bypassGovernanceRetention: true
|
|
@@ -65,16 +65,16 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
65
65
|
};
|
|
66
66
|
const handleCloseSummary = ()=>{
|
|
67
67
|
setShowSummary(false);
|
|
68
|
-
setConfirmText(
|
|
68
|
+
setConfirmText('');
|
|
69
69
|
reset();
|
|
70
70
|
};
|
|
71
71
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
72
72
|
children: [
|
|
73
73
|
/*#__PURE__*/ jsx(Tooltip, {
|
|
74
|
-
overlay: isCheckingEmpty ?
|
|
74
|
+
overlay: isCheckingEmpty ? 'Checking if bucket is empty' : 'Bucket is already empty',
|
|
75
75
|
overlayStyle: {
|
|
76
|
-
width:
|
|
77
|
-
display: isEmpty ? void 0 :
|
|
76
|
+
width: '9rem',
|
|
77
|
+
display: isEmpty ? void 0 : 'none'
|
|
78
78
|
},
|
|
79
79
|
children: /*#__PURE__*/ jsx(Button, {
|
|
80
80
|
icon: /*#__PURE__*/ jsx(Icon, {
|
|
@@ -85,7 +85,7 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
85
85
|
onClick: ()=>setIsEmptyModalOpen(true),
|
|
86
86
|
label: "Empty Bucket",
|
|
87
87
|
style: {
|
|
88
|
-
marginRight:
|
|
88
|
+
marginRight: '1rem'
|
|
89
89
|
}
|
|
90
90
|
})
|
|
91
91
|
}),
|
|
@@ -95,7 +95,7 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
95
95
|
close: ()=>{
|
|
96
96
|
if (!isEmptying) {
|
|
97
97
|
setIsEmptyModalOpen(false);
|
|
98
|
-
setConfirmText(
|
|
98
|
+
setConfirmText('');
|
|
99
99
|
reset();
|
|
100
100
|
}
|
|
101
101
|
},
|
|
@@ -103,7 +103,7 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
103
103
|
children: [
|
|
104
104
|
isEmptying && /*#__PURE__*/ jsx(Text, {
|
|
105
105
|
variant: "Larger",
|
|
106
|
-
children: result?.deletedCount ? `${result?.deletedCount} deletion attempts...` :
|
|
106
|
+
children: result?.deletedCount ? `${result?.deletedCount} deletion attempts...` : 'Deletion in progress...'
|
|
107
107
|
}),
|
|
108
108
|
/*#__PURE__*/ jsx("p", {}),
|
|
109
109
|
/*#__PURE__*/ jsxs(Stack, {
|
|
@@ -112,7 +112,7 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
112
112
|
variant: "outline",
|
|
113
113
|
onClick: ()=>{
|
|
114
114
|
setIsEmptyModalOpen(false);
|
|
115
|
-
setConfirmText(
|
|
115
|
+
setConfirmText('');
|
|
116
116
|
reset();
|
|
117
117
|
},
|
|
118
118
|
label: "Cancel",
|
|
@@ -171,7 +171,7 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
171
171
|
}),
|
|
172
172
|
/*#__PURE__*/ jsx("ul", {
|
|
173
173
|
style: {
|
|
174
|
-
padding:
|
|
174
|
+
padding: '2rem'
|
|
175
175
|
},
|
|
176
176
|
children: emptyBucketInfosList.map((listInfo, i)=>/*#__PURE__*/ jsx(CustomListItem, {
|
|
177
177
|
children: listInfo
|
|
@@ -180,9 +180,9 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
180
180
|
/*#__PURE__*/ jsx(Banner, {
|
|
181
181
|
icon: /*#__PURE__*/ jsx("div", {
|
|
182
182
|
style: {
|
|
183
|
-
display:
|
|
184
|
-
alignItems:
|
|
185
|
-
marginLeft:
|
|
183
|
+
display: 'flex',
|
|
184
|
+
alignItems: 'center',
|
|
185
|
+
marginLeft: '0.571rem'
|
|
186
186
|
},
|
|
187
187
|
children: /*#__PURE__*/ jsx(Icon, {
|
|
188
188
|
name: "Info-circle",
|
|
@@ -200,8 +200,8 @@ const EmptyBucketButton = ({ bucketName })=>{
|
|
|
200
200
|
children: [
|
|
201
201
|
/*#__PURE__*/ jsx("label", {
|
|
202
202
|
style: {
|
|
203
|
-
float:
|
|
204
|
-
marginRight:
|
|
203
|
+
float: 'left',
|
|
204
|
+
marginRight: '1rem'
|
|
205
205
|
},
|
|
206
206
|
children: "Type the name of the bucket to delete all its content."
|
|
207
207
|
}),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { DeleteObjectsCommandOutput } from
|
|
1
|
+
import type { DeleteObjectsCommandOutput } from '@aws-sdk/client-s3';
|
|
2
2
|
interface EmptyBucketSummaryProps {
|
|
3
3
|
deleteResult: DeleteObjectsCommandOutput;
|
|
4
4
|
close: () => void;
|
|
5
5
|
open: boolean;
|
|
6
6
|
isFetchNextPage: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const EmptyBucketSummary: ({ deleteResult, close, open, isFetchNextPage
|
|
8
|
+
export declare const EmptyBucketSummary: ({ deleteResult, close, open, isFetchNextPage }: EmptyBucketSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -10,7 +10,7 @@ const useCreateDeleteSummaryData = (deleteResult)=>useMemo(()=>{
|
|
|
10
10
|
deleted: deleteResult.Deleted?.length || 0,
|
|
11
11
|
errors: {
|
|
12
12
|
nbErrors: deleteResult.Errors?.length || 0,
|
|
13
|
-
messages: deleteResult.Errors?.map((error)=>error.Message ||
|
|
13
|
+
messages: deleteResult.Errors?.map((error)=>error.Message || '') || []
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
];
|
|
@@ -9,5 +9,5 @@ interface DeleteSummaryData extends Record<string, unknown> {
|
|
|
9
9
|
interface EmptyBucketSummaryListProps {
|
|
10
10
|
summaryData: DeleteSummaryData[];
|
|
11
11
|
}
|
|
12
|
-
export declare const EmptyBucketSummaryList: ({ summaryData
|
|
12
|
+
export declare const EmptyBucketSummaryList: ({ summaryData }: EmptyBucketSummaryListProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -17,10 +17,10 @@ const getUniqueErrorMessages = (errorMessages)=>{
|
|
|
17
17
|
const ErrorsTable = ({ messages })=>{
|
|
18
18
|
const messagesColumns = [
|
|
19
19
|
{
|
|
20
|
-
Header:
|
|
21
|
-
accessor:
|
|
20
|
+
Header: 'Error Message',
|
|
21
|
+
accessor: 'message',
|
|
22
22
|
cellStyle: {
|
|
23
|
-
minWidth:
|
|
23
|
+
minWidth: '8rem'
|
|
24
24
|
},
|
|
25
25
|
Cell ({ value }) {
|
|
26
26
|
return /*#__PURE__*/ jsx(Text, {
|
|
@@ -29,10 +29,10 @@ const ErrorsTable = ({ messages })=>{
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
Header:
|
|
33
|
-
accessor:
|
|
32
|
+
Header: 'Number of errors',
|
|
33
|
+
accessor: 'errorNumbers',
|
|
34
34
|
cellStyle: {
|
|
35
|
-
minWidth:
|
|
35
|
+
minWidth: '8rem'
|
|
36
36
|
},
|
|
37
37
|
Cell ({ value }) {
|
|
38
38
|
return /*#__PURE__*/ jsx(Text, {
|
|
@@ -46,7 +46,7 @@ const ErrorsTable = ({ messages })=>{
|
|
|
46
46
|
return /*#__PURE__*/ jsx(IconHelp, {
|
|
47
47
|
placement: "top",
|
|
48
48
|
overlayStyle: {
|
|
49
|
-
width:
|
|
49
|
+
width: '30rem'
|
|
50
50
|
},
|
|
51
51
|
tooltipMessage: /*#__PURE__*/ jsx("div", {
|
|
52
52
|
style: {
|
|
@@ -64,12 +64,12 @@ const ErrorsTable = ({ messages })=>{
|
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
66
|
const SummaryCell = (value, isFailed = false, withIcon = false, messages)=>{
|
|
67
|
-
const text = 1 === value ?
|
|
67
|
+
const text = 1 === value ? '1 object' : `${value} objects`;
|
|
68
68
|
if (withIcon) return /*#__PURE__*/ jsxs(Stack, {
|
|
69
69
|
children: [
|
|
70
70
|
/*#__PURE__*/ jsx(Icon, {
|
|
71
|
-
name: isFailed ?
|
|
72
|
-
color: isFailed ?
|
|
71
|
+
name: isFailed ? 'Exclamation-circle' : 'Check-circle',
|
|
72
|
+
color: isFailed ? 'statusCritical' : 'statusHealthy'
|
|
73
73
|
}),
|
|
74
74
|
/*#__PURE__*/ jsx(BasicText, {
|
|
75
75
|
children: text
|
|
@@ -85,30 +85,30 @@ const SummaryCell = (value, isFailed = false, withIcon = false, messages)=>{
|
|
|
85
85
|
};
|
|
86
86
|
const useCreateDeleteSummaryColumns = ()=>useMemo(()=>[
|
|
87
87
|
{
|
|
88
|
-
Header:
|
|
89
|
-
accessor:
|
|
88
|
+
Header: 'Total attempts',
|
|
89
|
+
accessor: 'attempts',
|
|
90
90
|
cellStyle: {
|
|
91
|
-
minWidth:
|
|
91
|
+
minWidth: '12rem'
|
|
92
92
|
},
|
|
93
93
|
Cell ({ value }) {
|
|
94
94
|
return SummaryCell(value);
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
|
-
Header:
|
|
99
|
-
accessor:
|
|
98
|
+
Header: 'Successfully deleted',
|
|
99
|
+
accessor: 'deleted',
|
|
100
100
|
cellStyle: {
|
|
101
|
-
minWidth:
|
|
101
|
+
minWidth: '12rem'
|
|
102
102
|
},
|
|
103
103
|
Cell ({ value }) {
|
|
104
104
|
return SummaryCell(value, false, true);
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
|
-
Header:
|
|
109
|
-
accessor:
|
|
108
|
+
Header: 'Deletion failed',
|
|
109
|
+
accessor: 'errors',
|
|
110
110
|
cellStyle: {
|
|
111
|
-
minWidth:
|
|
111
|
+
minWidth: '12rem'
|
|
112
112
|
},
|
|
113
113
|
Cell ({ value }) {
|
|
114
114
|
return SummaryCell(value.nbErrors, true, true, value.messages);
|
|
@@ -119,15 +119,15 @@ const EmptyBucketSummaryList = ({ summaryData })=>{
|
|
|
119
119
|
const summaryColumns = useCreateDeleteSummaryColumns();
|
|
120
120
|
return /*#__PURE__*/ jsx("div", {
|
|
121
121
|
style: {
|
|
122
|
-
height:
|
|
122
|
+
height: '15rem'
|
|
123
123
|
},
|
|
124
124
|
children: /*#__PURE__*/ jsx(Table, {
|
|
125
125
|
columns: summaryColumns,
|
|
126
126
|
data: summaryData,
|
|
127
127
|
children: /*#__PURE__*/ jsx("div", {
|
|
128
128
|
style: {
|
|
129
|
-
height:
|
|
130
|
-
paddingBottom:
|
|
129
|
+
height: '10rem',
|
|
130
|
+
paddingBottom: '5rem'
|
|
131
131
|
},
|
|
132
132
|
children: /*#__PURE__*/ jsx(Table.SingleSelectableContent, {
|
|
133
133
|
rowHeight: "h40",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|