Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3300747
D10747.id37192.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10747.id37192.diff
View Options
diff --git a/web/settings/relationship/add-users-list.react.js b/web/settings/relationship/add-users-list.react.js
--- a/web/settings/relationship/add-users-list.react.js
+++ b/web/settings/relationship/add-users-list.react.js
@@ -133,26 +133,43 @@
return { color: 'var(--link-background-secondary-default)' };
}, [pendingUsersToAdd.size]);
+ const clearAllButton = React.useMemo(() => {
+ if (searchText.length > 0) {
+ return null;
+ }
+
+ return (
+ <Button
+ variant="text"
+ buttonColor={clearAllButtonColor}
+ onClick={onClickClearAll}
+ disabled={pendingUsersToAdd.size === 0}
+ >
+ Clear all
+ </Button>
+ );
+ }, [
+ clearAllButtonColor,
+ onClickClearAll,
+ pendingUsersToAdd.size,
+ searchText.length,
+ ]);
+
const listHeader = React.useMemo(() => {
let selectionText = 'Select users';
- if (pendingUsersToAdd.size > 0) {
+ if (searchText.length > 0) {
+ selectionText = 'Search results:';
+ } else if (pendingUsersToAdd.size > 0) {
selectionText = `${pendingUsersToAdd.size} selected`;
}
return (
<div className={css.listHeaderContainer}>
<div className={css.selectionText}>{selectionText}</div>
- <Button
- variant="text"
- buttonColor={clearAllButtonColor}
- onClick={onClickClearAll}
- disabled={pendingUsersToAdd.size === 0}
- >
- Clear all
- </Button>
+ {clearAllButton}
</div>
);
- }, [clearAllButtonColor, onClickClearAll, pendingUsersToAdd.size]);
+ }, [clearAllButton, pendingUsersToAdd.size, searchText.length]);
let errors;
if (errorMessage) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 9:37 PM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535753
Default Alt Text
D10747.id37192.diff (1 KB)
Attached To
Mode
D10747: [web] update add user list header based on if searching users
Attached
Detach File
Event Timeline
Log In to Comment