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

Fix wording and duplicate code in embeddable example plugin #3911

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export class SearchableListContainerComponentInner extends Component<Props, Stat
const output = props.embeddable.getChild(id).getOutput();
hasMatch[id] = hasHasMatchOutput(output) && output.hasMatch;
});
props.embeddable.getChildIds().forEach((id) => (checked[id] = false));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a duplicate of line 81

this.state = {
checked,
hasMatch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ export function ListContainerExample({
The first HelloWorldEmbeddable does not emit the hasMatch output variable, so the
container chooses to hide it.
</p>
<p>
Type some strings in the search bar, and press Check matching button. If the search
string matches with any strings from the title or the description of the children
embeddables, the child embeddable&#39;s check box will be checked. Noted that the
search filter is case sensitive. However, even if the search string matches with the
strings in the HelloWorldEmbeddable, its check box will not be checked because of the
reason explained above. If we click Delete checked, all the selected child embeddables
will be deleted from the container.
</p>

<p>
Check out the &quot;Dynamically adding children&quot; section, to see how to add
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/embeddable/docs/input_and_output_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,6 @@ There are no real life examples showcasing this, it may not even be really neede
the thinking being that it would support any type of rendering of child embeddables - whether in a "snap to grid" style like dashboard,
or in a free form layout like canvas.

The only real implementation of a container in production code at the time this is written is Dashboard however, with no plans to migrate
Canvas over to use it (this was the original impetus for an abstraction). The container code is quite complicated with child management,
so it makes creating a new container very easy, as you can see in the developer examples of containers. But, it's possible this layer was
an over abstraction without a real prod use case (I can say that because I wrote it, I'm only insulting myself!) :).
The only real implementation of a container in production code at the time is written in the Dashboard plugin, however, with no plans to migrate over to Canvas (this was the original impetus for an abstraction). The container code is quite complicated with child management, so it makes creating a new container very easy, as you can see in the developer examples of containers. But, it's possible this layer was an over abstraction without a real prod use case (I can say that because I wrote it, I'm only insulting myself!) :).

Be sure to read [Common mistakes with embeddable containers and inherited input state](./containers_and_inherited_state.md) next!