diff --git a/superset-frontend/playwright/components/modals/ConfirmDialog.ts b/superset-frontend/playwright/components/modals/ConfirmDialog.ts index 2d1c975e170..c62ae7bbbb3 100644 --- a/superset-frontend/playwright/components/modals/ConfirmDialog.ts +++ b/superset-frontend/playwright/components/modals/ConfirmDialog.ts @@ -22,7 +22,7 @@ import { Modal } from '../core/Modal'; /** * Confirm Dialog component for Ant Design Modal.confirm dialogs. - * These are the "OK" / "Cancel" confirmation dialogs used throughout Superset. + * These are the "Confirm" / "Cancel" confirmation dialogs used throughout Superset. * Uses getByRole with name to target specific confirm dialogs when multiple are open. */ export class ConfirmDialog extends Modal { @@ -43,7 +43,7 @@ export class ConfirmDialog extends Modal { } /** - * Clicks the OK button to confirm. + * Clicks the Confirm button to confirm. * @param options.timeout - If provided, silently returns if dialog doesn't appear * within timeout. If not provided, waits indefinitely (strict mode). */ @@ -53,7 +53,7 @@ export class ConfirmDialog extends Modal { state: 'visible', timeout: options?.timeout, }); - await this.clickFooterButton('OK'); + await this.clickFooterButton('Confirm'); await this.waitForHidden(); } catch (error) { // Only swallow TimeoutError when timeout was explicitly provided diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx index a4c24a34c80..18786158c12 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx @@ -390,7 +390,7 @@ const ResultSet = ({ // provides. redirect(getExportCsvUrl(query.id)); }, - confirmText: t('OK'), + confirmText: t('Confirm'), cancelText: t('Close'), }); } diff --git a/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.tsx b/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.tsx index b5b7a1a6b3c..942cddb6648 100644 --- a/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.tsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.tsx @@ -120,7 +120,7 @@ describe('DatasourceModal', () => { }); const saveButton = screen.getByTestId('datasource-modal-save'); fireEvent.click(saveButton); - const okButton = await screen.findByRole('button', { name: 'OK' }); + const okButton = await screen.findByRole('button', { name: 'Confirm' }); fireEvent.click(okButton); await waitFor(() => { expect(onDatasourceSave).toHaveBeenCalled(); @@ -142,7 +142,7 @@ describe('DatasourceModal', () => { const saveButton = screen.getByTestId('datasource-modal-save'); fireEvent.click(saveButton); - const okButton = await screen.findByRole('button', { name: 'OK' }); + const okButton = await screen.findByRole('button', { name: 'Confirm' }); fireEvent.click(okButton); const errorElements = await screen.findAllByText('Error saving dataset'); @@ -230,7 +230,7 @@ describe('DatasourceModal', () => { expect(checkbox).toBeChecked(); // Click OK to submit - const okButton = screen.getByRole('button', { name: 'OK' }); + const okButton = screen.getByRole('button', { name: 'Confirm' }); fireEvent.click(okButton); // Verify the PUT request was made with override_columns=true @@ -297,7 +297,7 @@ describe('DatasourceModal', () => { expect(checkbox).not.toBeChecked(); // Click OK to submit - const okButton = screen.getByRole('button', { name: 'OK' }); + const okButton = screen.getByRole('button', { name: 'Confirm' }); fireEvent.click(okButton); // Verify the PUT request was made with override_columns=false diff --git a/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx b/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx index db06d3da57a..69c7ff293da 100644 --- a/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx @@ -395,7 +395,7 @@ const DatasourceModal: FunctionComponent = ({ show={confirmModalOpen} onHide={handleConfirmModalClose} onHandledPrimaryAction={handleConfirmSave} - primaryButtonName={t('OK')} + primaryButtonName={t('Confirm')} primaryButtonLoading={isSaving} > {getSaveDialog()} diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx index fbad8478620..c557c2f90ea 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx @@ -150,7 +150,7 @@ const waitForRender = (props?: any) => test('renders with default props', async () => { await waitForRender(); expect(screen.getByRole('button', { name: 'Apply' })).toBeDisabled(); - expect(screen.getByRole('button', { name: 'OK' })).toBeDisabled(); + expect(screen.getByRole('button', { name: 'Confirm' })).toBeDisabled(); expect(screen.getByRole('button', { name: 'Cancel' })).toBeEnabled(); }); @@ -188,7 +188,7 @@ test('enables apply and ok buttons', async () => { await waitFor(() => { expect(screen.getByRole('button', { name: 'Apply' })).toBeEnabled(); - expect(screen.getByRole('button', { name: 'OK' })).toBeEnabled(); + expect(screen.getByRole('button', { name: 'Confirm' })).toBeEnabled(); }); }); @@ -203,7 +203,7 @@ test('triggers addAnnotationLayer and close when ok button is clicked', async () const addAnnotationLayer = jest.fn(); const close = jest.fn(); await waitForRender({ name: 'Test', value: '2x', addAnnotationLayer, close }); - userEvent.click(screen.getByRole('button', { name: 'OK' })); + userEvent.click(screen.getByRole('button', { name: 'Confirm' })); expect(addAnnotationLayer).toHaveBeenCalled(); expect(close).toHaveBeenCalled(); }); @@ -724,7 +724,7 @@ test('Disable apply button if formula is incorrect', async () => { const formulaInput = screen.getByRole('textbox', { name: 'Formula' }); const applyButton = screen.getByRole('button', { name: 'Apply' }); - const okButton = screen.getByRole('button', { name: 'OK' }); + const okButton = screen.getByRole('button', { name: 'Confirm' }); userEvent.type(formulaInput, 'x+1'); expect(formulaInput).toHaveValue('x+1'); diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx index 9f1b9abb33f..b429151c660 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx @@ -1303,7 +1303,7 @@ function AnnotationLayer({ disabled={!isValid} onClick={submitAnnotation} > - {t('OK')} + {t('Confirm')} diff --git a/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx b/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx index 98debbb906e..07d6365f6c6 100644 --- a/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx +++ b/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx @@ -187,7 +187,7 @@ async function openAndSaveChanges( await userEvent.click(screen.getByTestId('datasource-menu-trigger')); await userEvent.click(await screen.findByTestId('edit-dataset')); await userEvent.click(await screen.findByTestId('datasource-modal-save')); - await userEvent.click(await screen.findByText('OK')); + await userEvent.click(await screen.findByText('Confirm')); } test('Should render', async () => { @@ -714,10 +714,10 @@ test('should handle metric save confirmation modal', async () => { await userEvent.click(await screen.findByTestId('datasource-modal-save')); // Verify confirmation modal appears - expect(await screen.findByText('OK')).toBeInTheDocument(); + expect(await screen.findByText('Confirm')).toBeInTheDocument(); // Confirm save - await userEvent.click(screen.getByText('OK')); + await userEvent.click(screen.getByText('Confirm')); await waitFor(() => { expect(props.onDatasourceSave).toHaveBeenCalled();