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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) 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 +93 -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 +225 -191
  57. package/dist/components/buckets/BucketLifecycleList.d.ts +2 -2
  58. package/dist/components/buckets/BucketLifecycleList.js +59 -61
  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 +48 -45
  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 +289 -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 +103 -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/formUtils.d.ts +15 -0
  113. package/dist/components/objects/ObjectDetails/formUtils.js +7 -0
  114. package/dist/components/objects/ObjectDetails/index.d.ts +18 -2
  115. package/dist/components/objects/ObjectDetails/index.js +152 -40
  116. package/dist/components/objects/ObjectList.d.ts +12 -10
  117. package/dist/components/objects/ObjectList.js +590 -263
  118. package/dist/components/objects/ObjectLock/EditRetentionButton.js +4 -4
  119. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +15 -15
  120. package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +1 -1
  121. package/dist/components/objects/ObjectLock/ObjectLockSettings.js +32 -31
  122. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +1 -1
  123. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +6 -6
  124. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +51 -51
  125. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +78 -78
  126. package/dist/components/objects/ObjectPage.js +12 -8
  127. package/dist/components/objects/UploadButton.d.ts +3 -3
  128. package/dist/components/objects/UploadButton.js +10 -10
  129. package/dist/components/objects/__tests__/GetPresignedUrlButton.test.d.ts +1 -0
  130. package/dist/components/objects/__tests__/GetPresignedUrlButton.test.js +531 -0
  131. package/dist/components/providers/DataBrowserProvider.d.ts +23 -12
  132. package/dist/components/providers/DataBrowserProvider.js +60 -38
  133. package/dist/components/providers/QueryProvider.d.ts +9 -0
  134. package/dist/components/providers/QueryProvider.js +21 -0
  135. package/dist/components/search/MetadataSearch.js +29 -28
  136. package/dist/components/search/SearchHints.js +1 -1
  137. package/dist/components/ui/ArrayFieldActions.js +12 -7
  138. package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +2 -2
  139. package/dist/components/ui/ConfirmDeleteRuleModal.js +6 -1
  140. package/dist/components/ui/DeleteObjectModalContent.d.ts +1 -1
  141. package/dist/components/ui/DeleteObjectModalContent.js +12 -12
  142. package/dist/components/ui/FilterFormSection.d.ts +2 -2
  143. package/dist/components/ui/FilterFormSection.js +29 -29
  144. package/dist/components/ui/Search.elements.d.ts +2 -2
  145. package/dist/components/ui/Search.elements.js +7 -7
  146. package/dist/components/ui/Table.elements.d.ts +2 -1
  147. package/dist/components/ui/Table.elements.js +18 -12
  148. package/dist/config/__tests__/factory.test.d.ts +1 -0
  149. package/dist/config/__tests__/factory.test.js +311 -0
  150. package/dist/config/factory.d.ts +10 -56
  151. package/dist/config/factory.js +23 -71
  152. package/dist/config/types.d.ts +212 -34
  153. package/dist/contexts/DataBrowserUICustomizationContext.d.ts +27 -0
  154. package/dist/contexts/DataBrowserUICustomizationContext.js +13 -0
  155. package/dist/hooks/__tests__/useAccessibleBuckets.test.d.ts +1 -0
  156. package/dist/hooks/__tests__/useAccessibleBuckets.test.js +145 -0
  157. package/dist/hooks/__tests__/useISVBucketDetection.test.js +45 -45
  158. package/dist/hooks/__tests__/useIsBucketEmpty.test.js +27 -27
  159. package/dist/hooks/__tests__/useLoginMutation.test.d.ts +1 -0
  160. package/dist/hooks/__tests__/useLoginMutation.test.js +194 -0
  161. package/dist/hooks/bucketConfiguration.d.ts +8 -1
  162. package/dist/hooks/bucketConfiguration.js +52 -51
  163. package/dist/hooks/bucketOperations.d.ts +10 -1
  164. package/dist/hooks/bucketOperations.js +10 -9
  165. package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +80 -80
  166. package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +80 -80
  167. package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +44 -44
  168. package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +63 -63
  169. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +65 -65
  170. package/dist/hooks/factories/index.d.ts +4 -4
  171. package/dist/hooks/factories/index.js +2 -2
  172. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +2 -2
  173. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +16 -13
  174. package/dist/hooks/factories/useCreateS3LoginHook.d.ts +2 -2
  175. package/dist/hooks/factories/useCreateS3LoginHook.js +1 -1
  176. package/dist/hooks/factories/useCreateS3MutationHook.d.ts +3 -3
  177. package/dist/hooks/factories/useCreateS3MutationHook.js +7 -2
  178. package/dist/hooks/factories/useCreateS3QueryHook.d.ts +2 -2
  179. package/dist/hooks/factories/useCreateS3QueryHook.js +11 -6
  180. package/dist/hooks/index.d.ts +19 -12
  181. package/dist/hooks/index.js +16 -9
  182. package/dist/hooks/loginOperations.d.ts +1 -1
  183. package/dist/hooks/loginOperations.js +1 -1
  184. package/dist/hooks/objectOperations.d.ts +2 -2
  185. package/dist/hooks/objectOperations.js +50 -49
  186. package/dist/hooks/presignedOperations.d.ts +4 -4
  187. package/dist/hooks/presignedOperations.js +5 -5
  188. package/dist/hooks/useAccessibleBuckets.d.ts +11 -0
  189. package/dist/hooks/useAccessibleBuckets.js +115 -0
  190. package/dist/hooks/useBatchObjectLegalHold.d.ts +11 -0
  191. package/dist/hooks/useBatchObjectLegalHold.js +48 -0
  192. package/dist/hooks/useBucketConfigEditor.d.ts +31 -0
  193. package/dist/hooks/useBucketConfigEditor.js +82 -0
  194. package/dist/hooks/useDataBrowserNavigate.d.ts +28 -0
  195. package/dist/hooks/useDataBrowserNavigate.js +24 -0
  196. package/dist/hooks/useDeleteBucketConfigRule.d.ts +2 -2
  197. package/dist/hooks/useDeleteBucketConfigRule.js +4 -4
  198. package/dist/hooks/useEmptyBucket.js +11 -11
  199. package/dist/hooks/useFeatures.d.ts +7 -0
  200. package/dist/hooks/useFeatures.js +8 -0
  201. package/dist/hooks/useISVBucketDetection.js +6 -6
  202. package/dist/hooks/useIsBucketEmpty.js +4 -4
  203. package/dist/hooks/useLimitedAccessFlow.d.ts +48 -0
  204. package/dist/hooks/useLimitedAccessFlow.js +23 -0
  205. package/dist/hooks/useS3Client.d.ts +6 -0
  206. package/dist/hooks/useS3Client.js +3 -2
  207. package/dist/hooks/useS3ConfigSwitch.d.ts +11 -0
  208. package/dist/hooks/useS3ConfigSwitch.js +37 -0
  209. package/dist/hooks/useSupportedNotificationEvents.d.ts +6 -0
  210. package/dist/hooks/useSupportedNotificationEvents.js +8 -0
  211. package/dist/index.d.ts +6 -6
  212. package/dist/index.js +2 -2
  213. package/dist/schemas/bucketPolicySchema.json +3 -13
  214. package/dist/test/msw/handlers/deleteBucket.d.ts +1 -1
  215. package/dist/test/msw/handlers/deleteBucket.js +20 -10
  216. package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -1
  217. package/dist/test/msw/handlers/getBucketAcl.js +29 -17
  218. package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -1
  219. package/dist/test/msw/handlers/getBucketLocation.js +29 -15
  220. package/dist/test/msw/handlers/getBucketPolicy.d.ts +1 -1
  221. package/dist/test/msw/handlers/getBucketPolicy.js +52 -32
  222. package/dist/test/msw/handlers/headObject.d.ts +1 -1
  223. package/dist/test/msw/handlers/headObject.js +31 -13
  224. package/dist/test/msw/handlers/listBuckets.d.ts +1 -1
  225. package/dist/test/msw/handlers/listBuckets.js +5 -3
  226. package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -1
  227. package/dist/test/msw/handlers/listObjectVersions.js +38 -26
  228. package/dist/test/msw/handlers/listObjects.d.ts +1 -1
  229. package/dist/test/msw/handlers/listObjects.js +35 -23
  230. package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -1
  231. package/dist/test/msw/handlers/objectLegalHold.js +32 -17
  232. package/dist/test/msw/handlers/objectRetention.d.ts +1 -1
  233. package/dist/test/msw/handlers/objectRetention.js +31 -17
  234. package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -1
  235. package/dist/test/msw/handlers/putBucketAcl.js +29 -14
  236. package/dist/test/msw/handlers/putObject.d.ts +1 -1
  237. package/dist/test/msw/handlers/putObject.js +27 -12
  238. package/dist/test/msw/handlers.d.ts +3 -3
  239. package/dist/test/msw/handlers.js +77 -54
  240. package/dist/test/msw/index.d.ts +2 -2
  241. package/dist/test/msw/index.js +1 -1
  242. package/dist/test/msw/server.d.ts +1 -1
  243. package/dist/test/msw/server.js +1 -1
  244. package/dist/test/msw/utils.js +2 -2
  245. package/dist/test/setup.d.ts +1 -1
  246. package/dist/test/setup.js +13 -30
  247. package/dist/test/testUtils.d.ts +85 -33
  248. package/dist/test/testUtils.js +176 -111
  249. package/dist/test/utils/errorHandling.test.js +119 -119
  250. package/dist/types/index.d.ts +50 -37
  251. package/dist/types/monaco.d.ts +13 -0
  252. package/dist/types/monaco.js +0 -0
  253. package/dist/utils/__tests__/proxyMiddleware.test.d.ts +1 -0
  254. package/dist/utils/__tests__/proxyMiddleware.test.js +579 -0
  255. package/dist/utils/__tests__/s3Client.test.d.ts +1 -0
  256. package/dist/utils/__tests__/s3Client.test.js +340 -0
  257. package/dist/utils/__tests__/s3ConfigIdentifier.test.d.ts +1 -0
  258. package/dist/utils/__tests__/s3ConfigIdentifier.test.js +437 -0
  259. package/dist/utils/constants.d.ts +10 -0
  260. package/dist/utils/constants.js +19 -9
  261. package/dist/utils/deletion/index.d.ts +2 -2
  262. package/dist/utils/deletion/index.js +1 -1
  263. package/dist/utils/deletion/messages.d.ts +1 -1
  264. package/dist/utils/deletion/messages.js +4 -4
  265. package/dist/utils/errorHandling.d.ts +3 -3
  266. package/dist/utils/errorHandling.js +6 -6
  267. package/dist/utils/hooks.js +8 -8
  268. package/dist/utils/index.d.ts +5 -4
  269. package/dist/utils/index.js +4 -2
  270. package/dist/utils/proxyMiddleware.d.ts +32 -13
  271. package/dist/utils/proxyMiddleware.js +90 -36
  272. package/dist/utils/s3Client.d.ts +14 -4
  273. package/dist/utils/s3Client.js +5 -26
  274. package/dist/utils/s3ConfigIdentifier.d.ts +79 -0
  275. package/dist/utils/s3ConfigIdentifier.js +57 -0
  276. package/dist/utils/s3RuleUtils.d.ts +5 -5
  277. package/dist/utils/s3RuleUtils.js +17 -17
  278. package/package.json +10 -8
  279. package/dist/components/__tests__/BucketNotificationCreatePage.test.js +0 -316
  280. package/dist/components/buckets/BucketPolicyButton.d.ts +0 -7
  281. package/dist/components/buckets/notifications/BucketNotificationCreatePage.d.ts +0 -1
  282. package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +0 -234
  283. package/dist/hooks/useLoginMutation.d.ts +0 -21
  284. package/dist/hooks/useLoginMutation.js +0 -9
  285. package/dist/utils/useFeatures.d.ts +0 -1
  286. package/dist/utils/useFeatures.js +0 -7
  287. /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
  }
@@ -254,13 +257,31 @@ const generateStorageClassHelpText = ()=>{
254
257
  const hints = [];
255
258
  storageClassOptions.forEach((option)=>{
256
259
  const minDays = STORAGE_CLASS_MIN_DAYS[option.value];
257
- if (minDays > 0) hints.push(`<li>${option.label}: min ${minDays} days</li>`);
260
+ if (minDays > 0) hints.push({
261
+ label: option.label,
262
+ minDays
263
+ });
264
+ });
265
+ if (0 === hints.length) return;
266
+ return /*#__PURE__*/ jsxs(Fragment, {
267
+ children: [
268
+ "Storage class requirements:",
269
+ /*#__PURE__*/ jsx("ul", {
270
+ children: hints.map((hint)=>/*#__PURE__*/ jsxs("li", {
271
+ children: [
272
+ hint.label,
273
+ ": min ",
274
+ hint.minDays,
275
+ " days"
276
+ ]
277
+ }, hint.label))
278
+ })
279
+ ]
258
280
  });
259
- return hints.length > 0 ? `Storage class requirements:<ul>${hints.join("")}</ul>` : void 0;
260
281
  };
261
282
  function BucketLifecycleFormPage() {
262
283
  const { bucketName, ruleId } = useParams();
263
- const navigate = useNavigate();
284
+ const navigate = useDataBrowserNavigate();
264
285
  const { showToast } = useToast();
265
286
  const isEditMode = !!ruleId;
266
287
  const { data: lifecycleData, status: lifecycleStatus } = useGetBucketLifecycle({
@@ -281,27 +302,27 @@ function BucketLifecycleFormPage() {
281
302
  ]);
282
303
  const dynamicSchema = useMemo(()=>schema.keys({
283
304
  ruleId: joi.string().required().invalid(...existingRuleIds).messages({
284
- "string.empty": "Rule ID is required",
285
- "any.invalid": "A rule with this ID already exists"
305
+ 'string.empty': 'Rule ID is required',
306
+ 'any.invalid': 'A rule with this ID already exists'
286
307
  })
287
308
  }), [
288
309
  existingRuleIds
289
310
  ]);
290
311
  const methods = useForm({
291
312
  resolver: joiResolver(dynamicSchema),
292
- mode: "onChange",
313
+ mode: 'onChange',
293
314
  defaultValues: {
294
- ruleId: "",
295
- status: "Enabled",
296
- filterType: "none",
297
- prefix: "",
315
+ ruleId: '',
316
+ status: 'Enabled',
317
+ filterType: 'none',
318
+ prefix: '',
298
319
  tags: [],
299
320
  transitionsEnabled: false,
300
321
  transitions: [],
301
322
  expirationEnabled: false,
302
- expirationType: "days",
323
+ expirationType: 'days',
303
324
  expirationDays: 30,
304
- expirationDate: "",
325
+ expirationDate: '',
305
326
  expiredObjectDeleteMarker: false,
306
327
  noncurrentTransitionsEnabled: false,
307
328
  noncurrentTransitions: [],
@@ -315,23 +336,24 @@ function BucketLifecycleFormPage() {
315
336
  const { handleSubmit, register, control, watch, reset, formState: { isValid, isDirty, errors } } = methods;
316
337
  const { fields: transitionFields, append: appendTransition, remove: removeTransition } = useFieldArray({
317
338
  control,
318
- name: "transitions"
339
+ name: 'transitions'
319
340
  });
320
341
  const { fields: noncurrentTransitionFields, append: appendNoncurrentTransition, remove: removeNoncurrentTransition } = useFieldArray({
321
342
  control,
322
- name: "noncurrentTransitions"
343
+ name: 'noncurrentTransitions'
323
344
  });
324
345
  const { fields: tagFields, append: appendTag, remove: removeTag } = useFieldArray({
325
346
  control,
326
- name: "tags"
347
+ name: 'tags'
327
348
  });
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");
349
+ const filterType = watch('filterType');
350
+ const transitionsEnabled = watch('transitionsEnabled');
351
+ const expirationEnabled = watch('expirationEnabled');
352
+ const expirationType = watch('expirationType');
353
+ const expiredObjectDeleteMarker = watch('expiredObjectDeleteMarker');
354
+ const noncurrentTransitionsEnabled = watch('noncurrentTransitionsEnabled');
355
+ const noncurrentExpirationEnabled = watch('noncurrentExpirationEnabled');
356
+ const abortMpuEnabled = watch('abortMpuEnabled');
335
357
  const { mutate: setLifecycle, isPending: isSaving } = useSetBucketLifecycle();
336
358
  const transitionsHelpText = useMemo(()=>{
337
359
  if (!transitionsEnabled || 0 === transitionFields.length) return;
@@ -363,10 +385,10 @@ function BucketLifecycleFormPage() {
363
385
  const prevValue = prevTransitionsEnabledRef.current;
364
386
  prevTransitionsEnabledRef.current = transitionsEnabled;
365
387
  if (!isEditMode && null !== prevValue && !prevValue && transitionsEnabled && 0 === transitionFields.length) appendTransition({
366
- timeType: "days",
388
+ timeType: 'days',
367
389
  days: 30,
368
- date: "",
369
- storageClass: "STANDARD_IA"
390
+ date: '',
391
+ storageClass: 'STANDARD_IA'
370
392
  });
371
393
  }, [
372
394
  isEditMode,
@@ -379,7 +401,7 @@ function BucketLifecycleFormPage() {
379
401
  prevNoncurrentTransitionsEnabledRef.current = noncurrentTransitionsEnabled;
380
402
  if (!isEditMode && null !== prevValue && !prevValue && noncurrentTransitionsEnabled && 0 === noncurrentTransitionFields.length) appendNoncurrentTransition({
381
403
  noncurrentDays: 30,
382
- storageClass: "GLACIER",
404
+ storageClass: 'GLACIER',
383
405
  newerNoncurrentVersions: 0
384
406
  });
385
407
  }, [
@@ -392,17 +414,17 @@ function BucketLifecycleFormPage() {
392
414
  useEffect(()=>{
393
415
  const prevFilterType = prevFilterTypeRef.current;
394
416
  prevFilterTypeRef.current = filterType;
395
- if (("tags" === filterType || "and" === filterType) && 0 === tagFields.length) {
417
+ if (('tags' === filterType || 'and' === filterType) && 0 === tagFields.length) {
396
418
  if (!isEditMode || void 0 !== prevFilterType && prevFilterType !== filterType) appendTag({
397
- key: "",
398
- value: ""
419
+ key: '',
420
+ value: ''
399
421
  });
400
422
  }
401
423
  if (void 0 !== prevFilterType && prevFilterType !== filterType) {
402
- if (("none" === filterType || "prefix" === filterType) && tagFields.length > 0) tagFields.forEach((_, index)=>{
424
+ if (('none' === filterType || 'prefix' === filterType) && tagFields.length > 0) tagFields.forEach((_, index)=>{
403
425
  removeTag(tagFields.length - 1 - index);
404
426
  });
405
- if ("none" === filterType) methods.setValue("prefix", "", {
427
+ if ('none' === filterType) methods.setValue('prefix', '', {
406
428
  shouldDirty: true
407
429
  });
408
430
  }
@@ -431,20 +453,17 @@ function BucketLifecycleFormPage() {
431
453
  const t = {
432
454
  StorageClass: transition.storageClass
433
455
  };
434
- if ("days" === transition.timeType) t.Days = transition.days;
456
+ if ('days' === transition.timeType) t.Days = transition.days;
435
457
  else t.Date = new Date(transition.date);
436
458
  return t;
437
459
  });
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
- };
460
+ if (data.expirationEnabled || data.expiredObjectDeleteMarker) {
461
+ rule.Expiration = {};
462
+ if (data.expirationEnabled) {
463
+ if ('days' === data.expirationType) rule.Expiration.Days = data.expirationDays;
464
+ else if ('date' === data.expirationType) rule.Expiration.Date = new Date(data.expirationDate);
465
+ }
466
+ if (data.expiredObjectDeleteMarker) rule.Expiration.ExpiredObjectDeleteMarker = true;
448
467
  }
449
468
  if (data.noncurrentTransitionsEnabled && data.noncurrentTransitions.length > 0) rule.NoncurrentVersionTransitions = data.noncurrentTransitions.map((transition)=>({
450
469
  NoncurrentDays: transition.noncurrentDays,
@@ -476,17 +495,17 @@ function BucketLifecycleFormPage() {
476
495
  onSuccess: ()=>{
477
496
  showToast({
478
497
  open: true,
479
- message: `Lifecycle rule ${isEditMode ? "updated" : "created"} successfully`,
480
- status: "success"
498
+ message: `Lifecycle rule ${isEditMode ? 'updated' : 'created'} successfully`,
499
+ status: 'success'
481
500
  });
482
501
  navigate(`/buckets/${bucketName}?tab=lifecycle`);
483
502
  },
484
503
  onError: (error)=>{
485
- const errorMessage = error instanceof Error ? error.message : `Failed to ${isEditMode ? "update" : "create"} lifecycle rule`;
504
+ const errorMessage = error instanceof Error ? error.message : `Failed to ${isEditMode ? 'update' : 'create'} lifecycle rule`;
486
505
  showToast({
487
506
  open: true,
488
507
  message: errorMessage,
489
- status: "error"
508
+ status: 'error'
490
509
  });
491
510
  }
492
511
  });
@@ -499,7 +518,7 @@ function BucketLifecycleFormPage() {
499
518
  isEditMode,
500
519
  existingRule
501
520
  ]);
502
- if ("pending" === lifecycleStatus) return /*#__PURE__*/ jsx(Loader, {
521
+ if ('pending' === lifecycleStatus) return /*#__PURE__*/ jsx(Loader, {
503
522
  centered: true,
504
523
  children: /*#__PURE__*/ jsx(Text, {
505
524
  children: "Loading..."
@@ -516,8 +535,8 @@ function BucketLifecycleFormPage() {
516
535
  ...methods,
517
536
  children: /*#__PURE__*/ jsxs(Form, {
518
537
  layout: {
519
- kind: "page",
520
- title: isEditMode ? "Edit Lifecycle Rule" : "Create Lifecycle Rule"
538
+ kind: 'page',
539
+ title: isEditMode ? 'Edit Lifecycle Rule' : 'Create Lifecycle Rule'
521
540
  },
522
541
  requireMode: "partial",
523
542
  onSubmit: handleSubmit(onSubmit),
@@ -533,10 +552,10 @@ function BucketLifecycleFormPage() {
533
552
  disabled: isSaving
534
553
  }),
535
554
  /*#__PURE__*/ jsx(Button, {
536
- id: isEditMode ? "save-lifecycle-btn" : "create-lifecycle-btn",
555
+ id: isEditMode ? 'save-lifecycle-btn' : 'create-lifecycle-btn',
537
556
  type: "submit",
538
557
  variant: "primary",
539
- label: isEditMode ? "Save" : "Create",
558
+ label: isEditMode ? 'Save' : 'Create',
540
559
  icon: isEditMode ? /*#__PURE__*/ jsx(Icon, {
541
560
  name: "Save"
542
561
  }) : void 0,
@@ -547,7 +566,7 @@ function BucketLifecycleFormPage() {
547
566
  children: [
548
567
  /*#__PURE__*/ jsxs(FormSection, {
549
568
  title: {
550
- name: "Rule Scope"
569
+ name: 'Rule Scope'
551
570
  },
552
571
  forceLabelWidth: convertRemToPixels(15),
553
572
  children: [
@@ -559,10 +578,10 @@ function BucketLifecycleFormPage() {
559
578
  helpErrorPosition: "bottom",
560
579
  required: true,
561
580
  content: isEditMode ? /*#__PURE__*/ jsx(Text, {
562
- children: watch("ruleId")
581
+ children: watch('ruleId')
563
582
  }) : /*#__PURE__*/ jsx(Input, {
564
583
  id: "ruleId",
565
- ...register("ruleId")
584
+ ...register('ruleId')
566
585
  })
567
586
  }),
568
587
  /*#__PURE__*/ jsx(FormGroup, {
@@ -590,8 +609,8 @@ function BucketLifecycleFormPage() {
590
609
  }),
591
610
  /*#__PURE__*/ jsx(FilterFormSection, {
592
611
  filterType: filterType,
593
- onFilterTypeChange: (value)=>methods.setValue("filterType", value),
594
- prefixRegister: register("prefix"),
612
+ onFilterTypeChange: (value)=>methods.setValue('filterType', value),
613
+ prefixRegister: register('prefix'),
595
614
  tagFields: tagFields,
596
615
  tagKeyRegister: (index)=>register(`tags.${index}.key`),
597
616
  tagValueRegister: (index)=>register(`tags.${index}.value`),
@@ -603,7 +622,7 @@ function BucketLifecycleFormPage() {
603
622
  }),
604
623
  /*#__PURE__*/ jsxs(FormSection, {
605
624
  title: {
606
- name: transitionsEnabled || expirationEnabled || noncurrentTransitionsEnabled || noncurrentExpirationEnabled || abortMpuEnabled ? "Lifecycle Rule" : "Lifecycle Rule (At least one action must be enabled)"
625
+ name: transitionsEnabled || expirationEnabled || noncurrentTransitionsEnabled || noncurrentExpirationEnabled || abortMpuEnabled ? 'Lifecycle Rule' : 'Lifecycle Rule (At least one action must be enabled)'
607
626
  },
608
627
  forceLabelWidth: convertRemToPixels(18),
609
628
  children: [
@@ -618,7 +637,7 @@ function BucketLifecycleFormPage() {
618
637
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
619
638
  toggle: field.value,
620
639
  onChange: field.onChange,
621
- label: field.value ? "Enabled" : "Disabled"
640
+ label: field.value ? 'Enabled' : 'Disabled'
622
641
  })
623
642
  })
624
643
  }),
@@ -644,14 +663,14 @@ function BucketLifecycleFormPage() {
644
663
  })
645
664
  }),
646
665
  /*#__PURE__*/ jsx(Box, {
647
- flex: "1/3",
666
+ flex: "1/2",
648
667
  children: /*#__PURE__*/ jsx(Text, {
649
668
  color: "textSecondary",
650
669
  children: "Value"
651
670
  })
652
671
  }),
653
672
  /*#__PURE__*/ jsx(Box, {
654
- width: convertRemToPixels(0.1)
673
+ width: convertRemToPixels(4)
655
674
  }),
656
675
  /*#__PURE__*/ jsx(Box, {
657
676
  flex: "1",
@@ -694,18 +713,18 @@ function BucketLifecycleFormPage() {
694
713
  }),
695
714
  /*#__PURE__*/ jsx(Box, {
696
715
  flex: "1",
697
- children: "days" === watch(`transitions.${index}.timeType`) ? /*#__PURE__*/ jsx(Input, {
716
+ children: 'days' === watch(`transitions.${index}.timeType`) ? /*#__PURE__*/ jsx(Input, {
698
717
  id: `transition-days-${index}`,
699
718
  type: "number",
700
719
  placeholder: "Days",
701
- size: "1/3",
720
+ size: "1/2",
702
721
  ...register(`transitions.${index}.days`, {
703
722
  valueAsNumber: true
704
723
  })
705
724
  }) : /*#__PURE__*/ jsx(Input, {
706
725
  id: `transition-date-${index}`,
707
726
  type: "date",
708
- size: "1/3",
727
+ size: "1/2",
709
728
  ...register(`transitions.${index}.date`)
710
729
  })
711
730
  }),
@@ -731,33 +750,30 @@ function BucketLifecycleFormPage() {
731
750
  showAdd: index === transitionFields.length - 1,
732
751
  onRemove: ()=>removeTransition(index),
733
752
  onAdd: ()=>appendTransition({
734
- timeType: "days",
753
+ timeType: 'days',
735
754
  days: 30,
736
- date: "",
737
- storageClass: "STANDARD_IA"
755
+ date: '',
756
+ storageClass: 'STANDARD_IA'
738
757
  }),
739
758
  canRemove: transitionFields.length > 1
740
- }),
741
- index < transitionFields.length - 1 && /*#__PURE__*/ jsx(Box, {
742
- width: convertRemToPixels(1.9)
743
759
  })
744
760
  ]
745
761
  }),
746
- getArrayFieldError(errors, "transitions", index) && /*#__PURE__*/ jsx(Text, {
762
+ getArrayFieldError(errors, 'transitions', index) && /*#__PURE__*/ jsx(Text, {
747
763
  color: "statusCritical",
748
- children: getArrayFieldError(errors, "transitions", index)
764
+ children: getArrayFieldError(errors, 'transitions', index)
749
765
  }),
750
- getArrayFieldError(errors, "transitions", index, "days") && /*#__PURE__*/ jsx(Text, {
766
+ getArrayFieldError(errors, 'transitions', index, 'days') && /*#__PURE__*/ jsx(Text, {
751
767
  color: "statusCritical",
752
- children: getArrayFieldError(errors, "transitions", index, "days")
768
+ children: getArrayFieldError(errors, 'transitions', index, 'days')
753
769
  }),
754
- getArrayFieldError(errors, "transitions", index, "storageClass") && /*#__PURE__*/ jsx(Text, {
770
+ getArrayFieldError(errors, 'transitions', index, 'storageClass') && /*#__PURE__*/ jsx(Text, {
755
771
  color: "statusCritical",
756
- children: getArrayFieldError(errors, "transitions", index, "storageClass")
772
+ children: getArrayFieldError(errors, 'transitions', index, 'storageClass')
757
773
  }),
758
- getArrayFieldError(errors, "transitions", index, "date") && /*#__PURE__*/ jsx(Text, {
774
+ getArrayFieldError(errors, 'transitions', index, 'date') && /*#__PURE__*/ jsx(Text, {
759
775
  color: "statusCritical",
760
- children: getArrayFieldError(errors, "transitions", index, "date")
776
+ children: getArrayFieldError(errors, 'transitions', index, 'date')
761
777
  })
762
778
  ]
763
779
  }, field.id))
@@ -768,13 +784,20 @@ function BucketLifecycleFormPage() {
768
784
  label: "Expiration current version",
769
785
  id: "expirationEnabled",
770
786
  direction: "horizontal",
787
+ labelHelpTooltip: "Expire objects after a specified time. Cannot be combined with expired delete markers removal.",
771
788
  content: /*#__PURE__*/ jsx(Controller, {
772
789
  name: "expirationEnabled",
773
790
  control: control,
774
791
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
775
792
  toggle: field.value,
776
- onChange: field.onChange,
777
- label: field.value ? "Enabled" : "Disabled"
793
+ onChange: (value)=>{
794
+ field.onChange(value);
795
+ if (value && expiredObjectDeleteMarker) methods.setValue('expiredObjectDeleteMarker', false, {
796
+ shouldDirty: true
797
+ });
798
+ },
799
+ label: field.value ? 'Enabled' : 'Disabled',
800
+ disabled: expiredObjectDeleteMarker
778
801
  })
779
802
  })
780
803
  }),
@@ -799,16 +822,12 @@ function BucketLifecycleFormPage() {
799
822
  /*#__PURE__*/ jsx(Select.Option, {
800
823
  value: "date",
801
824
  children: "Date"
802
- }),
803
- /*#__PURE__*/ jsx(Select.Option, {
804
- value: "deleteMarker",
805
- children: "Expired delete markers"
806
825
  })
807
826
  ]
808
827
  })
809
828
  })
810
829
  }),
811
- "days" === expirationType && /*#__PURE__*/ jsx(FormGroup, {
830
+ 'days' === expirationType && /*#__PURE__*/ jsx(FormGroup, {
812
831
  label: "Days",
813
832
  id: "expirationDays",
814
833
  direction: "horizontal",
@@ -819,29 +838,47 @@ function BucketLifecycleFormPage() {
819
838
  children: /*#__PURE__*/ jsx(Input, {
820
839
  type: "number",
821
840
  id: "expirationDays",
822
- ...register("expirationDays", {
841
+ ...register('expirationDays', {
823
842
  valueAsNumber: true
824
843
  })
825
844
  })
826
845
  })
827
846
  }),
828
- "date" === expirationType && /*#__PURE__*/ jsx(FormGroup, {
847
+ 'date' === expirationType && /*#__PURE__*/ jsx(FormGroup, {
829
848
  label: "Date",
830
849
  id: "expirationDate",
831
850
  direction: "horizontal",
832
851
  error: errors?.expirationDate?.message,
833
852
  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
- })
853
+ content: /*#__PURE__*/ jsx(Input, {
854
+ type: "date",
855
+ id: "expirationDate",
856
+ ...register('expirationDate')
841
857
  })
842
858
  })
843
859
  ]
844
860
  }) : /*#__PURE__*/ jsx(Fragment, {}),
861
+ /*#__PURE__*/ jsx(FormGroup, {
862
+ label: "Remove expired delete markers",
863
+ id: "expiredObjectDeleteMarker",
864
+ direction: "horizontal",
865
+ labelHelpTooltip: "Automatically remove expired object delete markers in versioned buckets. Cannot be combined with Days/Date expiration.",
866
+ content: /*#__PURE__*/ jsx(Controller, {
867
+ name: "expiredObjectDeleteMarker",
868
+ control: control,
869
+ render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
870
+ toggle: field.value,
871
+ onChange: (value)=>{
872
+ field.onChange(value);
873
+ if (value && expirationEnabled) methods.setValue('expirationEnabled', false, {
874
+ shouldDirty: true
875
+ });
876
+ },
877
+ label: field.value ? 'Enabled' : 'Disabled',
878
+ disabled: expirationEnabled
879
+ })
880
+ })
881
+ }),
845
882
  /*#__PURE__*/ jsx(FormGroup, {
846
883
  label: "Transition noncurrent version",
847
884
  id: "noncurrentTransitionsEnabled",
@@ -852,7 +889,7 @@ function BucketLifecycleFormPage() {
852
889
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
853
890
  toggle: field.value,
854
891
  onChange: field.onChange,
855
- label: field.value ? "Enabled" : "Disabled"
892
+ label: field.value ? 'Enabled' : 'Disabled'
856
893
  })
857
894
  })
858
895
  }),
@@ -954,23 +991,20 @@ function BucketLifecycleFormPage() {
954
991
  onRemove: ()=>removeNoncurrentTransition(index),
955
992
  onAdd: ()=>appendNoncurrentTransition({
956
993
  noncurrentDays: 30,
957
- storageClass: "GLACIER",
994
+ storageClass: 'GLACIER',
958
995
  newerNoncurrentVersions: 0
959
996
  }),
960
997
  canRemove: noncurrentTransitionFields.length > 1
961
- }),
962
- index < noncurrentTransitionFields.length - 1 && /*#__PURE__*/ jsx(Box, {
963
- width: convertRemToPixels(1.9)
964
998
  })
965
999
  ]
966
1000
  }),
967
- getArrayFieldError(errors, "noncurrentTransitions", index, "noncurrentDays") && /*#__PURE__*/ jsx(Text, {
1001
+ getArrayFieldError(errors, 'noncurrentTransitions', index, 'noncurrentDays') && /*#__PURE__*/ jsx(Text, {
968
1002
  color: "statusCritical",
969
- children: getArrayFieldError(errors, "noncurrentTransitions", index, "noncurrentDays")
1003
+ children: getArrayFieldError(errors, 'noncurrentTransitions', index, 'noncurrentDays')
970
1004
  }),
971
- getArrayFieldError(errors, "noncurrentTransitions", index, "storageClass") && /*#__PURE__*/ jsx(Text, {
1005
+ getArrayFieldError(errors, 'noncurrentTransitions', index, 'storageClass') && /*#__PURE__*/ jsx(Text, {
972
1006
  color: "statusCritical",
973
- children: getArrayFieldError(errors, "noncurrentTransitions", index, "storageClass")
1007
+ children: getArrayFieldError(errors, 'noncurrentTransitions', index, 'storageClass')
974
1008
  })
975
1009
  ]
976
1010
  }, field.id))
@@ -987,7 +1021,7 @@ function BucketLifecycleFormPage() {
987
1021
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
988
1022
  toggle: field.value,
989
1023
  onChange: field.onChange,
990
- label: field.value ? "Enabled" : "Disabled"
1024
+ label: field.value ? 'Enabled' : 'Disabled'
991
1025
  })
992
1026
  })
993
1027
  }),
@@ -1004,7 +1038,7 @@ function BucketLifecycleFormPage() {
1004
1038
  children: /*#__PURE__*/ jsx(Input, {
1005
1039
  type: "number",
1006
1040
  id: "noncurrentExpirationDays",
1007
- ...register("noncurrentExpirationDays", {
1041
+ ...register('noncurrentExpirationDays', {
1008
1042
  valueAsNumber: true
1009
1043
  })
1010
1044
  })
@@ -1020,7 +1054,7 @@ function BucketLifecycleFormPage() {
1020
1054
  type: "number",
1021
1055
  id: "noncurrentNewerVersions",
1022
1056
  placeholder: "0",
1023
- ...register("noncurrentNewerVersions", {
1057
+ ...register('noncurrentNewerVersions', {
1024
1058
  valueAsNumber: true
1025
1059
  })
1026
1060
  })
@@ -1032,7 +1066,7 @@ function BucketLifecycleFormPage() {
1032
1066
  label: "Expire incomplete multipart upload",
1033
1067
  id: "abortMpuEnabled",
1034
1068
  direction: "horizontal",
1035
- error: ("tags" === filterType || "and" === filterType) && abortMpuEnabled ? "Tag-based filter cannot be used with Abort Incomplete Multipart Upload" : void 0,
1069
+ error: ('tags' === filterType || 'and' === filterType) && abortMpuEnabled ? 'Tag-based filter cannot be used with Abort Incomplete Multipart Upload' : void 0,
1036
1070
  helpErrorPosition: "bottom",
1037
1071
  content: /*#__PURE__*/ jsx(Controller, {
1038
1072
  name: "abortMpuEnabled",
@@ -1040,7 +1074,7 @@ function BucketLifecycleFormPage() {
1040
1074
  render: ({ field })=>/*#__PURE__*/ jsx(Toggle, {
1041
1075
  toggle: field.value,
1042
1076
  onChange: field.onChange,
1043
- label: field.value ? "Enabled" : "Disabled"
1077
+ label: field.value ? 'Enabled' : 'Disabled'
1044
1078
  })
1045
1079
  })
1046
1080
  }),
@@ -1055,7 +1089,7 @@ function BucketLifecycleFormPage() {
1055
1089
  children: /*#__PURE__*/ jsx(Input, {
1056
1090
  type: "number",
1057
1091
  id: "abortMpuDays",
1058
- ...register("abortMpuDays", {
1092
+ ...register('abortMpuDays', {
1059
1093
  valueAsNumber: true
1060
1094
  })
1061
1095
  })