@scality/data-browser-library 1.0.0-preview.9 → 1.0.1

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.
Files changed (285) hide show
  1. package/dist/components/DataBrowserUI.d.ts +12 -0
  2. package/dist/components/DataBrowserUI.js +99 -0
  3. package/dist/components/Editor.d.ts +1 -1
  4. package/dist/components/Editor.js +3 -3
  5. package/dist/components/__tests__/BucketAccessor.test.js +214 -0
  6. package/dist/components/__tests__/BucketCorsPage.test.d.ts +1 -0
  7. package/dist/components/__tests__/BucketCorsPage.test.js +263 -0
  8. package/dist/components/__tests__/BucketCreate.test.js +271 -105
  9. package/dist/components/__tests__/BucketDetails.test.d.ts +1 -0
  10. package/dist/components/__tests__/BucketDetails.test.js +421 -0
  11. package/dist/components/__tests__/BucketLifecycleFormPage.test.d.ts +13 -0
  12. package/dist/components/__tests__/BucketLifecycleFormPage.test.js +178 -178
  13. package/dist/components/__tests__/BucketLifecycleList.test.js +85 -85
  14. package/dist/components/__tests__/BucketList.test.js +463 -239
  15. package/dist/components/__tests__/BucketNotificationFormPage.test.d.ts +1 -0
  16. package/dist/components/__tests__/BucketNotificationFormPage.test.js +348 -0
  17. package/dist/components/__tests__/BucketNotificationList.test.d.ts +1 -0
  18. package/dist/components/__tests__/BucketNotificationList.test.js +379 -0
  19. package/dist/components/__tests__/BucketOverview.test.js +281 -266
  20. package/dist/components/__tests__/BucketPolicyPage.test.js +151 -99
  21. package/dist/components/__tests__/BucketReplicationFormPage.test.d.ts +15 -0
  22. package/dist/components/__tests__/BucketReplicationFormPage.test.js +544 -544
  23. package/dist/components/__tests__/BucketReplicationList.test.js +106 -106
  24. package/dist/components/__tests__/CreateFolderButton.test.js +56 -56
  25. package/dist/components/__tests__/DeleteBucketButton.test.js +64 -64
  26. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +47 -47
  27. package/dist/components/__tests__/DeleteObjectButton.test.js +64 -64
  28. package/dist/components/__tests__/EmptyBucketButton.test.js +59 -59
  29. package/dist/components/__tests__/MetadataSearch.test.js +65 -65
  30. package/dist/components/__tests__/ObjectList.test.js +741 -240
  31. package/dist/components/__tests__/UploadButton.test.js +45 -45
  32. package/dist/components/breadcrumb/Breadcrumb.d.ts +6 -0
  33. package/dist/components/breadcrumb/Breadcrumb.js +37 -0
  34. package/dist/components/breadcrumb/DataBrowserBreadcrumb.d.ts +1 -0
  35. package/dist/components/breadcrumb/DataBrowserBreadcrumb.js +10 -0
  36. package/dist/components/breadcrumb/__tests__/Breadcrumb.test.d.ts +1 -0
  37. package/dist/components/breadcrumb/__tests__/Breadcrumb.test.js +196 -0
  38. package/dist/components/breadcrumb/__tests__/DataBrowserBreadcrumb.test.d.ts +1 -0
  39. package/dist/components/breadcrumb/__tests__/DataBrowserBreadcrumb.test.js +153 -0
  40. package/dist/components/breadcrumb/__tests__/useBreadcrumbPaths.test.d.ts +1 -0
  41. package/dist/components/breadcrumb/__tests__/useBreadcrumbPaths.test.js +134 -0
  42. package/dist/components/breadcrumb/index.d.ts +8 -0
  43. package/dist/components/breadcrumb/index.js +4 -0
  44. package/dist/components/breadcrumb/useBreadcrumbPaths.d.ts +2 -0
  45. package/dist/components/breadcrumb/useBreadcrumbPaths.js +82 -0
  46. package/dist/components/buckets/BucketAccessor.d.ts +2 -0
  47. package/dist/components/buckets/BucketAccessor.js +125 -0
  48. package/dist/components/buckets/BucketConfigEditButton.d.ts +8 -0
  49. package/dist/components/buckets/{BucketPolicyButton.js → BucketConfigEditButton.js} +9 -5
  50. package/dist/components/buckets/BucketCorsPage.d.ts +1 -0
  51. package/dist/components/buckets/BucketCorsPage.js +234 -0
  52. package/dist/components/buckets/BucketCreate.d.ts +3 -2
  53. package/dist/components/buckets/BucketCreate.js +89 -47
  54. package/dist/components/buckets/BucketDetails.d.ts +42 -0
  55. package/dist/components/buckets/BucketDetails.js +249 -85
  56. package/dist/components/buckets/BucketLifecycleFormPage.js +206 -190
  57. package/dist/components/buckets/BucketLifecycleList.d.ts +2 -2
  58. package/dist/components/buckets/BucketLifecycleList.js +47 -47
  59. package/dist/components/buckets/BucketList.d.ts +7 -8
  60. package/dist/components/buckets/BucketList.js +158 -101
  61. package/dist/components/buckets/BucketLocation.js +4 -4
  62. package/dist/components/buckets/BucketOverview.d.ts +22 -2
  63. package/dist/components/buckets/BucketOverview.js +394 -187
  64. package/dist/components/buckets/BucketPage.js +43 -21
  65. package/dist/components/buckets/BucketPolicyPage.js +155 -127
  66. package/dist/components/buckets/BucketReplicationFormPage.js +134 -133
  67. package/dist/components/buckets/BucketReplicationList.d.ts +2 -2
  68. package/dist/components/buckets/BucketReplicationList.js +42 -42
  69. package/dist/components/buckets/BucketVersioning.d.ts +4 -0
  70. package/dist/components/buckets/BucketVersioning.js +76 -0
  71. package/dist/components/buckets/DeleteBucketButton.js +8 -8
  72. package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +2 -2
  73. package/dist/components/buckets/DeleteBucketConfigRuleButton.js +2 -2
  74. package/dist/components/buckets/EmptyBucketButton.js +24 -24
  75. package/dist/components/buckets/EmptyBucketSummary.d.ts +2 -2
  76. package/dist/components/buckets/EmptyBucketSummary.js +1 -1
  77. package/dist/components/buckets/EmptyBucketSummaryList.d.ts +1 -1
  78. package/dist/components/buckets/EmptyBucketSummaryList.js +22 -22
  79. package/dist/components/buckets/__tests__/BucketVersioning.test.d.ts +1 -0
  80. package/dist/components/buckets/__tests__/BucketVersioning.test.js +163 -0
  81. package/dist/components/buckets/notifications/BucketNotificationFormPage.d.ts +1 -0
  82. package/dist/components/buckets/notifications/BucketNotificationFormPage.js +316 -0
  83. package/dist/components/buckets/notifications/BucketNotificationList.d.ts +10 -0
  84. package/dist/components/buckets/notifications/BucketNotificationList.js +267 -0
  85. package/dist/components/buckets/notifications/EventsSection.js +145 -29
  86. package/dist/components/buckets/notifications/__tests__/events.test.d.ts +1 -0
  87. package/dist/components/buckets/notifications/__tests__/events.test.js +56 -0
  88. package/dist/components/buckets/notifications/events.d.ts +71 -7
  89. package/dist/components/buckets/notifications/events.js +98 -16
  90. package/dist/components/index.d.ts +27 -20
  91. package/dist/components/index.js +17 -10
  92. package/dist/components/layouts/ArrowNavigation.d.ts +3 -0
  93. package/dist/components/layouts/ArrowNavigation.js +28 -0
  94. package/dist/components/layouts/BrowserPageLayout.d.ts +5 -1
  95. package/dist/components/layouts/BrowserPageLayout.js +10 -5
  96. package/dist/components/objects/CreateFolderButton.d.ts +2 -2
  97. package/dist/components/objects/CreateFolderButton.js +12 -12
  98. package/dist/components/objects/DeleteObjectButton.d.ts +1 -1
  99. package/dist/components/objects/DeleteObjectButton.js +19 -21
  100. package/dist/components/objects/GetPresignedUrlButton.d.ts +7 -0
  101. package/dist/components/objects/GetPresignedUrlButton.js +255 -0
  102. package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +2 -2
  103. package/dist/components/objects/ObjectDetails/ObjectMetadata.js +263 -230
  104. package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +2 -2
  105. package/dist/components/objects/ObjectDetails/ObjectSummary.js +540 -138
  106. package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +2 -2
  107. package/dist/components/objects/ObjectDetails/ObjectTags.js +95 -123
  108. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.d.ts +1 -0
  109. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +516 -0
  110. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.d.ts +1 -0
  111. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.js +1064 -0
  112. package/dist/components/objects/ObjectDetails/index.d.ts +18 -2
  113. package/dist/components/objects/ObjectDetails/index.js +152 -40
  114. package/dist/components/objects/ObjectList.d.ts +12 -10
  115. package/dist/components/objects/ObjectList.js +590 -263
  116. package/dist/components/objects/ObjectLock/EditRetentionButton.js +4 -4
  117. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +15 -15
  118. package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +1 -1
  119. package/dist/components/objects/ObjectLock/ObjectLockSettings.js +32 -31
  120. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +1 -1
  121. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +6 -6
  122. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +51 -51
  123. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +78 -78
  124. package/dist/components/objects/ObjectPage.js +12 -8
  125. package/dist/components/objects/UploadButton.d.ts +3 -3
  126. package/dist/components/objects/UploadButton.js +10 -10
  127. package/dist/components/objects/__tests__/GetPresignedUrlButton.test.d.ts +1 -0
  128. package/dist/components/objects/__tests__/GetPresignedUrlButton.test.js +531 -0
  129. package/dist/components/providers/DataBrowserProvider.d.ts +23 -12
  130. package/dist/components/providers/DataBrowserProvider.js +60 -38
  131. package/dist/components/providers/QueryProvider.d.ts +9 -0
  132. package/dist/components/providers/QueryProvider.js +21 -0
  133. package/dist/components/search/MetadataSearch.js +29 -28
  134. package/dist/components/search/SearchHints.js +1 -1
  135. package/dist/components/ui/ArrayFieldActions.js +12 -7
  136. package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +2 -2
  137. package/dist/components/ui/ConfirmDeleteRuleModal.js +6 -1
  138. package/dist/components/ui/DeleteObjectModalContent.d.ts +1 -1
  139. package/dist/components/ui/DeleteObjectModalContent.js +12 -12
  140. package/dist/components/ui/FilterFormSection.d.ts +2 -2
  141. package/dist/components/ui/FilterFormSection.js +29 -29
  142. package/dist/components/ui/Search.elements.d.ts +2 -2
  143. package/dist/components/ui/Search.elements.js +7 -7
  144. package/dist/components/ui/Table.elements.d.ts +2 -1
  145. package/dist/components/ui/Table.elements.js +18 -12
  146. package/dist/config/__tests__/factory.test.d.ts +1 -0
  147. package/dist/config/__tests__/factory.test.js +311 -0
  148. package/dist/config/factory.d.ts +10 -56
  149. package/dist/config/factory.js +23 -71
  150. package/dist/config/types.d.ts +212 -34
  151. package/dist/contexts/DataBrowserUICustomizationContext.d.ts +27 -0
  152. package/dist/contexts/DataBrowserUICustomizationContext.js +13 -0
  153. package/dist/hooks/__tests__/useAccessibleBuckets.test.d.ts +1 -0
  154. package/dist/hooks/__tests__/useAccessibleBuckets.test.js +145 -0
  155. package/dist/hooks/__tests__/useISVBucketDetection.test.js +45 -45
  156. package/dist/hooks/__tests__/useIsBucketEmpty.test.js +27 -27
  157. package/dist/hooks/__tests__/useLoginMutation.test.d.ts +1 -0
  158. package/dist/hooks/__tests__/useLoginMutation.test.js +194 -0
  159. package/dist/hooks/bucketConfiguration.d.ts +8 -1
  160. package/dist/hooks/bucketConfiguration.js +52 -51
  161. package/dist/hooks/bucketOperations.d.ts +10 -1
  162. package/dist/hooks/bucketOperations.js +10 -9
  163. package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +80 -80
  164. package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +80 -80
  165. package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +44 -44
  166. package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +63 -63
  167. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +65 -65
  168. package/dist/hooks/factories/index.d.ts +4 -4
  169. package/dist/hooks/factories/index.js +2 -2
  170. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +2 -2
  171. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +16 -13
  172. package/dist/hooks/factories/useCreateS3LoginHook.d.ts +2 -2
  173. package/dist/hooks/factories/useCreateS3LoginHook.js +1 -1
  174. package/dist/hooks/factories/useCreateS3MutationHook.d.ts +3 -3
  175. package/dist/hooks/factories/useCreateS3MutationHook.js +7 -2
  176. package/dist/hooks/factories/useCreateS3QueryHook.d.ts +2 -2
  177. package/dist/hooks/factories/useCreateS3QueryHook.js +11 -6
  178. package/dist/hooks/index.d.ts +19 -12
  179. package/dist/hooks/index.js +16 -9
  180. package/dist/hooks/loginOperations.d.ts +1 -1
  181. package/dist/hooks/loginOperations.js +1 -1
  182. package/dist/hooks/objectOperations.d.ts +2 -2
  183. package/dist/hooks/objectOperations.js +50 -49
  184. package/dist/hooks/presignedOperations.d.ts +4 -4
  185. package/dist/hooks/presignedOperations.js +5 -5
  186. package/dist/hooks/useAccessibleBuckets.d.ts +11 -0
  187. package/dist/hooks/useAccessibleBuckets.js +115 -0
  188. package/dist/hooks/useBatchObjectLegalHold.d.ts +11 -0
  189. package/dist/hooks/useBatchObjectLegalHold.js +48 -0
  190. package/dist/hooks/useBucketConfigEditor.d.ts +31 -0
  191. package/dist/hooks/useBucketConfigEditor.js +82 -0
  192. package/dist/hooks/useDataBrowserNavigate.d.ts +28 -0
  193. package/dist/hooks/useDataBrowserNavigate.js +24 -0
  194. package/dist/hooks/useDeleteBucketConfigRule.d.ts +2 -2
  195. package/dist/hooks/useDeleteBucketConfigRule.js +4 -4
  196. package/dist/hooks/useEmptyBucket.js +11 -11
  197. package/dist/hooks/useFeatures.d.ts +7 -0
  198. package/dist/hooks/useFeatures.js +8 -0
  199. package/dist/hooks/useISVBucketDetection.js +6 -6
  200. package/dist/hooks/useIsBucketEmpty.js +4 -4
  201. package/dist/hooks/useLimitedAccessFlow.d.ts +48 -0
  202. package/dist/hooks/useLimitedAccessFlow.js +23 -0
  203. package/dist/hooks/useS3Client.d.ts +6 -0
  204. package/dist/hooks/useS3Client.js +3 -2
  205. package/dist/hooks/useS3ConfigSwitch.d.ts +11 -0
  206. package/dist/hooks/useS3ConfigSwitch.js +37 -0
  207. package/dist/hooks/useSupportedNotificationEvents.d.ts +6 -0
  208. package/dist/hooks/useSupportedNotificationEvents.js +8 -0
  209. package/dist/index.d.ts +6 -6
  210. package/dist/index.js +2 -2
  211. package/dist/schemas/bucketPolicySchema.json +3 -13
  212. package/dist/test/msw/handlers/deleteBucket.d.ts +1 -1
  213. package/dist/test/msw/handlers/deleteBucket.js +20 -10
  214. package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -1
  215. package/dist/test/msw/handlers/getBucketAcl.js +29 -17
  216. package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -1
  217. package/dist/test/msw/handlers/getBucketLocation.js +29 -15
  218. package/dist/test/msw/handlers/getBucketPolicy.d.ts +1 -1
  219. package/dist/test/msw/handlers/getBucketPolicy.js +52 -32
  220. package/dist/test/msw/handlers/headObject.d.ts +1 -1
  221. package/dist/test/msw/handlers/headObject.js +31 -13
  222. package/dist/test/msw/handlers/listBuckets.d.ts +1 -1
  223. package/dist/test/msw/handlers/listBuckets.js +5 -3
  224. package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -1
  225. package/dist/test/msw/handlers/listObjectVersions.js +38 -26
  226. package/dist/test/msw/handlers/listObjects.d.ts +1 -1
  227. package/dist/test/msw/handlers/listObjects.js +35 -23
  228. package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -1
  229. package/dist/test/msw/handlers/objectLegalHold.js +32 -17
  230. package/dist/test/msw/handlers/objectRetention.d.ts +1 -1
  231. package/dist/test/msw/handlers/objectRetention.js +31 -17
  232. package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -1
  233. package/dist/test/msw/handlers/putBucketAcl.js +29 -14
  234. package/dist/test/msw/handlers/putObject.d.ts +1 -1
  235. package/dist/test/msw/handlers/putObject.js +27 -12
  236. package/dist/test/msw/handlers.d.ts +3 -3
  237. package/dist/test/msw/handlers.js +77 -54
  238. package/dist/test/msw/index.d.ts +2 -2
  239. package/dist/test/msw/index.js +1 -1
  240. package/dist/test/msw/server.d.ts +1 -1
  241. package/dist/test/msw/server.js +1 -1
  242. package/dist/test/msw/utils.js +2 -2
  243. package/dist/test/setup.d.ts +1 -1
  244. package/dist/test/setup.js +13 -30
  245. package/dist/test/testUtils.d.ts +85 -33
  246. package/dist/test/testUtils.js +176 -111
  247. package/dist/test/utils/errorHandling.test.js +119 -119
  248. package/dist/types/index.d.ts +49 -36
  249. package/dist/types/monaco.d.ts +13 -0
  250. package/dist/types/monaco.js +0 -0
  251. package/dist/utils/__tests__/proxyMiddleware.test.d.ts +1 -0
  252. package/dist/utils/__tests__/proxyMiddleware.test.js +579 -0
  253. package/dist/utils/__tests__/s3Client.test.d.ts +1 -0
  254. package/dist/utils/__tests__/s3Client.test.js +340 -0
  255. package/dist/utils/__tests__/s3ConfigIdentifier.test.d.ts +1 -0
  256. package/dist/utils/__tests__/s3ConfigIdentifier.test.js +437 -0
  257. package/dist/utils/constants.d.ts +10 -0
  258. package/dist/utils/constants.js +19 -9
  259. package/dist/utils/deletion/index.d.ts +2 -2
  260. package/dist/utils/deletion/index.js +1 -1
  261. package/dist/utils/deletion/messages.d.ts +1 -1
  262. package/dist/utils/deletion/messages.js +4 -4
  263. package/dist/utils/errorHandling.d.ts +3 -3
  264. package/dist/utils/errorHandling.js +6 -6
  265. package/dist/utils/hooks.js +8 -8
  266. package/dist/utils/index.d.ts +5 -4
  267. package/dist/utils/index.js +4 -2
  268. package/dist/utils/proxyMiddleware.d.ts +32 -13
  269. package/dist/utils/proxyMiddleware.js +90 -36
  270. package/dist/utils/s3Client.d.ts +14 -4
  271. package/dist/utils/s3Client.js +5 -26
  272. package/dist/utils/s3ConfigIdentifier.d.ts +79 -0
  273. package/dist/utils/s3ConfigIdentifier.js +57 -0
  274. package/dist/utils/s3RuleUtils.d.ts +5 -5
  275. package/dist/utils/s3RuleUtils.js +17 -17
  276. package/package.json +10 -8
  277. package/dist/components/__tests__/BucketNotificationCreatePage.test.js +0 -316
  278. package/dist/components/buckets/BucketPolicyButton.d.ts +0 -7
  279. package/dist/components/buckets/notifications/BucketNotificationCreatePage.d.ts +0 -1
  280. package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +0 -234
  281. package/dist/hooks/useLoginMutation.d.ts +0 -21
  282. package/dist/hooks/useLoginMutation.js +0 -9
  283. package/dist/utils/useFeatures.d.ts +0 -1
  284. package/dist/utils/useFeatures.js +0 -7
  285. /package/dist/components/__tests__/{BucketNotificationCreatePage.test.d.ts → BucketAccessor.test.d.ts} +0 -0
@@ -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 { useNavigate, useParams } from "react-router-dom";
9
+ import { useParams } from "react-router";
10
10
  import { useGetBucketLifecycle, useSetBucketLifecycle } from "../../hooks/bucketConfiguration.js";
11
- import { FilterFormSection, createFilterValidationSchema } from "../ui/FilterFormSection.js";
12
- import { ArrayFieldActions } from "../ui/ArrayFieldActions.js";
11
+ import { useDataBrowserNavigate } from "../../hooks/useDataBrowserNavigate.js";
13
12
  import { AWS_RULE_LIMITS, STATUS_OPTIONS, buildS3Filter } from "../../utils/s3RuleUtils.js";
13
+ import { ArrayFieldActions } from "../ui/ArrayFieldActions.js";
14
+ import { FilterFormSection, createFilterValidationSchema } from "../ui/FilterFormSection.js";
14
15
  const storageClassOptions = [
15
16
  {
16
- value: "GLACIER",
17
- label: "Glacier"
17
+ value: 'GLACIER',
18
+ label: 'Glacier'
18
19
  },
19
20
  {
20
- value: "DEEP_ARCHIVE",
21
- label: "Glacier Deep Archive"
21
+ value: 'DEEP_ARCHIVE',
22
+ label: 'Glacier Deep Archive'
22
23
  },
23
24
  {
24
- value: "STANDARD_IA",
25
- label: "Standard-IA"
25
+ value: 'STANDARD_IA',
26
+ label: 'Standard-IA'
26
27
  },
27
28
  {
28
- value: "ONEZONE_IA",
29
- label: "One Zone-IA"
29
+ value: 'ONEZONE_IA',
30
+ label: 'One Zone-IA'
30
31
  },
31
32
  {
32
- value: "INTELLIGENT_TIERING",
33
- label: "Intelligent-Tiering"
33
+ value: 'INTELLIGENT_TIERING',
34
+ label: 'Intelligent-Tiering'
34
35
  },
35
36
  {
36
- value: "GLACIER_IR",
37
- label: "Glacier Instant Retrieval"
37
+ value: 'GLACIER_IR',
38
+ label: 'Glacier Instant Retrieval'
38
39
  }
39
40
  ];
40
41
  const STORAGE_CLASS_MIN_DAYS = {
@@ -51,109 +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
- "string.empty": "Rule ID is required",
55
- "string.max": `Rule ID must not exceed ${AWS_RULE_LIMITS.RULE_ID_MAX_LENGTH} characters`
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("transitionsEnabled", {
61
+ transitions: joi.when('transitionsEnabled', {
61
62
  is: true,
62
63
  then: joi.array().items(joi.object({
63
- timeType: joi.string().valid("days", "date").required(),
64
- days: joi.when("timeType", {
65
- is: "days",
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
- "number.base": "Days must be a number",
68
- "number.min": "Days must be at least 0"
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("timeType", {
73
- is: "date",
73
+ date: joi.when('timeType', {
74
+ is: 'date',
74
75
  then: joi.string().required().messages({
75
- "string.empty": "Date is required"
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
- "string.empty": "Storage class is required"
81
+ 'string.empty': 'Storage class is required'
81
82
  })
82
83
  }).custom((value, helpers)=>{
83
- if ("days" === value.timeType && value.storageClass && value.days < STORAGE_CLASS_MIN_DAYS[value.storageClass]) return helpers.error("any.custom", {
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
- "array.min": "At least one transition is required when enabled"
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("expirationEnabled", {
94
+ expirationType: joi.when('expirationEnabled', {
94
95
  is: true,
95
- then: joi.string().valid("days", "date", "deleteMarker").required(),
96
+ then: joi.string().valid('days', 'date').required(),
96
97
  otherwise: joi.any()
97
98
  }),
98
- expirationDays: joi.when("expirationType", {
99
- is: "days",
99
+ expirationDays: joi.when('expirationType', {
100
+ is: 'days',
100
101
  then: joi.number().integer().min(1).required().messages({
101
- "number.base": "Days must be a number",
102
- "number.min": "Days must be at least 1"
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("expirationType", {
107
- is: "date",
107
+ expirationDate: joi.when('expirationType', {
108
+ is: 'date',
108
109
  then: joi.string().required().messages({
109
- "string.empty": "Date is required"
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("noncurrentTransitionsEnabled", {
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
- "number.base": "Noncurrent days must be a number",
120
- "number.min": `Noncurrent days must be at least ${LIFECYCLE_LIMITS.NONCURRENT_TRANSITION_MIN_DAYS}`
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
- "string.empty": "Storage class is required"
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
- "array.min": "At least one noncurrent transition is required when enabled"
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("noncurrentExpirationEnabled", {
133
+ noncurrentExpirationDays: joi.when('noncurrentExpirationEnabled', {
133
134
  is: true,
134
135
  then: joi.number().integer().min(1).required().messages({
135
- "number.base": "Noncurrent days must be a number",
136
- "number.min": "Noncurrent days must be at least 1"
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("abortMpuEnabled", {
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
- "number.base": "Days must be a number",
146
- "number.min": `Days must be at least ${LIFECYCLE_LIMITS.ABORT_MPU_MIN_DAYS}`
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
- const hasAtLeastOneAction = value.transitionsEnabled || value.expirationEnabled || value.noncurrentTransitionsEnabled || value.noncurrentExpirationEnabled || value.abortMpuEnabled;
152
- if (!hasAtLeastOneAction) return helpers.error("any.custom", {
153
- message: "At least one lifecycle action must be enabled (transition, expiration, or abort multipart upload)"
152
+ const hasAtLeastOneAction = value.transitionsEnabled || value.expirationEnabled || value.expiredObjectDeleteMarker || value.noncurrentTransitionsEnabled || value.noncurrentExpirationEnabled || value.abortMpuEnabled;
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 (("tags" === value.filterType || "and" === value.filterType) && value.abortMpuEnabled) return helpers.error("any.custom", {
156
- message: "Tag-based filter cannot be used with Abort Incomplete Multipart Upload"
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'
158
+ });
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'
157
161
  });
158
162
  return value;
159
163
  });
@@ -165,17 +169,17 @@ const getArrayFieldError = (errors, fieldName, index, propertyName)=>{
165
169
  };
166
170
  const ruleToFormValues = (rule)=>{
167
171
  const formValues = {
168
- ruleId: rule.ID || "",
169
- status: rule.Status || "Enabled",
170
- filterType: "none",
171
- prefix: "",
172
+ ruleId: rule.ID || '',
173
+ status: rule.Status || 'Enabled',
174
+ filterType: 'none',
175
+ prefix: '',
172
176
  tags: [],
173
177
  transitionsEnabled: false,
174
178
  transitions: [],
175
179
  expirationEnabled: false,
176
- expirationType: "days",
180
+ expirationType: 'days',
177
181
  expirationDays: 30,
178
- expirationDate: "",
182
+ expirationDate: '',
179
183
  expiredObjectDeleteMarker: false,
180
184
  noncurrentTransitionsEnabled: false,
181
185
  noncurrentTransitions: [],
@@ -185,26 +189,26 @@ const ruleToFormValues = (rule)=>{
185
189
  abortMpuEnabled: false,
186
190
  abortMpuDays: 7
187
191
  };
188
- if (void 0 !== rule.Prefix && "" !== rule.Prefix) {
189
- formValues.filterType = "prefix";
192
+ if (void 0 !== rule.Prefix && '' !== rule.Prefix) {
193
+ formValues.filterType = 'prefix';
190
194
  formValues.prefix = rule.Prefix;
191
195
  } else if (rule.Filter) {
192
196
  if (rule.Filter.And) {
193
- formValues.filterType = "and";
194
- formValues.prefix = rule.Filter.And.Prefix || "";
197
+ formValues.filterType = 'and';
198
+ formValues.prefix = rule.Filter.And.Prefix || '';
195
199
  formValues.tags = rule.Filter.And.Tags?.map((tag)=>({
196
- key: tag.Key || "",
197
- value: tag.Value || ""
200
+ key: tag.Key || '',
201
+ value: tag.Value || ''
198
202
  })) || [];
199
203
  } else if (void 0 !== rule.Filter.Prefix) {
200
- formValues.filterType = "prefix";
204
+ formValues.filterType = 'prefix';
201
205
  formValues.prefix = rule.Filter.Prefix;
202
206
  } else if (rule.Filter.Tag) {
203
- formValues.filterType = "tags";
207
+ formValues.filterType = 'tags';
204
208
  formValues.tags = [
205
209
  {
206
- key: rule.Filter.Tag.Key || "",
207
- value: rule.Filter.Tag.Value || ""
210
+ key: rule.Filter.Tag.Key || '',
211
+ value: rule.Filter.Tag.Value || ''
208
212
  }
209
213
  ];
210
214
  }
@@ -212,30 +216,29 @@ const ruleToFormValues = (rule)=>{
212
216
  if (rule.Transitions && rule.Transitions.length > 0) {
213
217
  formValues.transitionsEnabled = true;
214
218
  formValues.transitions = rule.Transitions.map((t)=>({
215
- timeType: void 0 !== t.Days ? "days" : "date",
219
+ timeType: void 0 !== t.Days ? 'days' : 'date',
216
220
  days: t.Days || 30,
217
- date: t.Date ? new Date(t.Date).toISOString().split("T")[0] : "",
218
- storageClass: t.StorageClass || "GLACIER"
221
+ date: t.Date ? new Date(t.Date).toISOString().split('T')[0] : '',
222
+ storageClass: t.StorageClass || 'GLACIER'
219
223
  }));
220
224
  }
221
225
  if (rule.Expiration) {
222
- formValues.expirationEnabled = true;
223
226
  if (rule.Expiration.Days) {
224
- formValues.expirationType = "days";
227
+ formValues.expirationEnabled = true;
228
+ formValues.expirationType = 'days';
225
229
  formValues.expirationDays = rule.Expiration.Days;
226
230
  } else if (rule.Expiration.Date) {
227
- formValues.expirationType = "date";
228
- formValues.expirationDate = new Date(rule.Expiration.Date).toISOString().split("T")[0];
229
- } else if (rule.Expiration.ExpiredObjectDeleteMarker) {
230
- formValues.expirationType = "deleteMarker";
231
- formValues.expiredObjectDeleteMarker = true;
231
+ formValues.expirationEnabled = true;
232
+ formValues.expirationType = 'date';
233
+ formValues.expirationDate = new Date(rule.Expiration.Date).toISOString().split('T')[0];
232
234
  }
235
+ if (rule.Expiration.ExpiredObjectDeleteMarker) formValues.expiredObjectDeleteMarker = true;
233
236
  }
234
237
  if (rule.NoncurrentVersionTransitions && rule.NoncurrentVersionTransitions.length > 0) {
235
238
  formValues.noncurrentTransitionsEnabled = true;
236
239
  formValues.noncurrentTransitions = rule.NoncurrentVersionTransitions.map((t)=>({
237
240
  noncurrentDays: t.NoncurrentDays || 30,
238
- storageClass: t.StorageClass || "GLACIER",
241
+ storageClass: t.StorageClass || 'GLACIER',
239
242
  newerNoncurrentVersions: t.NewerNoncurrentVersions || 0
240
243
  }));
241
244
  }
@@ -256,11 +259,11 @@ const generateStorageClassHelpText = ()=>{
256
259
  const minDays = STORAGE_CLASS_MIN_DAYS[option.value];
257
260
  if (minDays > 0) hints.push(`<li>${option.label}: min ${minDays} days</li>`);
258
261
  });
259
- return hints.length > 0 ? `Storage class requirements:<ul>${hints.join("")}</ul>` : void 0;
262
+ return hints.length > 0 ? `Storage class requirements:<ul>${hints.join('')}</ul>` : void 0;
260
263
  };
261
264
  function BucketLifecycleFormPage() {
262
265
  const { bucketName, ruleId } = useParams();
263
- const navigate = useNavigate();
266
+ const navigate = useDataBrowserNavigate();
264
267
  const { showToast } = useToast();
265
268
  const isEditMode = !!ruleId;
266
269
  const { data: lifecycleData, status: lifecycleStatus } = useGetBucketLifecycle({
@@ -281,27 +284,27 @@ function BucketLifecycleFormPage() {
281
284
  ]);
282
285
  const dynamicSchema = useMemo(()=>schema.keys({
283
286
  ruleId: joi.string().required().invalid(...existingRuleIds).messages({
284
- "string.empty": "Rule ID is required",
285
- "any.invalid": "A rule with this ID already exists"
287
+ 'string.empty': 'Rule ID is required',
288
+ 'any.invalid': 'A rule with this ID already exists'
286
289
  })
287
290
  }), [
288
291
  existingRuleIds
289
292
  ]);
290
293
  const methods = useForm({
291
294
  resolver: joiResolver(dynamicSchema),
292
- mode: "onChange",
295
+ mode: 'onChange',
293
296
  defaultValues: {
294
- ruleId: "",
295
- status: "Enabled",
296
- filterType: "none",
297
- prefix: "",
297
+ ruleId: '',
298
+ status: 'Enabled',
299
+ filterType: 'none',
300
+ prefix: '',
298
301
  tags: [],
299
302
  transitionsEnabled: false,
300
303
  transitions: [],
301
304
  expirationEnabled: false,
302
- expirationType: "days",
305
+ expirationType: 'days',
303
306
  expirationDays: 30,
304
- expirationDate: "",
307
+ expirationDate: '',
305
308
  expiredObjectDeleteMarker: false,
306
309
  noncurrentTransitionsEnabled: false,
307
310
  noncurrentTransitions: [],
@@ -315,23 +318,24 @@ function BucketLifecycleFormPage() {
315
318
  const { handleSubmit, register, control, watch, reset, formState: { isValid, isDirty, errors } } = methods;
316
319
  const { fields: transitionFields, append: appendTransition, remove: removeTransition } = useFieldArray({
317
320
  control,
318
- name: "transitions"
321
+ name: 'transitions'
319
322
  });
320
323
  const { fields: noncurrentTransitionFields, append: appendNoncurrentTransition, remove: removeNoncurrentTransition } = useFieldArray({
321
324
  control,
322
- name: "noncurrentTransitions"
325
+ name: 'noncurrentTransitions'
323
326
  });
324
327
  const { fields: tagFields, append: appendTag, remove: removeTag } = useFieldArray({
325
328
  control,
326
- name: "tags"
329
+ name: 'tags'
327
330
  });
328
- const filterType = watch("filterType");
329
- const transitionsEnabled = watch("transitionsEnabled");
330
- const expirationEnabled = watch("expirationEnabled");
331
- const expirationType = watch("expirationType");
332
- const noncurrentTransitionsEnabled = watch("noncurrentTransitionsEnabled");
333
- const noncurrentExpirationEnabled = watch("noncurrentExpirationEnabled");
334
- const abortMpuEnabled = watch("abortMpuEnabled");
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');
335
339
  const { mutate: setLifecycle, isPending: isSaving } = useSetBucketLifecycle();
336
340
  const transitionsHelpText = useMemo(()=>{
337
341
  if (!transitionsEnabled || 0 === transitionFields.length) return;
@@ -363,10 +367,10 @@ function BucketLifecycleFormPage() {
363
367
  const prevValue = prevTransitionsEnabledRef.current;
364
368
  prevTransitionsEnabledRef.current = transitionsEnabled;
365
369
  if (!isEditMode && null !== prevValue && !prevValue && transitionsEnabled && 0 === transitionFields.length) appendTransition({
366
- timeType: "days",
370
+ timeType: 'days',
367
371
  days: 30,
368
- date: "",
369
- storageClass: "STANDARD_IA"
372
+ date: '',
373
+ storageClass: 'STANDARD_IA'
370
374
  });
371
375
  }, [
372
376
  isEditMode,
@@ -379,7 +383,7 @@ function BucketLifecycleFormPage() {
379
383
  prevNoncurrentTransitionsEnabledRef.current = noncurrentTransitionsEnabled;
380
384
  if (!isEditMode && null !== prevValue && !prevValue && noncurrentTransitionsEnabled && 0 === noncurrentTransitionFields.length) appendNoncurrentTransition({
381
385
  noncurrentDays: 30,
382
- storageClass: "GLACIER",
386
+ storageClass: 'GLACIER',
383
387
  newerNoncurrentVersions: 0
384
388
  });
385
389
  }, [
@@ -392,17 +396,17 @@ function BucketLifecycleFormPage() {
392
396
  useEffect(()=>{
393
397
  const prevFilterType = prevFilterTypeRef.current;
394
398
  prevFilterTypeRef.current = filterType;
395
- if (("tags" === filterType || "and" === filterType) && 0 === tagFields.length) {
399
+ if (('tags' === filterType || 'and' === filterType) && 0 === tagFields.length) {
396
400
  if (!isEditMode || void 0 !== prevFilterType && prevFilterType !== filterType) appendTag({
397
- key: "",
398
- value: ""
401
+ key: '',
402
+ value: ''
399
403
  });
400
404
  }
401
405
  if (void 0 !== prevFilterType && prevFilterType !== filterType) {
402
- if (("none" === filterType || "prefix" === filterType) && tagFields.length > 0) tagFields.forEach((_, index)=>{
406
+ if (('none' === filterType || 'prefix' === filterType) && tagFields.length > 0) tagFields.forEach((_, index)=>{
403
407
  removeTag(tagFields.length - 1 - index);
404
408
  });
405
- if ("none" === filterType) methods.setValue("prefix", "", {
409
+ if ('none' === filterType) methods.setValue('prefix', '', {
406
410
  shouldDirty: true
407
411
  });
408
412
  }
@@ -431,20 +435,17 @@ function BucketLifecycleFormPage() {
431
435
  const t = {
432
436
  StorageClass: transition.storageClass
433
437
  };
434
- if ("days" === transition.timeType) t.Days = transition.days;
438
+ if ('days' === transition.timeType) t.Days = transition.days;
435
439
  else t.Date = new Date(transition.date);
436
440
  return t;
437
441
  });
438
- if (data.expirationEnabled) {
439
- if ("days" === data.expirationType) rule.Expiration = {
440
- Days: data.expirationDays
441
- };
442
- else if ("date" === data.expirationType) rule.Expiration = {
443
- Date: new Date(data.expirationDate)
444
- };
445
- else if ("deleteMarker" === data.expirationType) rule.Expiration = {
446
- ExpiredObjectDeleteMarker: true
447
- };
442
+ if (data.expirationEnabled || data.expiredObjectDeleteMarker) {
443
+ rule.Expiration = {};
444
+ if (data.expirationEnabled) {
445
+ if ('days' === data.expirationType) rule.Expiration.Days = data.expirationDays;
446
+ else if ('date' === data.expirationType) rule.Expiration.Date = new Date(data.expirationDate);
447
+ }
448
+ if (data.expiredObjectDeleteMarker) rule.Expiration.ExpiredObjectDeleteMarker = true;
448
449
  }
449
450
  if (data.noncurrentTransitionsEnabled && data.noncurrentTransitions.length > 0) rule.NoncurrentVersionTransitions = data.noncurrentTransitions.map((transition)=>({
450
451
  NoncurrentDays: transition.noncurrentDays,
@@ -476,17 +477,17 @@ function BucketLifecycleFormPage() {
476
477
  onSuccess: ()=>{
477
478
  showToast({
478
479
  open: true,
479
- message: `Lifecycle rule ${isEditMode ? "updated" : "created"} successfully`,
480
- status: "success"
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 ? "update" : "create"} lifecycle rule`;
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: "error"
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 ("pending" === lifecycleStatus) return /*#__PURE__*/ jsx(Loader, {
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: "page",
520
- title: isEditMode ? "Edit Lifecycle Rule" : "Create Lifecycle Rule"
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 ? "save-lifecycle-btn" : "create-lifecycle-btn",
537
+ id: isEditMode ? 'save-lifecycle-btn' : 'create-lifecycle-btn',
537
538
  type: "submit",
538
539
  variant: "primary",
539
- label: isEditMode ? "Save" : "Create",
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: "Rule Scope"
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("ruleId")
563
+ children: watch('ruleId')
563
564
  }) : /*#__PURE__*/ jsx(Input, {
564
565
  id: "ruleId",
565
- ...register("ruleId")
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("filterType", value),
594
- prefixRegister: register("prefix"),
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 ? "Lifecycle Rule" : "Lifecycle Rule (At least one action must be enabled)"
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 ? "Enabled" : "Disabled"
622
+ label: field.value ? 'Enabled' : 'Disabled'
622
623
  })
623
624
  })
624
625
  }),
@@ -644,14 +645,14 @@ function BucketLifecycleFormPage() {
644
645
  })
645
646
  }),
646
647
  /*#__PURE__*/ jsx(Box, {
647
- flex: "1/3",
648
+ flex: "1/2",
648
649
  children: /*#__PURE__*/ jsx(Text, {
649
650
  color: "textSecondary",
650
651
  children: "Value"
651
652
  })
652
653
  }),
653
654
  /*#__PURE__*/ jsx(Box, {
654
- width: convertRemToPixels(0.1)
655
+ width: convertRemToPixels(4)
655
656
  }),
656
657
  /*#__PURE__*/ jsx(Box, {
657
658
  flex: "1",
@@ -694,18 +695,18 @@ function BucketLifecycleFormPage() {
694
695
  }),
695
696
  /*#__PURE__*/ jsx(Box, {
696
697
  flex: "1",
697
- children: "days" === watch(`transitions.${index}.timeType`) ? /*#__PURE__*/ jsx(Input, {
698
+ children: 'days' === watch(`transitions.${index}.timeType`) ? /*#__PURE__*/ jsx(Input, {
698
699
  id: `transition-days-${index}`,
699
700
  type: "number",
700
701
  placeholder: "Days",
701
- size: "1/3",
702
+ size: "1/2",
702
703
  ...register(`transitions.${index}.days`, {
703
704
  valueAsNumber: true
704
705
  })
705
706
  }) : /*#__PURE__*/ jsx(Input, {
706
707
  id: `transition-date-${index}`,
707
708
  type: "date",
708
- size: "1/3",
709
+ size: "1/2",
709
710
  ...register(`transitions.${index}.date`)
710
711
  })
711
712
  }),
@@ -731,33 +732,30 @@ function BucketLifecycleFormPage() {
731
732
  showAdd: index === transitionFields.length - 1,
732
733
  onRemove: ()=>removeTransition(index),
733
734
  onAdd: ()=>appendTransition({
734
- timeType: "days",
735
+ timeType: 'days',
735
736
  days: 30,
736
- date: "",
737
- storageClass: "STANDARD_IA"
737
+ date: '',
738
+ storageClass: 'STANDARD_IA'
738
739
  }),
739
740
  canRemove: transitionFields.length > 1
740
- }),
741
- index < transitionFields.length - 1 && /*#__PURE__*/ jsx(Box, {
742
- width: convertRemToPixels(1.9)
743
741
  })
744
742
  ]
745
743
  }),
746
- getArrayFieldError(errors, "transitions", index) && /*#__PURE__*/ jsx(Text, {
744
+ getArrayFieldError(errors, 'transitions', index) && /*#__PURE__*/ jsx(Text, {
747
745
  color: "statusCritical",
748
- children: getArrayFieldError(errors, "transitions", index)
746
+ children: getArrayFieldError(errors, 'transitions', index)
749
747
  }),
750
- getArrayFieldError(errors, "transitions", index, "days") && /*#__PURE__*/ jsx(Text, {
748
+ getArrayFieldError(errors, 'transitions', index, 'days') && /*#__PURE__*/ jsx(Text, {
751
749
  color: "statusCritical",
752
- children: getArrayFieldError(errors, "transitions", index, "days")
750
+ children: getArrayFieldError(errors, 'transitions', index, 'days')
753
751
  }),
754
- getArrayFieldError(errors, "transitions", index, "storageClass") && /*#__PURE__*/ jsx(Text, {
752
+ getArrayFieldError(errors, 'transitions', index, 'storageClass') && /*#__PURE__*/ jsx(Text, {
755
753
  color: "statusCritical",
756
- children: getArrayFieldError(errors, "transitions", index, "storageClass")
754
+ children: getArrayFieldError(errors, 'transitions', index, 'storageClass')
757
755
  }),
758
- getArrayFieldError(errors, "transitions", index, "date") && /*#__PURE__*/ jsx(Text, {
756
+ getArrayFieldError(errors, 'transitions', index, 'date') && /*#__PURE__*/ jsx(Text, {
759
757
  color: "statusCritical",
760
- children: getArrayFieldError(errors, "transitions", index, "date")
758
+ children: getArrayFieldError(errors, 'transitions', index, 'date')
761
759
  })
762
760
  ]
763
761
  }, field.id))
@@ -768,13 +766,20 @@ function BucketLifecycleFormPage() {
768
766
  label: "Expiration current version",
769
767
  id: "expirationEnabled",
770
768
  direction: "horizontal",
769
+ labelHelpTooltip: "Expire objects after a specified time. Cannot be combined with expired delete markers removal.",
771
770
  content: /*#__PURE__*/ jsx(Controller, {
772
771
  name: "expirationEnabled",
773
772
  control: control,
774
773
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
775
774
  toggle: field.value,
776
- onChange: field.onChange,
777
- label: field.value ? "Enabled" : "Disabled"
775
+ onChange: (value)=>{
776
+ field.onChange(value);
777
+ if (value && expiredObjectDeleteMarker) methods.setValue('expiredObjectDeleteMarker', false, {
778
+ shouldDirty: true
779
+ });
780
+ },
781
+ label: field.value ? 'Enabled' : 'Disabled',
782
+ disabled: expiredObjectDeleteMarker
778
783
  })
779
784
  })
780
785
  }),
@@ -799,16 +804,12 @@ function BucketLifecycleFormPage() {
799
804
  /*#__PURE__*/ jsx(Select.Option, {
800
805
  value: "date",
801
806
  children: "Date"
802
- }),
803
- /*#__PURE__*/ jsx(Select.Option, {
804
- value: "deleteMarker",
805
- children: "Expired delete markers"
806
807
  })
807
808
  ]
808
809
  })
809
810
  })
810
811
  }),
811
- "days" === expirationType && /*#__PURE__*/ jsx(FormGroup, {
812
+ 'days' === expirationType && /*#__PURE__*/ jsx(FormGroup, {
812
813
  label: "Days",
813
814
  id: "expirationDays",
814
815
  direction: "horizontal",
@@ -819,29 +820,47 @@ function BucketLifecycleFormPage() {
819
820
  children: /*#__PURE__*/ jsx(Input, {
820
821
  type: "number",
821
822
  id: "expirationDays",
822
- ...register("expirationDays", {
823
+ ...register('expirationDays', {
823
824
  valueAsNumber: true
824
825
  })
825
826
  })
826
827
  })
827
828
  }),
828
- "date" === expirationType && /*#__PURE__*/ jsx(FormGroup, {
829
+ 'date' === expirationType && /*#__PURE__*/ jsx(FormGroup, {
829
830
  label: "Date",
830
831
  id: "expirationDate",
831
832
  direction: "horizontal",
832
833
  error: errors?.expirationDate?.message,
833
834
  helpErrorPosition: "bottom",
834
- content: /*#__PURE__*/ jsx(Box, {
835
- width: "200px",
836
- children: /*#__PURE__*/ jsx(Input, {
837
- type: "date",
838
- id: "expirationDate",
839
- ...register("expirationDate")
840
- })
835
+ content: /*#__PURE__*/ jsx(Input, {
836
+ type: "date",
837
+ id: "expirationDate",
838
+ ...register('expirationDate')
841
839
  })
842
840
  })
843
841
  ]
844
842
  }) : /*#__PURE__*/ jsx(Fragment, {}),
843
+ /*#__PURE__*/ jsx(FormGroup, {
844
+ label: "Remove expired delete markers",
845
+ id: "expiredObjectDeleteMarker",
846
+ direction: "horizontal",
847
+ labelHelpTooltip: "Automatically remove expired object delete markers in versioned buckets. Cannot be combined with Days/Date expiration.",
848
+ content: /*#__PURE__*/ jsx(Controller, {
849
+ name: "expiredObjectDeleteMarker",
850
+ control: control,
851
+ render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
852
+ toggle: field.value,
853
+ onChange: (value)=>{
854
+ field.onChange(value);
855
+ if (value && expirationEnabled) methods.setValue('expirationEnabled', false, {
856
+ shouldDirty: true
857
+ });
858
+ },
859
+ label: field.value ? 'Enabled' : 'Disabled',
860
+ disabled: expirationEnabled
861
+ })
862
+ })
863
+ }),
845
864
  /*#__PURE__*/ jsx(FormGroup, {
846
865
  label: "Transition noncurrent version",
847
866
  id: "noncurrentTransitionsEnabled",
@@ -852,7 +871,7 @@ function BucketLifecycleFormPage() {
852
871
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
853
872
  toggle: field.value,
854
873
  onChange: field.onChange,
855
- label: field.value ? "Enabled" : "Disabled"
874
+ label: field.value ? 'Enabled' : 'Disabled'
856
875
  })
857
876
  })
858
877
  }),
@@ -954,23 +973,20 @@ function BucketLifecycleFormPage() {
954
973
  onRemove: ()=>removeNoncurrentTransition(index),
955
974
  onAdd: ()=>appendNoncurrentTransition({
956
975
  noncurrentDays: 30,
957
- storageClass: "GLACIER",
976
+ storageClass: 'GLACIER',
958
977
  newerNoncurrentVersions: 0
959
978
  }),
960
979
  canRemove: noncurrentTransitionFields.length > 1
961
- }),
962
- index < noncurrentTransitionFields.length - 1 && /*#__PURE__*/ jsx(Box, {
963
- width: convertRemToPixels(1.9)
964
980
  })
965
981
  ]
966
982
  }),
967
- getArrayFieldError(errors, "noncurrentTransitions", index, "noncurrentDays") && /*#__PURE__*/ jsx(Text, {
983
+ getArrayFieldError(errors, 'noncurrentTransitions', index, 'noncurrentDays') && /*#__PURE__*/ jsx(Text, {
968
984
  color: "statusCritical",
969
- children: getArrayFieldError(errors, "noncurrentTransitions", index, "noncurrentDays")
985
+ children: getArrayFieldError(errors, 'noncurrentTransitions', index, 'noncurrentDays')
970
986
  }),
971
- getArrayFieldError(errors, "noncurrentTransitions", index, "storageClass") && /*#__PURE__*/ jsx(Text, {
987
+ getArrayFieldError(errors, 'noncurrentTransitions', index, 'storageClass') && /*#__PURE__*/ jsx(Text, {
972
988
  color: "statusCritical",
973
- children: getArrayFieldError(errors, "noncurrentTransitions", index, "storageClass")
989
+ children: getArrayFieldError(errors, 'noncurrentTransitions', index, 'storageClass')
974
990
  })
975
991
  ]
976
992
  }, field.id))
@@ -987,7 +1003,7 @@ function BucketLifecycleFormPage() {
987
1003
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
988
1004
  toggle: field.value,
989
1005
  onChange: field.onChange,
990
- label: field.value ? "Enabled" : "Disabled"
1006
+ label: field.value ? 'Enabled' : 'Disabled'
991
1007
  })
992
1008
  })
993
1009
  }),
@@ -1004,7 +1020,7 @@ function BucketLifecycleFormPage() {
1004
1020
  children: /*#__PURE__*/ jsx(Input, {
1005
1021
  type: "number",
1006
1022
  id: "noncurrentExpirationDays",
1007
- ...register("noncurrentExpirationDays", {
1023
+ ...register('noncurrentExpirationDays', {
1008
1024
  valueAsNumber: true
1009
1025
  })
1010
1026
  })
@@ -1020,7 +1036,7 @@ function BucketLifecycleFormPage() {
1020
1036
  type: "number",
1021
1037
  id: "noncurrentNewerVersions",
1022
1038
  placeholder: "0",
1023
- ...register("noncurrentNewerVersions", {
1039
+ ...register('noncurrentNewerVersions', {
1024
1040
  valueAsNumber: true
1025
1041
  })
1026
1042
  })
@@ -1032,7 +1048,7 @@ function BucketLifecycleFormPage() {
1032
1048
  label: "Expire incomplete multipart upload",
1033
1049
  id: "abortMpuEnabled",
1034
1050
  direction: "horizontal",
1035
- error: ("tags" === filterType || "and" === filterType) && abortMpuEnabled ? "Tag-based filter cannot be used with Abort Incomplete Multipart Upload" : void 0,
1051
+ error: ('tags' === filterType || 'and' === filterType) && abortMpuEnabled ? 'Tag-based filter cannot be used with Abort Incomplete Multipart Upload' : void 0,
1036
1052
  helpErrorPosition: "bottom",
1037
1053
  content: /*#__PURE__*/ jsx(Controller, {
1038
1054
  name: "abortMpuEnabled",
@@ -1040,7 +1056,7 @@ function BucketLifecycleFormPage() {
1040
1056
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
1041
1057
  toggle: field.value,
1042
1058
  onChange: field.onChange,
1043
- label: field.value ? "Enabled" : "Disabled"
1059
+ label: field.value ? 'Enabled' : 'Disabled'
1044
1060
  })
1045
1061
  })
1046
1062
  }),
@@ -1055,7 +1071,7 @@ function BucketLifecycleFormPage() {
1055
1071
  children: /*#__PURE__*/ jsx(Input, {
1056
1072
  type: "number",
1057
1073
  id: "abortMpuDays",
1058
- ...register("abortMpuDays", {
1074
+ ...register('abortMpuDays', {
1059
1075
  valueAsNumber: true
1060
1076
  })
1061
1077
  })