Skip to content

DEV: d-multi-select and chat-channel-multi-select #32782

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jjaffeux
Copy link
Contributor

@jjaffeux jjaffeux commented May 17, 2025

Implement a new component called d-multi-select which allows to select multiple items.

It has the following features:

  • accepts a loadFn to load data
  • yield result to customise results
  • yield selection to customise selection

Usage:

 <DMultiSelect
  @loadFn={{this.loadData}}
  @onChange={{this.onChange}}
  @selection={{this.selection}}
>
  <:selection as |item|>{{item.name}}</:selection>
  <:result as |result|>{{result.name}}</:result>
</DMultiSelect>

For chat channels, we added a dedicated component on top of DMultiselect, which allows you to pass a list of ids or a selection if you already have the channels objects:

<ChatChannelMultiSelect
  @onChange={{fn (mut this.selectedChannels)}}
  @initialIds={{array 2}}
  @selection={{this.selectedChannels}}
>
  <:selection as |item|>{{item.name}}</:selection>
  <:result as |result|>{{result.name}}</:result>
</ChatChannelMultiSelect>

Implement a new component called `d-multi-select` which allows to select multiple items.

It has the following features:
- accepts a `loadFn` to load data
- yield result to customise results
- yield selection to customise selection

Usage:

```gjs
 <DMultiSelect
  @loadFn={{this.loadData}}
  @onchange={{this.onChange}}
  @selection={{this.selection}}
>
  <:selection as |item|>{{item.name}}</:selection>
  <:result as |result|>{{result.name}}</:result>
</DMultiSelect>

```gjs
<ChatChannelMultiSelect
  @onchange={{fn (mut this.selectedChannels)}}
  @initialIds={{array 2}}
  @selection={{this.selectedChannels}}
>
    <:selection as |item|>{{item.name}}</:selection>
    <:result as |result|>{{result.name}}</:result>
</ChatChannelMultiSelect>
@github-actions github-actions bot added the chat PRs which include a change to Chat plugin label May 17, 2025
@jjaffeux jjaffeux requested a review from davidtaylorhq May 17, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat PRs which include a change to Chat plugin
Development

Successfully merging this pull request may close these issues.

1 participant