Skip to content

Commit

Permalink
[FIX] Initial members value on Create Channel Modal (#26000)
Browse files Browse the repository at this point in the history
<!-- This is a pull request template, you do not need to uncomment or remove the comments, they won't show up in the PR text. -->

<!-- Your Pull Request name should start with one of the following tags
  [NEW] For new features
  [IMPROVE] For an improvement (performance or little improvements) in existing features
  [FIX] For bug fixes that affect the end-user
  [BREAK] For pull requests including breaking changes
  Chore: For small tasks
  Doc: For documentation
-->

<!-- Checklist!!! If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code. 
  - I have read the Contributing Guide - https://github.com/RocketChat/Rocket.Chat/blob/develop/.github/CONTRIBUTING.md#contributing-to-rocketchat doc
  - I have signed the CLA - https://cla-assistant.io/RocketChat/Rocket.Chat
  - Lint and unit tests pass locally with my changes
  - I have added tests that prove my fix is effective or that my feature works (if applicable)
  - I have added necessary documentation (if applicable)
  - Any dependent changes have been merged and published in downstream modules
-->

## Proposed changes (including videos or screenshots)
<!-- CHANGELOG -->
<!--
  Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
  If it fixes a bug or resolves a feature request, be sure to link to that issue below.
  This description will appear in the release notes if we accept the contribution.
-->
#### before
![Screen Shot 2022-06-24 at 11 58 22](https://user-images.githubusercontent.com/27704687/175562315-221dbc9a-5695-4259-a8f7-644e2ff0ab36.png)

#### after
![Screen Shot 2022-06-24 at 11 59 38](https://user-images.githubusercontent.com/27704687/175562510-a4a6be49-bbd2-4aeb-aedb-a5a7a6f1159d.png)

<!-- END CHANGELOG -->

## Issue(s)
<!-- Link the issues being closed by or related to this PR. For example, you can use #594 if this PR closes issue number 594 -->

## Steps to test or reproduce
<!-- Mention how you would reproduce the bug if not mentioned on the issue page already. Also mention which screens are going to have the changes if applicable -->

## Further comments
<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
  • Loading branch information
dougfabris committed Jun 24, 2022
1 parent 24ffc28 commit d9ffbd6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const UserAutoComplete = ({ value, ...props }: UserAutoCompleteProps): ReactElem
onChange={props.onChange as any}
filter={filter}
setFilter={setFilter}
renderSelected={({ value, label }): ReactElement => {
renderSelected={({ value, label }): ReactElement | null => {
if (!value) {
undefined;
return null;
}

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AutoComplete, Box, Option, Chip } from '@rocket.chat/fuselage';
import { AutoComplete, Box, Option, OptionAvatar, OptionContent, Chip } from '@rocket.chat/fuselage';
import { useMutableCallback, useDebouncedValue } from '@rocket.chat/fuselage-hooks';
import React, { ComponentProps, memo, ReactElement, useMemo, useState } from 'react';

Expand Down Expand Up @@ -52,12 +52,12 @@ const UserAutoCompleteMultiple = ({ onChange, ...props }: UserAutoCompleteMultip
}
renderItem={({ value, label, ...props }): ReactElement => (
<Option key={value} {...props}>
<Option.Avatar>
<OptionAvatar>
<UserAvatar username={value} size='x20' />
</Option.Avatar>
<Option.Content>
</OptionAvatar>
<OptionContent>
{label} <Option.Description>({value})</Option.Description>
</Option.Content>
</OptionContent>
</Option>
)}
options={options}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const CreateChannelWithData = ({ onClose, teamId = '', reload }: CreateChannelWi
}, [canCreateChannel, canCreatePrivateChannel]);

const initialValues = {
users: [''],
users: [],
name: '',
description: '',
type: canOnlyCreateOneType ? canOnlyCreateOneType === 'p' : true,
Expand Down

0 comments on commit d9ffbd6

Please sign in to comment.