Explore: minor copy changes (#47922)

* Explore: minor copy changes

* fix tests
pull/47953/head
Giordano Ricci 4 years ago committed by GitHub
parent ff60f39e96
commit c1490a464a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      public/app/features/explore/AddToDashboard/AddToDashboardModal.tsx
  2. 8
      public/app/features/explore/AddToDashboard/index.test.tsx

@ -18,11 +18,11 @@ enum SaveTarget {
const SAVE_TARGETS: Array<SelectableValue<SaveTarget>> = [ const SAVE_TARGETS: Array<SelectableValue<SaveTarget>> = [
{ {
label: 'New Dashboard', label: 'New dashboard',
value: SaveTarget.NewDashboard, value: SaveTarget.NewDashboard,
}, },
{ {
label: 'Existing Dashboard', label: 'Existing dashboard',
value: SaveTarget.ExistingDashboard, value: SaveTarget.ExistingDashboard,
}, },
]; ];
@ -141,7 +141,7 @@ export const AddToDashboardModal = ({ onClose, exploreId }: Props) => {
<InputControl <InputControl
control={control} control={control}
render={({ field: { ref, ...field } }) => ( render={({ field: { ref, ...field } }) => (
<Field label="Target dashboard" description="Start a new dashboard or save the panel in an existing one."> <Field label="Target dashboard" description="Choose where to add the panel.">
<RadioButtonGroup options={SAVE_TARGETS} {...field} id="e2d-save-target" /> <RadioButtonGroup options={SAVE_TARGETS} {...field} id="e2d-save-target" />
</Field> </Field>
)} )}
@ -195,7 +195,7 @@ export const AddToDashboardModal = ({ onClose, exploreId }: Props) => {
Open in new tab Open in new tab
</Button> </Button>
<Button type="submit" variant="primary" onClick={handleSubmit(partial(onSubmit, false))} icon="apps"> <Button type="submit" variant="primary" onClick={handleSubmit(partial(onSubmit, false))} icon="apps">
Open Open dashboard
</Button> </Button>
</Modal.ButtonRow> </Modal.ButtonRow>
</form> </form>

@ -86,7 +86,7 @@ describe('AddToDashboardButton', () => {
await openModal(); await openModal();
userEvent.click(screen.getByRole('button', { name: /open$/i })); userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitForAddToDashboardResponse(); await waitForAddToDashboardResponse();
@ -138,7 +138,7 @@ describe('AddToDashboardButton', () => {
await openModal(); await openModal();
userEvent.click(screen.getByRole('button', { name: /open$/i })); userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitForAddToDashboardResponse(); await waitForAddToDashboardResponse();
@ -170,7 +170,7 @@ describe('AddToDashboardButton', () => {
userEvent.click(screen.getByRole<HTMLInputElement>('radio', { name: /existing dashboard/i })); userEvent.click(screen.getByRole<HTMLInputElement>('radio', { name: /existing dashboard/i }));
userEvent.click(screen.getByRole('button', { name: /open$/i })); userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitForAddToDashboardResponse(); await waitForAddToDashboardResponse();
expect(locationService.push).not.toHaveBeenCalled(); expect(locationService.push).not.toHaveBeenCalled();
@ -255,7 +255,7 @@ describe('AddToDashboardButton', () => {
}); });
userEvent.click(screen.getByLabelText('Select option')); userEvent.click(screen.getByLabelText('Select option'));
userEvent.click(screen.getByRole('button', { name: /open$/i })); userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitFor(async () => { await waitFor(async () => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument(); expect(screen.queryByRole('dialog')).not.toBeInTheDocument();

Loading…
Cancel
Save