Skip to content

Commit 6e352ff

Browse files
authored
Fix wording and duplicate code in embeddable example plugin (#3911)
* Fix wording and duplicate code in embeddable example plugin Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * Fix some wording in the embeddable readme Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> --------- Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
1 parent 5ea0cbe commit 6e352ff

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

examples/embeddable_examples/public/searchable_list_container/searchable_list_container_component.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export class SearchableListContainerComponentInner extends Component<Props, Stat
8282
const output = props.embeddable.getChild(id).getOutput();
8383
hasMatch[id] = hasHasMatchOutput(output) && output.hasMatch;
8484
});
85-
props.embeddable.getChildIds().forEach((id) => (checked[id] = false));
8685
this.state = {
8786
checked,
8887
hasMatch,

examples/embeddable_explorer/public/list_container_example.tsx

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

168177
<p>
169178
Check out the &quot;Dynamically adding children&quot; section, to see how to add

src/plugins/embeddable/docs/input_and_output_state.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ There are no real life examples showcasing this, it may not even be really neede
274274
the thinking being that it would support any type of rendering of child embeddables - whether in a "snap to grid" style like dashboard,
275275
or in a free form layout like canvas.
276276
277-
The only real implementation of a container in production code at the time this is written is Dashboard however, with no plans to migrate
278-
Canvas over to use it (this was the original impetus for an abstraction). The container code is quite complicated with child management,
279-
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
280-
an over abstraction without a real prod use case (I can say that because I wrote it, I'm only insulting myself!) :).
277+
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!) :).
281278
282279
Be sure to read [Common mistakes with embeddable containers and inherited input state](./containers_and_inherited_state.md) next!

0 commit comments

Comments
 (0)