@scality/data-browser-library 1.1.3 → 1.1.5

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.
@@ -215,8 +215,7 @@ function BucketList({ buckets, bucketStatus, selectedBucketName, onBucketSelect,
215
215
  rowHeight: "h40",
216
216
  selectedId: selectedId,
217
217
  onRowSelected: handleRowSelected,
218
- separationLineVariant: "backgroundLevel1",
219
- autoScrollToSelected: true
218
+ separationLineVariant: "backgroundLevel1"
220
219
  })
221
220
  ]
222
221
  });
@@ -34,7 +34,7 @@ const EmptyBucketButton = ({ bucketName })=>{
34
34
  const isObjectLockEnabled = objectLockData?.ObjectLockConfiguration?.ObjectLockEnabled === 'Enabled';
35
35
  const { emptyBucket, isEmptying, error, result, reset } = useEmptyBucket({
36
36
  maxObjects: MAX_OBJECTS_TO_DELETE,
37
- bypassGovernanceRetention: true
37
+ bypassGovernanceRetention: isObjectLockEnabled
38
38
  });
39
39
  const isConfirmed = confirmText === bucketName;
40
40
  const deleteResultForSummary = useMemo(()=>{
@@ -65,7 +65,7 @@ const DeleteObjectButton = ({ objects, bucketName, onDeleteSuccess })=>{
65
65
  objects
66
66
  ]);
67
67
  const deleteSelectedFiles = useCallback(()=>{
68
- const objectsToDelete = selectedObjects.filter((object)=>'object' === object.type && object.Key).map((object)=>{
68
+ const objectsToDelete = selectedObjects.filter((object)=>'folder' !== object.type && object.Key).map((object)=>{
69
69
  const deleteItem = {
70
70
  Key: object.Key
71
71
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { ConstrainedText, FormattedDateTime, Icon, Link, PrettyBytes, SearchInput, Text, Toggle, Wrap, spacing, useToast } from "@scality/core-ui";
2
+ import { Banner, ConstrainedText, FormattedDateTime, Icon, Link, PrettyBytes, SearchInput, Text, Toggle, spacing, useToast } from "@scality/core-ui";
3
3
  import { Box, Table } from "@scality/core-ui/dist/next";
4
4
  import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { useLocation, useNavigate } from "react-router";
@@ -754,40 +754,50 @@ const ObjectList = ({ bucketName, prefix, onObjectSelect, onPrefixChange, onSele
754
754
  onBottom: handleReachBottom,
755
755
  globalFilter: isMetadataSearchEnabled ? void 0 : searchValue,
756
756
  children: [
757
- /*#__PURE__*/ jsxs(Wrap, {
757
+ /*#__PURE__*/ jsxs(Box, {
758
+ display: "flex",
759
+ flexDirection: "column",
760
+ gap: spacing.r8,
758
761
  padding: spacing.r16,
759
762
  children: [
760
- isMetadataSearchEnabled ? /*#__PURE__*/ jsx(MetadataSearch, {
761
- isError: !!error
762
- }) : /*#__PURE__*/ jsx(SearchInput, {
763
- value: searchValue,
764
- placeholder: "Search",
765
- size: "1",
766
- onChange: (e)=>handleSearchChange(e.target.value),
767
- onReset: ()=>handleSearchChange('')
768
- }),
769
763
  /*#__PURE__*/ jsxs(Box, {
770
764
  display: "flex",
771
765
  justifyContent: "space-between",
772
766
  alignItems: "center",
773
767
  gap: spacing.r8,
774
768
  children: [
775
- /*#__PURE__*/ jsx(Box, {
769
+ isMetadataSearchEnabled ? /*#__PURE__*/ jsx(MetadataSearch, {
770
+ isError: !!error
771
+ }) : /*#__PURE__*/ jsx(SearchInput, {
772
+ value: searchValue,
773
+ placeholder: "Search items loaded from this bucket",
774
+ size: "1",
775
+ onChange: (e)=>handleSearchChange(e.target.value),
776
+ onReset: ()=>handleSearchChange('')
777
+ }),
778
+ /*#__PURE__*/ jsxs(Box, {
776
779
  display: "flex",
777
780
  alignItems: "center",
778
781
  gap: spacing.r8,
779
- children: actions.map((action)=>/*#__PURE__*/ jsx(Fragment, {
780
- children: action.render()
781
- }, action.id))
782
- }),
783
- /*#__PURE__*/ jsx(Toggle, {
784
- toggle: showVersions,
785
- onChange: (e)=>setShowVersions(e.target.checked),
786
- label: "List Versions",
787
- "aria-label": showVersions ? 'Hide object versions' : 'Show object versions',
788
- "aria-pressed": showVersions
782
+ children: [
783
+ actions.map((action)=>/*#__PURE__*/ jsx(Fragment, {
784
+ children: action.render()
785
+ }, action.id)),
786
+ /*#__PURE__*/ jsx(Toggle, {
787
+ toggle: showVersions,
788
+ onChange: (e)=>setShowVersions(e.target.checked),
789
+ label: "List Versions",
790
+ "aria-label": showVersions ? 'Hide object versions' : 'Show object versions',
791
+ "aria-pressed": showVersions
792
+ })
793
+ ]
789
794
  })
790
795
  ]
796
+ }),
797
+ !isMetadataSearchEnabled && searchValue && /*#__PURE__*/ jsx(Banner, {
798
+ variant: "base",
799
+ withDefaultIcon: true,
800
+ children: "Search only applies to items currently loaded from this bucket. Other items in the bucket may exist but are not searched."
791
801
  })
792
802
  ]
793
803
  }),
@@ -150,7 +150,7 @@ const MetadataSearch = ({ isError })=>{
150
150
  onHintClick: handleHintClickWithFocus
151
151
  }),
152
152
  /*#__PURE__*/ jsx(Button, {
153
- variant: "primary",
153
+ variant: "secondary",
154
154
  type: "submit",
155
155
  label: "Search",
156
156
  disabled: isSearchDisabled,
@@ -3,7 +3,7 @@ import { useCallback, useState } from "react";
3
3
  import { useInvalidateQueries } from "../components/providers/DataBrowserProvider.js";
4
4
  import { useS3Client } from "./useS3Client.js";
5
5
  const useEmptyBucket = (options = {})=>{
6
- const { maxObjects = 20000, maxKeysPerList = 1000, bypassGovernanceRetention = true, onProgress, onSuccess, onError } = options;
6
+ const { maxObjects = 20000, maxKeysPerList = 1000, bypassGovernanceRetention = false, onProgress, onSuccess, onError } = options;
7
7
  const [isEmptying, setIsEmptying] = useState(false);
8
8
  const [error, setError] = useState(null);
9
9
  const [result, setResult] = useState(null);
@@ -43,7 +43,9 @@ const useEmptyBucket = (options = {})=>{
43
43
  Delete: {
44
44
  Objects: objectsToDelete
45
45
  },
46
- BypassGovernanceRetention: bypassGovernanceRetention
46
+ ...bypassGovernanceRetention && {
47
+ BypassGovernanceRetention: true
48
+ }
47
49
  });
48
50
  const deleteResponse = await s3Client.send(deleteCommand);
49
51
  const successCount = deleteResponse.Deleted?.length || 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scality/data-browser-library",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "A modular React component library for browsing S3 buckets and objects",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",