Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3363139
D4574.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D4574.diff
View Options
diff --git a/web/modals/threads/members/add-members-group.react.js b/web/modals/threads/members/add-members-group.react.js
--- a/web/modals/threads/members/add-members-group.react.js
+++ b/web/modals/threads/members/add-members-group.react.js
@@ -8,7 +8,7 @@
import css from './members-modal.css';
type AddMemberItemGroupProps = {
- +header: string,
+ +header: ?string,
+userInfos: $ReadOnlyArray<UserListItem>,
+onUserClick: (userID: string) => void,
+usersAdded: $ReadOnlySet<string>,
@@ -32,10 +32,13 @@
)),
[onUserClick, sortedUserInfos, usersAdded],
);
+ const headerComponent = header ? (
+ <div className={css.addMemberItemsGroupHeader}>{header}:</div>
+ ) : null;
return (
<>
- <div className={css.addMemberItemsGroupHeader}>{header}:</div>
+ {headerComponent}
{userInfosComponents}
</>
);
diff --git a/web/modals/threads/members/add-members-list.react.js b/web/modals/threads/members/add-members-list.react.js
--- a/web/modals/threads/members/add-members-list.react.js
+++ b/web/modals/threads/members/add-members-list.react.js
@@ -12,10 +12,16 @@
+userListItems: $ReadOnlyArray<UserListItem>,
+pendingUsersToAdd: $ReadOnlySet<string>,
+switchUser: string => void,
+ +hasParentThread: boolean,
};
function AddMembersList(props: Props): React.Node {
- const { userListItems, pendingUsersToAdd, switchUser } = props;
+ const {
+ userListItems,
+ pendingUsersToAdd,
+ switchUser,
+ hasParentThread,
+ } = props;
const usersAvailableToAdd = React.useMemo(
() => userListItems.filter(user => !user.alertText),
@@ -27,13 +33,13 @@
[usersAvailableToAdd],
);
- const membersInParentThread = React.useMemo(
- () =>
- groupedAvailableUsersList['undefined']
- ? ['Users in parent channel', groupedAvailableUsersList['undefined']]
- : undefined,
- [groupedAvailableUsersList],
- );
+ const membersInParentThread = React.useMemo(() => {
+ if (!groupedAvailableUsersList['undefined']) {
+ return;
+ }
+ const label = hasParentThread ? 'Users in parent channel' : null;
+ return [label, groupedAvailableUsersList['undefined']];
+ }, [groupedAvailableUsersList, hasParentThread]);
const membersNotInParentThread = React.useMemo(
() =>
diff --git a/web/modals/threads/members/add-members-modal.react.js b/web/modals/threads/members/add-members-modal.react.js
--- a/web/modals/threads/members/add-members-modal.react.js
+++ b/web/modals/threads/members/add-members-modal.react.js
@@ -143,6 +143,7 @@
userListItems={userSearchResults}
switchUser={onSwitchUser}
pendingUsersToAdd={pendingUsersToAdd}
+ hasParentThread={!!threadInfo.parentThreadID}
/>
</div>
<div className={css.addMembersFooter}>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 12:26 AM (21 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581777
Default Alt Text
D4574.diff (2 KB)
Attached To
Mode
D4574: [web] Hide "Users in parent channel" header for threads without parent in `AddMembersModal`
Attached
Detach File
Event Timeline
Log In to Comment