Skip to content

Commit

Permalink
[ui-storageBrowser]Handle errors and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhibhatg committed Jun 14, 2024
1 parent 1bd4d52 commit a197aed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ const StorageBrowserActions = ({ selectedFiles }: StorageBrowserRowActionsProps)
const { t } = i18nReact.useTranslation();

const isSummaryEnabled = () => {
const selectedFile = selectedFiles[0];
return (
selectedFiles.length == 1 &&
(isHDFS(selectedFiles[0].path) || isOFS(selectedFiles[0].path)) &&
selectedFiles[0].type === 'file'
(isHDFS(selectedFile.path) || isOFS(selectedFile.path)) &&
selectedFile.type === 'file'
);
};

Expand Down Expand Up @@ -74,8 +75,8 @@ const StorageBrowserActions = ({ selectedFiles }: StorageBrowserRowActionsProps)
}}
trigger={['click', 'hover']}
>
<Button onClick={e => e.stopPropagation()} data-event="">
Actions
<Button data-event="">
{t('Actions')}
<DropDownIcon />
</Button>
</Dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { PrimaryButton } from 'cuix/dist/components/Button';
import Table from 'cuix/dist/components/Table';

import { i18nReact } from '../../../../utils/i18nReact';
import huePubSub from '../../../../utils/huePubSub';
import { mkdir, touch } from '../../../../reactComponents/FileChooser/api';
import {
PageStats,
Expand Down Expand Up @@ -226,8 +227,8 @@ const StorageBrowserTable = ({
setRefreshKey(oldKey => oldKey + 1);
})
.catch(error => {
// eslint-disable-next-line no-restricted-syntax
console.log(error);
huePubSub.publish('hue.error', error);
setShowNewFolderModal(false);
})
.finally(() => {
setLoadingFiles(false);
Expand All @@ -241,8 +242,8 @@ const StorageBrowserTable = ({
setRefreshKey(oldKey => oldKey + 1);
})
.catch(error => {
// eslint-disable-next-line no-restricted-syntax
console.log(error);
huePubSub.publish('hue.error', error);
setShowNewFileModal(false);
})
.finally(() => {
setLoadingFiles(false);
Expand Down

0 comments on commit a197aed

Please sign in to comment.