chore: rename 'Change dataset' action to 'Swap dataset' (#22197)

This commit is contained in:
Maxime Beauchemin 2022-11-23 10:19:59 -08:00 committed by GitHub
parent a77b2d6ebf
commit 888f43c6ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -251,7 +251,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
show={show}
onHide={onHide}
responsive
title={t('Change dataset')}
title={t('Swap dataset')}
width={confirmChange ? '432px' : ''}
height={confirmChange ? 'auto' : '540px'}
hideFooter={!confirmChange}

View File

@ -94,17 +94,17 @@ test('Should open a menu', async () => {
render(<DatasourceControl {...props} />);
expect(screen.queryByText('Edit dataset')).not.toBeInTheDocument();
expect(screen.queryByText('Change dataset')).not.toBeInTheDocument();
expect(screen.queryByText('Swap dataset')).not.toBeInTheDocument();
expect(screen.queryByText('View in SQL Lab')).not.toBeInTheDocument();
userEvent.click(screen.getByTestId('datasource-menu-trigger'));
expect(await screen.findByText('Edit dataset')).toBeInTheDocument();
expect(screen.getByText('Change dataset')).toBeInTheDocument();
expect(screen.getByText('Swap dataset')).toBeInTheDocument();
expect(screen.getByText('View in SQL Lab')).toBeInTheDocument();
});
test('Click on Change dataset option', async () => {
test('Click on Swap dataset option', async () => {
const props = createProps();
SupersetClientGet.mockImplementation(
async ({ endpoint }: { endpoint: string }) => {
@ -123,7 +123,7 @@ test('Click on Change dataset option', async () => {
userEvent.click(screen.getByTestId('datasource-menu-trigger'));
await act(async () => {
userEvent.click(screen.getByText('Change dataset'));
userEvent.click(screen.getByText('Swap dataset'));
});
expect(
screen.getByText(

View File

@ -302,7 +302,7 @@ class DatasourceControl extends React.PureComponent {
)}
</Menu.Item>
)}
<Menu.Item key={CHANGE_DATASET}>{t('Change dataset')}</Menu.Item>
<Menu.Item key={CHANGE_DATASET}>{t('Swap dataset')}</Menu.Item>
{datasource && (
<Menu.Item key={VIEW_IN_SQL_LAB}>{t('View in SQL Lab')}</Menu.Item>
)}
@ -421,7 +421,7 @@ class DatasourceControl extends React.PureComponent {
this.handleMenuItemClick({ key: CHANGE_DATASET })
}
>
{t('Change dataset')}
{t('Swap dataset')}
</Button>
</p>
</>