1
0
mirror of https://github.com/bitwarden/web synced 2026-01-19 08:54:06 +00:00

Apply Prettier (#1347)

This commit is contained in:
Oscar Hinton
2021-12-17 15:57:11 +01:00
committed by GitHub
parent 2b0a9d995e
commit 56477eb39c
414 changed files with 33390 additions and 26857 deletions

View File

@@ -1,50 +1,46 @@
import {
Component,
Input,
} from '@angular/core';
import { Component, Input } from "@angular/core";
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { OrganizationUserBulkRequest } from 'jslib-common/models/request/organizationUserBulkRequest';
import { ApiService } from "jslib-common/abstractions/api.service";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { OrganizationUserBulkRequest } from "jslib-common/models/request/organizationUserBulkRequest";
import { BulkUserDetails } from './bulk-status.component';
import { BulkUserDetails } from "./bulk-status.component";
@Component({
selector: 'app-bulk-remove',
templateUrl: 'bulk-remove.component.html',
selector: "app-bulk-remove",
templateUrl: "bulk-remove.component.html",
})
export class BulkRemoveComponent {
@Input() organizationId: string;
@Input() users: BulkUserDetails[];
@Input() organizationId: string;
@Input() users: BulkUserDetails[];
statuses: Map<string, string> = new Map();
statuses: Map<string, string> = new Map();
loading: boolean = false;
done: boolean = false;
error: string;
loading: boolean = false;
done: boolean = false;
error: string;
constructor(protected apiService: ApiService, protected i18nService: I18nService) {}
constructor(protected apiService: ApiService, protected i18nService: I18nService) { }
async submit() {
this.loading = true;
try {
const response = await this.deleteUsers();
async submit() {
this.loading = true;
try {
const response = await this.deleteUsers();
response.data.forEach(entry => {
const error = entry.error !== '' ? entry.error : this.i18nService.t('bulkRemovedMessage');
this.statuses.set(entry.id, error);
});
this.done = true;
} catch (e) {
this.error = e.message;
}
this.loading = false;
response.data.forEach((entry) => {
const error = entry.error !== "" ? entry.error : this.i18nService.t("bulkRemovedMessage");
this.statuses.set(entry.id, error);
});
this.done = true;
} catch (e) {
this.error = e.message;
}
protected async deleteUsers() {
const request = new OrganizationUserBulkRequest(this.users.map(user => user.id));
return await this.apiService.deleteManyOrganizationUsers(this.organizationId, request);
}
this.loading = false;
}
protected async deleteUsers() {
const request = new OrganizationUserBulkRequest(this.users.map((user) => user.id));
return await this.apiService.deleteManyOrganizationUsers(this.organizationId, request);
}
}