@scality/data-browser-library 1.0.0-preview.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/components/Editor.d.ts +12 -0
  2. package/dist/components/Editor.js +28 -0
  3. package/dist/components/__tests__/BucketCreate.test.d.ts +1 -0
  4. package/dist/components/__tests__/BucketCreate.test.js +408 -0
  5. package/dist/components/__tests__/BucketLifecycleFormPage.test.d.ts +1 -0
  6. package/dist/components/__tests__/BucketLifecycleFormPage.test.js +618 -0
  7. package/dist/components/__tests__/BucketLifecycleList.test.d.ts +1 -0
  8. package/dist/components/__tests__/BucketLifecycleList.test.js +325 -0
  9. package/dist/components/__tests__/BucketList.test.d.ts +1 -0
  10. package/dist/components/__tests__/BucketList.test.js +415 -0
  11. package/dist/components/__tests__/BucketNotificationCreatePage.test.d.ts +1 -0
  12. package/dist/components/__tests__/BucketNotificationCreatePage.test.js +316 -0
  13. package/dist/components/__tests__/BucketOverview.test.d.ts +1 -0
  14. package/dist/components/__tests__/BucketOverview.test.js +769 -0
  15. package/dist/components/__tests__/BucketPolicyPage.test.d.ts +1 -0
  16. package/dist/components/__tests__/BucketPolicyPage.test.js +268 -0
  17. package/dist/components/__tests__/BucketReplicationFormPage.test.d.ts +1 -0
  18. package/dist/components/__tests__/BucketReplicationFormPage.test.js +1757 -0
  19. package/dist/components/__tests__/BucketReplicationList.test.d.ts +1 -0
  20. package/dist/components/__tests__/BucketReplicationList.test.js +344 -0
  21. package/dist/components/__tests__/CreateFolderButton.test.d.ts +1 -0
  22. package/dist/components/__tests__/CreateFolderButton.test.js +147 -0
  23. package/dist/components/__tests__/DeleteBucketButton.test.d.ts +1 -0
  24. package/dist/components/__tests__/DeleteBucketButton.test.js +272 -0
  25. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.d.ts +1 -0
  26. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +196 -0
  27. package/dist/components/__tests__/DeleteObjectButton.test.d.ts +1 -0
  28. package/dist/components/__tests__/DeleteObjectButton.test.js +302 -0
  29. package/dist/components/__tests__/EmptyBucketButton.test.d.ts +1 -0
  30. package/dist/components/__tests__/EmptyBucketButton.test.js +302 -0
  31. package/dist/components/__tests__/MetadataSearch.test.d.ts +1 -0
  32. package/dist/components/__tests__/MetadataSearch.test.js +201 -0
  33. package/dist/components/__tests__/ObjectList.test.d.ts +1 -0
  34. package/dist/components/__tests__/ObjectList.test.js +283 -0
  35. package/dist/components/__tests__/UploadButton.test.d.ts +1 -0
  36. package/dist/components/__tests__/UploadButton.test.js +144 -0
  37. package/dist/components/buckets/BucketCreate.d.ts +49 -0
  38. package/dist/components/buckets/BucketCreate.js +237 -0
  39. package/dist/components/buckets/BucketDetails.d.ts +1 -0
  40. package/dist/components/buckets/BucketDetails.js +106 -0
  41. package/dist/components/buckets/BucketLifecycleFormPage.d.ts +15 -0
  42. package/dist/components/buckets/BucketLifecycleFormPage.js +1085 -0
  43. package/dist/components/buckets/BucketLifecycleList.d.ts +10 -0
  44. package/dist/components/buckets/BucketLifecycleList.js +270 -0
  45. package/dist/components/buckets/BucketList.d.ts +15 -0
  46. package/dist/components/buckets/BucketList.js +146 -0
  47. package/dist/components/buckets/BucketLocation.d.ts +3 -0
  48. package/dist/components/buckets/BucketLocation.js +16 -0
  49. package/dist/components/buckets/BucketOverview.d.ts +88 -0
  50. package/dist/components/buckets/BucketOverview.js +291 -0
  51. package/dist/components/buckets/BucketPage.d.ts +2 -0
  52. package/dist/components/buckets/BucketPage.js +47 -0
  53. package/dist/components/buckets/BucketPolicyButton.d.ts +7 -0
  54. package/dist/components/buckets/BucketPolicyButton.js +18 -0
  55. package/dist/components/buckets/BucketPolicyPage.d.ts +1 -0
  56. package/dist/components/buckets/BucketPolicyPage.js +236 -0
  57. package/dist/components/buckets/BucketReplicationFormPage.d.ts +1 -0
  58. package/dist/components/buckets/BucketReplicationFormPage.js +834 -0
  59. package/dist/components/buckets/BucketReplicationList.d.ts +11 -0
  60. package/dist/components/buckets/BucketReplicationList.js +189 -0
  61. package/dist/components/buckets/BucketVersioning.d.ts +4 -0
  62. package/dist/components/buckets/BucketVersioning.js +73 -0
  63. package/dist/components/buckets/DeleteBucketButton.d.ts +8 -0
  64. package/dist/components/buckets/DeleteBucketButton.js +78 -0
  65. package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +18 -0
  66. package/dist/components/buckets/DeleteBucketConfigRuleButton.js +53 -0
  67. package/dist/components/buckets/EmptyBucketButton.d.ts +5 -0
  68. package/dist/components/buckets/EmptyBucketButton.js +232 -0
  69. package/dist/components/buckets/EmptyBucketSummary.d.ts +9 -0
  70. package/dist/components/buckets/EmptyBucketSummary.js +60 -0
  71. package/dist/components/buckets/EmptyBucketSummaryList.d.ts +13 -0
  72. package/dist/components/buckets/EmptyBucketSummaryList.js +140 -0
  73. package/dist/components/buckets/__tests__/BucketVersioning.test.d.ts +1 -0
  74. package/dist/components/buckets/__tests__/BucketVersioning.test.js +163 -0
  75. package/dist/components/buckets/notifications/BucketNotificationCreatePage.d.ts +1 -0
  76. package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +234 -0
  77. package/dist/components/buckets/notifications/EventsSection.d.ts +1 -0
  78. package/dist/components/buckets/notifications/EventsSection.js +123 -0
  79. package/dist/components/buckets/notifications/events.d.ts +12 -0
  80. package/dist/components/buckets/notifications/events.js +27 -0
  81. package/dist/components/index.d.ts +21 -0
  82. package/dist/components/index.js +22 -0
  83. package/dist/components/layouts/ArrowNavigation.d.ts +4 -0
  84. package/dist/components/layouts/ArrowNavigation.js +16 -0
  85. package/dist/components/layouts/BrowserPageLayout.d.ts +12 -0
  86. package/dist/components/layouts/BrowserPageLayout.js +51 -0
  87. package/dist/components/objects/CreateFolderButton.d.ts +29 -0
  88. package/dist/components/objects/CreateFolderButton.js +118 -0
  89. package/dist/components/objects/DeleteObjectButton.d.ts +8 -0
  90. package/dist/components/objects/DeleteObjectButton.js +191 -0
  91. package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +2 -0
  92. package/dist/components/objects/ObjectDetails/ObjectMetadata.js +356 -0
  93. package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +3 -0
  94. package/dist/components/objects/ObjectDetails/ObjectSummary.js +241 -0
  95. package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +3 -0
  96. package/dist/components/objects/ObjectDetails/ObjectTags.js +272 -0
  97. package/dist/components/objects/ObjectDetails/index.d.ts +9 -0
  98. package/dist/components/objects/ObjectDetails/index.js +75 -0
  99. package/dist/components/objects/ObjectList.d.ts +40 -0
  100. package/dist/components/objects/ObjectList.js +453 -0
  101. package/dist/components/objects/ObjectLock/EditRetentionButton.d.ts +4 -0
  102. package/dist/components/objects/ObjectLock/EditRetentionButton.js +32 -0
  103. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.d.ts +3 -0
  104. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +211 -0
  105. package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +9 -0
  106. package/dist/components/objects/ObjectLock/ObjectLockSettings.js +158 -0
  107. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +8 -0
  108. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +39 -0
  109. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.d.ts +1 -0
  110. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +204 -0
  111. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.d.ts +1 -0
  112. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +374 -0
  113. package/dist/components/objects/ObjectPage.d.ts +1 -0
  114. package/dist/components/objects/ObjectPage.js +45 -0
  115. package/dist/components/objects/UploadButton.d.ts +34 -0
  116. package/dist/components/objects/UploadButton.js +229 -0
  117. package/dist/components/providers/DataBrowserProvider.d.ts +20 -0
  118. package/dist/components/providers/DataBrowserProvider.js +42 -0
  119. package/dist/components/search/MetadataSearch.d.ts +5 -0
  120. package/dist/components/search/MetadataSearch.js +162 -0
  121. package/dist/components/search/SearchHints.d.ts +8 -0
  122. package/dist/components/search/SearchHints.js +21 -0
  123. package/dist/components/ui/ArrayFieldActions.d.ts +36 -0
  124. package/dist/components/ui/ArrayFieldActions.js +43 -0
  125. package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +16 -0
  126. package/dist/components/ui/ConfirmDeleteRuleModal.js +43 -0
  127. package/dist/components/ui/DeleteObjectModalContent.d.ts +5 -0
  128. package/dist/components/ui/DeleteObjectModalContent.js +71 -0
  129. package/dist/components/ui/FilterFormSection.d.ts +44 -0
  130. package/dist/components/ui/FilterFormSection.js +159 -0
  131. package/dist/components/ui/Search.elements.d.ts +17 -0
  132. package/dist/components/ui/Search.elements.js +59 -0
  133. package/dist/components/ui/Table.elements.d.ts +36 -0
  134. package/dist/components/ui/Table.elements.js +87 -0
  135. package/dist/config/factory.d.ts +63 -0
  136. package/dist/config/factory.js +74 -0
  137. package/dist/config/types.d.ts +46 -0
  138. package/dist/config/types.js +0 -0
  139. package/dist/hooks/__tests__/useISVBucketDetection.test.d.ts +1 -0
  140. package/dist/hooks/__tests__/useISVBucketDetection.test.js +188 -0
  141. package/dist/hooks/__tests__/useIsBucketEmpty.test.d.ts +1 -0
  142. package/dist/hooks/__tests__/useIsBucketEmpty.test.js +122 -0
  143. package/dist/hooks/bucketConfiguration.d.ts +168 -0
  144. package/dist/hooks/bucketConfiguration.js +67 -0
  145. package/dist/hooks/bucketOperations.d.ts +36 -0
  146. package/dist/hooks/bucketOperations.js +12 -0
  147. package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.d.ts +1 -0
  148. package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +276 -0
  149. package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.d.ts +1 -0
  150. package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +259 -0
  151. package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.d.ts +1 -0
  152. package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +166 -0
  153. package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.d.ts +1 -0
  154. package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +200 -0
  155. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.d.ts +1 -0
  156. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +179 -0
  157. package/dist/hooks/factories/index.d.ts +18 -0
  158. package/dist/hooks/factories/index.js +5 -0
  159. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +13 -0
  160. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +76 -0
  161. package/dist/hooks/factories/useCreateS3LoginHook.d.ts +8 -0
  162. package/dist/hooks/factories/useCreateS3LoginHook.js +22 -0
  163. package/dist/hooks/factories/useCreateS3MutationHook.d.ts +5 -0
  164. package/dist/hooks/factories/useCreateS3MutationHook.js +50 -0
  165. package/dist/hooks/factories/useCreateS3QueryHook.d.ts +3 -0
  166. package/dist/hooks/factories/useCreateS3QueryHook.js +51 -0
  167. package/dist/hooks/index.d.ts +13 -0
  168. package/dist/hooks/index.js +13 -0
  169. package/dist/hooks/loginOperations.d.ts +21 -0
  170. package/dist/hooks/loginOperations.js +9 -0
  171. package/dist/hooks/objectOperations.d.ts +190 -0
  172. package/dist/hooks/objectOperations.js +67 -0
  173. package/dist/hooks/presignedOperations.d.ts +73 -0
  174. package/dist/hooks/presignedOperations.js +72 -0
  175. package/dist/hooks/useBatchObjectLegalHold.d.ts +11 -0
  176. package/dist/hooks/useBatchObjectLegalHold.js +45 -0
  177. package/dist/hooks/useDeleteBucketConfigRule.d.ts +26 -0
  178. package/dist/hooks/useDeleteBucketConfigRule.js +46 -0
  179. package/dist/hooks/useEmptyBucket.d.ts +27 -0
  180. package/dist/hooks/useEmptyBucket.js +116 -0
  181. package/dist/hooks/useISVBucketDetection.d.ts +15 -0
  182. package/dist/hooks/useISVBucketDetection.js +27 -0
  183. package/dist/hooks/useIsBucketEmpty.d.ts +7 -0
  184. package/dist/hooks/useIsBucketEmpty.js +36 -0
  185. package/dist/hooks/useLoginMutation.d.ts +21 -0
  186. package/dist/hooks/useLoginMutation.js +9 -0
  187. package/dist/hooks/useS3Client.d.ts +1 -0
  188. package/dist/hooks/useS3Client.js +13 -0
  189. package/dist/hooks/useTableRowSelection.d.ts +9 -0
  190. package/dist/hooks/useTableRowSelection.js +45 -0
  191. package/dist/index.d.ts +6 -0
  192. package/dist/index.js +6 -0
  193. package/dist/schemas/bucketPolicySchema.json +321 -0
  194. package/dist/test/msw/handlers/deleteBucket.d.ts +1 -0
  195. package/dist/test/msw/handlers/deleteBucket.js +14 -0
  196. package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -0
  197. package/dist/test/msw/handlers/getBucketAcl.js +96 -0
  198. package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -0
  199. package/dist/test/msw/handlers/getBucketLocation.js +23 -0
  200. package/dist/test/msw/handlers/getBucketPolicy.d.ts +11 -0
  201. package/dist/test/msw/handlers/getBucketPolicy.js +72 -0
  202. package/dist/test/msw/handlers/headObject.d.ts +1 -0
  203. package/dist/test/msw/handlers/headObject.js +17 -0
  204. package/dist/test/msw/handlers/listBuckets.d.ts +1 -0
  205. package/dist/test/msw/handlers/listBuckets.js +24 -0
  206. package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -0
  207. package/dist/test/msw/handlers/listObjectVersions.js +83 -0
  208. package/dist/test/msw/handlers/listObjects.d.ts +1 -0
  209. package/dist/test/msw/handlers/listObjects.js +66 -0
  210. package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -0
  211. package/dist/test/msw/handlers/objectLegalHold.js +24 -0
  212. package/dist/test/msw/handlers/objectRetention.d.ts +1 -0
  213. package/dist/test/msw/handlers/objectRetention.js +27 -0
  214. package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -0
  215. package/dist/test/msw/handlers/putBucketAcl.js +18 -0
  216. package/dist/test/msw/handlers/putObject.d.ts +1 -0
  217. package/dist/test/msw/handlers/putObject.js +16 -0
  218. package/dist/test/msw/handlers.d.ts +4 -0
  219. package/dist/test/msw/handlers.js +109 -0
  220. package/dist/test/msw/index.d.ts +2 -0
  221. package/dist/test/msw/index.js +3 -0
  222. package/dist/test/msw/server.d.ts +4 -0
  223. package/dist/test/msw/server.js +20 -0
  224. package/dist/test/msw/utils.d.ts +2 -0
  225. package/dist/test/msw/utils.js +13 -0
  226. package/dist/test/setup.d.ts +1 -0
  227. package/dist/test/setup.js +90 -0
  228. package/dist/test/testUtils.d.ts +181 -0
  229. package/dist/test/testUtils.js +310 -0
  230. package/dist/test/utils/errorHandling.test.d.ts +1 -0
  231. package/dist/test/utils/errorHandling.test.js +423 -0
  232. package/dist/types/index.d.ts +51 -0
  233. package/dist/types/index.js +0 -0
  234. package/dist/utils/constants.d.ts +12 -0
  235. package/dist/utils/constants.js +9 -0
  236. package/dist/utils/deletion/index.d.ts +2 -0
  237. package/dist/utils/deletion/index.js +2 -0
  238. package/dist/utils/deletion/messages.d.ts +5 -0
  239. package/dist/utils/deletion/messages.js +29 -0
  240. package/dist/utils/deletion/types.d.ts +11 -0
  241. package/dist/utils/deletion/types.js +0 -0
  242. package/dist/utils/errorHandling.d.ts +63 -0
  243. package/dist/utils/errorHandling.js +84 -0
  244. package/dist/utils/hooks.d.ts +2 -0
  245. package/dist/utils/hooks.js +26 -0
  246. package/dist/utils/index.d.ts +4 -0
  247. package/dist/utils/index.js +4 -0
  248. package/dist/utils/proxyMiddleware.d.ts +18 -0
  249. package/dist/utils/proxyMiddleware.js +56 -0
  250. package/dist/utils/s3Client.d.ts +5 -0
  251. package/dist/utils/s3Client.js +36 -0
  252. package/dist/utils/s3RuleUtils.d.ts +53 -0
  253. package/dist/utils/s3RuleUtils.js +101 -0
  254. package/dist/utils/useFeatures.d.ts +1 -0
  255. package/dist/utils/useFeatures.js +7 -0
  256. package/package.json +84 -0
@@ -0,0 +1,159 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { FormGroup, FormSection, Stack, Text } from "@scality/core-ui";
3
+ import { convertRemToPixels } from "@scality/core-ui/dist/components/tablev2/TableUtils";
4
+ import { Box, Input, Select } from "@scality/core-ui/dist/next";
5
+ import { ArrayFieldActions } from "./ArrayFieldActions.js";
6
+ const filterTypeOptions = [
7
+ {
8
+ value: "none",
9
+ label: "All objects"
10
+ },
11
+ {
12
+ value: "prefix",
13
+ label: "Prefix filter"
14
+ },
15
+ {
16
+ value: "tags",
17
+ label: "Tags filter"
18
+ },
19
+ {
20
+ value: "and",
21
+ label: "Prefix and tags filter"
22
+ }
23
+ ];
24
+ const shouldShowPrefix = (filterType)=>"prefix" === filterType || "and" === filterType;
25
+ const shouldShowTags = (filterType)=>"tags" === filterType || "and" === filterType;
26
+ function FilterFormSection({ filterType, onFilterTypeChange, prefixRegister, tagFields, tagKeyRegister, tagValueRegister, getTagKeyValue, getTagValueValue, appendTag, removeTag, errors, forceLabelWidth = convertRemToPixels(15) }) {
27
+ return /*#__PURE__*/ jsxs(FormSection, {
28
+ title: {
29
+ name: "Filter"
30
+ },
31
+ forceLabelWidth: forceLabelWidth,
32
+ children: [
33
+ /*#__PURE__*/ jsx(FormGroup, {
34
+ label: "Filter",
35
+ id: "filterType",
36
+ direction: "horizontal",
37
+ content: /*#__PURE__*/ jsx(Select, {
38
+ id: "filterType",
39
+ value: filterType,
40
+ onChange: onFilterTypeChange,
41
+ children: filterTypeOptions.map((option)=>/*#__PURE__*/ jsx(Select.Option, {
42
+ value: option.value,
43
+ children: option.label
44
+ }, option.value))
45
+ })
46
+ }),
47
+ shouldShowPrefix(filterType) ? /*#__PURE__*/ jsx(FormGroup, {
48
+ label: "Prefix",
49
+ id: "prefix",
50
+ direction: "horizontal",
51
+ error: errors?.prefix?.message,
52
+ helpErrorPosition: "bottom",
53
+ required: "prefix" === filterType,
54
+ content: /*#__PURE__*/ jsx(Input, {
55
+ id: "prefix",
56
+ placeholder: "folder/",
57
+ ...prefixRegister
58
+ })
59
+ }) : /*#__PURE__*/ jsx(Fragment, {}),
60
+ shouldShowTags(filterType) ? /*#__PURE__*/ jsx(FormGroup, {
61
+ label: "Tags",
62
+ id: "tags",
63
+ direction: "horizontal",
64
+ error: errors?.tags?.message,
65
+ helpErrorPosition: "bottom",
66
+ required: true,
67
+ content: /*#__PURE__*/ jsxs(Stack, {
68
+ direction: "vertical",
69
+ gap: "r8",
70
+ children: [
71
+ /*#__PURE__*/ jsxs(Stack, {
72
+ gap: "r8",
73
+ children: [
74
+ /*#__PURE__*/ jsx(Box, {
75
+ flex: "1",
76
+ children: /*#__PURE__*/ jsx(Text, {
77
+ color: "textSecondary",
78
+ children: "Key"
79
+ })
80
+ }),
81
+ /*#__PURE__*/ jsx(Box, {
82
+ flex: "1",
83
+ children: /*#__PURE__*/ jsx(Text, {
84
+ color: "textSecondary",
85
+ children: "Value"
86
+ })
87
+ }),
88
+ /*#__PURE__*/ jsx(Box, {
89
+ width: "80px"
90
+ })
91
+ ]
92
+ }),
93
+ tagFields.map((field, index)=>/*#__PURE__*/ jsxs(Stack, {
94
+ gap: "r8",
95
+ children: [
96
+ /*#__PURE__*/ jsx(Input, {
97
+ id: `tag-key-${index}`,
98
+ placeholder: "Key",
99
+ size: "1/2",
100
+ ...tagKeyRegister(index)
101
+ }),
102
+ /*#__PURE__*/ jsx(Input, {
103
+ id: `tag-value-${index}`,
104
+ placeholder: "Value",
105
+ size: "1/2",
106
+ ...tagValueRegister(index)
107
+ }),
108
+ /*#__PURE__*/ jsx(ArrayFieldActions, {
109
+ showAdd: index === tagFields.length - 1,
110
+ onRemove: ()=>removeTag(index),
111
+ onAdd: ()=>appendTag({
112
+ key: "",
113
+ value: ""
114
+ }),
115
+ canRemove: tagFields.length > 1,
116
+ canAdd: !!getTagKeyValue(index) && !!getTagValueValue(index),
117
+ removeLabel: "Remove tag",
118
+ addLabel: "Add tag"
119
+ })
120
+ ]
121
+ }, field.id))
122
+ ]
123
+ })
124
+ }) : /*#__PURE__*/ jsx(Fragment, {})
125
+ ]
126
+ });
127
+ }
128
+ const createFilterValidationSchema = (Joi)=>({
129
+ filterType: Joi.string().valid("none", "prefix", "tags", "and").required(),
130
+ prefix: Joi.when("filterType", {
131
+ is: "prefix",
132
+ then: Joi.string().required().min(1).messages({
133
+ "string.empty": "Prefix is required when using prefix filter",
134
+ "string.min": "Prefix is required when using prefix filter"
135
+ }),
136
+ otherwise: Joi.when("filterType", {
137
+ is: "and",
138
+ then: Joi.string().allow("").optional(),
139
+ otherwise: Joi.any()
140
+ })
141
+ }),
142
+ tags: Joi.when("filterType", {
143
+ is: Joi.valid("tags", "and"),
144
+ then: Joi.array().items(Joi.object({
145
+ key: Joi.string().required().max(128).messages({
146
+ "string.empty": "Tag key is required",
147
+ "string.max": "Tag key must not exceed 128 characters"
148
+ }),
149
+ value: Joi.string().required().max(256).messages({
150
+ "string.empty": "Tag value is required",
151
+ "string.max": "Tag value must not exceed 256 characters"
152
+ })
153
+ })).min(1).messages({
154
+ "array.min": "At least one tag is required when using tag filter"
155
+ }),
156
+ otherwise: Joi.array().optional()
157
+ })
158
+ });
159
+ export { FilterFormSection, createFilterValidationSchema };
@@ -0,0 +1,17 @@
1
+ import { IconColor, IconName } from "@scality/core-ui/dist/components/icon/Icon.component";
2
+ export declare const SearchContainer: import("styled-components").StyledComponent<"form", any, {
3
+ isHidden?: boolean;
4
+ }, never>;
5
+ export declare const SearchInputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const HintsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const HintItem: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const HintsTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ type SearchIcon = {
10
+ name: IconName;
11
+ color: IconColor;
12
+ };
13
+ export declare const searchIcon: ({ isMetadata, isError, }: {
14
+ isMetadata: boolean;
15
+ isError: boolean;
16
+ }) => SearchIcon;
17
+ export {};
@@ -0,0 +1,59 @@
1
+ import { spacing } from "@scality/core-ui/dist/spacing";
2
+ import styled_components from "styled-components";
3
+ const SearchContainer = styled_components.form`
4
+ flex: 1 0 auto;
5
+ display: flex;
6
+ max-width: 600px;
7
+ margin-right: ${spacing.r20};
8
+ visibility: ${(props)=>props.isHidden ? "hidden" : "visible"};
9
+ gap: ${spacing.r8};
10
+ `;
11
+ const SearchInputContainer = styled_components.div`
12
+ position: relative;
13
+ display: flex;
14
+ flex-direction: row;
15
+ margin-right: ${spacing.r4};
16
+ align-items: center;
17
+ `;
18
+ const HintsContainer = styled_components.div`
19
+ position: absolute;
20
+ z-index: 1;
21
+ background-color: ${(props)=>props.theme.backgroundLevel1};
22
+ padding: ${spacing.r16};
23
+ margin-top: ${spacing.r40};
24
+ `;
25
+ const HintItem = styled_components.div`
26
+ padding: ${spacing.r8} ${spacing.r12};
27
+ cursor: pointer;
28
+ color: ${(props)=>props.theme.textPrimary};
29
+ font-size: 0.875rem;
30
+ transition: background-color 0.2s ease;
31
+
32
+ &:hover {
33
+ background: ${(props)=>props.theme.backgroundLevel2};
34
+ }
35
+
36
+ &:last-child {
37
+ border-bottom: none;
38
+ }
39
+ `;
40
+ const HintsTitle = styled_components.div`
41
+ font-style: italic;
42
+ padding: ${spacing.r2} 0px ${spacing.r8} ${spacing.r8};
43
+ color: ${(props)=>props.theme.textSecondary};
44
+ `;
45
+ const searchIcon = ({ isMetadata, isError })=>{
46
+ if (isError) return {
47
+ name: "Close",
48
+ color: "statusCritical"
49
+ };
50
+ if (isMetadata) return {
51
+ name: "Check",
52
+ color: "statusHealthy"
53
+ };
54
+ return {
55
+ name: "Search",
56
+ color: "textSecondary"
57
+ };
58
+ };
59
+ export { HintItem, HintsContainer, HintsTitle, SearchContainer, SearchInputContainer, searchIcon };
@@ -0,0 +1,36 @@
1
+ export declare const Table: ({ children, ...props }: {
2
+ children: React.ReactNode;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const Body: ({ children, ...props }: {
5
+ children: React.ReactNode;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const Group: ({ children, ...props }: {
8
+ children: React.ReactNode;
9
+ }) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const GroupName: ({ children, ...props }: {
11
+ children: React.ReactNode;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const GroupContent: ({ children, ...props }: {
14
+ children: React.ReactNode;
15
+ }) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const Row: ({ children, ...props }: {
17
+ children: React.ReactNode;
18
+ }) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const Key: import("styled-components").StyledComponent<"div", any, {
20
+ principal?: boolean;
21
+ required?: boolean;
22
+ } & {
23
+ size?: string;
24
+ }, never>;
25
+ export declare const Value: import("styled-components").StyledComponent<"div", any, {
26
+ width?: string;
27
+ }, never>;
28
+ export declare const TableContainer: ({ children, ...props }: {
29
+ children: React.ReactNode;
30
+ }) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const GroupValues: import("styled-components").StyledComponent<"div", any, {
32
+ size?: string;
33
+ }, never>;
34
+ export declare const ExtraCell: import("styled-components").StyledComponent<"div", any, {
35
+ marginLeft?: string;
36
+ }, never>;
@@ -0,0 +1,87 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Text, spacing } from "@scality/core-ui";
3
+ import { Box } from "@scality/core-ui/dist/next";
4
+ import styled_components from "styled-components";
5
+ const Table = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
6
+ height: "100%",
7
+ overflow: "auto",
8
+ width: "100%",
9
+ ...props,
10
+ children: children
11
+ });
12
+ const Body = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
13
+ display: "flex",
14
+ flexDirection: "column",
15
+ ...props,
16
+ children: children
17
+ });
18
+ const Group = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
19
+ marginBottom: spacing.r28,
20
+ ...props,
21
+ children: children
22
+ });
23
+ const GroupName = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
24
+ marginBottom: spacing.r10,
25
+ ...props,
26
+ children: /*#__PURE__*/ jsx(Text, {
27
+ isEmphazed: true,
28
+ color: "textPrimary",
29
+ children: children
30
+ })
31
+ });
32
+ const GroupContent = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
33
+ display: "flex",
34
+ flexDirection: "column",
35
+ ...props,
36
+ children: children
37
+ });
38
+ const Row = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
39
+ position: "relative",
40
+ display: "flex",
41
+ flexDirection: "row",
42
+ alignItems: "center",
43
+ marginBottom: spacing.r8,
44
+ minHeight: spacing.r28,
45
+ ...props,
46
+ children: children
47
+ });
48
+ const RawKey = styled_components.div`
49
+ color: ${(props)=>props.principal ? props.theme.textPrimary : props.theme?.textSecondary};
50
+ font-weight: ${(props)=>props.principal ? "bold" : "normal"};
51
+ ${(props)=>props.required ? `
52
+ &:after {
53
+ content: '*';
54
+ }
55
+ ` : ""}
56
+ `;
57
+ const Key = styled_components(RawKey)`
58
+ && {
59
+ flex: ${(props)=>props.size || "0.35"};
60
+ min-width: 0;
61
+ }
62
+ `;
63
+ const Value = styled_components.div`
64
+ flex: 0.65;
65
+ flex-direction: column;
66
+ min-width: 0;
67
+ color: ${(props)=>props.theme?.textPrimary};
68
+ width: ${(props)=>props.width};
69
+ `;
70
+ const TableContainer = ({ children, ...props })=>/*#__PURE__*/ jsx(Box, {
71
+ display: "flex",
72
+ flexDirection: "column",
73
+ height: "100%",
74
+ ...props,
75
+ children: children
76
+ });
77
+ const GroupValues = styled_components.div`
78
+ display: flex;
79
+ flex: ${(props)=>props.size || "0.65"};
80
+ justify-content: space-between;
81
+ align-items: center;
82
+ min-width: 0;
83
+ `;
84
+ const ExtraCell = styled_components.div`
85
+ margin-left: ${(props)=>props.marginLeft || "1.429rem"};
86
+ `;
87
+ export { Body, ExtraCell, Group, GroupContent, GroupName, GroupValues, Key, Row, Table, TableContainer, Value };
@@ -0,0 +1,63 @@
1
+ import type { S3ClientConfiguration } from "./types";
2
+ import type { S3BrowserConfig, S3Credentials } from "../types";
3
+ import { CoreUIThemeName } from "@scality/core-ui/dist/style/theme";
4
+ interface RuntimeConfig {
5
+ s3: {
6
+ endpoint?: string;
7
+ region: string;
8
+ forcePathStyle?: boolean;
9
+ };
10
+ theme?: CoreUIThemeName;
11
+ basePath?: string;
12
+ }
13
+ /**
14
+ * Configuration factory that uses build-time constants
15
+ * No runtime environment detection or hardcoded values
16
+ */
17
+ export declare class S3ConfigurationFactory {
18
+ /**
19
+ * Load runtime configuration from config.json
20
+ * Should be called at app startup
21
+ */
22
+ static loadRuntimeConfig(configUrl: string): Promise<RuntimeConfig | null>;
23
+ private static getBuildTimeConfig;
24
+ /**
25
+ * Create S3 client configuration based on build-time settings
26
+ */
27
+ static createClientConfiguration(credentials: S3Credentials): S3BrowserConfig & {
28
+ credentials: S3Credentials;
29
+ };
30
+ /**
31
+ * Create proxy middleware configuration
32
+ */
33
+ static createProxyConfiguration(): S3ClientConfiguration;
34
+ /**
35
+ * Check if proxy middleware should be enabled
36
+ */
37
+ static shouldUseProxyMiddleware(): boolean;
38
+ /**
39
+ * Get build-time environment info for debugging
40
+ */
41
+ static getBuildInfo(): {
42
+ environment: string;
43
+ useProxy: boolean;
44
+ s3Endpoint: string;
45
+ proxyEndpoint: string | undefined;
46
+ };
47
+ }
48
+ /**
49
+ * Convenience functions for common use cases
50
+ */
51
+ export declare const createS3Config: (credentials: S3Credentials) => S3BrowserConfig & {
52
+ credentials: S3Credentials;
53
+ };
54
+ export declare const shouldUseProxy: () => boolean;
55
+ export declare const getProxyConfig: () => S3ClientConfiguration;
56
+ export declare const getBuildInfo: () => {
57
+ environment: string;
58
+ useProxy: boolean;
59
+ s3Endpoint: string;
60
+ proxyEndpoint: string | undefined;
61
+ };
62
+ export declare const loadRuntimeConfig: (configUrl: string) => Promise<RuntimeConfig | null>;
63
+ export {};
@@ -0,0 +1,74 @@
1
+ let runtimeConfig = null;
2
+ class S3ConfigurationFactory {
3
+ static async loadRuntimeConfig(configUrl) {
4
+ try {
5
+ const response = await fetch(configUrl);
6
+ if (response.ok) {
7
+ const data = await response.json();
8
+ runtimeConfig = data;
9
+ if (runtimeConfig?.s3?.endpoint === "origin") runtimeConfig.s3.endpoint = window.location.origin;
10
+ console.log("Loaded runtime configuration:", runtimeConfig);
11
+ return data;
12
+ }
13
+ return null;
14
+ } catch (error) {
15
+ console.warn("Could not load runtime config, using build-time config:", error);
16
+ return null;
17
+ }
18
+ }
19
+ static getBuildTimeConfig() {
20
+ return {
21
+ s3: __S3_CONFIG__,
22
+ dev: __DEV_CONFIG__,
23
+ isDevelopment: __IS_DEVELOPMENT__,
24
+ isProduction: __IS_PRODUCTION__
25
+ };
26
+ }
27
+ static createClientConfiguration(credentials) {
28
+ const buildConfig = this.getBuildTimeConfig();
29
+ const s3Config = buildConfig.isProduction && runtimeConfig?.s3 ? runtimeConfig.s3 : buildConfig.s3;
30
+ const baseConfig = {
31
+ credentials,
32
+ region: s3Config.region,
33
+ forcePathStyle: s3Config.forcePathStyle ?? true,
34
+ endpoint: s3Config.endpoint
35
+ };
36
+ if (buildConfig.isDevelopment && buildConfig.dev.useProxy && buildConfig.dev.proxyEndpoint) baseConfig.endpoint = buildConfig.dev.proxyEndpoint;
37
+ return baseConfig;
38
+ }
39
+ static createProxyConfiguration() {
40
+ const buildConfig = this.getBuildTimeConfig();
41
+ const config = {
42
+ endpoint: buildConfig.s3.endpoint,
43
+ region: buildConfig.s3.region,
44
+ forcePathStyle: buildConfig.s3.forcePathStyle,
45
+ useProxy: buildConfig.isDevelopment && buildConfig.dev.useProxy
46
+ };
47
+ if (config.useProxy) config.proxyConfig = {
48
+ realHost: buildConfig.s3.realHost,
49
+ proxyBasePath: buildConfig.dev.proxyBasePath,
50
+ proxyHost: buildConfig.dev.proxyHost,
51
+ proxyPort: buildConfig.dev.proxyPort
52
+ };
53
+ return config;
54
+ }
55
+ static shouldUseProxyMiddleware() {
56
+ const buildConfig = this.getBuildTimeConfig();
57
+ return buildConfig.isDevelopment && buildConfig.dev.useProxy;
58
+ }
59
+ static getBuildInfo() {
60
+ const buildConfig = this.getBuildTimeConfig();
61
+ return {
62
+ environment: buildConfig.isDevelopment ? "development" : "production",
63
+ useProxy: buildConfig.dev.useProxy,
64
+ s3Endpoint: buildConfig.s3.endpoint,
65
+ proxyEndpoint: buildConfig.dev.proxyEndpoint
66
+ };
67
+ }
68
+ }
69
+ const createS3Config = (credentials)=>S3ConfigurationFactory.createClientConfiguration(credentials);
70
+ const shouldUseProxy = ()=>S3ConfigurationFactory.shouldUseProxyMiddleware();
71
+ const getProxyConfig = ()=>S3ConfigurationFactory.createProxyConfiguration();
72
+ const getBuildInfo = ()=>S3ConfigurationFactory.getBuildInfo();
73
+ const loadRuntimeConfig = (configUrl)=>S3ConfigurationFactory.loadRuntimeConfig(configUrl);
74
+ export { S3ConfigurationFactory, createS3Config, getBuildInfo, getProxyConfig, loadRuntimeConfig, shouldUseProxy };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Build-time configuration types injected by RSBuild
3
+ */
4
+ export interface S3Configuration {
5
+ endpoint: string;
6
+ region: string;
7
+ realHost: string;
8
+ forcePathStyle: boolean;
9
+ }
10
+ export interface DevelopmentConfiguration {
11
+ useProxy: boolean;
12
+ proxyEndpoint?: string;
13
+ proxyBasePath: string;
14
+ proxyHost: string;
15
+ proxyPort: number;
16
+ }
17
+ export interface BuildTimeConfig {
18
+ s3: S3Configuration;
19
+ dev: DevelopmentConfiguration;
20
+ isDevelopment: boolean;
21
+ isProduction: boolean;
22
+ }
23
+ /**
24
+ * Runtime configuration for S3 client
25
+ */
26
+ export interface S3ClientConfiguration {
27
+ endpoint: string;
28
+ region: string;
29
+ forcePathStyle: boolean;
30
+ useProxy: boolean;
31
+ proxyConfig?: {
32
+ realHost: string;
33
+ proxyBasePath: string;
34
+ proxyHost: string;
35
+ proxyPort: number;
36
+ };
37
+ }
38
+ /**
39
+ * Global type declarations for build-time constants
40
+ */
41
+ declare global {
42
+ const __S3_CONFIG__: S3Configuration;
43
+ const __DEV_CONFIG__: DevelopmentConfiguration;
44
+ const __IS_DEVELOPMENT__: boolean;
45
+ const __IS_PRODUCTION__: boolean;
46
+ }
File without changes