Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard First] Add / Unlink Actions Require Specifically Shaped Input #74297

Closed
ThomThomson opened this issue Aug 4, 2020 · 1 comment · Fixed by #74302
Closed

[Dashboard First] Add / Unlink Actions Require Specifically Shaped Input #74297

ThomThomson opened this issue Aug 4, 2020 · 1 comment · Fixed by #74302
Assignees
Labels
discuss Feature:Dashboard Dashboard related features Feature:Embedding Embedding content via iFrame Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@ThomThomson
Copy link
Contributor

Problem:
The add to library action #73899 as it's currently drafted explicitly requires the input to be in the shape: { attributes: SavedObjectAttributesType }

Conversely, the unlink from library action will require the input to be shaped like a SavedObjectEmbeddableInput. These requirements are too strict, and not well defined.

** Possible Solution **
A byReferenceOrValue interface could be added which any embeddable which can be 'by reference OR by value' will implement: i.e.

export class BookEmbeddable extends Embeddable<BookEmbeddableInput, BookEmbeddableOutput>
  implements ReferenceOrValueEmbeddable<BookByValueInput, BookByReferenceInput> {

This interface would have to provide the ability to:

  • determine if the implementing embeddable is by value or not
  • transform any by value input for that embeddable type into by reference input (certain embeddables could show a save modal here)...
  • transform any by reference input for that embeddable type into by value input

By creating this interface, the attribute_service becomes decoupled from the concept of the by value or by reference embeddable. Embeddables that have input in the specific shape required by attribute_service, could implement the interface by deferring back to the attribute service. I.e

getInputAsValueType = async (): Promise<BookByValueInput> => {
    return this.attributeService.getInputAsValueType(this.input);
};
@ThomThomson ThomThomson added discuss Feature:Dashboard Dashboard related features Feature:Embedding Embedding content via iFrame Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Aug 4, 2020
@ThomThomson ThomThomson self-assigned this Aug 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature:Dashboard Dashboard related features Feature:Embedding Embedding content via iFrame Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants