1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Bulk confirm (#987)

* Add bulk confirm

* Add confirmation modal to the other bulk actions

* Add spinner to bulk status to let the user know something is going on

* Fix linting

* Add await before reloading users

* Close modal on error

* Bump jslib
This commit is contained in:
Oscar Hinton
2021-05-25 19:24:09 +02:00
committed by GitHub
parent d566c963c1
commit d31130b79f
10 changed files with 285 additions and 84 deletions

View File

@@ -8,12 +8,9 @@ import {
import { ConstantsService } from 'jslib/services/constants.service';
import { ApiService } from 'jslib/abstractions/api.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
import { StorageService } from 'jslib/abstractions/storage.service';
import { Utils } from 'jslib/misc/utils';
@Component({
selector: 'app-user-confirm',
templateUrl: 'user-confirm.component.html',
@@ -23,22 +20,18 @@ export class UserConfirmComponent implements OnInit {
@Input() userId: string;
@Input() organizationUserId: string;
@Input() organizationId: string;
@Input() publicKey: Uint8Array;
@Output() onConfirmedUser = new EventEmitter();
dontAskAgain = false;
loading = true;
fingerprint: string;
private publicKey: Uint8Array = null;
constructor(private apiService: ApiService, private cryptoService: CryptoService,
private storageService: StorageService) { }
constructor(private cryptoService: CryptoService, private storageService: StorageService) { }
async ngOnInit() {
try {
const publicKeyResponse = await this.apiService.getUserPublicKey(this.userId);
if (publicKeyResponse != null) {
this.publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey);
if (this.publicKey != null) {
const fingerprint = await this.cryptoService.getFingerprint(this.userId, this.publicKey.buffer);
if (fingerprint != null) {
this.fingerprint = fingerprint.join('-');
@@ -57,6 +50,6 @@ export class UserConfirmComponent implements OnInit {
await this.storageService.save(ConstantsService.autoConfirmFingerprints, true);
}
this.onConfirmedUser.emit(this.publicKey);
this.onConfirmedUser.emit();
}
}