-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.13] [dashboard] fix Inspect panel action displays untitled instead…
… of panel title (#177516) (#177610) # Backport This will backport the following commits from `main` to `8.13`: - [[dashboard] fix Inspect panel action displays untitled instead of panel title (#177516)](#177516) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-02-22T15:27:12Z","message":"[dashboard] fix Inspect panel action displays untitled instead of panel title (#177516)\n\nFixes https://github.com/elastic/kibana/issues/176870\r\n\r\nPR provides a utility method for fetching title that falls back to\r\ndefault title when title is not provided.","sha":"c747a3b35dc086bfa3b8a1cbe67e276558c9a1f4","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","Feature:Drilldowns","v8.13.0","project:embeddableRebuild","v8.14.0"],"title":"[dashboard] fix Inspect panel action displays untitled instead of panel title","number":177516,"url":"https://github.com/elastic/kibana/pull/177516","mergeCommit":{"message":"[dashboard] fix Inspect panel action displays untitled instead of panel title (#177516)\n\nFixes https://github.com/elastic/kibana/issues/176870\r\n\r\nPR provides a utility method for fetching title that falls back to\r\ndefault title when title is not provided.","sha":"c747a3b35dc086bfa3b8a1cbe67e276558c9a1f4"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177516","number":177516,"mergeCommit":{"message":"[dashboard] fix Inspect panel action displays untitled instead of panel title (#177516)\n\nFixes https://github.com/elastic/kibana/issues/176870\r\n\r\nPR provides a utility method for fetching title that falls back to\r\ndefault title when title is not provided.","sha":"c747a3b35dc086bfa3b8a1cbe67e276558c9a1f4"}}]}] BACKPORT--> Co-authored-by: Nathan Reese <[email protected]>
- Loading branch information
1 parent
bbec153
commit 621a681
Showing
14 changed files
with
79 additions
and
29 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
packages/presentation/presentation_publishing/interfaces/publishes_panel_title.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 { getPanelTitle } from './publishes_panel_title'; | ||
|
||
describe('getPanelTitle', () => { | ||
test('should return default title when title is undefined', () => { | ||
const api = { | ||
panelTitle: new BehaviorSubject<string | undefined>(undefined), | ||
defaultPanelTitle: new BehaviorSubject<string | undefined>('default title'), | ||
}; | ||
expect(getPanelTitle(api)).toBe('default title'); | ||
}); | ||
|
||
test('should return default title when title is empty string', () => { | ||
const api = { | ||
panelTitle: new BehaviorSubject<string | undefined>(''), | ||
defaultPanelTitle: new BehaviorSubject<string | undefined>('default title'), | ||
}; | ||
expect(getPanelTitle(api)).toBe('default title'); | ||
}); | ||
|
||
test('should return title when title is provided', () => { | ||
const api = { | ||
panelTitle: new BehaviorSubject<string | undefined>('custom title'), | ||
defaultPanelTitle: new BehaviorSubject<string | undefined>('default title'), | ||
}; | ||
expect(getPanelTitle(api)).toBe('custom title'); | ||
}); | ||
}); |
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
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