-
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.10] [Dashboard] Get panel description from the embeddable method (#…
…166825) (#166897) # Backport This will backport the following commits from `main` to `8.10`: - [[Dashboard] Get panel description from the embeddable method (#166825)](#166825) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nick Peihl","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-09-20T21:56:54Z","message":"[Dashboard] Get panel description from the embeddable method (#166825)\n\nFixes #166773 \r\n\r\n## Summary\r\n\r\nFixes a bug where panels are not showing descriptions from library\r\nitems.\r\n\r\nChanges the panel to use the `embeddable.getDescription` method for\r\nretrieving the description. This is necessary since by-reference panels\r\ncan store descriptions in the saved object. `getDescription` will check\r\nfor a description in the saved object attributes, but the panel\r\ndescription will still take precedence. This is very similar to how we\r\nget the panel title.","sha":"26893e2e363ad875fea5506a050b4729de20394f","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","release_note:fix","Team:Presentation","v8.11.0","v8.10.3"],"number":166825,"url":"https://github.com/elastic/kibana/pull/166825","mergeCommit":{"message":"[Dashboard] Get panel description from the embeddable method (#166825)\n\nFixes #166773 \r\n\r\n## Summary\r\n\r\nFixes a bug where panels are not showing descriptions from library\r\nitems.\r\n\r\nChanges the panel to use the `embeddable.getDescription` method for\r\nretrieving the description. This is necessary since by-reference panels\r\ncan store descriptions in the saved object. `getDescription` will check\r\nfor a description in the saved object attributes, but the panel\r\ndescription will still take precedence. This is very similar to how we\r\nget the panel title.","sha":"26893e2e363ad875fea5506a050b4729de20394f"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/166825","number":166825,"mergeCommit":{"message":"[Dashboard] Get panel description from the embeddable method (#166825)\n\nFixes #166773 \r\n\r\n## Summary\r\n\r\nFixes a bug where panels are not showing descriptions from library\r\nitems.\r\n\r\nChanges the panel to use the `embeddable.getDescription` method for\r\nretrieving the description. This is necessary since by-reference panels\r\ncan store descriptions in the saved object. `getDescription` will check\r\nfor a description in the saved object attributes, but the panel\r\ndescription will still take precedence. This is very similar to how we\r\nget the panel title.","sha":"26893e2e363ad875fea5506a050b4729de20394f"}},{"branch":"8.10","label":"v8.10.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nick Peihl <[email protected]>
- Loading branch information
1 parent
5e728ad
commit 093f590
Showing
5 changed files
with
121 additions
and
14 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
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
43 changes: 43 additions & 0 deletions
43
.../lib/test_samples/embeddables/contact_card/descriptive_contact_card_embeddable_factory.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,43 @@ | ||
/* | ||
* 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 { UiActionsStart } from '@kbn/ui-actions-plugin/public'; | ||
|
||
import { Container, EmbeddableFactoryDefinition } from '../../..'; | ||
import { ContactCardEmbeddable, ContactCardEmbeddableInput } from './contact_card_embeddable'; | ||
|
||
export const DESCRIPTIVE_CONTACT_CARD_EMBEDDABLE = 'DESCRIPTIVE_CONTACT_CARD_EMBEDDABLE'; | ||
|
||
export class DescriptiveContactCardEmbeddableFactory | ||
implements EmbeddableFactoryDefinition<ContactCardEmbeddableInput> | ||
{ | ||
public readonly type = DESCRIPTIVE_CONTACT_CARD_EMBEDDABLE; | ||
|
||
constructor(protected readonly execTrigger: UiActionsStart['executeTriggerActions']) {} | ||
|
||
public async isEditable() { | ||
return true; | ||
} | ||
|
||
public getDisplayName() { | ||
return 'descriptive contact card'; | ||
} | ||
|
||
public create = async (initialInput: ContactCardEmbeddableInput, parent?: Container) => { | ||
return new ContactCardEmbeddable( | ||
initialInput, | ||
{ | ||
execAction: this.execTrigger, | ||
outputOverrides: { | ||
defaultDescription: 'This is a family friend', | ||
}, | ||
}, | ||
parent | ||
); | ||
}; | ||
} |