Web: Accounts: Hotkeys: Groups: added selectAll action

This commit is contained in:
Nikita Gopienko 2024-06-05 14:08:17 +03:00
parent 80d1b1f378
commit f078c29e36
5 changed files with 16 additions and 3 deletions

View File

@ -582,7 +582,6 @@ const InsideGroupTableRow = (props) => {
color={sideInfoColor}
onClick={onEmailClick}
isTextOverflow
enableUserSelect
dir="auto"
>
{email}

View File

@ -585,7 +585,6 @@ const PeopleTableRow = (props) => {
color={sideInfoColor}
onClick={onEmailClick}
isTextOverflow
enableUserSelect
dir="auto"
>
{email}

View File

@ -144,7 +144,6 @@ export default inject(({ peopleStore }) => {
setSelection: setPeopleSelection,
setBufferSelection: setPeopleBufferSelection,
selectUser,
selectAll,
} = peopleStore.selectionStore;
const {
@ -161,6 +160,8 @@ export default inject(({ peopleStore }) => {
activateHotkeys,
setHotkeyCaretStart,
setHotkeyCaret,
selectAll,
deselectAll,
} = peopleStore.accountsHotkeysStore;

View File

@ -218,6 +218,14 @@ class AccountsHotkeysStore {
setSelected("none");
};
selectAll = () => {
const { selectAll } = this.isAccountsPage
? this.peopleStore.selectionStore
: this.peopleStore.groupsStore;
selectAll();
};
activateHotkeys = (e: KeyboardEvent) => {
const infiniteLoaderComponent = document.getElementsByClassName(
"ReactVirtualized__List",

View File

@ -365,6 +365,12 @@ class GroupsStore {
return selected;
};
selectAll = () => {
this.bufferSelection = null;
if (this.groups?.length) this.setSelection(this.groups);
};
getGroupsBySelected = (selected: "all" | "none") => {
if (selected === "all" && this.groups) return [...this.groups];
return [];