@scality/data-browser-library 1.0.0-preview.13 → 1.0.0-preview.16
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 +6 -14
- package/dist/components/DataBrowserUI.js +79 -55
- package/dist/components/Editor.d.ts +1 -1
- package/dist/components/Editor.js +3 -3
- package/dist/components/__tests__/BucketCreate.test.js +102 -102
- package/dist/components/__tests__/BucketDetails.test.js +122 -123
- package/dist/components/__tests__/BucketLifecycleFormPage.test.js +177 -177
- package/dist/components/__tests__/BucketLifecycleList.test.js +85 -85
- package/dist/components/__tests__/BucketList.test.js +175 -176
- package/dist/components/__tests__/BucketNotificationCreatePage.test.js +84 -84
- package/dist/components/__tests__/BucketOverview.test.js +257 -201
- package/dist/components/__tests__/BucketPolicyPage.test.js +62 -62
- package/dist/components/__tests__/BucketReplicationFormPage.test.js +542 -542
- 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 +62 -62
- package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +47 -47
- package/dist/components/__tests__/DeleteObjectButton.test.js +63 -63
- package/dist/components/__tests__/EmptyBucketButton.test.js +56 -56
- package/dist/components/__tests__/MetadataSearch.test.js +65 -65
- package/dist/components/__tests__/ObjectList.test.js +252 -251
- package/dist/components/__tests__/UploadButton.test.js +45 -45
- package/dist/components/buckets/BucketCreate.d.ts +2 -2
- package/dist/components/buckets/BucketCreate.js +41 -41
- package/dist/components/buckets/BucketDetails.d.ts +2 -2
- package/dist/components/buckets/BucketDetails.js +48 -36
- package/dist/components/buckets/BucketLifecycleFormPage.js +161 -160
- package/dist/components/buckets/BucketLifecycleList.d.ts +2 -2
- package/dist/components/buckets/BucketLifecycleList.js +46 -46
- package/dist/components/buckets/BucketList.d.ts +2 -2
- package/dist/components/buckets/BucketList.js +28 -27
- package/dist/components/buckets/BucketLocation.js +3 -3
- package/dist/components/buckets/BucketOverview.d.ts +1 -1
- package/dist/components/buckets/BucketOverview.js +64 -65
- package/dist/components/buckets/BucketPage.js +19 -11
- package/dist/components/buckets/BucketPolicyButton.js +2 -2
- package/dist/components/buckets/BucketPolicyPage.js +27 -25
- package/dist/components/buckets/BucketReplicationFormPage.js +133 -132
- package/dist/components/buckets/BucketReplicationList.d.ts +2 -2
- package/dist/components/buckets/BucketReplicationList.js +41 -41
- package/dist/components/buckets/BucketVersioning.js +11 -11
- package/dist/components/buckets/DeleteBucketButton.js +5 -5
- package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +2 -2
- package/dist/components/buckets/DeleteBucketConfigRuleButton.js +1 -1
- package/dist/components/buckets/EmptyBucketButton.js +19 -19
- package/dist/components/buckets/EmptyBucketSummary.d.ts +1 -1
- package/dist/components/buckets/EmptyBucketSummary.js +1 -1
- package/dist/components/buckets/EmptyBucketSummaryList.js +22 -22
- package/dist/components/buckets/__tests__/BucketVersioning.test.js +45 -45
- package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +34 -33
- package/dist/components/buckets/notifications/EventsSection.js +144 -28
- 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 +24 -22
- package/dist/components/index.js +5 -3
- package/dist/components/layouts/ArrowNavigation.d.ts +1 -2
- package/dist/components/layouts/ArrowNavigation.js +3 -3
- package/dist/components/layouts/BrowserPageLayout.d.ts +2 -3
- package/dist/components/layouts/BrowserPageLayout.js +1 -1
- package/dist/components/objects/CreateFolderButton.d.ts +2 -2
- package/dist/components/objects/CreateFolderButton.js +9 -9
- package/dist/components/objects/DeleteObjectButton.d.ts +1 -1
- package/dist/components/objects/DeleteObjectButton.js +20 -20
- package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +1 -1
- package/dist/components/objects/ObjectDetails/ObjectMetadata.js +56 -56
- package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +1 -1
- package/dist/components/objects/ObjectDetails/ObjectSummary.js +39 -39
- package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +1 -1
- package/dist/components/objects/ObjectDetails/ObjectTags.js +25 -25
- package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +119 -119
- package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.js +211 -211
- package/dist/components/objects/ObjectDetails/index.d.ts +1 -1
- package/dist/components/objects/ObjectDetails/index.js +30 -30
- package/dist/components/objects/ObjectList.d.ts +5 -5
- package/dist/components/objects/ObjectList.js +113 -112
- package/dist/components/objects/ObjectLock/EditRetentionButton.js +3 -3
- package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +14 -14
- package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +1 -1
- package/dist/components/objects/ObjectLock/ObjectLockSettings.js +29 -28
- 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 +50 -50
- package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +77 -77
- package/dist/components/objects/ObjectPage.js +5 -4
- package/dist/components/objects/UploadButton.d.ts +3 -3
- package/dist/components/objects/UploadButton.js +5 -5
- 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 +22 -0
- package/dist/components/search/MetadataSearch.js +26 -25
- package/dist/components/search/SearchHints.js +1 -1
- package/dist/components/ui/ArrayFieldActions.js +4 -4
- package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +1 -1
- package/dist/components/ui/ConfirmDeleteRuleModal.js +1 -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 +1 -1
- package/dist/components/ui/Search.elements.js +7 -7
- package/dist/components/ui/Table.elements.js +5 -5
- package/dist/config/factory.d.ts +23 -10
- package/dist/config/factory.js +22 -7
- package/dist/config/types.d.ts +20 -3
- package/dist/contexts/DataBrowserUICustomizationContext.d.ts +2 -2
- package/dist/hooks/__tests__/useISVBucketDetection.test.js +42 -42
- package/dist/hooks/__tests__/useIsBucketEmpty.test.js +25 -25
- package/dist/hooks/bucketConfiguration.d.ts +1 -1
- package/dist/hooks/bucketConfiguration.js +48 -48
- package/dist/hooks/bucketOperations.d.ts +1 -1
- package/dist/hooks/bucketOperations.js +6 -6
- package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +78 -78
- package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +78 -78
- package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +42 -42
- package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +61 -61
- package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +63 -63
- package/dist/hooks/factories/index.d.ts +4 -4
- package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +2 -2
- package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +15 -12
- package/dist/hooks/factories/useCreateS3LoginHook.d.ts +2 -2
- package/dist/hooks/factories/useCreateS3MutationHook.d.ts +3 -3
- package/dist/hooks/factories/useCreateS3MutationHook.js +6 -1
- package/dist/hooks/factories/useCreateS3QueryHook.d.ts +2 -2
- package/dist/hooks/factories/useCreateS3QueryHook.js +8 -5
- package/dist/hooks/index.d.ts +16 -13
- package/dist/hooks/index.js +4 -1
- 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 +49 -49
- package/dist/hooks/presignedOperations.d.ts +2 -2
- package/dist/hooks/presignedOperations.js +3 -3
- package/dist/hooks/useBatchObjectLegalHold.js +7 -4
- 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 +10 -10
- package/dist/hooks/useFeatures.d.ts +7 -0
- package/dist/hooks/useFeatures.js +8 -0
- package/dist/hooks/useISVBucketDetection.js +5 -5
- package/dist/hooks/useIsBucketEmpty.js +4 -4
- package/dist/hooks/useLoginMutation.d.ts +1 -1
- package/dist/hooks/useLoginMutation.js +1 -1
- 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/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 +31 -16
- 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 +72 -49
- package/dist/test/msw/index.d.ts +2 -2
- 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 +19 -19
- package/dist/test/testUtils.d.ts +9 -15
- package/dist/test/testUtils.js +73 -91
- package/dist/test/utils/errorHandling.test.js +119 -119
- package/dist/types/index.d.ts +6 -31
- package/dist/utils/__tests__/s3ConfigIdentifier.test.d.ts +1 -0
- package/dist/utils/__tests__/s3ConfigIdentifier.test.js +429 -0
- package/dist/utils/constants.js +8 -8
- package/dist/utils/deletion/index.d.ts +2 -2
- 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 +2 -0
- package/dist/utils/proxyMiddleware.d.ts +1 -1
- package/dist/utils/proxyMiddleware.js +6 -11
- package/dist/utils/s3Client.d.ts +2 -2
- package/dist/utils/s3Client.js +1 -1
- package/dist/utils/s3ConfigIdentifier.d.ts +68 -0
- package/dist/utils/s3ConfigIdentifier.js +55 -0
- package/dist/utils/s3RuleUtils.d.ts +5 -5
- package/dist/utils/s3RuleUtils.js +17 -17
- package/package.json +2 -2
- package/dist/utils/useFeatures.d.ts +0 -1
- package/dist/utils/useFeatures.js +0 -7
|
@@ -6,35 +6,36 @@ import { Box, Button, Input, Select } from "@scality/core-ui/dist/next";
|
|
|
6
6
|
import joi from "joi";
|
|
7
7
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
8
8
|
import { Controller, FormProvider, useFieldArray, useForm } from "react-hook-form";
|
|
9
|
-
import {
|
|
9
|
+
import { useParams } from "react-router";
|
|
10
10
|
import { useGetBucketLifecycle, useSetBucketLifecycle } from "../../hooks/bucketConfiguration.js";
|
|
11
|
+
import { useDataBrowserNavigate } from "../../hooks/useDataBrowserNavigate.js";
|
|
11
12
|
import { FilterFormSection, createFilterValidationSchema } from "../ui/FilterFormSection.js";
|
|
12
13
|
import { ArrayFieldActions } from "../ui/ArrayFieldActions.js";
|
|
13
14
|
import { AWS_RULE_LIMITS, STATUS_OPTIONS, buildS3Filter } from "../../utils/s3RuleUtils.js";
|
|
14
15
|
const storageClassOptions = [
|
|
15
16
|
{
|
|
16
|
-
value:
|
|
17
|
-
label:
|
|
17
|
+
value: 'GLACIER',
|
|
18
|
+
label: 'Glacier'
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
|
-
value:
|
|
21
|
-
label:
|
|
21
|
+
value: 'DEEP_ARCHIVE',
|
|
22
|
+
label: 'Glacier Deep Archive'
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
|
-
value:
|
|
25
|
-
label:
|
|
25
|
+
value: 'STANDARD_IA',
|
|
26
|
+
label: 'Standard-IA'
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
|
-
value:
|
|
29
|
-
label:
|
|
29
|
+
value: 'ONEZONE_IA',
|
|
30
|
+
label: 'One Zone-IA'
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
|
-
value:
|
|
33
|
-
label:
|
|
33
|
+
value: 'INTELLIGENT_TIERING',
|
|
34
|
+
label: 'Intelligent-Tiering'
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
|
-
value:
|
|
37
|
-
label:
|
|
37
|
+
value: 'GLACIER_IR',
|
|
38
|
+
label: 'Glacier Instant Retrieval'
|
|
38
39
|
}
|
|
39
40
|
];
|
|
40
41
|
const STORAGE_CLASS_MIN_DAYS = {
|
|
@@ -51,112 +52,112 @@ const LIFECYCLE_LIMITS = {
|
|
|
51
52
|
};
|
|
52
53
|
const schema = joi.object({
|
|
53
54
|
ruleId: joi.string().required().max(AWS_RULE_LIMITS.RULE_ID_MAX_LENGTH).messages({
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
'string.empty': 'Rule ID is required',
|
|
56
|
+
'string.max': `Rule ID must not exceed ${AWS_RULE_LIMITS.RULE_ID_MAX_LENGTH} characters`
|
|
56
57
|
}),
|
|
57
58
|
status: joi.string().valid(...STATUS_OPTIONS.map((o)=>o.value)).required(),
|
|
58
59
|
...createFilterValidationSchema(joi),
|
|
59
60
|
transitionsEnabled: joi.boolean(),
|
|
60
|
-
transitions: joi.when(
|
|
61
|
+
transitions: joi.when('transitionsEnabled', {
|
|
61
62
|
is: true,
|
|
62
63
|
then: joi.array().items(joi.object({
|
|
63
|
-
timeType: joi.string().valid(
|
|
64
|
-
days: joi.when(
|
|
65
|
-
is:
|
|
64
|
+
timeType: joi.string().valid('days', 'date').required(),
|
|
65
|
+
days: joi.when('timeType', {
|
|
66
|
+
is: 'days',
|
|
66
67
|
then: joi.number().integer().min(0).required().messages({
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
'number.base': 'Days must be a number',
|
|
69
|
+
'number.min': 'Days must be at least 0'
|
|
69
70
|
}),
|
|
70
71
|
otherwise: joi.any()
|
|
71
72
|
}),
|
|
72
|
-
date: joi.when(
|
|
73
|
-
is:
|
|
73
|
+
date: joi.when('timeType', {
|
|
74
|
+
is: 'date',
|
|
74
75
|
then: joi.string().required().messages({
|
|
75
|
-
|
|
76
|
+
'string.empty': 'Date is required'
|
|
76
77
|
}),
|
|
77
78
|
otherwise: joi.any()
|
|
78
79
|
}),
|
|
79
80
|
storageClass: joi.string().valid(...storageClassOptions.map((o)=>o.value)).required().messages({
|
|
80
|
-
|
|
81
|
+
'string.empty': 'Storage class is required'
|
|
81
82
|
})
|
|
82
83
|
}).custom((value, helpers)=>{
|
|
83
|
-
if (
|
|
84
|
+
if ('days' === value.timeType && value.storageClass && value.days < STORAGE_CLASS_MIN_DAYS[value.storageClass]) return helpers.error('any.custom', {
|
|
84
85
|
message: `${value.storageClass} requires at least ${STORAGE_CLASS_MIN_DAYS[value.storageClass]} days`
|
|
85
86
|
});
|
|
86
87
|
return value;
|
|
87
88
|
})).min(1).messages({
|
|
88
|
-
|
|
89
|
+
'array.min': 'At least one transition is required when enabled'
|
|
89
90
|
}),
|
|
90
91
|
otherwise: joi.any()
|
|
91
92
|
}),
|
|
92
93
|
expirationEnabled: joi.boolean(),
|
|
93
|
-
expirationType: joi.when(
|
|
94
|
+
expirationType: joi.when('expirationEnabled', {
|
|
94
95
|
is: true,
|
|
95
|
-
then: joi.string().valid(
|
|
96
|
+
then: joi.string().valid('days', 'date').required(),
|
|
96
97
|
otherwise: joi.any()
|
|
97
98
|
}),
|
|
98
|
-
expirationDays: joi.when(
|
|
99
|
-
is:
|
|
99
|
+
expirationDays: joi.when('expirationType', {
|
|
100
|
+
is: 'days',
|
|
100
101
|
then: joi.number().integer().min(1).required().messages({
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
'number.base': 'Days must be a number',
|
|
103
|
+
'number.min': 'Days must be at least 1'
|
|
103
104
|
}),
|
|
104
105
|
otherwise: joi.any()
|
|
105
106
|
}),
|
|
106
|
-
expirationDate: joi.when(
|
|
107
|
-
is:
|
|
107
|
+
expirationDate: joi.when('expirationType', {
|
|
108
|
+
is: 'date',
|
|
108
109
|
then: joi.string().required().messages({
|
|
109
|
-
|
|
110
|
+
'string.empty': 'Date is required'
|
|
110
111
|
}),
|
|
111
112
|
otherwise: joi.any()
|
|
112
113
|
}),
|
|
113
114
|
expiredObjectDeleteMarker: joi.boolean(),
|
|
114
115
|
noncurrentTransitionsEnabled: joi.boolean(),
|
|
115
|
-
noncurrentTransitions: joi.when(
|
|
116
|
+
noncurrentTransitions: joi.when('noncurrentTransitionsEnabled', {
|
|
116
117
|
is: true,
|
|
117
118
|
then: joi.array().items(joi.object({
|
|
118
119
|
noncurrentDays: joi.number().integer().min(LIFECYCLE_LIMITS.NONCURRENT_TRANSITION_MIN_DAYS).required().messages({
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
'number.base': 'Noncurrent days must be a number',
|
|
121
|
+
'number.min': `Noncurrent days must be at least ${LIFECYCLE_LIMITS.NONCURRENT_TRANSITION_MIN_DAYS}`
|
|
121
122
|
}),
|
|
122
123
|
storageClass: joi.string().valid(...storageClassOptions.map((o)=>o.value)).required().messages({
|
|
123
|
-
|
|
124
|
+
'string.empty': 'Storage class is required'
|
|
124
125
|
}),
|
|
125
|
-
newerNoncurrentVersions: joi.number().integer().min(0).optional().allow(null,
|
|
126
|
+
newerNoncurrentVersions: joi.number().integer().min(0).optional().allow(null, '')
|
|
126
127
|
})).min(1).messages({
|
|
127
|
-
|
|
128
|
+
'array.min': 'At least one noncurrent transition is required when enabled'
|
|
128
129
|
}),
|
|
129
130
|
otherwise: joi.any()
|
|
130
131
|
}),
|
|
131
132
|
noncurrentExpirationEnabled: joi.boolean(),
|
|
132
|
-
noncurrentExpirationDays: joi.when(
|
|
133
|
+
noncurrentExpirationDays: joi.when('noncurrentExpirationEnabled', {
|
|
133
134
|
is: true,
|
|
134
135
|
then: joi.number().integer().min(1).required().messages({
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
'number.base': 'Noncurrent days must be a number',
|
|
137
|
+
'number.min': 'Noncurrent days must be at least 1'
|
|
137
138
|
}),
|
|
138
139
|
otherwise: joi.any()
|
|
139
140
|
}),
|
|
140
|
-
noncurrentNewerVersions: joi.number().integer().min(0).optional().allow(null,
|
|
141
|
+
noncurrentNewerVersions: joi.number().integer().min(0).optional().allow(null, ''),
|
|
141
142
|
abortMpuEnabled: joi.boolean(),
|
|
142
|
-
abortMpuDays: joi.when(
|
|
143
|
+
abortMpuDays: joi.when('abortMpuEnabled', {
|
|
143
144
|
is: true,
|
|
144
145
|
then: joi.number().integer().min(LIFECYCLE_LIMITS.ABORT_MPU_MIN_DAYS).required().messages({
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
'number.base': 'Days must be a number',
|
|
147
|
+
'number.min': `Days must be at least ${LIFECYCLE_LIMITS.ABORT_MPU_MIN_DAYS}`
|
|
147
148
|
}),
|
|
148
149
|
otherwise: joi.any()
|
|
149
150
|
})
|
|
150
151
|
}).custom((value, helpers)=>{
|
|
151
152
|
const hasAtLeastOneAction = value.transitionsEnabled || value.expirationEnabled || value.expiredObjectDeleteMarker || value.noncurrentTransitionsEnabled || value.noncurrentExpirationEnabled || value.abortMpuEnabled;
|
|
152
|
-
if (!hasAtLeastOneAction) return helpers.error(
|
|
153
|
-
message:
|
|
153
|
+
if (!hasAtLeastOneAction) return helpers.error('any.custom', {
|
|
154
|
+
message: 'At least one lifecycle action must be enabled (transition, expiration, or abort multipart upload)'
|
|
154
155
|
});
|
|
155
|
-
if (value.expirationEnabled && value.expiredObjectDeleteMarker) return helpers.error(
|
|
156
|
-
message:
|
|
156
|
+
if (value.expirationEnabled && value.expiredObjectDeleteMarker) return helpers.error('any.custom', {
|
|
157
|
+
message: 'Expired delete markers removal cannot be combined with Days/Date expiration on the same rule'
|
|
157
158
|
});
|
|
158
|
-
if ((
|
|
159
|
-
message:
|
|
159
|
+
if (('tags' === value.filterType || 'and' === value.filterType) && value.abortMpuEnabled) return helpers.error('any.custom', {
|
|
160
|
+
message: 'Tag-based filter cannot be used with Abort Incomplete Multipart Upload'
|
|
160
161
|
});
|
|
161
162
|
return value;
|
|
162
163
|
});
|
|
@@ -168,17 +169,17 @@ const getArrayFieldError = (errors, fieldName, index, propertyName)=>{
|
|
|
168
169
|
};
|
|
169
170
|
const ruleToFormValues = (rule)=>{
|
|
170
171
|
const formValues = {
|
|
171
|
-
ruleId: rule.ID ||
|
|
172
|
-
status: rule.Status ||
|
|
173
|
-
filterType:
|
|
174
|
-
prefix:
|
|
172
|
+
ruleId: rule.ID || '',
|
|
173
|
+
status: rule.Status || 'Enabled',
|
|
174
|
+
filterType: 'none',
|
|
175
|
+
prefix: '',
|
|
175
176
|
tags: [],
|
|
176
177
|
transitionsEnabled: false,
|
|
177
178
|
transitions: [],
|
|
178
179
|
expirationEnabled: false,
|
|
179
|
-
expirationType:
|
|
180
|
+
expirationType: 'days',
|
|
180
181
|
expirationDays: 30,
|
|
181
|
-
expirationDate:
|
|
182
|
+
expirationDate: '',
|
|
182
183
|
expiredObjectDeleteMarker: false,
|
|
183
184
|
noncurrentTransitionsEnabled: false,
|
|
184
185
|
noncurrentTransitions: [],
|
|
@@ -188,26 +189,26 @@ const ruleToFormValues = (rule)=>{
|
|
|
188
189
|
abortMpuEnabled: false,
|
|
189
190
|
abortMpuDays: 7
|
|
190
191
|
};
|
|
191
|
-
if (void 0 !== rule.Prefix &&
|
|
192
|
-
formValues.filterType =
|
|
192
|
+
if (void 0 !== rule.Prefix && '' !== rule.Prefix) {
|
|
193
|
+
formValues.filterType = 'prefix';
|
|
193
194
|
formValues.prefix = rule.Prefix;
|
|
194
195
|
} else if (rule.Filter) {
|
|
195
196
|
if (rule.Filter.And) {
|
|
196
|
-
formValues.filterType =
|
|
197
|
-
formValues.prefix = rule.Filter.And.Prefix ||
|
|
197
|
+
formValues.filterType = 'and';
|
|
198
|
+
formValues.prefix = rule.Filter.And.Prefix || '';
|
|
198
199
|
formValues.tags = rule.Filter.And.Tags?.map((tag)=>({
|
|
199
|
-
key: tag.Key ||
|
|
200
|
-
value: tag.Value ||
|
|
200
|
+
key: tag.Key || '',
|
|
201
|
+
value: tag.Value || ''
|
|
201
202
|
})) || [];
|
|
202
203
|
} else if (void 0 !== rule.Filter.Prefix) {
|
|
203
|
-
formValues.filterType =
|
|
204
|
+
formValues.filterType = 'prefix';
|
|
204
205
|
formValues.prefix = rule.Filter.Prefix;
|
|
205
206
|
} else if (rule.Filter.Tag) {
|
|
206
|
-
formValues.filterType =
|
|
207
|
+
formValues.filterType = 'tags';
|
|
207
208
|
formValues.tags = [
|
|
208
209
|
{
|
|
209
|
-
key: rule.Filter.Tag.Key ||
|
|
210
|
-
value: rule.Filter.Tag.Value ||
|
|
210
|
+
key: rule.Filter.Tag.Key || '',
|
|
211
|
+
value: rule.Filter.Tag.Value || ''
|
|
211
212
|
}
|
|
212
213
|
];
|
|
213
214
|
}
|
|
@@ -215,21 +216,21 @@ const ruleToFormValues = (rule)=>{
|
|
|
215
216
|
if (rule.Transitions && rule.Transitions.length > 0) {
|
|
216
217
|
formValues.transitionsEnabled = true;
|
|
217
218
|
formValues.transitions = rule.Transitions.map((t)=>({
|
|
218
|
-
timeType: void 0 !== t.Days ?
|
|
219
|
+
timeType: void 0 !== t.Days ? 'days' : 'date',
|
|
219
220
|
days: t.Days || 30,
|
|
220
|
-
date: t.Date ? new Date(t.Date).toISOString().split(
|
|
221
|
-
storageClass: t.StorageClass ||
|
|
221
|
+
date: t.Date ? new Date(t.Date).toISOString().split('T')[0] : '',
|
|
222
|
+
storageClass: t.StorageClass || 'GLACIER'
|
|
222
223
|
}));
|
|
223
224
|
}
|
|
224
225
|
if (rule.Expiration) {
|
|
225
226
|
if (rule.Expiration.Days) {
|
|
226
227
|
formValues.expirationEnabled = true;
|
|
227
|
-
formValues.expirationType =
|
|
228
|
+
formValues.expirationType = 'days';
|
|
228
229
|
formValues.expirationDays = rule.Expiration.Days;
|
|
229
230
|
} else if (rule.Expiration.Date) {
|
|
230
231
|
formValues.expirationEnabled = true;
|
|
231
|
-
formValues.expirationType =
|
|
232
|
-
formValues.expirationDate = new Date(rule.Expiration.Date).toISOString().split(
|
|
232
|
+
formValues.expirationType = 'date';
|
|
233
|
+
formValues.expirationDate = new Date(rule.Expiration.Date).toISOString().split('T')[0];
|
|
233
234
|
}
|
|
234
235
|
if (rule.Expiration.ExpiredObjectDeleteMarker) formValues.expiredObjectDeleteMarker = true;
|
|
235
236
|
}
|
|
@@ -237,7 +238,7 @@ const ruleToFormValues = (rule)=>{
|
|
|
237
238
|
formValues.noncurrentTransitionsEnabled = true;
|
|
238
239
|
formValues.noncurrentTransitions = rule.NoncurrentVersionTransitions.map((t)=>({
|
|
239
240
|
noncurrentDays: t.NoncurrentDays || 30,
|
|
240
|
-
storageClass: t.StorageClass ||
|
|
241
|
+
storageClass: t.StorageClass || 'GLACIER',
|
|
241
242
|
newerNoncurrentVersions: t.NewerNoncurrentVersions || 0
|
|
242
243
|
}));
|
|
243
244
|
}
|
|
@@ -258,11 +259,11 @@ const generateStorageClassHelpText = ()=>{
|
|
|
258
259
|
const minDays = STORAGE_CLASS_MIN_DAYS[option.value];
|
|
259
260
|
if (minDays > 0) hints.push(`<li>${option.label}: min ${minDays} days</li>`);
|
|
260
261
|
});
|
|
261
|
-
return hints.length > 0 ? `Storage class requirements:<ul>${hints.join(
|
|
262
|
+
return hints.length > 0 ? `Storage class requirements:<ul>${hints.join('')}</ul>` : void 0;
|
|
262
263
|
};
|
|
263
264
|
function BucketLifecycleFormPage() {
|
|
264
265
|
const { bucketName, ruleId } = useParams();
|
|
265
|
-
const navigate =
|
|
266
|
+
const navigate = useDataBrowserNavigate();
|
|
266
267
|
const { showToast } = useToast();
|
|
267
268
|
const isEditMode = !!ruleId;
|
|
268
269
|
const { data: lifecycleData, status: lifecycleStatus } = useGetBucketLifecycle({
|
|
@@ -283,27 +284,27 @@ function BucketLifecycleFormPage() {
|
|
|
283
284
|
]);
|
|
284
285
|
const dynamicSchema = useMemo(()=>schema.keys({
|
|
285
286
|
ruleId: joi.string().required().invalid(...existingRuleIds).messages({
|
|
286
|
-
|
|
287
|
-
|
|
287
|
+
'string.empty': 'Rule ID is required',
|
|
288
|
+
'any.invalid': 'A rule with this ID already exists'
|
|
288
289
|
})
|
|
289
290
|
}), [
|
|
290
291
|
existingRuleIds
|
|
291
292
|
]);
|
|
292
293
|
const methods = useForm({
|
|
293
294
|
resolver: joiResolver(dynamicSchema),
|
|
294
|
-
mode:
|
|
295
|
+
mode: 'onChange',
|
|
295
296
|
defaultValues: {
|
|
296
|
-
ruleId:
|
|
297
|
-
status:
|
|
298
|
-
filterType:
|
|
299
|
-
prefix:
|
|
297
|
+
ruleId: '',
|
|
298
|
+
status: 'Enabled',
|
|
299
|
+
filterType: 'none',
|
|
300
|
+
prefix: '',
|
|
300
301
|
tags: [],
|
|
301
302
|
transitionsEnabled: false,
|
|
302
303
|
transitions: [],
|
|
303
304
|
expirationEnabled: false,
|
|
304
|
-
expirationType:
|
|
305
|
+
expirationType: 'days',
|
|
305
306
|
expirationDays: 30,
|
|
306
|
-
expirationDate:
|
|
307
|
+
expirationDate: '',
|
|
307
308
|
expiredObjectDeleteMarker: false,
|
|
308
309
|
noncurrentTransitionsEnabled: false,
|
|
309
310
|
noncurrentTransitions: [],
|
|
@@ -317,24 +318,24 @@ function BucketLifecycleFormPage() {
|
|
|
317
318
|
const { handleSubmit, register, control, watch, reset, formState: { isValid, isDirty, errors } } = methods;
|
|
318
319
|
const { fields: transitionFields, append: appendTransition, remove: removeTransition } = useFieldArray({
|
|
319
320
|
control,
|
|
320
|
-
name:
|
|
321
|
+
name: 'transitions'
|
|
321
322
|
});
|
|
322
323
|
const { fields: noncurrentTransitionFields, append: appendNoncurrentTransition, remove: removeNoncurrentTransition } = useFieldArray({
|
|
323
324
|
control,
|
|
324
|
-
name:
|
|
325
|
+
name: 'noncurrentTransitions'
|
|
325
326
|
});
|
|
326
327
|
const { fields: tagFields, append: appendTag, remove: removeTag } = useFieldArray({
|
|
327
328
|
control,
|
|
328
|
-
name:
|
|
329
|
+
name: 'tags'
|
|
329
330
|
});
|
|
330
|
-
const filterType = watch(
|
|
331
|
-
const transitionsEnabled = watch(
|
|
332
|
-
const expirationEnabled = watch(
|
|
333
|
-
const expirationType = watch(
|
|
334
|
-
const expiredObjectDeleteMarker = watch(
|
|
335
|
-
const noncurrentTransitionsEnabled = watch(
|
|
336
|
-
const noncurrentExpirationEnabled = watch(
|
|
337
|
-
const abortMpuEnabled = watch(
|
|
331
|
+
const filterType = watch('filterType');
|
|
332
|
+
const transitionsEnabled = watch('transitionsEnabled');
|
|
333
|
+
const expirationEnabled = watch('expirationEnabled');
|
|
334
|
+
const expirationType = watch('expirationType');
|
|
335
|
+
const expiredObjectDeleteMarker = watch('expiredObjectDeleteMarker');
|
|
336
|
+
const noncurrentTransitionsEnabled = watch('noncurrentTransitionsEnabled');
|
|
337
|
+
const noncurrentExpirationEnabled = watch('noncurrentExpirationEnabled');
|
|
338
|
+
const abortMpuEnabled = watch('abortMpuEnabled');
|
|
338
339
|
const { mutate: setLifecycle, isPending: isSaving } = useSetBucketLifecycle();
|
|
339
340
|
const transitionsHelpText = useMemo(()=>{
|
|
340
341
|
if (!transitionsEnabled || 0 === transitionFields.length) return;
|
|
@@ -366,10 +367,10 @@ function BucketLifecycleFormPage() {
|
|
|
366
367
|
const prevValue = prevTransitionsEnabledRef.current;
|
|
367
368
|
prevTransitionsEnabledRef.current = transitionsEnabled;
|
|
368
369
|
if (!isEditMode && null !== prevValue && !prevValue && transitionsEnabled && 0 === transitionFields.length) appendTransition({
|
|
369
|
-
timeType:
|
|
370
|
+
timeType: 'days',
|
|
370
371
|
days: 30,
|
|
371
|
-
date:
|
|
372
|
-
storageClass:
|
|
372
|
+
date: '',
|
|
373
|
+
storageClass: 'STANDARD_IA'
|
|
373
374
|
});
|
|
374
375
|
}, [
|
|
375
376
|
isEditMode,
|
|
@@ -382,7 +383,7 @@ function BucketLifecycleFormPage() {
|
|
|
382
383
|
prevNoncurrentTransitionsEnabledRef.current = noncurrentTransitionsEnabled;
|
|
383
384
|
if (!isEditMode && null !== prevValue && !prevValue && noncurrentTransitionsEnabled && 0 === noncurrentTransitionFields.length) appendNoncurrentTransition({
|
|
384
385
|
noncurrentDays: 30,
|
|
385
|
-
storageClass:
|
|
386
|
+
storageClass: 'GLACIER',
|
|
386
387
|
newerNoncurrentVersions: 0
|
|
387
388
|
});
|
|
388
389
|
}, [
|
|
@@ -395,17 +396,17 @@ function BucketLifecycleFormPage() {
|
|
|
395
396
|
useEffect(()=>{
|
|
396
397
|
const prevFilterType = prevFilterTypeRef.current;
|
|
397
398
|
prevFilterTypeRef.current = filterType;
|
|
398
|
-
if ((
|
|
399
|
+
if (('tags' === filterType || 'and' === filterType) && 0 === tagFields.length) {
|
|
399
400
|
if (!isEditMode || void 0 !== prevFilterType && prevFilterType !== filterType) appendTag({
|
|
400
|
-
key:
|
|
401
|
-
value:
|
|
401
|
+
key: '',
|
|
402
|
+
value: ''
|
|
402
403
|
});
|
|
403
404
|
}
|
|
404
405
|
if (void 0 !== prevFilterType && prevFilterType !== filterType) {
|
|
405
|
-
if ((
|
|
406
|
+
if (('none' === filterType || 'prefix' === filterType) && tagFields.length > 0) tagFields.forEach((_, index)=>{
|
|
406
407
|
removeTag(tagFields.length - 1 - index);
|
|
407
408
|
});
|
|
408
|
-
if (
|
|
409
|
+
if ('none' === filterType) methods.setValue('prefix', '', {
|
|
409
410
|
shouldDirty: true
|
|
410
411
|
});
|
|
411
412
|
}
|
|
@@ -434,15 +435,15 @@ function BucketLifecycleFormPage() {
|
|
|
434
435
|
const t = {
|
|
435
436
|
StorageClass: transition.storageClass
|
|
436
437
|
};
|
|
437
|
-
if (
|
|
438
|
+
if ('days' === transition.timeType) t.Days = transition.days;
|
|
438
439
|
else t.Date = new Date(transition.date);
|
|
439
440
|
return t;
|
|
440
441
|
});
|
|
441
442
|
if (data.expirationEnabled || data.expiredObjectDeleteMarker) {
|
|
442
443
|
rule.Expiration = {};
|
|
443
444
|
if (data.expirationEnabled) {
|
|
444
|
-
if (
|
|
445
|
-
else if (
|
|
445
|
+
if ('days' === data.expirationType) rule.Expiration.Days = data.expirationDays;
|
|
446
|
+
else if ('date' === data.expirationType) rule.Expiration.Date = new Date(data.expirationDate);
|
|
446
447
|
}
|
|
447
448
|
if (data.expiredObjectDeleteMarker) rule.Expiration.ExpiredObjectDeleteMarker = true;
|
|
448
449
|
}
|
|
@@ -476,17 +477,17 @@ function BucketLifecycleFormPage() {
|
|
|
476
477
|
onSuccess: ()=>{
|
|
477
478
|
showToast({
|
|
478
479
|
open: true,
|
|
479
|
-
message: `Lifecycle rule ${isEditMode ?
|
|
480
|
-
status:
|
|
480
|
+
message: `Lifecycle rule ${isEditMode ? 'updated' : 'created'} successfully`,
|
|
481
|
+
status: 'success'
|
|
481
482
|
});
|
|
482
483
|
navigate(`/buckets/${bucketName}?tab=lifecycle`);
|
|
483
484
|
},
|
|
484
485
|
onError: (error)=>{
|
|
485
|
-
const errorMessage = error instanceof Error ? error.message : `Failed to ${isEditMode ?
|
|
486
|
+
const errorMessage = error instanceof Error ? error.message : `Failed to ${isEditMode ? 'update' : 'create'} lifecycle rule`;
|
|
486
487
|
showToast({
|
|
487
488
|
open: true,
|
|
488
489
|
message: errorMessage,
|
|
489
|
-
status:
|
|
490
|
+
status: 'error'
|
|
490
491
|
});
|
|
491
492
|
}
|
|
492
493
|
});
|
|
@@ -499,7 +500,7 @@ function BucketLifecycleFormPage() {
|
|
|
499
500
|
isEditMode,
|
|
500
501
|
existingRule
|
|
501
502
|
]);
|
|
502
|
-
if (
|
|
503
|
+
if ('pending' === lifecycleStatus) return /*#__PURE__*/ jsx(Loader, {
|
|
503
504
|
centered: true,
|
|
504
505
|
children: /*#__PURE__*/ jsx(Text, {
|
|
505
506
|
children: "Loading..."
|
|
@@ -516,8 +517,8 @@ function BucketLifecycleFormPage() {
|
|
|
516
517
|
...methods,
|
|
517
518
|
children: /*#__PURE__*/ jsxs(Form, {
|
|
518
519
|
layout: {
|
|
519
|
-
kind:
|
|
520
|
-
title: isEditMode ?
|
|
520
|
+
kind: 'page',
|
|
521
|
+
title: isEditMode ? 'Edit Lifecycle Rule' : 'Create Lifecycle Rule'
|
|
521
522
|
},
|
|
522
523
|
requireMode: "partial",
|
|
523
524
|
onSubmit: handleSubmit(onSubmit),
|
|
@@ -533,10 +534,10 @@ function BucketLifecycleFormPage() {
|
|
|
533
534
|
disabled: isSaving
|
|
534
535
|
}),
|
|
535
536
|
/*#__PURE__*/ jsx(Button, {
|
|
536
|
-
id: isEditMode ?
|
|
537
|
+
id: isEditMode ? 'save-lifecycle-btn' : 'create-lifecycle-btn',
|
|
537
538
|
type: "submit",
|
|
538
539
|
variant: "primary",
|
|
539
|
-
label: isEditMode ?
|
|
540
|
+
label: isEditMode ? 'Save' : 'Create',
|
|
540
541
|
icon: isEditMode ? /*#__PURE__*/ jsx(Icon, {
|
|
541
542
|
name: "Save"
|
|
542
543
|
}) : void 0,
|
|
@@ -547,7 +548,7 @@ function BucketLifecycleFormPage() {
|
|
|
547
548
|
children: [
|
|
548
549
|
/*#__PURE__*/ jsxs(FormSection, {
|
|
549
550
|
title: {
|
|
550
|
-
name:
|
|
551
|
+
name: 'Rule Scope'
|
|
551
552
|
},
|
|
552
553
|
forceLabelWidth: convertRemToPixels(15),
|
|
553
554
|
children: [
|
|
@@ -559,10 +560,10 @@ function BucketLifecycleFormPage() {
|
|
|
559
560
|
helpErrorPosition: "bottom",
|
|
560
561
|
required: true,
|
|
561
562
|
content: isEditMode ? /*#__PURE__*/ jsx(Text, {
|
|
562
|
-
children: watch(
|
|
563
|
+
children: watch('ruleId')
|
|
563
564
|
}) : /*#__PURE__*/ jsx(Input, {
|
|
564
565
|
id: "ruleId",
|
|
565
|
-
...register(
|
|
566
|
+
...register('ruleId')
|
|
566
567
|
})
|
|
567
568
|
}),
|
|
568
569
|
/*#__PURE__*/ jsx(FormGroup, {
|
|
@@ -590,8 +591,8 @@ function BucketLifecycleFormPage() {
|
|
|
590
591
|
}),
|
|
591
592
|
/*#__PURE__*/ jsx(FilterFormSection, {
|
|
592
593
|
filterType: filterType,
|
|
593
|
-
onFilterTypeChange: (value)=>methods.setValue(
|
|
594
|
-
prefixRegister: register(
|
|
594
|
+
onFilterTypeChange: (value)=>methods.setValue('filterType', value),
|
|
595
|
+
prefixRegister: register('prefix'),
|
|
595
596
|
tagFields: tagFields,
|
|
596
597
|
tagKeyRegister: (index)=>register(`tags.${index}.key`),
|
|
597
598
|
tagValueRegister: (index)=>register(`tags.${index}.value`),
|
|
@@ -603,7 +604,7 @@ function BucketLifecycleFormPage() {
|
|
|
603
604
|
}),
|
|
604
605
|
/*#__PURE__*/ jsxs(FormSection, {
|
|
605
606
|
title: {
|
|
606
|
-
name: transitionsEnabled || expirationEnabled || noncurrentTransitionsEnabled || noncurrentExpirationEnabled || abortMpuEnabled ?
|
|
607
|
+
name: transitionsEnabled || expirationEnabled || noncurrentTransitionsEnabled || noncurrentExpirationEnabled || abortMpuEnabled ? 'Lifecycle Rule' : 'Lifecycle Rule (At least one action must be enabled)'
|
|
607
608
|
},
|
|
608
609
|
forceLabelWidth: convertRemToPixels(18),
|
|
609
610
|
children: [
|
|
@@ -618,7 +619,7 @@ function BucketLifecycleFormPage() {
|
|
|
618
619
|
render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
|
|
619
620
|
toggle: field.value,
|
|
620
621
|
onChange: field.onChange,
|
|
621
|
-
label: field.value ?
|
|
622
|
+
label: field.value ? 'Enabled' : 'Disabled'
|
|
622
623
|
})
|
|
623
624
|
})
|
|
624
625
|
}),
|
|
@@ -694,7 +695,7 @@ function BucketLifecycleFormPage() {
|
|
|
694
695
|
}),
|
|
695
696
|
/*#__PURE__*/ jsx(Box, {
|
|
696
697
|
flex: "1",
|
|
697
|
-
children:
|
|
698
|
+
children: 'days' === watch(`transitions.${index}.timeType`) ? /*#__PURE__*/ jsx(Input, {
|
|
698
699
|
id: `transition-days-${index}`,
|
|
699
700
|
type: "number",
|
|
700
701
|
placeholder: "Days",
|
|
@@ -731,30 +732,30 @@ function BucketLifecycleFormPage() {
|
|
|
731
732
|
showAdd: index === transitionFields.length - 1,
|
|
732
733
|
onRemove: ()=>removeTransition(index),
|
|
733
734
|
onAdd: ()=>appendTransition({
|
|
734
|
-
timeType:
|
|
735
|
+
timeType: 'days',
|
|
735
736
|
days: 30,
|
|
736
|
-
date:
|
|
737
|
-
storageClass:
|
|
737
|
+
date: '',
|
|
738
|
+
storageClass: 'STANDARD_IA'
|
|
738
739
|
}),
|
|
739
740
|
canRemove: transitionFields.length > 1
|
|
740
741
|
})
|
|
741
742
|
]
|
|
742
743
|
}),
|
|
743
|
-
getArrayFieldError(errors,
|
|
744
|
+
getArrayFieldError(errors, 'transitions', index) && /*#__PURE__*/ jsx(Text, {
|
|
744
745
|
color: "statusCritical",
|
|
745
|
-
children: getArrayFieldError(errors,
|
|
746
|
+
children: getArrayFieldError(errors, 'transitions', index)
|
|
746
747
|
}),
|
|
747
|
-
getArrayFieldError(errors,
|
|
748
|
+
getArrayFieldError(errors, 'transitions', index, 'days') && /*#__PURE__*/ jsx(Text, {
|
|
748
749
|
color: "statusCritical",
|
|
749
|
-
children: getArrayFieldError(errors,
|
|
750
|
+
children: getArrayFieldError(errors, 'transitions', index, 'days')
|
|
750
751
|
}),
|
|
751
|
-
getArrayFieldError(errors,
|
|
752
|
+
getArrayFieldError(errors, 'transitions', index, 'storageClass') && /*#__PURE__*/ jsx(Text, {
|
|
752
753
|
color: "statusCritical",
|
|
753
|
-
children: getArrayFieldError(errors,
|
|
754
|
+
children: getArrayFieldError(errors, 'transitions', index, 'storageClass')
|
|
754
755
|
}),
|
|
755
|
-
getArrayFieldError(errors,
|
|
756
|
+
getArrayFieldError(errors, 'transitions', index, 'date') && /*#__PURE__*/ jsx(Text, {
|
|
756
757
|
color: "statusCritical",
|
|
757
|
-
children: getArrayFieldError(errors,
|
|
758
|
+
children: getArrayFieldError(errors, 'transitions', index, 'date')
|
|
758
759
|
})
|
|
759
760
|
]
|
|
760
761
|
}, field.id))
|
|
@@ -773,11 +774,11 @@ function BucketLifecycleFormPage() {
|
|
|
773
774
|
toggle: field.value,
|
|
774
775
|
onChange: (value)=>{
|
|
775
776
|
field.onChange(value);
|
|
776
|
-
if (value && expiredObjectDeleteMarker) methods.setValue(
|
|
777
|
+
if (value && expiredObjectDeleteMarker) methods.setValue('expiredObjectDeleteMarker', false, {
|
|
777
778
|
shouldDirty: true
|
|
778
779
|
});
|
|
779
780
|
},
|
|
780
|
-
label: field.value ?
|
|
781
|
+
label: field.value ? 'Enabled' : 'Disabled',
|
|
781
782
|
disabled: expiredObjectDeleteMarker
|
|
782
783
|
})
|
|
783
784
|
})
|
|
@@ -808,7 +809,7 @@ function BucketLifecycleFormPage() {
|
|
|
808
809
|
})
|
|
809
810
|
})
|
|
810
811
|
}),
|
|
811
|
-
|
|
812
|
+
'days' === expirationType && /*#__PURE__*/ jsx(FormGroup, {
|
|
812
813
|
label: "Days",
|
|
813
814
|
id: "expirationDays",
|
|
814
815
|
direction: "horizontal",
|
|
@@ -819,13 +820,13 @@ function BucketLifecycleFormPage() {
|
|
|
819
820
|
children: /*#__PURE__*/ jsx(Input, {
|
|
820
821
|
type: "number",
|
|
821
822
|
id: "expirationDays",
|
|
822
|
-
...register(
|
|
823
|
+
...register('expirationDays', {
|
|
823
824
|
valueAsNumber: true
|
|
824
825
|
})
|
|
825
826
|
})
|
|
826
827
|
})
|
|
827
828
|
}),
|
|
828
|
-
|
|
829
|
+
'date' === expirationType && /*#__PURE__*/ jsx(FormGroup, {
|
|
829
830
|
label: "Date",
|
|
830
831
|
id: "expirationDate",
|
|
831
832
|
direction: "horizontal",
|
|
@@ -834,7 +835,7 @@ function BucketLifecycleFormPage() {
|
|
|
834
835
|
content: /*#__PURE__*/ jsx(Input, {
|
|
835
836
|
type: "date",
|
|
836
837
|
id: "expirationDate",
|
|
837
|
-
...register(
|
|
838
|
+
...register('expirationDate')
|
|
838
839
|
})
|
|
839
840
|
})
|
|
840
841
|
]
|
|
@@ -851,11 +852,11 @@ function BucketLifecycleFormPage() {
|
|
|
851
852
|
toggle: field.value,
|
|
852
853
|
onChange: (value)=>{
|
|
853
854
|
field.onChange(value);
|
|
854
|
-
if (value && expirationEnabled) methods.setValue(
|
|
855
|
+
if (value && expirationEnabled) methods.setValue('expirationEnabled', false, {
|
|
855
856
|
shouldDirty: true
|
|
856
857
|
});
|
|
857
858
|
},
|
|
858
|
-
label: field.value ?
|
|
859
|
+
label: field.value ? 'Enabled' : 'Disabled',
|
|
859
860
|
disabled: expirationEnabled
|
|
860
861
|
})
|
|
861
862
|
})
|
|
@@ -870,7 +871,7 @@ function BucketLifecycleFormPage() {
|
|
|
870
871
|
render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
|
|
871
872
|
toggle: field.value,
|
|
872
873
|
onChange: field.onChange,
|
|
873
|
-
label: field.value ?
|
|
874
|
+
label: field.value ? 'Enabled' : 'Disabled'
|
|
874
875
|
})
|
|
875
876
|
})
|
|
876
877
|
}),
|
|
@@ -972,20 +973,20 @@ function BucketLifecycleFormPage() {
|
|
|
972
973
|
onRemove: ()=>removeNoncurrentTransition(index),
|
|
973
974
|
onAdd: ()=>appendNoncurrentTransition({
|
|
974
975
|
noncurrentDays: 30,
|
|
975
|
-
storageClass:
|
|
976
|
+
storageClass: 'GLACIER',
|
|
976
977
|
newerNoncurrentVersions: 0
|
|
977
978
|
}),
|
|
978
979
|
canRemove: noncurrentTransitionFields.length > 1
|
|
979
980
|
})
|
|
980
981
|
]
|
|
981
982
|
}),
|
|
982
|
-
getArrayFieldError(errors,
|
|
983
|
+
getArrayFieldError(errors, 'noncurrentTransitions', index, 'noncurrentDays') && /*#__PURE__*/ jsx(Text, {
|
|
983
984
|
color: "statusCritical",
|
|
984
|
-
children: getArrayFieldError(errors,
|
|
985
|
+
children: getArrayFieldError(errors, 'noncurrentTransitions', index, 'noncurrentDays')
|
|
985
986
|
}),
|
|
986
|
-
getArrayFieldError(errors,
|
|
987
|
+
getArrayFieldError(errors, 'noncurrentTransitions', index, 'storageClass') && /*#__PURE__*/ jsx(Text, {
|
|
987
988
|
color: "statusCritical",
|
|
988
|
-
children: getArrayFieldError(errors,
|
|
989
|
+
children: getArrayFieldError(errors, 'noncurrentTransitions', index, 'storageClass')
|
|
989
990
|
})
|
|
990
991
|
]
|
|
991
992
|
}, field.id))
|
|
@@ -1002,7 +1003,7 @@ function BucketLifecycleFormPage() {
|
|
|
1002
1003
|
render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
|
|
1003
1004
|
toggle: field.value,
|
|
1004
1005
|
onChange: field.onChange,
|
|
1005
|
-
label: field.value ?
|
|
1006
|
+
label: field.value ? 'Enabled' : 'Disabled'
|
|
1006
1007
|
})
|
|
1007
1008
|
})
|
|
1008
1009
|
}),
|
|
@@ -1019,7 +1020,7 @@ function BucketLifecycleFormPage() {
|
|
|
1019
1020
|
children: /*#__PURE__*/ jsx(Input, {
|
|
1020
1021
|
type: "number",
|
|
1021
1022
|
id: "noncurrentExpirationDays",
|
|
1022
|
-
...register(
|
|
1023
|
+
...register('noncurrentExpirationDays', {
|
|
1023
1024
|
valueAsNumber: true
|
|
1024
1025
|
})
|
|
1025
1026
|
})
|
|
@@ -1035,7 +1036,7 @@ function BucketLifecycleFormPage() {
|
|
|
1035
1036
|
type: "number",
|
|
1036
1037
|
id: "noncurrentNewerVersions",
|
|
1037
1038
|
placeholder: "0",
|
|
1038
|
-
...register(
|
|
1039
|
+
...register('noncurrentNewerVersions', {
|
|
1039
1040
|
valueAsNumber: true
|
|
1040
1041
|
})
|
|
1041
1042
|
})
|
|
@@ -1047,7 +1048,7 @@ function BucketLifecycleFormPage() {
|
|
|
1047
1048
|
label: "Expire incomplete multipart upload",
|
|
1048
1049
|
id: "abortMpuEnabled",
|
|
1049
1050
|
direction: "horizontal",
|
|
1050
|
-
error: (
|
|
1051
|
+
error: ('tags' === filterType || 'and' === filterType) && abortMpuEnabled ? 'Tag-based filter cannot be used with Abort Incomplete Multipart Upload' : void 0,
|
|
1051
1052
|
helpErrorPosition: "bottom",
|
|
1052
1053
|
content: /*#__PURE__*/ jsx(Controller, {
|
|
1053
1054
|
name: "abortMpuEnabled",
|
|
@@ -1055,7 +1056,7 @@ function BucketLifecycleFormPage() {
|
|
|
1055
1056
|
render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
|
|
1056
1057
|
toggle: field.value,
|
|
1057
1058
|
onChange: field.onChange,
|
|
1058
|
-
label: field.value ?
|
|
1059
|
+
label: field.value ? 'Enabled' : 'Disabled'
|
|
1059
1060
|
})
|
|
1060
1061
|
})
|
|
1061
1062
|
}),
|
|
@@ -1070,7 +1071,7 @@ function BucketLifecycleFormPage() {
|
|
|
1070
1071
|
children: /*#__PURE__*/ jsx(Input, {
|
|
1071
1072
|
type: "number",
|
|
1072
1073
|
id: "abortMpuDays",
|
|
1073
|
-
...register(
|
|
1074
|
+
...register('abortMpuDays', {
|
|
1074
1075
|
valueAsNumber: true
|
|
1075
1076
|
})
|
|
1076
1077
|
})
|