Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui-core] remove deprecated data-event key from buttons #4103

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ const ServerLogsHeader: React.FC<ServerLogsHeaderProps> = ({

<Button
className="server__download-button"
data-event="download-button"
icon={<Download />}
onClick={handleDownloadClick}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const ReactExample: FunctionComponent<ReactExampleProps> = ({ activeExecutable,
defaultCurrent={1}
total={500}
/>
<PrimaryButton data-event="" icon={<PlusCircleIcon />} onClick={showModal}>
<PrimaryButton icon={<PlusCircleIcon />} onClick={showModal}>
{t('Open (cuix button)')}
</PrimaryButton>
<Dropdown menu={{ items }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const ImporterSourceSelector = ({ setFileMetaData }: ImporterSourceSelectorProps
className="hue-importer__source-selector-option-button"
size="large"
icon={<DocumentationIcon />}
data-event={''}
onClick={handleUploadClick}
></Button>
<span className="hue-importer__source-selector-option-btn-title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
setFilePath(fileSystem.userHomeDirectory);
}}
className="hue-storage-browser-tab__title-bar-button"
data-event=""
title={t('Home')}
icon={<HomeIcon />}
>
Expand All @@ -153,7 +152,6 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
<BorderlessButton
onClick={onTrashClick}
className="hue-storage-browser-tab__title-bar-button"
data-event=""
title={t('Trash')}
icon={<DeleteIcon />}
disabled={!trashData?.trashPath}
Expand All @@ -164,7 +162,6 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
<BorderlessButton
onClick={reloadData}
className="hue-storage-browser-tab__title-bar-button"
data-event=""
title={t('Refresh')}
icon={<RefreshIcon />}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const CreateAndUploadAction = ({
}}
trigger={['click']}
>
<PrimaryButton data-event="">
<PrimaryButton>
{t('New')}
<DropDownIcon />
</PrimaryButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,14 @@ const StorageFilePage = ({ fileStats, onReload }: StorageFilePageProps): JSX.Ele
{t('Content')}
<div className="preview__action-group">
{isEditingEnabled && (
<PrimaryButton
data-testid="preview--edit--button"
data-event=""
onClick={handleEdit}
>
<PrimaryButton data-testid="preview--edit--button" onClick={handleEdit}>
{t('Edit')}
</PrimaryButton>
)}
{isEditing && (
<>
<PrimaryButton
data-testid="preview--save--button"
data-event=""
onClick={handleSave}
disabled={fileContent === data?.contents}
>
Expand All @@ -177,7 +172,6 @@ const StorageFilePage = ({ fileStats, onReload }: StorageFilePageProps): JSX.Ele
<Button
role="button"
data-testid="preview--cancel--button"
data-event=""
onClick={handleCancel}
>
{t('Cancel')}
Expand All @@ -186,11 +180,7 @@ const StorageFilePage = ({ fileStats, onReload }: StorageFilePageProps): JSX.Ele
)}
{config?.storage_browser.enable_file_download_button && (
<a href={fileDownloadUrl}>
<PrimaryButton
data-testid="preview--download--button"
data-event=""
onClick={handleDownload}
>
<PrimaryButton data-testid="preview--download--button" onClick={handleDownload}>
{t('Download')}
</PrimaryButton>
</a>
Expand Down Expand Up @@ -218,11 +208,7 @@ const StorageFilePage = ({ fileStats, onReload }: StorageFilePageProps): JSX.Ele
{fileType === SupportedFileTypes.DOCUMENT && (
<div className="preview__document">
<div>
<PrimaryButton
data-testid=""
data-event=""
onClick={() => window.open(filePreviewUrl)}
>
<PrimaryButton data-testid="" onClick={() => window.open(filePreviewUrl)}>
{t('Preview document')}
</PrimaryButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ const LoadingErrorWrapper = ({
description={error.description}
closable={error.closable}
onClick={error.onClick}
action={
<BorderlessButton onClick={error.onClick} data-event="">
{error.action}
</BorderlessButton>
}
action={<BorderlessButton onClick={error.onClick}>{error.action}</BorderlessButton>}
/>
))}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const Pagination = ({
setPageNumber(1);
}}
className="hue-pagination__page-size-menu-item-btn"
data-event={''}
>
{option}
</BorderlessButton>
Expand All @@ -81,7 +80,6 @@ const Pagination = ({
<Dropdown menu={{ items: pageSizeOptionsMenu }}>
<BorderlessButton
className="hue-pagination__page-size-menu-btn"
data-event={''}
icon={<DropdownIcon />}
iconPosition="right"
>
Expand All @@ -99,31 +97,27 @@ const Pagination = ({
<BorderlessButton
onClick={() => setPageNumber(1)}
className="hue-pagination__control-button"
data-event={''}
disabled={pageStats.pageNumber === 1}
title={t('First Page')}
icon={<PageFirstIcon />}
/>
<BorderlessButton
onClick={() => setPageNumber(pageStats.pageNumber - 1)}
className="hue-pagination__control-button"
data-event={''}
disabled={pageStats.pageNumber === 1}
title={t('First Page')}
icon={<PagePreviousIcon />}
/>
<BorderlessButton
onClick={() => setPageNumber(pageStats.pageNumber + 1)}
className="hue-pagination__control-button"
data-event={''}
disabled={pageStats.pageNumber === pageStats.totalPages}
title={t('Next Page')}
icon={<PageNextIcon />}
/>
<BorderlessButton
onClick={() => setPageNumber(pageStats.totalPages)}
className="hue-pagination__control-button"
data-event={''}
disabled={pageStats.pageNumber === pageStats.totalPages}
title={t('Last Page')}
icon={<PageLastIcon />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const OverflowingItem = ({ label, onClick, testId }: OverflowingItemProps): JSX.
className="hue-path-browser__overflowing-label"
onClick={onClick}
data-testid={`${testId}-label`}
data-event={''}
>
<span ref={textElementRef}>{label}</span>
</BorderlessButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ const PathBrowser = ({
data-testid={`${testId}-dropdown`}
>
<BorderlessButton
data-event=""
className="hue-path-browser__dropdown-button"
data-testid={`${testId}-dropdown-btn`}
>
Expand Down Expand Up @@ -205,14 +204,12 @@ const PathBrowser = ({
onClick={() => setIsEditMode(true)}
className="hue-path-browser__edit-path-btn"
data-testid="hue-path-browser__edit-path-btn"
data-event={''}
title={'Edit Path'}
icon={<EditIcon />}
/>
<BorderlessButton
onClick={() => navigator.clipboard.writeText(filePath)}
className="hue-path-browser__copy-path-btn"
data-event={''}
title={'Copy Path'}
icon={<CopyPathIcon />}
/>
Expand Down