-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary Updates to the panel title flyout behavior to be more strict about changes to the title, including... - Input defaults to the actual title when empty (`""`), no longer fills with default viz `title`/`description`. - Uses the default title/description when the value is `undefined`, such that the value has never been set. - Adds a clear button to the `title` input. - `Reset` wording replaced with `Reset to default`, for `title` and `description`. - Only shows reset if there is a `default` non-empty `title`/`description` to reset to, applies mostly to by-value viz. - Changes the inspect panel `title` to always match the panel `title` and show `"[No Title]"` when empty.
- Loading branch information
1 parent
5346e0d
commit 382ee2d
Showing
22 changed files
with
294 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...resentation/presentation_publishing/interfaces/titles/publishes_panel_description.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { BehaviorSubject } from 'rxjs'; | ||
import { getPanelDescription } from './publishes_panel_description'; | ||
|
||
describe('getPanelDescription', () => { | ||
test('should return default description when description is undefined', () => { | ||
const api = { | ||
panelDescription: new BehaviorSubject<string | undefined>(undefined), | ||
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'), | ||
}; | ||
expect(getPanelDescription(api)).toBe('default description'); | ||
}); | ||
|
||
test('should return empty description when description is empty string', () => { | ||
const api = { | ||
panelDescription: new BehaviorSubject<string | undefined>(''), | ||
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'), | ||
}; | ||
expect(getPanelDescription(api)).toBe(''); | ||
}); | ||
|
||
test('should return description when description is provided', () => { | ||
const api = { | ||
panelDescription: new BehaviorSubject<string | undefined>('custom description'), | ||
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'), | ||
}; | ||
expect(getPanelDescription(api)).toBe('custom description'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...ugins/saved_objects/public/save_modal/__snapshots__/saved_object_save_modal.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.