@scality/data-browser-library 1.1.3 → 1.1.4
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.
|
@@ -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:
|
|
37
|
+
bypassGovernanceRetention: isObjectLockEnabled
|
|
38
38
|
});
|
|
39
39
|
const isConfirmed = confirmText === bucketName;
|
|
40
40
|
const deleteResultForSummary = useMemo(()=>{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ConstrainedText, FormattedDateTime, Icon, Link, PrettyBytes, SearchInput, Text, Toggle,
|
|
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(
|
|
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(
|
|
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:
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
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
|
}),
|
|
@@ -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 =
|
|
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
|
-
|
|
46
|
+
...bypassGovernanceRetention && {
|
|
47
|
+
BypassGovernanceRetention: true
|
|
48
|
+
}
|
|
47
49
|
});
|
|
48
50
|
const deleteResponse = await s3Client.send(deleteCommand);
|
|
49
51
|
const successCount = deleteResponse.Deleted?.length || 0;
|