@aws-amplify/ui-react-storage 3.14.0 → 3.16.0
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.
- package/dist/browser.js +8 -2
- package/dist/{createStorageBrowser-CotOvK0A.js → createStorageBrowser-B-J76Lyp.js} +1012 -249
- package/dist/esm/browser.mjs +1 -0
- package/dist/esm/components/StorageBrowser/ErrorBoundary/ErrorBoundary.mjs +0 -3
- package/dist/esm/components/StorageBrowser/StorageBrowserAmplify.mjs +1 -0
- package/dist/esm/components/StorageBrowser/actions/configs/defaults.mjs +14 -3
- package/dist/esm/components/StorageBrowser/actions/handlers/defaults.mjs +1 -1
- package/dist/esm/components/StorageBrowser/actions/handlers/delete.mjs +39 -8
- package/dist/esm/components/StorageBrowser/actions/handlers/listLocations.mjs +7 -2
- package/dist/esm/components/StorageBrowser/actions/handlers/utils.mjs +65 -1
- package/dist/esm/components/StorageBrowser/actions/handlers/zipdownload.mjs +195 -0
- package/dist/esm/components/StorageBrowser/adapters/createAmplifyAuthAdapter/createAmplifyListLocationsHandler.mjs +3 -1
- package/dist/esm/components/StorageBrowser/adapters/createManagedAuthAdapter/createManagedAuthAdapter.mjs +1 -0
- package/dist/esm/components/StorageBrowser/components/ComponentsProvider.mjs +0 -3
- package/dist/esm/components/StorageBrowser/components/base/preview/DownloadButton.mjs +0 -3
- package/dist/esm/components/StorageBrowser/components/composables/ActionConfirmationModal.mjs +34 -0
- package/dist/esm/components/StorageBrowser/components/composables/defaults.mjs +2 -0
- package/dist/esm/components/StorageBrowser/components/elements/definitions.mjs +2 -2
- package/dist/esm/components/StorageBrowser/controls/ActionConfirmationModalControl.mjs +12 -0
- package/dist/esm/components/StorageBrowser/controls/DataTableControl.mjs +0 -3
- package/dist/esm/components/StorageBrowser/controls/hooks/useActionConfirmationModal.mjs +17 -0
- package/dist/esm/components/StorageBrowser/createStorageBrowser/StorageBrowserDefault.mjs +8 -3
- package/dist/esm/components/StorageBrowser/createStorageBrowser/createProvider.mjs +1 -0
- package/dist/esm/components/StorageBrowser/createStorageBrowser/createStorageBrowser.mjs +9 -4
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/deleteView.mjs +117 -5
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/downloadView.mjs +2 -0
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/locationDetailView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/shared.mjs +3 -0
- package/dist/esm/components/StorageBrowser/locationItems/context.mjs +18 -14
- package/dist/esm/components/StorageBrowser/locationItems/utils.mjs +38 -0
- package/dist/esm/components/StorageBrowser/store/validateStoreProps.mjs +1 -1
- package/dist/esm/components/StorageBrowser/tasks/constants.mjs +2 -0
- package/dist/esm/components/StorageBrowser/tasks/useProcessTasks.mjs +14 -5
- package/dist/esm/components/StorageBrowser/tasks/utils.mjs +4 -1
- package/dist/esm/components/StorageBrowser/useAction/useHandler.mjs +1 -1
- package/dist/esm/components/StorageBrowser/useAction/utils.mjs +0 -4
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/CopyView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/CopyViewProvider.mjs +4 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/FoldersMessageControl.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/useCopyView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/useFolders.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CreateFolderView/CreateFolderView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CreateFolderView/useCreateFolderView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/DeleteView.mjs +5 -5
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/DeleteViewProvider.mjs +7 -6
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/useDeleteView.mjs +69 -6
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/utils.mjs +87 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DownloadView/DownloadView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DownloadView/DownloadViewProvider.mjs +9 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DownloadView/useDownloadView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/UploadView.mjs +1 -4
- package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/UploadViewProvider.mjs +4 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/useUploadView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/LocationDetailView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/LocationDetailViewProvider.mjs +2 -1
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/getLocationDetailViewTableData/getFolderRowContent.mjs +38 -27
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/getLocationDetailViewTableData/getLocationDetailViewTableData.mjs +9 -1
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/useLocationDetailView.mjs +11 -9
- package/dist/esm/components/StorageBrowser/views/LocationsView/LocationsView.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationsView/LocationsViewProvider.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationsView/useLocationsView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/context/actionViews.mjs +7 -3
- package/dist/esm/components/StorageBrowser/views/context/primaryViews.mjs +8 -3
- package/dist/esm/components/StorageBrowser/views/hooks/useFilePreview/useFilePreview.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/utils/tableResolvers/constants.mjs +14 -1
- package/dist/esm/components/StorageBrowser/views/utils/tableResolvers/deleteResolvers.mjs +123 -13
- package/dist/esm/components/StorageBrowser/views/utils/tableResolvers/utils.mjs +4 -4
- package/dist/esm/version.mjs +1 -1
- package/dist/index.js +2 -1
- package/dist/styles.css +100 -1
- package/dist/types/components/StorageBrowser/actions/handlers/delete.d.ts +5 -3
- package/dist/types/components/StorageBrowser/actions/handlers/index.d.ts +1 -0
- package/dist/types/components/StorageBrowser/actions/handlers/types.d.ts +18 -2
- package/dist/types/components/StorageBrowser/actions/handlers/utils.d.ts +11 -0
- package/dist/types/components/StorageBrowser/actions/handlers/zipdownload.d.ts +3 -0
- package/dist/types/components/StorageBrowser/components/composables/ActionConfirmationModal.d.ts +12 -0
- package/dist/types/components/StorageBrowser/components/composables/types.d.ts +2 -0
- package/dist/types/components/StorageBrowser/controls/ActionConfirmationModalControl.d.ts +2 -0
- package/dist/types/components/StorageBrowser/controls/hooks/useActionConfirmationModal.d.ts +2 -0
- package/dist/types/components/StorageBrowser/controls/index.d.ts +1 -0
- package/dist/types/components/StorageBrowser/controls/types.d.ts +4 -0
- package/dist/types/components/StorageBrowser/displayText/types.d.ts +9 -0
- package/dist/types/components/StorageBrowser/locationItems/context.d.ts +12 -3
- package/dist/types/components/StorageBrowser/locationItems/index.d.ts +1 -0
- package/dist/types/components/StorageBrowser/locationItems/utils.d.ts +27 -0
- package/dist/types/components/StorageBrowser/tasks/types.d.ts +10 -5
- package/dist/types/components/StorageBrowser/tasks/useProcessTasks.d.ts +1 -1
- package/dist/types/components/StorageBrowser/useAction/useHandler.d.ts +1 -1
- package/dist/types/components/StorageBrowser/views/LocationActionView/DeleteView/types.d.ts +5 -0
- package/dist/types/components/StorageBrowser/views/LocationActionView/DeleteView/utils.d.ts +26 -0
- package/dist/types/components/StorageBrowser/views/LocationDetailView/getLocationDetailViewTableData/getFolderRowContent.d.ts +4 -1
- package/dist/types/components/StorageBrowser/views/LocationDetailView/getLocationDetailViewTableData/getLocationDetailViewTableData.d.ts +3 -2
- package/dist/types/components/StorageBrowser/views/LocationDetailView/types.d.ts +8 -1
- package/dist/types/components/StorageBrowser/views/utils/index.d.ts +1 -1
- package/dist/types/components/StorageBrowser/views/utils/tableResolvers/constants.d.ts +5 -0
- package/dist/types/components/StorageBrowser/views/utils/tableResolvers/deleteResolvers.d.ts +5 -2
- package/dist/types/components/StorageBrowser/views/utils/tableResolvers/index.d.ts +1 -1
- package/dist/types/components/StorageBrowser/views/utils/tableResolvers/types.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +12 -9
- package/dist/esm/components/StorageBrowser/actions/handlers/download.mjs +0 -38
package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/useDeleteView.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { isFunction } from '@aws-amplify/ui';
|
|
3
3
|
import { useLocationItems } from '../../../locationItems/context.mjs';
|
|
4
|
+
import { getSelectionSummary } from '../../../locationItems/utils.mjs';
|
|
4
5
|
import { useStore } from '../../../store/context.mjs';
|
|
5
6
|
import '../../../useAction/context.mjs';
|
|
6
7
|
import { useAction } from '../../../useAction/useAction.mjs';
|
|
@@ -8,27 +9,81 @@ import '@aws-amplify/ui-react-core';
|
|
|
8
9
|
import '@aws-amplify/ui-react-core/elements';
|
|
9
10
|
import '../../../credentials/context.mjs';
|
|
10
11
|
import '@aws-amplify/storage/internals';
|
|
11
|
-
import '../../../configuration/context.mjs';
|
|
12
|
-
import 'aws-amplify';
|
|
13
|
-
import 'aws-amplify/storage';
|
|
14
|
-
import '../../../actions/configs/context.mjs';
|
|
12
|
+
import { useGetActionInput } from '../../../configuration/context.mjs';
|
|
15
13
|
import '../../../actions/configs/defaults.mjs';
|
|
14
|
+
import { useDisplayText } from '../../../displayText/context.mjs';
|
|
15
|
+
import { createDeleteConfirmationModalProps, countFilesInFolder } from './utils.mjs';
|
|
16
16
|
|
|
17
17
|
// assign to constant to ensure referential equality
|
|
18
18
|
const EMPTY_ITEMS = [];
|
|
19
19
|
const useDeleteView = (options) => {
|
|
20
20
|
const { onExit: _onExit } = options ?? {};
|
|
21
|
+
const { DeleteView: displayText } = useDisplayText();
|
|
21
22
|
const [{ location }, storeDispatch] = useStore();
|
|
22
23
|
const [locationItems, locationItemsDispatch] = useLocationItems();
|
|
23
24
|
const { current } = location;
|
|
24
|
-
const {
|
|
25
|
-
const
|
|
25
|
+
const { dataItems = EMPTY_ITEMS } = locationItems;
|
|
26
|
+
const getConfig = useGetActionInput();
|
|
27
|
+
const [itemsWithCount, setItemsWithCount] = React__default.useState(dataItems);
|
|
28
|
+
const folderCountsRef = React__default.useRef(new Map());
|
|
29
|
+
// Sync itemsWithCount with dataItems when dataItems changes (e.g., item removal)
|
|
30
|
+
React__default.useEffect(() => {
|
|
31
|
+
const itemsWithAppliedCounts = dataItems.map((item) => ({
|
|
32
|
+
...item,
|
|
33
|
+
totalCount: folderCountsRef.current.get(item.id),
|
|
34
|
+
}));
|
|
35
|
+
setItemsWithCount(itemsWithAppliedCounts);
|
|
36
|
+
}, [dataItems]);
|
|
37
|
+
const [processState, handleProcess] = useAction('delete', {
|
|
38
|
+
items: itemsWithCount,
|
|
39
|
+
});
|
|
40
|
+
const [showConfirmation, setShowConfirmation] = React__default.useState(false);
|
|
26
41
|
const { isProcessing, isProcessingComplete, statusCounts, tasks } = processState;
|
|
42
|
+
const selectionSummary = getSelectionSummary(dataItems);
|
|
43
|
+
const { hasFolders } = selectionSummary;
|
|
44
|
+
React__default.useEffect(() => {
|
|
45
|
+
const initializeFolderCounts = async () => {
|
|
46
|
+
if (!selectionSummary.hasFolders || !current) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const config = getConfig(current);
|
|
50
|
+
const foldersToCount = dataItems.filter((item) => item.type === 'FOLDER' && !folderCountsRef.current.has(item.id));
|
|
51
|
+
if (foldersToCount.length === 0) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
await Promise.all(foldersToCount.map(async (folder) => {
|
|
55
|
+
try {
|
|
56
|
+
const totalCount = await countFilesInFolder(folder.key, config);
|
|
57
|
+
folderCountsRef.current.set(folder.id, totalCount);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
folderCountsRef.current.set(folder.id, null);
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
63
|
+
setItemsWithCount((currentItems) => currentItems.map((item) => ({
|
|
64
|
+
...item,
|
|
65
|
+
totalCount: folderCountsRef.current.get(item.id),
|
|
66
|
+
})));
|
|
67
|
+
};
|
|
68
|
+
initializeFolderCounts();
|
|
69
|
+
}, [current, getConfig, selectionSummary.hasFolders, dataItems]);
|
|
27
70
|
const onActionStart = () => {
|
|
28
71
|
if (!current)
|
|
29
72
|
return;
|
|
73
|
+
if (hasFolders) {
|
|
74
|
+
setShowConfirmation(true);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
handleProcess();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const onConfirmDelete = () => {
|
|
81
|
+
setShowConfirmation(false);
|
|
30
82
|
handleProcess();
|
|
31
83
|
};
|
|
84
|
+
const onCancelConfirmation = () => {
|
|
85
|
+
setShowConfirmation(false);
|
|
86
|
+
};
|
|
32
87
|
const onActionCancel = () => {
|
|
33
88
|
tasks.forEach((task) => {
|
|
34
89
|
// @TODO Fixme, calling cancel on task doesn't currently work
|
|
@@ -47,6 +102,11 @@ const useDeleteView = (options) => {
|
|
|
47
102
|
const onTaskRemove = React__default.useCallback(({ data }) => {
|
|
48
103
|
locationItemsDispatch({ type: 'REMOVE_LOCATION_ITEM', id: data.id });
|
|
49
104
|
}, [locationItemsDispatch]);
|
|
105
|
+
const confirmationModal = React__default.useMemo(() => createDeleteConfirmationModalProps({
|
|
106
|
+
items: dataItems,
|
|
107
|
+
showConfirmation,
|
|
108
|
+
displayText,
|
|
109
|
+
}), [dataItems, showConfirmation, displayText]);
|
|
50
110
|
return {
|
|
51
111
|
isProcessing,
|
|
52
112
|
isProcessingComplete,
|
|
@@ -57,6 +117,9 @@ const useDeleteView = (options) => {
|
|
|
57
117
|
onActionExit,
|
|
58
118
|
onActionStart,
|
|
59
119
|
onTaskRemove,
|
|
120
|
+
onConfirmDelete,
|
|
121
|
+
onCancelConfirmation,
|
|
122
|
+
confirmationModal,
|
|
60
123
|
};
|
|
61
124
|
};
|
|
62
125
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { getSelectedFolders } from '../../../locationItems/utils.mjs';
|
|
3
|
+
import '@aws-amplify/ui-react';
|
|
4
|
+
import { TextElement, UnorderedListElement, ListItemElement } from '../../../components/elements/definitions.mjs';
|
|
5
|
+
import '../../../components/elements/IconElement.mjs';
|
|
6
|
+
import { list } from '@aws-amplify/storage/internals';
|
|
7
|
+
import { constructBucket } from '../../../actions/handlers/utils.mjs';
|
|
8
|
+
import '@aws-amplify/ui';
|
|
9
|
+
import 'jszip';
|
|
10
|
+
import 'aws-amplify/storage';
|
|
11
|
+
|
|
12
|
+
const getFolderName = (folderKey) => {
|
|
13
|
+
return folderKey.replace(/\/$/, '').split('/').pop() ?? folderKey;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Creates JSX content showing a list of folders to be deleted
|
|
17
|
+
*/
|
|
18
|
+
const createFolderListContent = (folders, folderListTitle) => {
|
|
19
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
20
|
+
React__default.createElement(TextElement, { className: "amplify-modal__list-title" },
|
|
21
|
+
React__default.createElement("strong", null, folderListTitle)),
|
|
22
|
+
React__default.createElement(UnorderedListElement, { className: "amplify-modal__list" }, folders.map((folder) => (React__default.createElement(ListItemElement, { key: folder.id, className: "amplify-modal__list-item" }, getFolderName(folder.key)))))));
|
|
23
|
+
};
|
|
24
|
+
const createDeleteConfirmationModalProps = ({ items, showConfirmation, displayText, }) => {
|
|
25
|
+
const folders = getSelectedFolders(items);
|
|
26
|
+
const folderCount = folders.length;
|
|
27
|
+
return {
|
|
28
|
+
isOpen: showConfirmation,
|
|
29
|
+
title: displayText.confirmationModalTitle,
|
|
30
|
+
message: displayText.confirmationModalMessage
|
|
31
|
+
.replace('{count}', folderCount.toString())
|
|
32
|
+
.replace('{plural}', folderCount !== 1 ? 's' : ''),
|
|
33
|
+
confirmLabel: displayText.confirmationModalConfirmLabel,
|
|
34
|
+
cancelLabel: displayText.confirmationModalCancelLabel,
|
|
35
|
+
content: createFolderListContent(folders, displayText.confirmationModalFolderListTitle),
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Maximum number of files to count before showing "+" notation
|
|
40
|
+
* This prevents expensive operations on very large folders
|
|
41
|
+
*/
|
|
42
|
+
const MAX_FILE_COUNT_LIMIT = 5000;
|
|
43
|
+
const LIST_PAGE_SIZE = 1000;
|
|
44
|
+
/**
|
|
45
|
+
* Count the total number of files in a folder with pagination and limits
|
|
46
|
+
* @param folderKey - The folder path to count files in
|
|
47
|
+
* @param config - Storage configuration
|
|
48
|
+
* @returns Promise<number | string> - File count or "5000+" if exceeds limit
|
|
49
|
+
*/
|
|
50
|
+
const countFilesInFolder = async (folderKey, config) => {
|
|
51
|
+
try {
|
|
52
|
+
const { accountId, credentials, customEndpoint } = config;
|
|
53
|
+
const bucket = constructBucket(config);
|
|
54
|
+
let fileCount = 0;
|
|
55
|
+
let nextToken;
|
|
56
|
+
let hasMoreItems = true;
|
|
57
|
+
while (hasMoreItems && fileCount < MAX_FILE_COUNT_LIMIT) {
|
|
58
|
+
const { items, nextToken: listNextToken } = await list({
|
|
59
|
+
path: folderKey,
|
|
60
|
+
options: {
|
|
61
|
+
bucket,
|
|
62
|
+
locationCredentialsProvider: credentials,
|
|
63
|
+
expectedBucketOwner: accountId,
|
|
64
|
+
customEndpoint,
|
|
65
|
+
pageSize: LIST_PAGE_SIZE,
|
|
66
|
+
nextToken,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
const batchFileCount = items.filter((item) => !item.path.endsWith('/')).length;
|
|
70
|
+
fileCount += batchFileCount;
|
|
71
|
+
nextToken = listNextToken;
|
|
72
|
+
hasMoreItems = !!nextToken;
|
|
73
|
+
if (fileCount >= MAX_FILE_COUNT_LIMIT) {
|
|
74
|
+
return `${MAX_FILE_COUNT_LIMIT}+`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (hasMoreItems) {
|
|
78
|
+
return `${fileCount}+`;
|
|
79
|
+
}
|
|
80
|
+
return fileCount;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export { countFilesInFolder, createDeleteConfirmationModalProps, createFolderListContent, getFolderName };
|
package/dist/esm/components/StorageBrowser/views/LocationActionView/DownloadView/DownloadView.mjs
CHANGED
|
@@ -18,9 +18,6 @@ import '@aws-amplify/ui-react-core/elements';
|
|
|
18
18
|
import '../../../credentials/context.mjs';
|
|
19
19
|
import '@aws-amplify/storage/internals';
|
|
20
20
|
import '../../../configuration/context.mjs';
|
|
21
|
-
import 'aws-amplify';
|
|
22
|
-
import 'aws-amplify/storage';
|
|
23
|
-
import '../../../actions/configs/context.mjs';
|
|
24
21
|
import '../../../actions/configs/defaults.mjs';
|
|
25
22
|
import '../../../displayText/context.mjs';
|
|
26
23
|
import '../../../filePreview/context.mjs';
|
|
@@ -3,6 +3,15 @@ import { ControlsContextProvider } from '../../../controls/context.mjs';
|
|
|
3
3
|
import { useDisplayText } from '../../../displayText/context.mjs';
|
|
4
4
|
import useResolveTableData from '../../hooks/useResolveTableData/useResolveTableData.mjs';
|
|
5
5
|
import '@aws-amplify/ui';
|
|
6
|
+
import '@aws-amplify/storage/internals';
|
|
7
|
+
import 'aws-amplify';
|
|
8
|
+
import 'jszip';
|
|
9
|
+
import 'aws-amplify/storage';
|
|
10
|
+
import '../../../actions/configs/context.mjs';
|
|
11
|
+
import '../../../actions/configs/defaults.mjs';
|
|
12
|
+
import '@aws-amplify/ui-react';
|
|
13
|
+
import '../../../components/elements/definitions.mjs';
|
|
14
|
+
import '../../../components/elements/IconElement.mjs';
|
|
6
15
|
import { DOWNLOAD_TABLE_RESOLVERS, DOWNLOAD_TABLE_KEYS } from '../../utils/tableResolvers/downloadResolvers.mjs';
|
|
7
16
|
|
|
8
17
|
function DownloadViewProvider({ children, ...props }) {
|
package/dist/esm/components/StorageBrowser/views/LocationActionView/DownloadView/useDownloadView.mjs
CHANGED
|
@@ -9,9 +9,6 @@ import '@aws-amplify/ui-react-core/elements';
|
|
|
9
9
|
import '../../../credentials/context.mjs';
|
|
10
10
|
import '@aws-amplify/storage/internals';
|
|
11
11
|
import '../../../configuration/context.mjs';
|
|
12
|
-
import 'aws-amplify';
|
|
13
|
-
import 'aws-amplify/storage';
|
|
14
|
-
import '../../../actions/configs/context.mjs';
|
|
15
12
|
import '../../../actions/configs/defaults.mjs';
|
|
16
13
|
|
|
17
14
|
// assign to constant to ensure referential equality
|
package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/UploadView.mjs
CHANGED
|
@@ -11,16 +11,13 @@ import '@aws-amplify/ui-react-core/elements';
|
|
|
11
11
|
import '../../../credentials/context.mjs';
|
|
12
12
|
import '@aws-amplify/storage/internals';
|
|
13
13
|
import '../../../configuration/context.mjs';
|
|
14
|
-
import 'aws-amplify';
|
|
15
|
-
import 'aws-amplify/storage';
|
|
16
|
-
import '../../../actions/configs/context.mjs';
|
|
17
14
|
import '../../../actions/configs/defaults.mjs';
|
|
18
15
|
import '../../../displayText/context.mjs';
|
|
19
16
|
import '../../../filePreview/context.mjs';
|
|
20
17
|
import { ActionCancelControl } from '../../../controls/ActionCancelControl.mjs';
|
|
18
|
+
import '../../../controls/context.mjs';
|
|
21
19
|
import { ActionDestinationControl } from '../../../controls/ActionDestinationControl.mjs';
|
|
22
20
|
import { ActionExitControl } from '../../../controls/ActionExitControl.mjs';
|
|
23
|
-
import '../../../controls/context.mjs';
|
|
24
21
|
import { ActionStartControl } from '../../../controls/ActionStartControl.mjs';
|
|
25
22
|
import { AddFilesControl } from '../../../controls/AddFilesControl.mjs';
|
|
26
23
|
import { AddFolderControl } from '../../../controls/AddFolderControl.mjs';
|
|
@@ -2,12 +2,16 @@ import React__default from 'react';
|
|
|
2
2
|
import '@aws-amplify/storage/internals';
|
|
3
3
|
import { isMultipartUpload } from '../../../actions/handlers/utils.mjs';
|
|
4
4
|
import '@aws-amplify/ui';
|
|
5
|
+
import 'jszip';
|
|
5
6
|
import 'aws-amplify/storage';
|
|
6
7
|
import '../../../actions/configs/context.mjs';
|
|
7
8
|
import '../../../actions/configs/defaults.mjs';
|
|
8
9
|
import { ControlsContextProvider } from '../../../controls/context.mjs';
|
|
9
10
|
import { useDisplayText } from '../../../displayText/context.mjs';
|
|
10
11
|
import useResolveTableData from '../../hooks/useResolveTableData/useResolveTableData.mjs';
|
|
12
|
+
import '@aws-amplify/ui-react';
|
|
13
|
+
import '../../../components/elements/definitions.mjs';
|
|
14
|
+
import '../../../components/elements/IconElement.mjs';
|
|
11
15
|
import { UPLOAD_TABLE_RESOLVERS, UPLOAD_TABLE_KEYS } from '../../utils/tableResolvers/uploadResolvers.mjs';
|
|
12
16
|
|
|
13
17
|
function UploadViewProvider({ children, ...props }) {
|
package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/useUploadView.mjs
CHANGED
|
@@ -9,9 +9,6 @@ import '@aws-amplify/ui-react-core/elements';
|
|
|
9
9
|
import '../../../credentials/context.mjs';
|
|
10
10
|
import '@aws-amplify/storage/internals';
|
|
11
11
|
import '../../../configuration/context.mjs';
|
|
12
|
-
import 'aws-amplify';
|
|
13
|
-
import 'aws-amplify/storage';
|
|
14
|
-
import '../../../actions/configs/context.mjs';
|
|
15
12
|
import '../../../actions/configs/defaults.mjs';
|
|
16
13
|
import { DEFAULT_OVERWRITE_ENABLED } from './constants.mjs';
|
|
17
14
|
import { usePaginate } from '../../hooks/usePaginate.mjs';
|
|
@@ -11,9 +11,6 @@ import '@aws-amplify/ui-react-core/elements';
|
|
|
11
11
|
import '../../credentials/context.mjs';
|
|
12
12
|
import '@aws-amplify/storage/internals';
|
|
13
13
|
import '../../configuration/context.mjs';
|
|
14
|
-
import 'aws-amplify';
|
|
15
|
-
import 'aws-amplify/storage';
|
|
16
|
-
import '../../actions/configs/context.mjs';
|
|
17
14
|
import '../../actions/configs/defaults.mjs';
|
|
18
15
|
import '../../displayText/context.mjs';
|
|
19
16
|
import '../../filePreview/context.mjs';
|
package/dist/esm/components/StorageBrowser/views/LocationDetailView/LocationDetailViewProvider.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { getLocationDetailViewTableData } from './getLocationDetailViewTableData
|
|
|
6
6
|
function LocationDetailViewProvider({ children, ...props }) {
|
|
7
7
|
const { LocationDetailView: displayText } = useDisplayText();
|
|
8
8
|
const { LocationDetailView: { loadingIndicatorLabel, searchSubfoldersToggleLabel, selectFileLabel, selectAllFilesLabel, searchPlaceholder, searchSubmitLabel, searchClearLabel, getActionListItemLabel, getDateDisplayValue, getTitle, getListItemsResultMessage, }, } = useDisplayText();
|
|
9
|
-
const { actionItems, activeFile, activeFileHasNext, activeFileHasPrev, page, pageItems, hasNextPage, highestPageVisited, isLoading, isSearchSubfoldersEnabled, location, fileDataItems, hasError, hasDownloadError, message, downloadErrorMessage, searchQuery, hasExhaustedSearch, onActionSelect, onDropFiles, onRefresh, onPaginate, onDownload, onNavigate, onNavigateHome, onSelect, onSelectActiveFile, onToggleSelectAll, onSearch, onSearchQueryChange, onSearchClear, onToggleSearchSubfolders, filePreviewState, filePreviewEnabled, onRetryFilePreview, } = props;
|
|
9
|
+
const { actionItems, activeFile, activeFileHasNext, activeFileHasPrev, page, pageItems, hasNextPage, highestPageVisited, isLoading, isSearchSubfoldersEnabled, location, fileDataItems, hasError, hasDownloadError, message, downloadErrorMessage, searchQuery, hasExhaustedSearch, onActionSelect, onDropFiles, onRefresh, onPaginate, onDownload, onNavigate, onNavigateHome, onSelect, onSelectActiveFile, onToggleSelectAll, onSearch, onSearchQueryChange, onSearchClear, onToggleSearchSubfolders, filePreviewState, filePreviewEnabled, onRetryFilePreview, dataItems, } = props;
|
|
10
10
|
const actionsWithDisplayText = actionItems.map((item) => ({
|
|
11
11
|
...item,
|
|
12
12
|
label: getActionListItemLabel(item.label),
|
|
@@ -63,6 +63,7 @@ function LocationDetailViewProvider({ children, ...props }) {
|
|
|
63
63
|
onNavigate,
|
|
64
64
|
onSelect,
|
|
65
65
|
onSelectAll: onToggleSelectAll,
|
|
66
|
+
dataItems,
|
|
66
67
|
}),
|
|
67
68
|
title: getTitle(location),
|
|
68
69
|
message: messageControlContent,
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
import { LOCATION_DETAIL_VIEW_HEADERS } from './constants.mjs';
|
|
2
2
|
|
|
3
|
-
const getFolderRowContent = ({ itemSubPath, rowId, onNavigate, }) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const getFolderRowContent = ({ itemSubPath, rowId, isSelected, selectFolderLabel, onNavigate, onSelect, }) => {
|
|
4
|
+
return LOCATION_DETAIL_VIEW_HEADERS.map((columnKey) => {
|
|
5
|
+
const key = `${columnKey}-${rowId}`;
|
|
6
|
+
switch (columnKey) {
|
|
7
|
+
case 'checkbox': {
|
|
8
|
+
return {
|
|
9
|
+
key,
|
|
10
|
+
type: 'checkbox',
|
|
11
|
+
content: {
|
|
12
|
+
checked: isSelected,
|
|
13
|
+
id: key,
|
|
14
|
+
label: `${selectFolderLabel} ${itemSubPath}`,
|
|
15
|
+
onSelect,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
case 'name': {
|
|
20
|
+
return {
|
|
21
|
+
key,
|
|
22
|
+
type: 'button',
|
|
23
|
+
content: {
|
|
24
|
+
icon: 'folder',
|
|
25
|
+
ariaLabel: itemSubPath,
|
|
26
|
+
label: itemSubPath,
|
|
27
|
+
onClick: onNavigate,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
case 'type': {
|
|
32
|
+
return { key, type: 'text', content: { text: 'Folder' } };
|
|
33
|
+
}
|
|
34
|
+
case 'last-modified':
|
|
35
|
+
case 'size':
|
|
36
|
+
case 'download': {
|
|
37
|
+
return { key, type: 'text', content: { text: '' } };
|
|
38
|
+
}
|
|
8
39
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
key,
|
|
12
|
-
type: 'button',
|
|
13
|
-
content: {
|
|
14
|
-
icon: 'folder',
|
|
15
|
-
ariaLabel: itemSubPath,
|
|
16
|
-
label: itemSubPath,
|
|
17
|
-
onClick: onNavigate,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
case 'type': {
|
|
22
|
-
return { key, type: 'text', content: { text: 'Folder' } };
|
|
23
|
-
}
|
|
24
|
-
case 'last-modified':
|
|
25
|
-
case 'size':
|
|
26
|
-
case 'download': {
|
|
27
|
-
return { key, type: 'text', content: { text: '' } };
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
40
|
+
});
|
|
41
|
+
};
|
|
31
42
|
|
|
32
43
|
export { getFolderRowContent };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '@aws-amplify/storage/internals';
|
|
2
2
|
import { createFileDataItem } from '../../../actions/handlers/utils.mjs';
|
|
3
3
|
import '@aws-amplify/ui';
|
|
4
|
+
import 'jszip';
|
|
4
5
|
import 'aws-amplify/storage';
|
|
5
6
|
import '../../../actions/configs/context.mjs';
|
|
6
7
|
import '../../../actions/configs/defaults.mjs';
|
|
@@ -8,7 +9,7 @@ import { getFileRowContent } from './getFileRowContent.mjs';
|
|
|
8
9
|
import { getFolderRowContent } from './getFolderRowContent.mjs';
|
|
9
10
|
import { getHeaders } from './getHeaders.mjs';
|
|
10
11
|
|
|
11
|
-
const getLocationDetailViewTableData = ({ filePreviewEnabled, activeFile, onSelectActiveFile, areAllFilesSelected, displayText, location, fileDataItems, hasFiles, pageItems, selectFileLabel, selectAllFilesLabel, getDateDisplayValue, onDownload, onNavigate, onSelect, onSelectAll, }) => {
|
|
12
|
+
const getLocationDetailViewTableData = ({ filePreviewEnabled, activeFile, onSelectActiveFile, areAllFilesSelected, displayText, location, fileDataItems, dataItems, hasFiles, pageItems, selectFileLabel, selectAllFilesLabel, getDateDisplayValue, onDownload, onNavigate, onSelect, onSelectAll, }) => {
|
|
12
13
|
const { tableColumnLastModifiedHeader, tableColumnNameHeader, tableColumnSizeHeader, tableColumnTypeHeader, } = displayText;
|
|
13
14
|
const headers = getHeaders({
|
|
14
15
|
areAllFilesSelected,
|
|
@@ -66,6 +67,10 @@ const getLocationDetailViewTableData = ({ filePreviewEnabled, activeFile, onSele
|
|
|
66
67
|
}
|
|
67
68
|
onNavigate({ ...current, id }, itemLocationPath);
|
|
68
69
|
};
|
|
70
|
+
const isSelected = dataItems?.some((item) => item.id === id) ?? false;
|
|
71
|
+
const onFolderSelect = () => {
|
|
72
|
+
onSelect(isSelected, locationItem);
|
|
73
|
+
};
|
|
69
74
|
return {
|
|
70
75
|
key: id,
|
|
71
76
|
active: false,
|
|
@@ -73,6 +78,9 @@ const getLocationDetailViewTableData = ({ filePreviewEnabled, activeFile, onSele
|
|
|
73
78
|
itemSubPath,
|
|
74
79
|
rowId: id,
|
|
75
80
|
onNavigate: onFolderNavigate,
|
|
81
|
+
selectFolderLabel: selectFileLabel,
|
|
82
|
+
isSelected,
|
|
83
|
+
onSelect: onFolderSelect,
|
|
76
84
|
}),
|
|
77
85
|
};
|
|
78
86
|
}
|
package/dist/esm/components/StorageBrowser/views/LocationDetailView/useLocationDetailView.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { isUndefined, isFunction } from '@aws-amplify/ui';
|
|
|
3
3
|
import { usePaginate } from '../hooks/usePaginate.mjs';
|
|
4
4
|
import '@aws-amplify/storage/internals';
|
|
5
5
|
import 'aws-amplify';
|
|
6
|
+
import 'jszip';
|
|
6
7
|
import 'aws-amplify/storage';
|
|
7
8
|
import { useActionConfigs } from '../../actions/configs/context.mjs';
|
|
8
9
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -38,7 +39,7 @@ const useLocationDetailView = (options) => {
|
|
|
38
39
|
const [activeFile, setActiveFile] = React__default.useState();
|
|
39
40
|
const { current, key } = location;
|
|
40
41
|
const { permissions, prefix } = current ?? {};
|
|
41
|
-
const { fileDataItems } = locationItems;
|
|
42
|
+
const { dataItems, fileDataItems } = locationItems;
|
|
42
43
|
const hasInvalidPrefix = isUndefined(prefix);
|
|
43
44
|
const [{ task }, handleDownload] = useAction('download');
|
|
44
45
|
const [{ value, isLoading, hasError, message }, handleList] = useList('locationItems');
|
|
@@ -165,13 +166,13 @@ const useLocationDetailView = (options) => {
|
|
|
165
166
|
actionType: type,
|
|
166
167
|
icon,
|
|
167
168
|
isDisabled: isFunction(disable)
|
|
168
|
-
? disable(
|
|
169
|
+
? disable(dataItems)
|
|
169
170
|
: disable ?? false,
|
|
170
171
|
isHidden: isFunction(hide) ? hide(permissions) : hide,
|
|
171
172
|
label,
|
|
172
173
|
};
|
|
173
174
|
});
|
|
174
|
-
}, [actionConfigs,
|
|
175
|
+
}, [actionConfigs, dataItems, permissions]);
|
|
175
176
|
return {
|
|
176
177
|
actionItems,
|
|
177
178
|
actionType,
|
|
@@ -182,6 +183,7 @@ const useLocationDetailView = (options) => {
|
|
|
182
183
|
page: currentPage,
|
|
183
184
|
pageItems,
|
|
184
185
|
location,
|
|
186
|
+
dataItems,
|
|
185
187
|
fileDataItems,
|
|
186
188
|
hasError,
|
|
187
189
|
hasDownloadError: task?.status === 'FAILED',
|
|
@@ -237,16 +239,16 @@ const useLocationDetailView = (options) => {
|
|
|
237
239
|
storeDispatch({ type: 'RESET_ACTION_TYPE' });
|
|
238
240
|
locationItemsDispatch({ type: 'RESET_LOCATION_ITEMS' });
|
|
239
241
|
},
|
|
240
|
-
onSelect: (isSelected,
|
|
242
|
+
onSelect: (isSelected, item) => {
|
|
241
243
|
locationItemsDispatch(isSelected
|
|
242
|
-
? { type: 'REMOVE_LOCATION_ITEM', id:
|
|
243
|
-
: { type: 'SET_LOCATION_ITEMS', items: [
|
|
244
|
+
? { type: 'REMOVE_LOCATION_ITEM', id: item.id }
|
|
245
|
+
: { type: 'SET_LOCATION_ITEMS', items: [item] });
|
|
244
246
|
},
|
|
245
247
|
onToggleSelectAll: () => {
|
|
246
|
-
const
|
|
247
|
-
locationItemsDispatch(
|
|
248
|
+
const selectableItems = pageItems;
|
|
249
|
+
locationItemsDispatch(selectableItems.length === dataItems?.length
|
|
248
250
|
? { type: 'RESET_LOCATION_ITEMS' }
|
|
249
|
-
: { type: 'SET_LOCATION_ITEMS', items:
|
|
251
|
+
: { type: 'SET_LOCATION_ITEMS', items: selectableItems });
|
|
250
252
|
},
|
|
251
253
|
onSearch: () => {
|
|
252
254
|
setActiveFile(undefined);
|
|
@@ -11,9 +11,6 @@ import '@aws-amplify/ui-react-core/elements';
|
|
|
11
11
|
import '../../credentials/context.mjs';
|
|
12
12
|
import '@aws-amplify/storage/internals';
|
|
13
13
|
import '../../configuration/context.mjs';
|
|
14
|
-
import 'aws-amplify';
|
|
15
|
-
import 'aws-amplify/storage';
|
|
16
|
-
import '../../actions/configs/context.mjs';
|
|
17
14
|
import '../../actions/configs/defaults.mjs';
|
|
18
15
|
import '../../displayText/context.mjs';
|
|
19
16
|
import '../../filePreview/context.mjs';
|
|
@@ -11,9 +11,6 @@ import '@aws-amplify/ui-react-core/elements';
|
|
|
11
11
|
import '../../credentials/context.mjs';
|
|
12
12
|
import '@aws-amplify/storage/internals';
|
|
13
13
|
import '../../configuration/context.mjs';
|
|
14
|
-
import 'aws-amplify';
|
|
15
|
-
import 'aws-amplify/storage';
|
|
16
|
-
import '../../actions/configs/context.mjs';
|
|
17
14
|
import '../../actions/configs/defaults.mjs';
|
|
18
15
|
import { useDisplayText } from '../../displayText/context.mjs';
|
|
19
16
|
import '../../filePreview/context.mjs';
|
|
@@ -2,6 +2,7 @@ import React__default from 'react';
|
|
|
2
2
|
import '@aws-amplify/storage/internals';
|
|
3
3
|
import { getFileKey } from '../../actions/handlers/utils.mjs';
|
|
4
4
|
import '@aws-amplify/ui';
|
|
5
|
+
import 'jszip';
|
|
5
6
|
import 'aws-amplify/storage';
|
|
6
7
|
import '../../actions/configs/context.mjs';
|
|
7
8
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -9,14 +9,18 @@ import '../../credentials/context.mjs';
|
|
|
9
9
|
import '@aws-amplify/storage/internals';
|
|
10
10
|
import '../../configuration/context.mjs';
|
|
11
11
|
import '@aws-amplify/ui-react-core';
|
|
12
|
-
import 'aws-amplify';
|
|
13
|
-
import 'aws-amplify/storage';
|
|
14
|
-
import '../../actions/configs/context.mjs';
|
|
15
12
|
import '../../actions/configs/defaults.mjs';
|
|
16
13
|
import { CreateFolderView } from '../LocationActionView/CreateFolderView/CreateFolderView.mjs';
|
|
17
14
|
import { CopyView } from '../LocationActionView/CopyView/CopyView.mjs';
|
|
18
15
|
import '../../locationItems/context.mjs';
|
|
19
16
|
import { DeleteView } from '../LocationActionView/DeleteView/DeleteView.mjs';
|
|
17
|
+
import '../../displayText/context.mjs';
|
|
18
|
+
import '@aws-amplify/ui-react';
|
|
19
|
+
import '../../components/elements/definitions.mjs';
|
|
20
|
+
import '../../components/elements/IconElement.mjs';
|
|
21
|
+
import 'aws-amplify';
|
|
22
|
+
import 'jszip';
|
|
23
|
+
import 'aws-amplify/storage';
|
|
20
24
|
import { DownloadView } from '../LocationActionView/DownloadView/DownloadView.mjs';
|
|
21
25
|
|
|
22
26
|
const DEFAULT_ACTION_VIEWS = {
|
|
@@ -9,17 +9,22 @@ import '../../credentials/context.mjs';
|
|
|
9
9
|
import '@aws-amplify/storage/internals';
|
|
10
10
|
import '../../configuration/context.mjs';
|
|
11
11
|
import '@aws-amplify/ui-react-core';
|
|
12
|
-
import 'aws-amplify';
|
|
13
|
-
import 'aws-amplify/storage';
|
|
14
|
-
import '../../actions/configs/context.mjs';
|
|
15
12
|
import '../../actions/configs/defaults.mjs';
|
|
16
13
|
import '../LocationActionView/CreateFolderView/CreateFolderView.mjs';
|
|
17
14
|
import '../LocationActionView/DeleteView/DeleteView.mjs';
|
|
15
|
+
import '../../displayText/context.mjs';
|
|
16
|
+
import '@aws-amplify/ui-react';
|
|
17
|
+
import '../../components/elements/definitions.mjs';
|
|
18
|
+
import '../../components/elements/IconElement.mjs';
|
|
19
|
+
import 'aws-amplify';
|
|
20
|
+
import 'jszip';
|
|
21
|
+
import 'aws-amplify/storage';
|
|
18
22
|
import '../LocationActionView/DownloadView/DownloadView.mjs';
|
|
19
23
|
import { LocationActionView } from '../LocationActionView/LocationActionView.mjs';
|
|
20
24
|
import '../LocationActionView/UploadView/UploadView.mjs';
|
|
21
25
|
import '../../fileItems/context.mjs';
|
|
22
26
|
import { LocationDetailView } from '../LocationDetailView/LocationDetailView.mjs';
|
|
27
|
+
import '../../actions/configs/context.mjs';
|
|
23
28
|
import '../../filePreview/context.mjs';
|
|
24
29
|
import { LocationsView } from '../LocationsView/LocationsView.mjs';
|
|
25
30
|
|
|
@@ -8,6 +8,7 @@ import { safeGetProperties } from '../../utils/files/safeGetProperties.mjs';
|
|
|
8
8
|
import { getUrl } from '@aws-amplify/storage/internals';
|
|
9
9
|
import { constructBucket } from '../../../actions/handlers/utils.mjs';
|
|
10
10
|
import '@aws-amplify/ui';
|
|
11
|
+
import 'jszip';
|
|
11
12
|
import 'aws-amplify/storage';
|
|
12
13
|
import { useStore } from '../../../store/context.mjs';
|
|
13
14
|
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
const STATUS_LABELS = {
|
|
2
2
|
PENDING: 'statusDisplayInProgressLabel',
|
|
3
|
+
FINISHING: 'statusDisplayFinishingLabel',
|
|
3
4
|
CANCELED: 'statusDisplayCanceledLabel',
|
|
4
5
|
COMPLETE: 'statusDisplayCompletedLabel',
|
|
6
|
+
LOADED: 'statusDisplayLoadedLabel',
|
|
5
7
|
FAILED: 'statusDisplayFailedLabel',
|
|
6
8
|
QUEUED: 'statusDisplayQueuedLabel',
|
|
7
9
|
OVERWRITE_PREVENTED: 'statusDisplayOverwritePreventedLabel',
|
|
8
10
|
};
|
|
9
11
|
const STATUS_ICONS = {
|
|
10
12
|
PENDING: 'action-progress',
|
|
13
|
+
FINISHING: 'action-progress',
|
|
11
14
|
COMPLETE: 'action-success',
|
|
15
|
+
LOADED: 'action-success',
|
|
12
16
|
FAILED: 'action-error',
|
|
13
17
|
OVERWRITE_PREVENTED: 'action-info',
|
|
14
18
|
CANCELED: 'action-canceled',
|
|
@@ -22,5 +26,14 @@ const FILE_DATA_ITEM_TABLE_KEYS = [
|
|
|
22
26
|
'status',
|
|
23
27
|
'cancel',
|
|
24
28
|
];
|
|
29
|
+
const DELETE_TABLE_KEYS = [
|
|
30
|
+
'name',
|
|
31
|
+
'folder',
|
|
32
|
+
'type',
|
|
33
|
+
'size',
|
|
34
|
+
'status',
|
|
35
|
+
'progress',
|
|
36
|
+
'cancel',
|
|
37
|
+
];
|
|
25
38
|
|
|
26
|
-
export { FILE_DATA_ITEM_TABLE_KEYS, STATUS_ICONS, STATUS_LABELS };
|
|
39
|
+
export { DELETE_TABLE_KEYS, FILE_DATA_ITEM_TABLE_KEYS, STATUS_ICONS, STATUS_LABELS };
|