|
@@ -15,9 +15,13 @@
|
|
|
// limitations under the License.
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
|
+import { Alert } from 'antd';
|
|
|
|
|
+import BucketIcon from '@cloudera/cuix-core/icons/react/BucketIcon';
|
|
|
|
|
+import RefreshIcon from '@cloudera/cuix-core/icons/react/RefreshIcon';
|
|
|
|
|
+import HomeIcon from '@cloudera/cuix-core/icons/react/HomeIcon';
|
|
|
|
|
+import DeleteIcon from '@cloudera/cuix-core/icons/react/DeleteIcon';
|
|
|
|
|
|
|
|
import { i18nReact } from '../../../utils/i18nReact';
|
|
import { i18nReact } from '../../../utils/i18nReact';
|
|
|
-import BucketIcon from '@cloudera/cuix-core/icons/react/BucketIcon';
|
|
|
|
|
|
|
|
|
|
import PathBrowser from '../../../reactComponents/PathBrowser/PathBrowser';
|
|
import PathBrowser from '../../../reactComponents/PathBrowser/PathBrowser';
|
|
|
import StorageDirectoryPage from '../StorageDirectoryPage/StorageDirectoryPage';
|
|
import StorageDirectoryPage from '../StorageDirectoryPage/StorageDirectoryPage';
|
|
@@ -25,17 +29,13 @@ import { FILE_STATS_API_URL, TRASH_PATH } from '../api';
|
|
|
import { BrowserViewType, FileStats, FileSystem, TrashData } from '../types';
|
|
import { BrowserViewType, FileStats, FileSystem, TrashData } from '../types';
|
|
|
import useLoadData from '../../../utils/hooks/useLoadData/useLoadData';
|
|
import useLoadData from '../../../utils/hooks/useLoadData/useLoadData';
|
|
|
import { BorderlessButton } from 'cuix/dist/components/Button';
|
|
import { BorderlessButton } from 'cuix/dist/components/Button';
|
|
|
-
|
|
|
|
|
-import './StorageBrowserTab.scss';
|
|
|
|
|
import StorageFilePage from '../StorageFilePage/StorageFilePage';
|
|
import StorageFilePage from '../StorageFilePage/StorageFilePage';
|
|
|
import changeURL from '../../../utils/url/changeURL';
|
|
import changeURL from '../../../utils/url/changeURL';
|
|
|
import LoadingErrorWrapper from '../../../reactComponents/LoadingErrorWrapper/LoadingErrorWrapper';
|
|
import LoadingErrorWrapper from '../../../reactComponents/LoadingErrorWrapper/LoadingErrorWrapper';
|
|
|
import { getFileSystemAndPath } from '../../../reactComponents/PathBrowser/PathBrowser.util';
|
|
import { getFileSystemAndPath } from '../../../reactComponents/PathBrowser/PathBrowser.util';
|
|
|
-import RefreshIcon from '@cloudera/cuix-core/icons/react/RefreshIcon';
|
|
|
|
|
-import HomeIcon from '@cloudera/cuix-core/icons/react/HomeIcon';
|
|
|
|
|
-import DeleteIcon from '@cloudera/cuix-core/icons/react/DeleteIcon';
|
|
|
|
|
import { inTrash } from '../../../utils/storageBrowserUtils';
|
|
import { inTrash } from '../../../utils/storageBrowserUtils';
|
|
|
-import { Alert } from 'antd';
|
|
|
|
|
|
|
+
|
|
|
|
|
+import './StorageBrowserTab.scss';
|
|
|
|
|
|
|
|
interface StorageBrowserTabProps {
|
|
interface StorageBrowserTabProps {
|
|
|
fileSystem: FileSystem;
|
|
fileSystem: FileSystem;
|
|
@@ -124,20 +124,29 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<LoadingErrorWrapper loading={isLoading} errors={errorConfig}>
|
|
<LoadingErrorWrapper loading={isLoading} errors={errorConfig}>
|
|
|
- <div className="hue-storage-browser-tab-content" data-testid={testId}>
|
|
|
|
|
- <div className="hue-storage-browser__title-bar" data-testid={`${testId}-title-bar`}>
|
|
|
|
|
- <div className="hue-storage-browser__title">
|
|
|
|
|
- <BucketIcon className="hue-storage-browser__icon" data-testid={`${testId}-icon`} />
|
|
|
|
|
- <h3 className="hue-storage-browser__folder-name" data-testid={`${testId}-folder-namer`}>
|
|
|
|
|
|
|
+ <div className="hue-storage-browser-tab" data-testid={testId}>
|
|
|
|
|
+ <div
|
|
|
|
|
+ className="hue-storage-browser-tab__title-bar-container"
|
|
|
|
|
+ data-testid={`${testId}-title-bar`}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className="hue-storage-browser-tab__title-bar">
|
|
|
|
|
+ <BucketIcon
|
|
|
|
|
+ className="hue-storage-browser-tab__title-bar-icon"
|
|
|
|
|
+ data-testid={`${testId}-icon`}
|
|
|
|
|
+ />
|
|
|
|
|
+ <h3
|
|
|
|
|
+ className="hue-storage-browser-tab__title-bar-name"
|
|
|
|
|
+ data-testid={`${testId}-folder-namer`}
|
|
|
|
|
+ >
|
|
|
{fileName}
|
|
{fileName}
|
|
|
</h3>
|
|
</h3>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="hue-storage-browser__home-bar-right">
|
|
|
|
|
|
|
+ <div className="hue-storage-browser-tab__title-bar-button-group">
|
|
|
<BorderlessButton
|
|
<BorderlessButton
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
setFilePath(fileSystem.userHomeDirectory);
|
|
setFilePath(fileSystem.userHomeDirectory);
|
|
|
}}
|
|
}}
|
|
|
- className="hue-storage-browser__home-bar-btns"
|
|
|
|
|
|
|
+ className="hue-storage-browser-tab__title-bar-button"
|
|
|
data-event=""
|
|
data-event=""
|
|
|
title={t('Home')}
|
|
title={t('Home')}
|
|
|
icon={<HomeIcon />}
|
|
icon={<HomeIcon />}
|
|
@@ -147,7 +156,7 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
|
|
|
{fileSystem.config?.isTrashEnabled && (
|
|
{fileSystem.config?.isTrashEnabled && (
|
|
|
<BorderlessButton
|
|
<BorderlessButton
|
|
|
onClick={onTrashClick}
|
|
onClick={onTrashClick}
|
|
|
- className="hue-path-browser__home-btn"
|
|
|
|
|
|
|
+ className="hue-storage-browser-tab__title-bar-button"
|
|
|
data-event=""
|
|
data-event=""
|
|
|
title={t('Trash')}
|
|
title={t('Trash')}
|
|
|
icon={<DeleteIcon />}
|
|
icon={<DeleteIcon />}
|
|
@@ -157,8 +166,8 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
|
|
|
</BorderlessButton>
|
|
</BorderlessButton>
|
|
|
)}
|
|
)}
|
|
|
<BorderlessButton
|
|
<BorderlessButton
|
|
|
- onClick={() => reloadData()}
|
|
|
|
|
- className="hue-storage-browser__home-bar-btns"
|
|
|
|
|
|
|
+ onClick={reloadData}
|
|
|
|
|
+ className="hue-storage-browser-tab__title-bar-button"
|
|
|
data-event=""
|
|
data-event=""
|
|
|
title={t('Refresh')}
|
|
title={t('Refresh')}
|
|
|
icon={<RefreshIcon />}
|
|
icon={<RefreshIcon />}
|
|
@@ -176,7 +185,7 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
<div
|
|
<div
|
|
|
- className="hue-storage-browser__path-browser-panel"
|
|
|
|
|
|
|
+ className="hue-storage-browser-tab__path-browser-container"
|
|
|
data-testid={`${testId}-path-browser-panel`}
|
|
data-testid={`${testId}-path-browser-panel`}
|
|
|
>
|
|
>
|
|
|
<PathBrowser
|
|
<PathBrowser
|