mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-30 08:10:34 +01:00
Ensure we only select all visible users (#1025)
This commit is contained in:
parent
fd683e9d71
commit
5939d590e3
@ -481,7 +481,7 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
|||||||
TwoFactorYubiKeyComponent,
|
TwoFactorYubiKeyComponent,
|
||||||
UpdateKeyComponent,
|
UpdateKeyComponent,
|
||||||
],
|
],
|
||||||
providers: [DatePipe],
|
providers: [DatePipe, SearchPipe],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
@ -37,6 +37,8 @@ import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserS
|
|||||||
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
|
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
|
||||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||||
|
|
||||||
|
import { SearchPipe } from 'jslib-angular/pipes/search.pipe';
|
||||||
|
|
||||||
import { Utils } from 'jslib-common/misc/utils';
|
import { Utils } from 'jslib-common/misc/utils';
|
||||||
|
|
||||||
import { ModalComponent } from '../../modal.component';
|
import { ModalComponent } from '../../modal.component';
|
||||||
@ -95,7 +97,8 @@ export class PeopleComponent implements OnInit {
|
|||||||
private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService,
|
private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService,
|
||||||
private cryptoService: CryptoService, private userService: UserService, private router: Router,
|
private cryptoService: CryptoService, private userService: UserService, private router: Router,
|
||||||
private storageService: StorageService, private searchService: SearchService,
|
private storageService: StorageService, private searchService: SearchService,
|
||||||
private validationService: ValidationService, private policyService: PolicyService) { }
|
private validationService: ValidationService, private policyService: PolicyService,
|
||||||
|
private searchPipe: SearchPipe) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.parent.parent.params.subscribe(async params => {
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
@ -545,11 +548,14 @@ export class PeopleComponent implements OnInit {
|
|||||||
if (select) {
|
if (select) {
|
||||||
this.selectAll(false);
|
this.selectAll(false);
|
||||||
}
|
}
|
||||||
const selectCount = select && this.users.length > MaxCheckedCount
|
|
||||||
|
const filteredUsers = this.searchPipe.transform(this.users, this.searchText, 'name', 'email', 'id');
|
||||||
|
|
||||||
|
const selectCount = select && filteredUsers.length > MaxCheckedCount
|
||||||
? MaxCheckedCount
|
? MaxCheckedCount
|
||||||
: this.users.length;
|
: filteredUsers.length;
|
||||||
for (let i = 0; i < selectCount; i++) {
|
for (let i = 0; i < selectCount; i++) {
|
||||||
this.checkUser(this.users[i], select);
|
this.checkUser(filteredUsers[i], select);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user