1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

[deps] Autofill: Update prettier to v3 (#7014)

* [deps] Autofill: Update prettier to v3

* prettier formatting updates

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
renovate[bot]
2023-11-29 16:15:20 -05:00
committed by GitHub
parent 4ff5f38e89
commit 28de9439be
1145 changed files with 5898 additions and 5612 deletions

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />

View File

@@ -124,8 +124,11 @@ h2 {
@font-face {
font-family: "bwi-font";
src: url(../images/bwi-font.svg) format("svg"), url(../fonts/bwi-font.ttf) format("truetype"),
url(../fonts/bwi-font.woff) format("woff"), url(../fonts/bwi-font.woff2) format("woff2");
src:
url(../images/bwi-font.svg) format("svg"),
url(../fonts/bwi-font.ttf) format("truetype"),
url(../fonts/bwi-font.woff) format("woff"),
url(../fonts/bwi-font.woff2) format("woff2");
font-weight: normal;
font-style: normal;
font-display: block;

View File

@@ -32,7 +32,7 @@ export abstract class BaseEventsComponent {
protected exportService: EventExportService,
protected platformUtilsService: PlatformUtilsService,
protected logService: LogService,
protected fileDownloadService: FileDownloadService
protected fileDownloadService: FileDownloadService,
) {
const defaultDates = this.eventService.getDefaultDateFilters();
this.start = defaultDates[0];
@@ -79,7 +79,7 @@ export abstract class BaseEventsComponent {
const promise = this.loadAndParseEvents(
dates[0],
dates[1],
clearExisting ? null : this.continuationToken
clearExisting ? null : this.continuationToken,
);
if (clearExisting) {
this.refreshPromise = promise;
@@ -108,14 +108,14 @@ export abstract class BaseEventsComponent {
protected abstract requestEvents(
startDate: string,
endDate: string,
continuationToken: string
continuationToken: string,
): Promise<ListResponse<EventResponse>>;
protected abstract getUserName(r: EventResponse, userId: string): { name: string; email: string };
protected async loadAndParseEvents(
startDate: string,
endDate: string,
continuationToken: string
continuationToken: string,
) {
const response = await this.requestEvents(startDate, endDate, continuationToken);
@@ -141,7 +141,7 @@ export abstract class BaseEventsComponent {
systemUser: r.systemUser,
serviceAccountId: r.serviceAccountId,
});
})
}),
);
return { continuationToken: response.continuationToken, events: events };
}
@@ -154,7 +154,7 @@ export abstract class BaseEventsComponent {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("invalidDateRange")
this.i18nService.t("invalidDateRange"),
);
return null;
}

View File

@@ -31,7 +31,7 @@ const MaxCheckedCount = 500;
@Directive()
export abstract class BasePeopleComponent<
UserType extends ProviderUserUserDetailsResponse | OrganizationUserView
UserType extends ProviderUserUserDetailsResponse | OrganizationUserView,
> {
@ViewChild("confirmTemplate", { read: ViewContainerRef, static: true })
confirmModalRef: ViewContainerRef;
@@ -110,7 +110,7 @@ export abstract class BasePeopleComponent<
private searchPipe: SearchPipe,
protected userNamePipe: UserNamePipe,
protected stateService: StateService,
protected dialogService: DialogService
protected dialogService: DialogService,
) {}
abstract edit(user: UserType): void;
@@ -138,8 +138,8 @@ export abstract class BasePeopleComponent<
this.allUsers.sort(
Utils.getSortFunction<ProviderUserUserDetailsResponse | OrganizationUserView>(
this.i18nService,
"email"
)
"email",
),
);
this.allUsers.forEach((u) => {
if (!this.statusMap.has(u.status)) {
@@ -178,7 +178,7 @@ export abstract class BasePeopleComponent<
}
if (this.users.length > pagedLength) {
this.pagedUsers = this.pagedUsers.concat(
this.users.slice(pagedLength, pagedLength + pagedSize)
this.users.slice(pagedLength, pagedLength + pagedSize),
);
}
this.pagedUsersCount = this.pagedUsers.length;
@@ -199,7 +199,7 @@ export abstract class BasePeopleComponent<
this.searchText,
"name",
"email",
"id"
"id",
);
const selectCount =
@@ -238,7 +238,7 @@ export abstract class BasePeopleComponent<
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("removedUserId", this.userNamePipe.transform(user))
this.i18nService.t("removedUserId", this.userNamePipe.transform(user)),
);
this.removeUser(user);
} catch (e) {
@@ -269,7 +269,7 @@ export abstract class BasePeopleComponent<
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("revokedUserId", this.userNamePipe.transform(user))
this.i18nService.t("revokedUserId", this.userNamePipe.transform(user)),
);
await this.load();
} catch (e) {
@@ -285,7 +285,7 @@ export abstract class BasePeopleComponent<
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("restoredUserId", this.userNamePipe.transform(user))
this.i18nService.t("restoredUserId", this.userNamePipe.transform(user)),
);
await this.load();
} catch (e) {
@@ -305,7 +305,7 @@ export abstract class BasePeopleComponent<
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("hasBeenReinvited", this.userNamePipe.transform(user))
this.i18nService.t("hasBeenReinvited", this.userNamePipe.transform(user)),
);
} catch (e) {
this.validationService.showError(e);
@@ -331,7 +331,7 @@ export abstract class BasePeopleComponent<
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("hasBeenConfirmed", this.userNamePipe.transform(user))
this.i18nService.t("hasBeenConfirmed", this.userNamePipe.transform(user)),
);
} catch (e) {
this.validationService.showError(e);
@@ -368,7 +368,7 @@ export abstract class BasePeopleComponent<
this.logService.error(e);
}
});
}
},
);
return;
}

View File

@@ -33,7 +33,7 @@
>
<div class="tw-px-5 tw-py-2">
<i class="bwi bwi-exclamation-triangle" aria-hidden="true"></i>
{{ "accessingUsingProvider" | i18n : activeOrganization.providerName }}
{{ "accessingUsingProvider" | i18n: activeOrganization.providerName }}
</div>
</div>
</div>

View File

@@ -14,7 +14,10 @@ import { Utils } from "@bitwarden/common/platform/misc/utils";
templateUrl: "organization-switcher.component.html",
})
export class OrganizationSwitcherComponent implements OnInit {
constructor(private organizationService: OrganizationService, private i18nService: I18nService) {}
constructor(
private organizationService: OrganizationService,
private i18nService: I18nService,
) {}
@Input() activeOrganization: Organization = null;
organizations$: Observable<Organization[]>;
@@ -24,7 +27,7 @@ export class OrganizationSwitcherComponent implements OnInit {
async ngOnInit() {
this.organizations$ = this.organizationService.memberOrganizations$.pipe(
canAccessAdmin(this.i18nService),
map((orgs) => orgs.sort(Utils.getSortFunction(this.i18nService, "name")))
map((orgs) => orgs.sort(Utils.getSortFunction(this.i18nService, "name"))),
);
this.loaded = true;

View File

@@ -23,7 +23,7 @@ export class GroupService {
"/organizations/" + orgId + "/groups/" + groupId + "/details",
null,
true,
true
true,
);
return GroupView.fromResponse(new GroupDetailsResponse(r));
@@ -35,7 +35,7 @@ export class GroupService {
"/organizations/" + orgId + "/groups",
null,
true,
true
true,
);
const listResponse = new ListResponse(r, GroupDetailsResponse);
@@ -56,7 +56,7 @@ export class InternalGroupService extends GroupService {
"/organizations/" + orgId + "/groups/" + groupId,
null,
true,
false
false,
);
}
@@ -66,7 +66,7 @@ export class InternalGroupService extends GroupService {
"/organizations/" + orgId + "/groups",
new OrganizationGroupBulkRequest(groupIds),
true,
true
true,
);
}
@@ -76,7 +76,7 @@ export class InternalGroupService extends GroupService {
request.accessAll = group.accessAll;
request.users = group.members;
request.collections = group.collections.map(
(c) => new SelectionReadOnlyRequest(c.id, c.readOnly, c.hidePasswords, c.manage)
(c) => new SelectionReadOnlyRequest(c.id, c.readOnly, c.hidePasswords, c.manage),
);
if (group.id == undefined) {
@@ -92,7 +92,7 @@ export class InternalGroupService extends GroupService {
"/organizations/" + organizationId + "/groups",
request,
true,
true
true,
);
return GroupView.fromResponse(new GroupResponse(r));
}
@@ -100,14 +100,14 @@ export class InternalGroupService extends GroupService {
private async putGroup(
organizationId: string,
id: string,
request: GroupRequest
request: GroupRequest,
): Promise<GroupView> {
const r = await this.apiService.send(
"PUT",
"/organizations/" + organizationId + "/groups/" + id,
request,
true,
true
true,
);
return GroupView.fromResponse(new GroupResponse(r));
}

View File

@@ -16,14 +16,14 @@ export class UserAdminService {
async get(
organizationId: string,
organizationUserId: string
organizationUserId: string,
): Promise<OrganizationUserAdminView | undefined> {
const userResponse = await this.organizationUserService.getOrganizationUser(
organizationId,
organizationUserId,
{
includeGroups: true,
}
},
);
if (userResponse == null) {
@@ -62,7 +62,7 @@ export class UserAdminService {
private async decryptMany(
organizationId: string,
users: OrganizationUserDetailsResponse[]
users: OrganizationUserDetailsResponse[],
): Promise<OrganizationUserAdminView[]> {
const promises = users.map(async (u) => {
const view = new OrganizationUserAdminView();

View File

@@ -13,7 +13,7 @@ export class IsPaidOrgGuard implements CanActivate {
private router: Router,
private organizationService: OrganizationService,
private messagingService: MessagingService,
private dialogService: DialogService
private dialogService: DialogService,
) {}
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {

View File

@@ -23,7 +23,7 @@ const orgFactory = (props: Partial<Organization> = {}) =>
enabled: true,
type: OrganizationUserType.Admin,
},
props
props,
);
describe("Organization Permissions Guard", () => {
@@ -52,7 +52,7 @@ describe("Organization Permissions Guard", () => {
organizationService,
mock<PlatformUtilsService>(),
mock<I18nService>(),
mock<SyncService>()
mock<SyncService>(),
);
});

View File

@@ -19,7 +19,7 @@ export class OrganizationPermissionsGuard implements CanActivate {
private organizationService: OrganizationService,
private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService,
private syncService: SyncService
private syncService: SyncService,
) {}
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
@@ -37,7 +37,7 @@ export class OrganizationPermissionsGuard implements CanActivate {
this.platformUtilsService.showToast(
"error",
null,
this.i18nService.t("organizationIsDisabled")
this.i18nService.t("organizationIsDisabled"),
);
return this.router.createUrlTree(["/"]);
}

View File

@@ -10,7 +10,10 @@ import {
providedIn: "root",
})
export class OrganizationRedirectGuard implements CanActivate {
constructor(private router: Router, private organizationService: OrganizationService) {}
constructor(
private router: Router,
private organizationService: OrganizationService,
) {}
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const org = this.organizationService.get(route.params.organizationId);

View File

@@ -23,7 +23,10 @@ export class OrganizationLayoutComponent implements OnInit, OnDestroy {
private _destroy = new Subject<void>();
constructor(private route: ActivatedRoute, private organizationService: OrganizationService) {}
constructor(
private route: ActivatedRoute,
private organizationService: OrganizationService,
) {}
ngOnInit() {
document.body.classList.remove("layout_frontend");
@@ -36,7 +39,7 @@ export class OrganizationLayoutComponent implements OnInit, OnDestroy {
return this.organizationService.organizations$
.pipe(takeUntil(this._destroy))
.pipe(getOrganizationById(id));
})
}),
);
}

View File

@@ -54,7 +54,7 @@
</ng-container>
<ng-template body let-rows$>
<tr bitRow *ngFor="let r of rows$ | async">
<td bitCell>{{ r.date | date : "medium" }}</td>
<td bitCell>{{ r.date | date: "medium" }}</td>
<td bitCell>
<i
class="tw-text-muted bwi bwi-lg {{ r.appIcon }}"

View File

@@ -62,7 +62,7 @@ export class EntityEventsComponent implements OnInit {
private logService: LogService,
private organizationUserService: OrganizationUserService,
private formBuilder: FormBuilder,
private validationService: ValidationService
private validationService: ValidationService,
) {}
async ngOnInit() {
@@ -106,13 +106,13 @@ export class EntityEventsComponent implements OnInit {
try {
dates = this.eventService.formatDateFilters(
this.filterFormGroup.value.start,
this.filterFormGroup.value.end
this.filterFormGroup.value.end,
);
} catch (e) {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("invalidDateRange")
this.i18nService.t("invalidDateRange"),
);
return;
}
@@ -124,7 +124,7 @@ export class EntityEventsComponent implements OnInit {
this.params.entityId,
dates[0],
dates[1],
clearExisting ? null : this.continuationToken
clearExisting ? null : this.continuationToken,
);
} else if (this.params.entity === "user") {
response = await this.apiService.getEventsOrganizationUser(
@@ -132,14 +132,14 @@ export class EntityEventsComponent implements OnInit {
this.params.entityId,
dates[0],
dates[1],
clearExisting ? null : this.continuationToken
clearExisting ? null : this.continuationToken,
);
} else {
response = await this.apiService.getEventsCipher(
this.params.entityId,
dates[0],
dates[1],
clearExisting ? null : this.continuationToken
clearExisting ? null : this.continuationToken,
);
}
@@ -168,7 +168,7 @@ export class EntityEventsComponent implements OnInit {
systemUser: r.systemUser,
serviceAccountId: r.serviceAccountId,
});
})
}),
);
if (!clearExisting && this.dataSource.data != null && this.dataSource.data.length > 0) {
@@ -186,7 +186,7 @@ export class EntityEventsComponent implements OnInit {
*/
export const openEntityEventsDialog = (
dialogService: DialogService,
config: DialogConfig<EntityEventsDialogParams>
config: DialogConfig<EntityEventsDialogParams>,
) => {
return dialogService.open<void, EntityEventsDialogParams>(EntityEventsComponent, config);
};

View File

@@ -77,7 +77,7 @@
</ng-container>
<ng-template body>
<tr bitRow *ngFor="let e of events" alignContent="top">
<td bitCell class="tw-whitespace-nowrap">{{ e.date | date : "medium" }}</td>
<td bitCell class="tw-whitespace-nowrap">{{ e.date | date: "medium" }}</td>
<td bitCell>
<span title="{{ e.appName }}, {{ e.ip }}">{{ e.appName }}</span>
</td>

View File

@@ -49,7 +49,7 @@ export class EventsComponent extends BaseEventsComponent implements OnInit, OnDe
private organizationService: OrganizationService,
private organizationUserService: OrganizationUserService,
private providerService: ProviderService,
fileDownloadService: FileDownloadService
fileDownloadService: FileDownloadService,
) {
super(
eventService,
@@ -57,7 +57,7 @@ export class EventsComponent extends BaseEventsComponent implements OnInit, OnDe
exportService,
platformUtilsService,
logService,
fileDownloadService
fileDownloadService,
);
}
@@ -73,7 +73,7 @@ export class EventsComponent extends BaseEventsComponent implements OnInit, OnDe
}
await this.load();
}),
takeUntil(this.destroy$)
takeUntil(this.destroy$),
)
.subscribe();
}
@@ -93,7 +93,7 @@ export class EventsComponent extends BaseEventsComponent implements OnInit, OnDe
(await this.providerService.get(this.organization.providerId)).canManageUsers
) {
const providerUsersResponse = await this.apiService.getProviderUsers(
this.organization.providerId
this.organization.providerId,
);
providerUsersResponse.data.forEach((u) => {
const name = this.userNamePipe.transform(u);
@@ -117,7 +117,7 @@ export class EventsComponent extends BaseEventsComponent implements OnInit, OnDe
this.organizationId,
startDate,
endDate,
continuationToken
continuationToken,
);
}

View File

@@ -21,7 +21,7 @@
<bit-form-field>
<bit-label>{{ "name" | i18n }}</bit-label>
<input bitInput appAutofocus type="text" formControlName="name" />
<bit-hint>{{ "characterMaximum" | i18n : 100 }}</bit-hint>
<bit-hint>{{ "characterMaximum" | i18n: 100 }}</bit-hint>
</bit-form-field>
<bit-form-field>
<bit-label>{{ "externalId" | i18n }}</bit-label>

View File

@@ -67,11 +67,11 @@ export enum GroupAddEditDialogResultType {
*/
export const openGroupAddEditDialog = (
dialogService: DialogService,
config: DialogConfig<GroupAddEditDialogParams>
config: DialogConfig<GroupAddEditDialogParams>,
) => {
return dialogService.open<GroupAddEditDialogResultType, GroupAddEditDialogParams>(
GroupAddEditComponent,
config
config,
);
};
@@ -82,7 +82,7 @@ export const openGroupAddEditDialog = (
export class GroupAddEditComponent implements OnInit, OnDestroy {
protected flexibleCollectionsEnabled$ = this.configService.getFeatureFlag$(
FeatureFlag.FlexibleCollections,
false
false,
);
protected PermissionMode = PermissionMode;
@@ -120,9 +120,9 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
return from(
this.collectionService.decryptMany(
response.data.map(
(r) => new Collection(new CollectionData(r as CollectionDetailsResponse))
)
)
(r) => new Collection(new CollectionData(r as CollectionDetailsResponse)),
),
),
);
}),
map((collections) =>
@@ -131,8 +131,8 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
type: AccessItemType.Collection,
labelName: c.name,
listName: c.name,
}))
)
})),
),
);
}
@@ -147,8 +147,8 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
listName: m.name?.length > 0 ? `${m.name} (${m.email})` : m.email,
labelName: m.name || m.email,
status: m.status,
}))
)
})),
),
);
}
@@ -172,7 +172,7 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
this.logService.error(e.toString());
}
return of(undefined);
})
}),
);
}
@@ -189,7 +189,7 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
private formBuilder: FormBuilder,
private changeDetectorRef: ChangeDetectorRef,
private dialogService: DialogService,
private configService: ConfigServiceAbstraction
private configService: ConfigServiceAbstraction,
) {
this.tabIndex = params.initialTab ?? GroupAddEditTabType.Info;
}
@@ -243,7 +243,7 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"error",
null,
this.i18nService.t("fieldOnTabRequiresAttention", this.i18nService.t("groupInfo"))
this.i18nService.t("fieldOnTabRequiresAttention", this.i18nService.t("groupInfo")),
);
}
return;
@@ -267,7 +267,7 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t(this.editMode ? "editedGroupId" : "createdGroupId", formValue.name)
this.i18nService.t(this.editMode ? "editedGroupId" : "createdGroupId", formValue.name),
);
this.dialogRef.close(GroupAddEditDialogResultType.Saved);
@@ -292,7 +292,7 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("deletedGroupId", this.group.name)
this.i18nService.t("deletedGroupId", this.group.name),
);
this.dialogRef.close(GroupAddEditDialogResultType.Deleted);
};

View File

@@ -130,7 +130,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
private searchService: SearchService,
private logService: LogService,
private collectionService: CollectionService,
private searchPipe: SearchPipe
private searchPipe: SearchPipe,
) {}
async ngOnInit() {
@@ -141,13 +141,13 @@ export class GroupsComponent implements OnInit, OnDestroy {
combineLatest([
// collectionMap
from(this.apiService.getCollections(this.organizationId)).pipe(
concatMap((response) => this.toCollectionMap(response))
concatMap((response) => this.toCollectionMap(response)),
),
// groups
this.refreshGroups$.pipe(
switchMap(() => this.groupService.getAll(this.organizationId))
switchMap(() => this.groupService.getAll(this.organizationId)),
),
])
]),
),
map(([collectionMap, groups]) => {
return groups
@@ -162,7 +162,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
.sort(this.i18nService.collator?.compare),
}));
}),
takeUntil(this.destroy$)
takeUntil(this.destroy$),
)
.subscribe((groups) => {
this.groups = groups;
@@ -177,7 +177,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
concatMap(async (qParams) => {
this.searchText = qParams.search;
}),
takeUntil(this.destroy$)
takeUntil(this.destroy$),
)
.subscribe();
}
@@ -198,7 +198,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
}
if (this.groups.length > pagedLength) {
this.pagedGroups = this.pagedGroups.concat(
this.groups.slice(pagedLength, pagedLength + pagedSize)
this.groups.slice(pagedLength, pagedLength + pagedSize),
);
}
this.pagedGroupsCount = this.pagedGroups.length;
@@ -207,7 +207,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
async edit(
group: GroupDetailsRow,
startingTabIndex: GroupAddEditTabType = GroupAddEditTabType.Info
startingTabIndex: GroupAddEditTabType = GroupAddEditTabType.Info,
) {
const dialogRef = openGroupAddEditDialog(this.dialogService, {
data: {
@@ -245,7 +245,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("deletedGroupId", groupRow.details.name)
this.i18nService.t("deletedGroupId", groupRow.details.name),
);
this.removeGroup(groupRow.details.id);
} catch (e) {
@@ -276,12 +276,12 @@ export class GroupsComponent implements OnInit, OnDestroy {
try {
await this.groupService.deleteMany(
this.organizationId,
groupsToDelete.map((g) => g.details.id)
groupsToDelete.map((g) => g.details.id),
);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("deletedManyGroups", groupsToDelete.length.toString())
this.i18nService.t("deletedManyGroups", groupsToDelete.length.toString()),
);
groupsToDelete.forEach((g) => this.removeGroup(g.details.id));
@@ -326,7 +326,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
private async toCollectionMap(response: ListResponse<CollectionResponse>) {
const collections = response.data.map(
(r) => new Collection(new CollectionData(r as CollectionDetailsResponse))
(r) => new Collection(new CollectionData(r as CollectionDetailsResponse)),
);
const decryptedCollections = await this.collectionService.decryptMany(collections);
@@ -344,7 +344,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
this.groups,
this.searchText,
(group) => group.details.name,
(group) => group.details.id
(group) => group.details.id,
);
}
}

View File

@@ -22,7 +22,7 @@ export class UserConfirmComponent implements OnInit {
constructor(
private cryptoService: CryptoService,
private logService: LogService,
private stateService: StateService
private stateService: StateService,
) {}
async ngOnInit() {

View File

@@ -33,7 +33,7 @@ export class BulkConfirmComponent implements OnInit {
protected cryptoService: CryptoService,
protected apiService: ApiService,
private organizationUserService: OrganizationUserService,
private i18nService: I18nService
private i18nService: I18nService,
) {}
async ngOnInit() {
@@ -95,7 +95,7 @@ export class BulkConfirmComponent implements OnInit {
protected async getPublicKeys() {
return await this.organizationUserService.postOrganizationUsersPublicKey(
this.organizationId,
this.filteredUsers.map((user) => user.id)
this.filteredUsers.map((user) => user.id),
);
}
@@ -107,7 +107,7 @@ export class BulkConfirmComponent implements OnInit {
const request = new OrganizationUserBulkConfirmRequest(userIdsWithKeys);
return await this.organizationUserService.postOrganizationUserBulkConfirm(
this.organizationId,
request
request,
);
}
}

View File

@@ -23,7 +23,7 @@ export class BulkEnableSecretsManagerDialogComponent implements OnInit {
@Inject(DIALOG_DATA) private data: BulkEnableSecretsManagerDialogData,
private organizationUserService: OrganizationUserService,
private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService
private i18nService: I18nService,
) {}
ngOnInit(): void {
@@ -33,12 +33,12 @@ export class BulkEnableSecretsManagerDialogComponent implements OnInit {
submit = async () => {
await this.organizationUserService.putOrganizationUserBulkEnableSecretsManager(
this.data.orgId,
this.dataSource.data.map((u) => u.id)
this.dataSource.data.map((u) => u.id),
);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("activatedAccessToSecretsManager")
this.i18nService.t("activatedAccessToSecretsManager"),
);
this.dialogRef.close();
};
@@ -46,7 +46,7 @@ export class BulkEnableSecretsManagerDialogComponent implements OnInit {
static open(dialogService: DialogService, data: BulkEnableSecretsManagerDialogData) {
return dialogService.open<unknown, BulkEnableSecretsManagerDialogData>(
BulkEnableSecretsManagerDialogComponent,
{ data }
{ data },
);
}
}

View File

@@ -33,7 +33,7 @@ export class BulkRemoveComponent {
constructor(
protected apiService: ApiService,
protected i18nService: I18nService,
private organizationUserService: OrganizationUserService
private organizationUserService: OrganizationUserService,
) {}
async submit() {
@@ -56,7 +56,7 @@ export class BulkRemoveComponent {
protected async deleteUsers() {
return await this.organizationUserService.deleteManyOrganizationUsers(
this.organizationId,
this.users.map((user) => user.id)
this.users.map((user) => user.id),
);
}

View File

@@ -32,7 +32,7 @@ export class BulkRestoreRevokeComponent {
constructor(
protected i18nService: I18nService,
private organizationUserService: OrganizationUserService,
@Inject(DIALOG_DATA) protected data: BulkRestoreDialogParams
@Inject(DIALOG_DATA) protected data: BulkRestoreDialogParams,
) {
this.isRevoking = data.isRevoking;
this.organizationId = data.organizationId;
@@ -65,12 +65,12 @@ export class BulkRestoreRevokeComponent {
if (this.isRevoking) {
return await this.organizationUserService.revokeManyOrganizationUsers(
this.organizationId,
userIds
userIds,
);
} else {
return await this.organizationUserService.restoreManyOrganizationUsers(
this.organizationId,
userIds
userIds,
);
}
}

View File

@@ -25,7 +25,7 @@
<input id="emails" type="text" appAutoFocus bitInput formControlName="emails" />
<bit-hint>{{
"inviteMultipleEmailDesc"
| i18n : (organization.planProductType === ProductType.TeamsStarter ? "10" : "20")
| i18n: (organization.planProductType === ProductType.TeamsStarter ? "10" : "20")
}}</bit-hint>
</bit-form-field>
</ng-container>

View File

@@ -71,7 +71,7 @@ export enum MemberDialogResult {
export class MemberDialogComponent implements OnInit, OnDestroy {
protected flexibleCollectionsEnabled$ = this.configService.getFeatureFlag$(
FeatureFlag.FlexibleCollections,
false
false,
);
loading = true;
@@ -145,7 +145,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
private userService: UserAdminService,
private organizationUserService: OrganizationUserService,
private dialogService: DialogService,
private configService: ConfigServiceAbstraction
private configService: ConfigServiceAbstraction,
) {}
async ngOnInit() {
@@ -154,7 +154,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
this.title = this.i18nService.t(this.editMode ? "editMember" : "inviteMember");
const organization$ = of(this.organizationService.get(this.params.organizationId)).pipe(
shareReplay({ refCount: true, bufferSize: 1 })
shareReplay({ refCount: true, bufferSize: 1 }),
);
const groups$ = organization$.pipe(
switchMap((organization) => {
@@ -163,7 +163,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
}
return this.groupService.getAll(this.params.organizationId);
})
}),
);
combineLatest({
@@ -186,12 +186,12 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
this.organization,
this.params.allOrganizationUserEmails,
this.i18nService.t("subscriptionFreePlan", organization.seats)
this.i18nService.t("subscriptionFreePlan", organization.seats),
),
orgWithoutAdditionalSeatLimitReachedWithoutUpgradePathValidator(
this.organization,
this.params.allOrganizationUserEmails,
this.i18nService.t("subscriptionFamiliesPlan", organization.seats)
this.i18nService.t("subscriptionFamiliesPlan", organization.seats),
),
];
@@ -200,11 +200,11 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
emailsControl.updateValueAndValidity();
this.collectionAccessItems = [].concat(
collections.map((c) => mapCollectionToAccessItemView(c))
collections.map((c) => mapCollectionToAccessItemView(c)),
);
this.groupAccessItems = [].concat(
groups.map<AccessItemView>((g) => mapGroupToAccessItemView(g))
groups.map<AccessItemView>((g) => mapGroupToAccessItemView(g)),
);
if (this.params.organizationUserId) {
@@ -252,13 +252,13 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
group.collections.map((accessSelection) => {
const collection = collections.find((c) => c.id === accessSelection.id);
return { group, collection, accessSelection };
})
}),
);
this.collectionAccessItems = this.collectionAccessItems.concat(
collectionsFromGroups.map(({ collection, accessSelection, group }) =>
mapCollectionToAccessItemView(collection, accessSelection, group)
)
mapCollectionToAccessItemView(collection, accessSelection, group),
),
);
const accessSelections = mapToAccessSelections(userDetails);
@@ -328,7 +328,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"info",
null,
this.i18nService.t("accountRecoveryManageUsers")
this.i18nService.t("accountRecoveryManageUsers"),
);
}
}
@@ -341,7 +341,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"error",
null,
this.i18nService.t("fieldOnTabRequiresAttention", this.i18nService.t("role"))
this.i18nService.t("fieldOnTabRequiresAttention", this.i18nService.t("role")),
);
}
return;
@@ -351,7 +351,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"error",
null,
this.i18nService.t("customNonEnterpriseError")
this.i18nService.t("customNonEnterpriseError"),
);
return;
}
@@ -363,7 +363,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
userView.type = this.formGroup.value.type;
userView.permissions = this.setRequestPermissions(
userView.permissions ?? new PermissionsApi(),
userView.type !== OrganizationUserType.Custom
userView.type !== OrganizationUserType.Custom,
);
userView.collections = this.formGroup.value.access
.filter((v) => v.type === AccessItemType.Collection)
@@ -399,7 +399,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t(this.editMode ? "editedUserId" : "invitedUsers", this.params.name)
this.i18nService.t(this.editMode ? "editedUserId" : "invitedUsers", this.params.name),
);
this.close(MemberDialogResult.Saved);
};
@@ -433,13 +433,13 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
await this.organizationUserService.deleteOrganizationUser(
this.params.organizationId,
this.params.organizationUserId
this.params.organizationUserId,
);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("removedUserId", this.params.name)
this.i18nService.t("removedUserId", this.params.name),
);
this.close(MemberDialogResult.Deleted);
};
@@ -470,13 +470,13 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
await this.organizationUserService.revokeOrganizationUser(
this.params.organizationId,
this.params.organizationUserId
this.params.organizationUserId,
);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("revokedUserId", this.params.name)
this.i18nService.t("revokedUserId", this.params.name),
);
this.isRevoked = true;
this.close(MemberDialogResult.Revoked);
@@ -489,13 +489,13 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
await this.organizationUserService.restoreOrganizationUser(
this.params.organizationId,
this.params.organizationUserId
this.params.organizationUserId,
);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("restoredUserId", this.params.name)
this.i18nService.t("restoredUserId", this.params.name),
);
this.isRevoked = false;
this.close(MemberDialogResult.Restored);
@@ -533,7 +533,7 @@ export class MemberDialogComponent implements OnInit, OnDestroy {
function mapCollectionToAccessItemView(
collection: CollectionView,
accessSelection?: CollectionAccessSelectionView,
group?: GroupView
group?: GroupView,
): AccessItemView {
return {
type: AccessItemType.Collection,
@@ -564,7 +564,7 @@ function mapToAccessSelections(user: OrganizationUserAdminView): AccessItemValue
id: selection.id,
type: AccessItemType.Collection,
permission: convertToPermission(selection),
}))
})),
);
}
@@ -576,7 +576,7 @@ function mapToGroupAccessSelections(groups: string[]): AccessItemValue[] {
groups.map((groupId) => ({
id: groupId,
type: AccessItemType.Group,
}))
})),
);
}
@@ -587,7 +587,7 @@ function mapToGroupAccessSelections(groups: string[]): AccessItemValue[] {
*/
export function openUserAddEditDialog(
dialogService: DialogService,
config: DialogConfig<MemberDialogParams>
config: DialogConfig<MemberDialogParams>,
) {
return dialogService.open<MemberDialogResult, MemberDialogParams>(MemberDialogComponent, config);
}

View File

@@ -29,7 +29,7 @@ export class NestedCheckboxComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this.destroy$))
.subscribe((value) => {
Object.values(this.checkboxes.controls).forEach((control) =>
control.setValue(value, { emitEvent: false })
control.setValue(value, { emitEvent: false }),
);
});
}

View File

@@ -14,7 +14,7 @@ const orgFactory = (props: Partial<Organization> = {}) =>
enabled: true,
type: OrganizationUserType.Admin,
},
props
props,
);
describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
@@ -30,7 +30,7 @@ describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
validatorFn = orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
organization,
allOrganizationUserEmails,
"You cannot invite more than 2 members without upgrading your plan."
"You cannot invite more than 2 members without upgrading your plan.",
);
const control = new FormControl("");
@@ -43,7 +43,7 @@ describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
validatorFn = orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
organization,
allOrganizationUserEmails,
"You cannot invite more than 2 members without upgrading your plan."
"You cannot invite more than 2 members without upgrading your plan.",
);
const control = new FormControl(null);
@@ -60,7 +60,7 @@ describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
validatorFn = orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
organization,
allOrganizationUserEmails,
"You cannot invite more than 2 members without upgrading your plan."
"You cannot invite more than 2 members without upgrading your plan.",
);
const control = new FormControl("user2@example.com");
@@ -77,7 +77,7 @@ describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
validatorFn = orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
organization,
allOrganizationUserEmails,
"You cannot invite more than 10 members without upgrading your plan."
"You cannot invite more than 10 members without upgrading your plan.",
);
const control = new FormControl(
"user2@example.com," +
@@ -88,7 +88,7 @@ describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
"user7@example.com," +
"user8@example.com," +
"user9@example.com," +
"user10@example.com"
"user10@example.com",
);
const result = validatorFn(control);
@@ -105,7 +105,7 @@ describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
validatorFn = orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
organization,
allOrganizationUserEmails,
"You cannot invite more than 2 members without upgrading your plan."
"You cannot invite more than 2 members without upgrading your plan.",
);
const control = new FormControl("user2@example.com,user3@example.com");
@@ -123,7 +123,7 @@ describe("orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator", () => {
validatorFn = orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
organization,
allOrganizationUserEmails,
"You cannot invite more than 2 members without upgrading your plan."
"You cannot invite more than 2 members without upgrading your plan.",
);
const result = validatorFn(control);

View File

@@ -14,7 +14,7 @@ import { ProductType } from "@bitwarden/common/enums";
export function orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
organization: Organization,
allOrganizationUserEmails: string[],
errorMessage: string
errorMessage: string,
): ValidatorFn {
return (control: AbstractControl): ValidationErrors | null => {
if (control.value === "" || !control.value) {
@@ -30,10 +30,10 @@ export function orgWithoutAdditionalSeatLimitReachedWithUpgradePathValidator(
newEmailToAdd &&
newEmailToAdd.trim() !== "" &&
!allOrganizationUserEmails.some(
(existingEmail) => existingEmail === newEmailToAdd.trim()
)
)
)
(existingEmail) => existingEmail === newEmailToAdd.trim(),
),
),
),
);
return organization.planProductType === ProductType.Free &&

View File

@@ -14,7 +14,7 @@ import { ProductType } from "@bitwarden/common/enums";
export function orgWithoutAdditionalSeatLimitReachedWithoutUpgradePathValidator(
organization: Organization,
allOrganizationUserEmails: string[],
errorMessage: string
errorMessage: string,
): ValidatorFn {
return (control: AbstractControl): ValidationErrors | null => {
if (control.value === "" || !control.value) {
@@ -30,10 +30,10 @@ export function orgWithoutAdditionalSeatLimitReachedWithoutUpgradePathValidator(
newEmailToAdd &&
newEmailToAdd.trim() !== "" &&
!allOrganizationUserEmails.some(
(existingEmail) => existingEmail === newEmailToAdd.trim()
)
)
)
(existingEmail) => existingEmail === newEmailToAdd.trim(),
),
),
),
);
return (organization.planProductType === ProductType.Families ||

View File

@@ -17,7 +17,7 @@
</div>
<div class="modal-body">
<app-callout type="warning"
>{{ "resetPasswordLoggedOutWarning" | i18n : loggedOutWarningName }}
>{{ "resetPasswordLoggedOutWarning" | i18n: loggedOutWarningName }}
</app-callout>
<auth-password-callout
[policy]="enforcedPolicyOptions"

View File

@@ -57,7 +57,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
private cryptoService: CryptoService,
private logService: LogService,
private organizationUserService: OrganizationUserService,
private dialogService: DialogService
private dialogService: DialogService,
) {}
async ngOnInit() {
@@ -66,7 +66,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this.destroy$))
.subscribe(
(enforcedPasswordPolicyOptions) =>
(this.enforcedPolicyOptions = enforcedPasswordPolicyOptions)
(this.enforcedPolicyOptions = enforcedPasswordPolicyOptions),
);
}
@@ -99,7 +99,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"info",
null,
this.i18nService.t("valueCopied", this.i18nService.t("password"))
this.i18nService.t("valueCopied", this.i18nService.t("password")),
);
}
@@ -109,7 +109,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("masterPasswordRequired")
this.i18nService.t("masterPasswordRequired"),
);
return false;
}
@@ -118,7 +118,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("masterPasswordMinlength", Utils.minimumPasswordLength)
this.i18nService.t("masterPasswordMinlength", Utils.minimumPasswordLength),
);
return false;
}
@@ -128,13 +128,13 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
!this.policyService.evaluateMasterPassword(
this.passwordStrengthResult.score,
this.newPassword,
this.enforcedPolicyOptions
this.enforcedPolicyOptions,
)
) {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("masterPasswordPolicyRequirementsNotMet")
this.i18nService.t("masterPasswordPolicyRequirementsNotMet"),
);
return;
}
@@ -171,7 +171,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
const orgSymKey = await this.cryptoService.getOrgKey(this.organizationId);
const decPrivateKey = await this.cryptoService.decryptToBytes(
new EncString(encryptedPrivateKey),
orgSymKey
orgSymKey,
);
// Decrypt User's Reset Password Key to get UserKey
@@ -183,17 +183,17 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
this.newPassword,
this.email.trim().toLowerCase(),
kdfType,
new KdfConfig(kdfIterations, kdfMemory, kdfParallelism)
new KdfConfig(kdfIterations, kdfMemory, kdfParallelism),
);
const newMasterKeyHash = await this.cryptoService.hashMasterKey(
this.newPassword,
newMasterKey
newMasterKey,
);
// Create new encrypted user key for the User
const newUserKey = await this.cryptoService.encryptUserKeyWithMasterKey(
newMasterKey,
existingUserKey
existingUserKey,
);
// Create request
@@ -205,7 +205,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
return this.organizationUserService.putOrganizationUserResetPassword(
this.organizationId,
this.id,
request
request,
);
});
@@ -213,7 +213,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("resetPasswordSuccess")
this.i18nService.t("resetPasswordSuccess"),
);
this.onPasswordReset.emit();
} catch (e) {

View File

@@ -52,7 +52,7 @@
!loading &&
(isPaging()
? pagedUsers
: (users | search : searchText : 'name' : 'email' : 'id')) as searchedUsers
: (users | search: searchText : 'name' : 'email' : 'id')) as searchedUsers
"
>
<p *ngIf="!searchedUsers.length">{{ "noMembersInList" | i18n }}</p>

View File

@@ -123,7 +123,7 @@ export class PeopleComponent
dialogService: DialogService,
private router: Router,
private groupService: GroupService,
private collectionService: CollectionService
private collectionService: CollectionService,
) {
super(
apiService,
@@ -137,30 +137,30 @@ export class PeopleComponent
searchPipe,
userNamePipe,
stateService,
dialogService
dialogService,
);
}
async ngOnInit() {
const organization$ = this.route.params.pipe(
map((params) => this.organizationService.get(params.organizationId)),
shareReplay({ refCount: true, bufferSize: 1 })
shareReplay({ refCount: true, bufferSize: 1 }),
);
this.canUseSecretsManager$ = organization$.pipe(
map((org) => org.useSecretsManager && flagEnabled("secretsManager"))
map((org) => org.useSecretsManager && flagEnabled("secretsManager")),
);
const policies$ = organization$.pipe(
switchMap((organization) => {
if (organization.isProviderUser) {
return from(this.policyApiService.getPolicies(organization.id)).pipe(
map((response) => this.policyService.mapPoliciesFromToken(response))
map((response) => this.policyService.mapPoliciesFromToken(response)),
);
}
return this.policyService.policies$;
})
}),
);
combineLatest([this.route.queryParams, policies$, organization$])
@@ -178,7 +178,7 @@ export class PeopleComponent
const request = new OrganizationKeysRequest(orgKeys[0], orgKeys[1].encryptedString);
const response = await this.organizationApiService.updateKeys(
this.organization.id,
request
request,
);
if (response != null) {
this.organization.hasPublicAndPrivateKeys =
@@ -204,7 +204,7 @@ export class PeopleComponent
}
}
}),
takeUntil(this.destroy$)
takeUntil(this.destroy$),
)
.subscribe();
}
@@ -270,7 +270,7 @@ export class PeopleComponent
const response = await this.apiService.getCollections(this.organization.id);
const collections = response.data.map(
(r) => new Collection(new CollectionData(r as CollectionDetailsResponse))
(r) => new Collection(new CollectionData(r as CollectionDetailsResponse)),
);
const decryptedCollections = await this.collectionService.decryptMany(collections);
@@ -303,7 +303,7 @@ export class PeopleComponent
await this.organizationUserService.postOrganizationUserConfirm(
this.organization.id,
user.id,
request
request,
);
}
@@ -378,7 +378,7 @@ export class PeopleComponent
private getDialogContent(): string {
return this.i18nService.t(
this.getProductKey(this.organization.planProductType),
this.organization.seats
this.organization.seats,
);
}
@@ -399,7 +399,7 @@ export class PeopleComponent
case ProductType.Free:
await this.router.navigate(
["/organizations", this.organization.id, "billing", "subscription"],
{ queryParams: { upgrade: true } }
{ queryParams: { upgrade: true } },
);
break;
case ProductType.TeamsStarter:
@@ -431,7 +431,7 @@ export class PeopleComponent
this.platformUtilsService.showToast(
"error",
this.i18nService.t("seatLimitReached"),
this.i18nService.t("contactYourProvider")
this.i18nService.t("contactYourProvider"),
);
return;
}
@@ -487,7 +487,7 @@ export class PeopleComponent
(comp) => {
comp.organizationId = this.organization.id;
comp.users = this.getCheckedUsers();
}
},
);
await modal.onClosedPromise();
@@ -529,7 +529,7 @@ export class PeopleComponent
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("noSelectedUsersApplicable")
this.i18nService.t("noSelectedUsersApplicable"),
);
return;
}
@@ -537,13 +537,13 @@ export class PeopleComponent
try {
const response = this.organizationUserService.postManyOrganizationUserReinvite(
this.organization.id,
filteredUsers.map((user) => user.id)
filteredUsers.map((user) => user.id),
);
this.showBulkStatus(
users,
filteredUsers,
response,
this.i18nService.t("bulkReinviteMessage")
this.i18nService.t("bulkReinviteMessage"),
);
} catch (e) {
this.validationService.showError(e);
@@ -562,7 +562,7 @@ export class PeopleComponent
(comp) => {
comp.organizationId = this.organization.id;
comp.users = this.getCheckedUsers();
}
},
);
await modal.onClosedPromise();
@@ -575,7 +575,7 @@ export class PeopleComponent
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("noSelectedUsersApplicable")
this.i18nService.t("noSelectedUsersApplicable"),
);
return;
}
@@ -616,7 +616,7 @@ export class PeopleComponent
modal.close();
this.load();
});
}
},
);
}
@@ -668,14 +668,14 @@ export class PeopleComponent
users: OrganizationUserView[],
filteredUsers: OrganizationUserView[],
request: Promise<ListResponse<OrganizationUserBulkResponse>>,
successfullMessage: string
successfullMessage: string,
) {
const [modal, childComponent] = await this.modalService.openViewRef(
BulkStatusComponent,
this.bulkStatusModalRef,
(comp) => {
comp.loading = true;
}
},
);
// Workaround to handle closing the modal shortly after it has been opened

View File

@@ -45,7 +45,7 @@ const routes: Routes = [
path: "settings",
loadChildren: () =>
import("./settings/organization-settings.module").then(
(m) => m.OrganizationSettingsModule
(m) => m.OrganizationSettingsModule,
),
},
{
@@ -65,14 +65,14 @@ const routes: Routes = [
path: "reporting",
loadChildren: () =>
import("../organizations/reporting/organization-reporting.module").then(
(m) => m.OrganizationReportingModule
(m) => m.OrganizationReportingModule,
),
},
{
path: "billing",
loadChildren: () =>
import("../../billing/organizations/organization-billing.module").then(
(m) => m.OrganizationBillingModule
(m) => m.OrganizationBillingModule,
),
},
],

View File

@@ -40,7 +40,7 @@ export class MasterPasswordPolicyComponent extends BasePolicyComponent {
constructor(
private formBuilder: FormBuilder,
i18nService: I18nService,
private organizationService: OrganizationService
private organizationService: OrganizationService,
) {
super();

View File

@@ -34,7 +34,10 @@ export class PasswordGeneratorPolicyComponent extends BasePolicyComponent {
defaultTypes: { name: string; value: string }[];
constructor(private formBuilder: UntypedFormBuilder, i18nService: I18nService) {
constructor(
private formBuilder: UntypedFormBuilder,
i18nService: I18nService,
) {
super();
this.defaultTypes = [

View File

@@ -37,7 +37,7 @@ export class PoliciesComponent implements OnInit {
private organizationService: OrganizationService,
private policyApiService: PolicyApiServiceAbstraction,
private policyListService: PolicyListService,
private router: Router
private router: Router,
) {}
async ngOnInit() {
@@ -93,7 +93,7 @@ export class PoliciesComponent implements OnInit {
modal.close();
this.load();
});
}
},
);
}
}

View File

@@ -47,7 +47,7 @@ export class PolicyEditComponent {
private platformUtilsService: PlatformUtilsService,
private componentFactoryResolver: ComponentFactoryResolver,
private cdr: ChangeDetectorRef,
private logService: LogService
private logService: LogService,
) {}
async ngAfterViewInit() {
@@ -67,7 +67,7 @@ export class PolicyEditComponent {
try {
this.policyResponse = await this.policyApiService.getPolicy(
this.organizationId,
this.policy.type
this.policy.type,
);
} catch (e) {
if (e.statusCode === 404) {
@@ -91,13 +91,13 @@ export class PolicyEditComponent {
this.formPromise = this.policyApiService.putPolicy(
this.organizationId,
this.policy.type,
request
request,
);
await this.formPromise;
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("editedPolicyId", this.i18nService.t(this.policy.name))
this.i18nService.t("editedPolicyId", this.i18nService.t(this.policy.name)),
);
this.onSavedPolicy.emit();
} catch (e) {

View File

@@ -28,7 +28,10 @@ export class ResetPasswordPolicyComponent extends BasePolicyComponent {
});
showKeyConnectorInfo = false;
constructor(private formBuilder: FormBuilder, private organizationService: OrganizationService) {
constructor(
private formBuilder: FormBuilder,
private organizationService: OrganizationService,
) {
super();
}

View File

@@ -26,13 +26,16 @@ export class SingleOrgPolicyComponent extends BasePolicyComponent {
if (!this.enabled.value) {
if (policiesEnabledMap.get(PolicyType.RequireSso) ?? false) {
throw new Error(
this.i18nService.t("disableRequiredError", this.i18nService.t("requireSso"))
this.i18nService.t("disableRequiredError", this.i18nService.t("requireSso")),
);
}
if (policiesEnabledMap.get(PolicyType.MaximumVaultTimeout) ?? false) {
throw new Error(
this.i18nService.t("disableRequiredError", this.i18nService.t("maximumVaultTimeoutLabel"))
this.i18nService.t(
"disableRequiredError",
this.i18nService.t("maximumVaultTimeoutLabel"),
),
);
}
}

View File

@@ -13,17 +13,20 @@ export class ReportingComponent implements OnInit {
organization$: Observable<Organization>;
showLeftNav$: Observable<boolean>;
constructor(private route: ActivatedRoute, private organizationService: OrganizationService) {}
constructor(
private route: ActivatedRoute,
private organizationService: OrganizationService,
) {}
ngOnInit() {
this.organization$ = this.route.params.pipe(
switchMap((params) => this.organizationService.get$(params.organizationId)),
shareReplay({ refCount: true, bufferSize: 1 })
shareReplay({ refCount: true, bufferSize: 1 }),
);
this.showLeftNav$ = this.organization$.pipe(
map((o) => o.canAccessEventLogs && o.canAccessReports),
startWith(true)
startWith(true),
);
}
}

View File

@@ -19,19 +19,19 @@ export class ReportsHomeComponent implements OnInit {
private route: ActivatedRoute,
private stateService: StateService,
private organizationService: OrganizationService,
private router: Router
private router: Router,
) {}
ngOnInit() {
this.homepage$ = this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
map((event) => (event as NavigationEnd).urlAfterRedirects.endsWith("/reports")),
startWith(true)
startWith(true),
);
this.reports$ = this.route.params.pipe(
map((params) => this.organizationService.get(params.organizationId)),
map((org) => this.buildReports(org.isFreeOrg))
map((org) => this.buildReports(org.isFreeOrg)),
);
}

View File

@@ -43,11 +43,11 @@ export class AccountComponent {
taxFormPromise: Promise<unknown>;
flexibleCollectionsEnabled$ = this.configService.getFeatureFlag$(
FeatureFlag.FlexibleCollections,
false
false,
);
flexibleCollectionsV1Enabled$ = this.configService.getFeatureFlag$(
FeatureFlag.FlexibleCollectionsV1,
false
false,
);
// FormGroup validators taken from server Organization domain object
@@ -57,15 +57,15 @@ export class AccountComponent {
{
validators: [Validators.required, Validators.maxLength(50)],
updateOn: "change",
}
},
),
billingEmail: this.formBuilder.control(
{ value: "", disabled: true },
{ validators: [Validators.required, Validators.email, Validators.maxLength(256)] }
{ validators: [Validators.required, Validators.email, Validators.maxLength(256)] },
),
businessName: this.formBuilder.control(
{ value: "", disabled: true },
{ validators: [Validators.maxLength(50)] }
{ validators: [Validators.maxLength(50)] },
),
});
@@ -93,7 +93,7 @@ export class AccountComponent {
private organizationApiService: OrganizationApiServiceAbstraction,
private dialogService: DialogService,
private formBuilder: FormBuilder,
private configService: ConfigServiceAbstraction
private configService: ConfigServiceAbstraction,
) {}
async ngOnInit() {
@@ -111,7 +111,7 @@ export class AccountComponent {
from(this.organizationApiService.getKeys(organization.id)),
]);
}),
takeUntil(this.destroy$)
takeUntil(this.destroy$),
)
.subscribe(([organization, orgResponse, orgKeys]) => {
// Set domain level organization variables
@@ -198,7 +198,7 @@ export class AccountComponent {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("collectionManagementUpdated")
this.i18nService.t("collectionManagementUpdated"),
);
};
@@ -228,7 +228,7 @@ export class AccountComponent {
comp.keyType = "organization";
comp.entityId = this.organizationId;
comp.postKey = this.organizationApiService.getOrCreateApiKey.bind(
this.organizationApiService
this.organizationApiService,
);
comp.scope = "api.organization";
comp.grantType = "client_credentials";

View File

@@ -3,7 +3,7 @@
<span bitDialogTitle>{{ "deleteOrganization" | i18n }}</span>
<div bitDialogContent>
<app-callout type="warning">{{
"deletingOrganizationIsPermanentWarning" | i18n : organization?.name
"deletingOrganizationIsPermanentWarning" | i18n: organization?.name
}}</app-callout>
<p id="organizationDeleteDescription">
<ng-container
@@ -16,7 +16,7 @@
</ng-container>
<ng-template #regularDelete>
<ng-container *ngIf="organizationContentSummary.totalItemCount > 0">
{{ "deletingOrganizationContentWarning" | i18n : organization?.name }}
{{ "deletingOrganizationContentWarning" | i18n: organization?.name }}
<ul>
<li *ngFor="let type of organizationContentSummary.itemCountByType">
{{ type.count }} {{ type.localizationKey | i18n }}

View File

@@ -93,7 +93,7 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy {
private cipherService: CipherService,
private organizationService: OrganizationService,
private organizationApiService: OrganizationApiServiceAbstraction,
private formBuilder: FormBuilder
private formBuilder: FormBuilder,
) {}
ngOnDestroy(): void {
@@ -124,7 +124,7 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
this.i18nService.t("organizationDeleted"),
this.i18nService.t("organizationDeletedDesc")
this.i18nService.t("organizationDeletedDesc"),
);
this.dialogRef.close(DeleteOrganizationDialogResult.Deleted);
};
@@ -144,8 +144,8 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy {
organizationContentSummary.itemCountByType.push(
new OrganizationContentSummaryItem(
count,
this.getOrganizationItemLocalizationKeysByType(CipherType[cipherType])
)
this.getOrganizationItemLocalizationKeysByType(CipherType[cipherType]),
),
);
}
}
@@ -169,10 +169,10 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy {
*/
export function openDeleteOrganizationDialog(
dialogService: DialogService,
config: DialogConfig<DeleteOrganizationDialogParams>
config: DialogConfig<DeleteOrganizationDialogParams>,
) {
return dialogService.open<DeleteOrganizationDialogResult, DeleteOrganizationDialogParams>(
DeleteOrganizationDialogComponent,
config
config,
);
}

View File

@@ -50,7 +50,7 @@ const routes: Routes = [
path: "import",
loadComponent: () =>
import("../../../tools/import/import-web.component").then(
(mod) => mod.ImportWebComponent
(mod) => mod.ImportWebComponent,
),
canActivate: [OrganizationPermissionsGuard],
data: {
@@ -62,7 +62,7 @@ const routes: Routes = [
path: "export",
loadChildren: () =>
import("../tools/vault-export/org-vault-export.module").then(
(m) => m.OrganizationVaultExportModule
(m) => m.OrganizationVaultExportModule,
),
},
],

View File

@@ -14,11 +14,14 @@ export class SettingsComponent implements OnInit {
organization$: Observable<Organization>;
FeatureFlag = FeatureFlag;
constructor(private route: ActivatedRoute, private organizationService: OrganizationService) {}
constructor(
private route: ActivatedRoute,
private organizationService: OrganizationService,
) {}
ngOnInit() {
this.organization$ = this.route.params.pipe(
switchMap((params) => this.organizationService.get$(params.organizationId))
switchMap((params) => this.organizationService.get$(params.organizationId)),
);
}
}

View File

@@ -28,7 +28,7 @@ export class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent {
policyService: PolicyService,
private route: ActivatedRoute,
stateService: StateService,
private organizationService: OrganizationService
private organizationService: OrganizationService,
) {
super(apiService, modalService, messagingService, policyService, stateService);
}
@@ -41,7 +41,7 @@ export class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent {
this.organization = this.organizationService.get(this.organizationId);
}),
concatMap(async () => await super.ngOnInit()),
takeUntil(this.destroy$)
takeUntil(this.destroy$),
)
.subscribe();
}

View File

@@ -130,7 +130,7 @@
</td>
<td bitCell *ngIf="showMemberRoles">
{{ $any(item).role | userType : "-" }}
{{ $any(item).role | userType: "-" }}
</td>
<td bitCell *ngIf="showGroupColumn">

View File

@@ -138,7 +138,7 @@ describe("AccessSelectorComponent", () => {
expect(mockChange.mock.lastCall[0]).toHaveProperty("[0].id", "123");
expect(mockChange.mock.lastCall[0]).toHaveProperty(
"[0].permission",
CollectionPermission.Edit
CollectionPermission.Edit,
);
});
@@ -246,7 +246,7 @@ describe("AccessSelectorComponent", () => {
// Assert
const colHeading = fixture.nativeElement.querySelector("#permissionColHeading");
expect(!!colHeading).toEqual(shouldShowColumn);
}
},
);
});
});

View File

@@ -63,7 +63,7 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
*/
private updateRowControlDisableState = (
controlRow: FormGroup<ControlsOf<AccessItemValue>>,
item: AccessItemView
item: AccessItemView,
) => {
// Disable entire row form group if readonly
if (item.readonly) {
@@ -140,14 +140,14 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
set items(val: AccessItemView[]) {
const selected = (this.selectionList.formArray.getRawValue() ?? []).concat(
val.filter((m) => m.readonly)
val.filter((m) => m.readonly),
);
this.selectionList.populateItems(
val.map((m) => {
m.icon = m.icon ?? this.itemIcon(m); // Ensure an icon is set
return m;
}),
selected
selected,
);
}
@@ -203,7 +203,7 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
constructor(
private readonly formBuilder: FormBuilder,
private readonly i18nService: I18nService
private readonly i18nService: I18nService,
) {}
/** Required for NG_VALUE_ACCESSOR */

View File

@@ -33,41 +33,40 @@ export enum AccessItemType {
* and then joined back with the base type.
*
*/
export type AccessItemView =
| SelectItemView & {
/**
* Flag that this group/member can access all items.
* This will disable the permission editor for this item.
*/
accessAllItems?: boolean;
export type AccessItemView = SelectItemView & {
/**
* Flag that this group/member can access all items.
* This will disable the permission editor for this item.
*/
accessAllItems?: boolean;
/**
* Flag that this item cannot be modified.
* This will disable the permission editor and will keep
* the item always selected.
*/
readonly?: boolean;
/**
* Flag that this item cannot be modified.
* This will disable the permission editor and will keep
* the item always selected.
*/
readonly?: boolean;
/**
* Optional permission that will be rendered for this
* item if it set to readonly.
*/
readonlyPermission?: CollectionPermission;
} & (
| {
type: AccessItemType.Collection;
viaGroupName?: string;
}
| {
type: AccessItemType.Group;
}
| {
type: AccessItemType.Member; // Members have a few extra details required to display, so they're added here
email: string;
role: OrganizationUserType;
status: OrganizationUserStatusType;
}
);
/**
* Optional permission that will be rendered for this
* item if it set to readonly.
*/
readonlyPermission?: CollectionPermission;
} & (
| {
type: AccessItemType.Collection;
viaGroupName?: string;
}
| {
type: AccessItemType.Group;
}
| {
type: AccessItemType.Member; // Members have a few extra details required to display, so they're added here
email: string;
role: OrganizationUserType;
status: OrganizationUserStatusType;
}
);
/**
* A type that is emitted as a value for the ngControl

View File

@@ -100,7 +100,7 @@ const sampleMembers = itemsFactory(10, AccessItemType.Member);
const sampleGroups = itemsFactory(6, AccessItemType.Group);
const StandaloneAccessSelectorTemplate: Story<AccessSelectorComponent> = (
args: AccessSelectorComponent
args: AccessSelectorComponent,
) => ({
props: {
items: [],
@@ -126,7 +126,7 @@ const StandaloneAccessSelectorTemplate: Story<AccessSelectorComponent> = (
});
const DialogAccessSelectorTemplate: Story<AccessSelectorComponent> = (
args: AccessSelectorComponent
args: AccessSelectorComponent,
) => ({
props: {
items: [],
@@ -338,7 +338,7 @@ GroupMembersAccess.story = {
const fb = new FormBuilder();
const ReactiveFormAccessSelectorTemplate: Story<AccessSelectorComponent> = (
args: AccessSelectorComponent
args: AccessSelectorComponent,
) => ({
props: {
items: [],

View File

@@ -64,7 +64,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
private syncService: SyncService,
private validationService: ValidationService,
private organizationService: OrganizationService,
private dialogService: DialogService
private dialogService: DialogService,
) {}
async ngOnInit() {
@@ -77,7 +77,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
"error",
null,
this.i18nService.t("sponsoredFamiliesAcceptFailed"),
{ timeout: 10000 }
{ timeout: 10000 },
);
this.router.navigate(["/"]);
return;
@@ -91,7 +91,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
});
this.existingFamilyOrganizations$ = this.organizationService.organizations$.pipe(
map((orgs) => orgs.filter((o) => o.planProductType === ProductType.Families))
map((orgs) => orgs.filter((o) => o.planProductType === ProductType.Families)),
);
this.existingFamilyOrganizations$.pipe(takeUntil(this._destroy)).subscribe((orgs) => {
@@ -131,7 +131,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("sponsoredFamiliesOfferRedeemed")
this.i18nService.t("sponsoredFamiliesOfferRedeemed"),
);
await this.syncService.fullSync(true);

View File

@@ -26,7 +26,7 @@ export class ExposedPasswordsReportComponent extends BaseExposedPasswordsReportC
modalService: ModalService,
organizationService: OrganizationService,
private route: ActivatedRoute,
passwordRepromptService: PasswordRepromptService
passwordRepromptService: PasswordRepromptService,
) {
super(cipherService, auditService, organizationService, modalService, passwordRepromptService);
}

View File

@@ -23,7 +23,7 @@ export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorRepor
private route: ActivatedRoute,
logService: LogService,
passwordRepromptService: PasswordRepromptService,
organizationService: OrganizationService
organizationService: OrganizationService,
) {
super(cipherService, organizationService, modalService, logService, passwordRepromptService);
}

View File

@@ -24,7 +24,7 @@ export class ReusedPasswordsReportComponent extends BaseReusedPasswordsReportCom
modalService: ModalService,
private route: ActivatedRoute,
organizationService: OrganizationService,
passwordRepromptService: PasswordRepromptService
passwordRepromptService: PasswordRepromptService,
) {
super(cipherService, organizationService, modalService, passwordRepromptService);
}

View File

@@ -18,7 +18,7 @@ export class ToolsComponent {
constructor(
private route: ActivatedRoute,
private organizationService: OrganizationService,
private messagingService: MessagingService
private messagingService: MessagingService,
) {}
ngOnInit() {

View File

@@ -21,7 +21,7 @@ export class UnsecuredWebsitesReportComponent extends BaseUnsecuredWebsitesRepor
modalService: ModalService,
private route: ActivatedRoute,
organizationService: OrganizationService,
passwordRepromptService: PasswordRepromptService
passwordRepromptService: PasswordRepromptService,
) {
super(cipherService, organizationService, modalService, passwordRepromptService);
}

View File

@@ -34,7 +34,7 @@ export class OrganizationVaultExportComponent extends ExportComponent {
userVerificationService: UserVerificationService,
formBuilder: UntypedFormBuilder,
fileDownloadService: FileDownloadService,
dialogService: DialogService
dialogService: DialogService,
) {
super(
cryptoService,
@@ -47,7 +47,7 @@ export class OrganizationVaultExportComponent extends ExportComponent {
userVerificationService,
formBuilder,
fileDownloadService,
dialogService
dialogService,
);
}
@@ -80,7 +80,7 @@ export class OrganizationVaultExportComponent extends ExportComponent {
EventType.Organization_ClientExportedVault,
null,
null,
this.organizationId
this.organizationId,
);
}
}

View File

@@ -26,14 +26,14 @@ export class WeakPasswordsReportComponent extends BaseWeakPasswordsReportCompone
modalService: ModalService,
private route: ActivatedRoute,
organizationService: OrganizationService,
passwordRepromptService: PasswordRepromptService
passwordRepromptService: PasswordRepromptService,
) {
super(
cipherService,
passwordStrengthService,
organizationService,
modalService,
passwordRepromptService
passwordRepromptService,
);
}

View File

@@ -41,7 +41,7 @@ export class EnrollMasterPasswordReset {
private syncService: SyncService,
private logService: LogService,
private organizationApiService: OrganizationApiServiceAbstraction,
private organizationUserService: OrganizationUserService
private organizationUserService: OrganizationUserService,
) {
this.organization = data.organization;
}
@@ -53,7 +53,7 @@ export class EnrollMasterPasswordReset {
await this.userVerificationService
.buildRequest(
this.formGroup.value.verification,
OrganizationUserResetPasswordEnrollmentRequest
OrganizationUserResetPasswordEnrollmentRequest,
)
.then(async (request) => {
// Set variables
@@ -78,7 +78,7 @@ export class EnrollMasterPasswordReset {
await this.organizationUserService.putOrganizationUserResetPasswordEnrollment(
this.organization.id,
this.organization.userId,
request
request,
);
await this.syncService.fullSync(true);

View File

@@ -14,7 +14,10 @@ export class ProvidersComponent implements OnInit {
loaded = false;
actionPromise: Promise<any>;
constructor(private providerService: ProviderService, private i18nService: I18nService) {}
constructor(
private providerService: ProviderService,
private i18nService: I18nService,
) {}
async ngOnInit() {
document.body.classList.remove("layout_frontend");

View File

@@ -43,7 +43,7 @@ export class SponsoredFamiliesComponent implements OnInit, OnDestroy {
private syncService: SyncService,
private organizationService: OrganizationService,
private formBuilder: FormBuilder,
private stateService: StateService
private stateService: StateService,
) {
this.sponsorshipForm = this.formBuilder.group<RequestSponsorshipForm>({
selectedSponsorshipOrgId: new FormControl("", {
@@ -61,7 +61,7 @@ export class SponsoredFamiliesComponent implements OnInit, OnDestroy {
async ngOnInit() {
this.availableSponsorshipOrgs$ = this.organizationService.organizations$.pipe(
map((orgs) => orgs.filter((o) => o.familySponsorshipAvailable))
map((orgs) => orgs.filter((o) => o.familySponsorshipAvailable)),
);
this.availableSponsorshipOrgs$.pipe(takeUntil(this._destroy)).subscribe((orgs) => {
@@ -75,7 +75,7 @@ export class SponsoredFamiliesComponent implements OnInit, OnDestroy {
this.anyOrgsAvailable$ = this.availableSponsorshipOrgs$.pipe(map((orgs) => orgs.length > 0));
this.activeSponsorshipOrgs$ = this.organizationService.organizations$.pipe(
map((orgs) => orgs.filter((o) => o.familySponsorshipFriendlyName !== null))
map((orgs) => orgs.filter((o) => o.familySponsorshipFriendlyName !== null)),
);
this.anyActiveSponsorships$ = this.activeSponsorshipOrgs$.pipe(map((orgs) => orgs.length > 0));
@@ -95,7 +95,7 @@ export class SponsoredFamiliesComponent implements OnInit, OnDestroy {
sponsoredEmail: this.sponsorshipForm.value.sponsorshipEmail,
planSponsorshipType: PlanSponsorshipType.FamiliesForEnterprise,
friendlyName: this.sponsorshipForm.value.sponsorshipEmail,
}
},
);
await this.formPromise;

View File

@@ -28,7 +28,7 @@
class="dropdown-item btn-submit"
[disabled]="$any(resendEmailBtn).loading"
(click)="resendEmail()"
[attr.aria-label]="'resendEmailLabel' | i18n : sponsoringOrg.familySponsorshipFriendlyName"
[attr.aria-label]="'resendEmailLabel' | i18n: sponsoringOrg.familySponsorshipFriendlyName"
>
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span>{{ "resendEmail" | i18n }}</span>
@@ -40,7 +40,7 @@
class="dropdown-item text-danger btn-submit"
[disabled]="$any(revokeSponsorshipBtn).loading"
(click)="revokeSponsorship()"
[attr.aria-label]="'revokeAccount' | i18n : sponsoringOrg.familySponsorshipFriendlyName"
[attr.aria-label]="'revokeAccount' | i18n: sponsoringOrg.familySponsorshipFriendlyName"
>
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span>{{ "remove" | i18n }}</span>

View File

@@ -32,7 +32,7 @@ export class SponsoringOrgRowComponent implements OnInit {
private i18nService: I18nService,
private logService: LogService,
private platformUtilsService: PlatformUtilsService,
private dialogService: DialogService
private dialogService: DialogService,
) {}
async ngOnInit() {
@@ -42,7 +42,7 @@ export class SponsoringOrgRowComponent implements OnInit {
this.isSelfHosted,
this.sponsoringOrg.familySponsorshipToDelete,
this.sponsoringOrg.familySponsorshipValidUntil,
this.sponsoringOrg.familySponsorshipLastSyncDate
this.sponsoringOrg.familySponsorshipLastSyncDate,
);
}
@@ -89,7 +89,7 @@ export class SponsoringOrgRowComponent implements OnInit {
selfHosted: boolean,
toDelete?: boolean,
validUntil?: Date,
lastSyncDate?: Date
lastSyncDate?: Date,
) {
/*
* Possible Statuses:
@@ -104,7 +104,7 @@ export class SponsoringOrgRowComponent implements OnInit {
// They want to delete but there is a valid until date which means there is an active sponsorship
this.statusMessage = this.i18nService.t(
"revokeWhenExpired",
formatDate(validUntil, "MM/dd/yyyy", this.locale)
formatDate(validUntil, "MM/dd/yyyy", this.locale),
);
this.statusClass = "text-danger";
} else if (toDelete) {

View File

@@ -81,7 +81,7 @@ export class AppComponent implements OnDestroy, OnInit {
protected policyListService: PolicyListService,
private keyConnectorService: KeyConnectorService,
private configService: ConfigServiceAbstraction,
private dialogService: DialogService
private dialogService: DialogService,
) {}
ngOnInit() {
@@ -174,7 +174,7 @@ export class AppComponent implements OnDestroy, OnInit {
});
if (emailVerificationConfirmed) {
this.platformUtilsService.launchUri(
"https://bitwarden.com/help/create-bitwarden-account/"
"https://bitwarden.com/help/create-bitwarden-account/",
);
}
break;
@@ -245,7 +245,7 @@ export class AppComponent implements OnDestroy, OnInit {
this.platformUtilsService.showToast(
"warning",
this.i18nService.t("loggedOut"),
this.i18nService.t("loginExpired")
this.i18nService.t("loginExpired"),
);
}
@@ -293,7 +293,7 @@ export class AppComponent implements OnDestroy, OnInit {
} else {
msg.text.forEach(
(t: string) =>
(message += "<p>" + this.sanitizer.sanitize(SecurityContext.HTML, t) + "</p>")
(message += "<p>" + this.sanitizer.sanitize(SecurityContext.HTML, t) + "</p>"),
);
options.enableHtml = true;
}

View File

@@ -45,7 +45,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
private organizationApiService: OrganizationApiServiceAbstraction,
private organizationUserService: OrganizationUserService,
private messagingService: MessagingService,
private apiService: ApiService
private apiService: ApiService,
) {
super(router, platformUtilsService, i18nService, route, stateService);
}
@@ -77,7 +77,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
initOrganization
? this.i18nService.t("inviteInitAcceptedDesc")
: this.i18nService.t("inviteAcceptedDesc"),
{ timeout: 10000 }
{ timeout: 10000 },
);
this.router.navigate(["/vault"]);
}
@@ -91,8 +91,8 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
this.organizationUserService.postOrganizationUserAcceptInit(
qParams.organizationId,
qParams.organizationUserId,
request
)
request,
),
);
}
@@ -101,13 +101,13 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
this.organizationUserService.postOrganizationUserAccept(
qParams.organizationId,
qParams.organizationUserId,
request
)
request,
),
);
}
private async prepareAcceptInitRequest(
qParams: Params
qParams: Params,
): Promise<OrganizationUserAcceptInitRequest> {
const request = new OrganizationUserAcceptInitRequest();
request.token = qParams.token;
@@ -116,13 +116,13 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
const [orgPublicKey, encryptedOrgPrivateKey] = await this.cryptoService.makeKeyPair(orgKey);
const collection = await this.cryptoService.encrypt(
this.i18nService.t("defaultCollection"),
orgKey
orgKey,
);
request.key = encryptedOrgKey.encryptedString;
request.keys = new OrganizationKeysRequest(
orgPublicKey,
encryptedOrgPrivateKey.encryptedString
encryptedOrgPrivateKey.encryptedString,
);
request.collectionName = collection.encryptedString;
@@ -159,7 +159,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
qParams.organizationId,
qParams.token,
qParams.email,
qParams.organizationUserId
qParams.organizationUserId,
);
policyList = this.policyService.mapPoliciesFromToken(policies);
} catch (e) {
@@ -169,7 +169,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
if (policyList != null) {
const result = this.policyService.getResetPasswordPolicyOptions(
policyList,
qParams.organizationId
qParams.organizationId,
);
// Return true if policy enabled and auto-enroll enabled
return result[1] && result[0].autoEnrollEnabled;

View File

@@ -51,7 +51,7 @@ describe("RotateableKeySetService", () => {
function createSymmetricKey() {
const key = Utils.fromB64ToArray(
"1h-TuPwSbX5qoX0aVgjmda_Lfq85qAcKssBlXZnPIsQC3HNDGIecunYqXhJnp55QpdXRh-egJiLH3a0wqlVQsQ"
"1h-TuPwSbX5qoX0aVgjmda_Lfq85qAcKssBlXZnPIsQC3HNDGIecunYqXhJnp55QpdXRh-egJiLH3a0wqlVQsQ",
);
return new SymmetricCryptoKey(key);
}

View File

@@ -19,7 +19,7 @@ export class RotateableKeySetService {
* @returns RotateableKeySet containing the current users `UserKey`
*/
async createKeySet<ExternalKey extends SymmetricCryptoKey>(
externalKey: ExternalKey
externalKey: ExternalKey,
): Promise<RotateableKeySet<ExternalKey>> {
const [publicKey, encryptedPrivateKey] = await this.cryptoService.makeKeyPair(externalKey);

View File

@@ -13,7 +13,7 @@ export class WebAuthnLoginAdminApiService {
constructor(private apiService: ApiService) {}
async getCredentialCreateOptions(
request: SecretVerificationRequest
request: SecretVerificationRequest,
): Promise<WebauthnLoginCredentialCreateOptionsResponse> {
const response = await this.apiService.send("POST", "/webauthn/options", request, true, true);
return new WebauthnLoginCredentialCreateOptionsResponse(response);

View File

@@ -32,7 +32,7 @@ describe("WebauthnAdminService", () => {
userVerificationService,
rotateableKeySetService,
webAuthnLoginPrfCryptoService,
credentials
credentials,
);
});

View File

@@ -30,7 +30,7 @@ export class WebauthnLoginAdminService {
tap(() => this._loading$.next(true)),
switchMap(() => this.fetchCredentials$()),
tap(() => this._loading$.next(false)),
shareReplay({ bufferSize: 1, refCount: true })
shareReplay({ bufferSize: 1, refCount: true }),
);
/**
@@ -45,7 +45,7 @@ export class WebauthnLoginAdminService {
private rotateableKeySetService: RotateableKeySetService,
private webAuthnLoginPrfCryptoService: WebAuthnLoginPrfCryptoServiceAbstraction,
@Optional() navigatorCredentials?: CredentialsContainer,
@Optional() private logService?: LogService
@Optional() private logService?: LogService,
) {
// Default parameters don't work when used with Angular DI
this.navigatorCredentials = navigatorCredentials ?? navigator.credentials;
@@ -60,7 +60,7 @@ export class WebauthnLoginAdminService {
* @returns The credential attestation options and a token to be used for the credential creation request.
*/
async getCredentialCreateOptions(
verification: Verification
verification: Verification,
): Promise<CredentialCreateOptionsView> {
const request = await this.userVerificationService.buildRequest(verification);
const response = await this.apiService.getCredentialCreateOptions(request);
@@ -74,7 +74,7 @@ export class WebauthnLoginAdminService {
* @returns A pending credential that can be saved to server directly or be used to create a key set.
*/
async createCredential(
credentialOptions: CredentialCreateOptionsView
credentialOptions: CredentialCreateOptionsView,
): Promise<PendingWebauthnLoginCredentialView | undefined> {
const nativeOptions: CredentialCreationOptions = {
publicKey: credentialOptions.options,
@@ -106,7 +106,7 @@ export class WebauthnLoginAdminService {
* @returns A key set that can be saved to the server. Undefined is returned if the credential doesn't support PRF.
*/
async createKeySet(
pendingCredential: PendingWebauthnLoginCredentialView
pendingCredential: PendingWebauthnLoginCredentialView,
): Promise<PrfKeySet | undefined> {
const nativeOptions: CredentialRequestOptions = {
publicKey: {
@@ -136,9 +136,8 @@ export class WebauthnLoginAdminService {
return undefined;
}
const symmetricPrfKey = await this.webAuthnLoginPrfCryptoService.createSymmetricKeyFromPrf(
prfResult
);
const symmetricPrfKey =
await this.webAuthnLoginPrfCryptoService.createSymmetricKeyFromPrf(prfResult);
return await this.rotateableKeySetService.createKeySet(symmetricPrfKey);
} catch (error) {
this.logService?.error(error);
@@ -156,7 +155,7 @@ export class WebauthnLoginAdminService {
async saveCredential(
name: string,
credential: PendingWebauthnLoginCredentialView,
prfKeySet?: PrfKeySet
prfKeySet?: PrfKeySet,
) {
const request = new SaveCredentialRequest();
request.deviceResponse = new WebauthnLoginAttestationResponseRequest(credential.deviceResponse);
@@ -193,7 +192,7 @@ export class WebauthnLoginAdminService {
getCredential$(credentialId: string): Observable<WebauthnLoginCredentialView> {
return this.credentials$.pipe(
map((credentials) => credentials.find((c) => c.id === credentialId)),
filter((c) => c !== undefined)
filter((c) => c !== undefined),
);
}
@@ -215,9 +214,9 @@ export class WebauthnLoginAdminService {
map((response) =>
response.data.map(
(credential) =>
new WebauthnLoginCredentialView(credential.id, credential.name, credential.prfStatus)
)
)
new WebauthnLoginCredentialView(credential.id, credential.name, credential.prfStatus),
),
),
);
}

View File

@@ -1,5 +1,8 @@
import { ChallengeResponse } from "@bitwarden/common/auth/models/response/two-factor-web-authn.response";
export class CredentialCreateOptionsView {
constructor(readonly options: ChallengeResponse, readonly token: string) {}
constructor(
readonly options: ChallengeResponse,
readonly token: string,
) {}
}

View File

@@ -7,6 +7,6 @@ export class PendingWebauthnLoginCredentialView {
constructor(
readonly createOptions: CredentialCreateOptionsView,
readonly deviceResponse: PublicKeyCredential,
readonly supportsPrf: boolean
readonly supportsPrf: boolean,
) {}
}

View File

@@ -4,6 +4,6 @@ export class WebauthnLoginCredentialView {
constructor(
readonly id: string,
readonly name: string,
readonly prfStatus: WebauthnLoginCredentialPrfStatus
readonly prfStatus: WebauthnLoginCredentialPrfStatus,
) {}
}

View File

@@ -28,7 +28,7 @@ export class AcceptEmergencyComponent extends BaseAcceptComponent {
i18nService: I18nService,
route: ActivatedRoute,
stateService: StateService,
private emergencyAccessService: EmergencyAccessService
private emergencyAccessService: EmergencyAccessService,
) {
super(router, platformUtilsService, i18nService, route, stateService);
}
@@ -40,7 +40,7 @@ export class AcceptEmergencyComponent extends BaseAcceptComponent {
"success",
this.i18nService.t("inviteAccepted"),
this.i18nService.t("emergencyInviteAcceptedDesc"),
{ timeout: 10000 }
{ timeout: 10000 },
);
this.router.navigate(["/vault"]);
}

View File

@@ -41,7 +41,7 @@ export class EmergencyAccessApiService {
"/emergency-access/" + id + "/policies",
null,
true,
true
true,
);
return new ListResponse(r, PolicyResponse);
}
@@ -68,7 +68,7 @@ export class EmergencyAccessApiService {
"/emergency-access/" + id + "/accept",
request,
true,
false
false,
);
}
@@ -78,7 +78,7 @@ export class EmergencyAccessApiService {
"/emergency-access/" + id + "/confirm",
request,
true,
false
false,
);
}
@@ -100,21 +100,21 @@ export class EmergencyAccessApiService {
"/emergency-access/" + id + "/takeover",
null,
true,
true
true,
);
return new EmergencyAccessTakeoverResponse(r);
}
async postEmergencyAccessPassword(
id: string,
request: EmergencyAccessPasswordRequest
request: EmergencyAccessPasswordRequest,
): Promise<void> {
await this.apiService.send(
"POST",
"/emergency-access/" + id + "/password",
request,
true,
true
true,
);
}
@@ -124,7 +124,7 @@ export class EmergencyAccessApiService {
"/emergency-access/" + id + "/view",
null,
true,
true
true,
);
return new EmergencyAccessViewResponse(r);
}

View File

@@ -52,7 +52,7 @@ describe("EmergencyAccessService", () => {
cryptoService,
encryptService,
cipherService,
logService
logService,
);
});
@@ -122,7 +122,7 @@ describe("EmergencyAccessService", () => {
const mockUserPublicKeyEncryptedUserKey = new EncString(
EncryptionType.AesCbc256_HmacSha256_B64,
"mockUserPublicKeyEncryptedUserKey"
"mockUserPublicKeyEncryptedUserKey",
);
cryptoService.getUserKey.mockResolvedValueOnce(mockUserKey);
@@ -170,7 +170,7 @@ describe("EmergencyAccessService", () => {
// where UserKey is the decrypted grantor user key
const mockMasterKeyEncryptedUserKey = new EncString(
EncryptionType.AesCbc256_HmacSha256_B64,
"mockMasterKeyEncryptedUserKey"
"mockMasterKeyEncryptedUserKey",
);
const mockUserKey = new SymmetricCryptoKey(mockDecryptedGrantorUserKey) as UserKey;
@@ -190,7 +190,7 @@ describe("EmergencyAccessService", () => {
// Assert
expect(emergencyAccessApiService.postEmergencyAccessPassword).toHaveBeenCalledWith(
mockId,
expectedEmergencyAccessPasswordRequest
expectedEmergencyAccessPasswordRequest,
);
});
@@ -203,7 +203,7 @@ describe("EmergencyAccessService", () => {
} as EmergencyAccessTakeoverResponse);
await expect(
emergencyAccessService.takeover(mockId, mockEmail, mockName)
emergencyAccessService.takeover(mockId, mockEmail, mockName),
).rejects.toThrowError("Failed to decrypt grantor key");
expect(emergencyAccessApiService.postEmergencyAccessPassword).not.toHaveBeenCalled();
@@ -240,7 +240,7 @@ describe("EmergencyAccessService", () => {
cryptoService.rsaEncrypt.mockImplementation((plainValue, publicKey) => {
return Promise.resolve(
new EncString(EncryptionType.Rsa2048_OaepSha1_B64, "Encrypted: " + plainValue)
new EncString(EncryptionType.Rsa2048_OaepSha1_B64, "Encrypted: " + plainValue),
);
});
});
@@ -254,13 +254,13 @@ describe("EmergencyAccessService", () => {
if (allowedStatuses.includes(emergencyAccess.status)) {
expect(emergencyAccessApiService.putEmergencyAccess).toHaveBeenCalledWith(
emergencyAccess.id,
expect.any(EmergencyAccessUpdateRequest)
expect.any(EmergencyAccessUpdateRequest),
);
expectedCallCount++;
} else {
expect(emergencyAccessApiService.putEmergencyAccess).not.toHaveBeenCalledWith(
emergencyAccess.id,
expect.any(EmergencyAccessUpdateRequest)
expect.any(EmergencyAccessUpdateRequest),
);
}
});
@@ -272,7 +272,7 @@ describe("EmergencyAccessService", () => {
function createMockEmergencyAccess(
id: string,
name: string,
status: EmergencyAccessStatusType
status: EmergencyAccessStatusType,
): EmergencyAccessGranteeDetailsResponse {
const emergencyAccess = new EmergencyAccessGranteeDetailsResponse({});
emergencyAccess.id = id;

View File

@@ -36,7 +36,7 @@ export class EmergencyAccessService {
private cryptoService: CryptoService,
private encryptService: EncryptService,
private cipherService: CipherService,
private logService: LogService
private logService: LogService,
) {}
/**
@@ -148,7 +148,7 @@ export class EmergencyAccessService {
try {
this.logService.debug(
"User's fingerprint: " +
(await this.cryptoService.getFingerprint(granteeId, publicKey)).join("-")
(await this.cryptoService.getFingerprint(granteeId, publicKey)).join("-"),
);
} catch {
// Ignore errors since it's just a debug message
@@ -208,7 +208,7 @@ export class EmergencyAccessService {
const ciphers = await this.encryptService.decryptItems(
response.ciphers.map((c) => new Cipher(c)),
grantorUserKey
grantorUserKey,
);
return ciphers.sort(this.cipherService.getLocaleSortingFunction());
}
@@ -237,8 +237,8 @@ export class EmergencyAccessService {
new KdfConfig(
takeoverResponse.kdfIterations,
takeoverResponse.kdfMemory,
takeoverResponse.kdfParallelism
)
takeoverResponse.kdfParallelism,
),
);
const masterKeyHash = await this.cryptoService.hashMasterKey(masterPassword, masterKey);
@@ -266,7 +266,7 @@ export class EmergencyAccessService {
EmergencyAccessStatusType.RecoveryApproved,
]);
const filteredAccesses = existingEmergencyAccess.data.filter((d) =>
allowedStatuses.has(d.status)
allowedStatuses.has(d.status),
);
for (const details of filteredAccesses) {

View File

@@ -19,7 +19,7 @@ export class HintComponent extends BaseHintComponent {
apiService: ApiService,
platformUtilsService: PlatformUtilsService,
logService: LogService,
loginService: LoginService
loginService: LoginService,
) {
super(router, i18nService, apiService, platformUtilsService, logService, loginService);
}

View File

@@ -34,7 +34,7 @@
</button>
</div>
<small class="text-muted form-text">
{{ "loggedInAsEmailOn" | i18n : email : webVaultHostname }}
{{ "loggedInAsEmailOn" | i18n: email : webVaultHostname }}
</small>
</div>
<hr />

View File

@@ -42,7 +42,7 @@ export class LockComponent extends BaseLockComponent {
passwordStrengthService: PasswordStrengthServiceAbstraction,
dialogService: DialogService,
deviceTrustCryptoService: DeviceTrustCryptoServiceAbstraction,
userVerificationService: UserVerificationService
userVerificationService: UserVerificationService,
) {
super(
router,
@@ -62,7 +62,7 @@ export class LockComponent extends BaseLockComponent {
passwordStrengthService,
dialogService,
deviceTrustCryptoService,
userVerificationService
userVerificationService,
);
}

View File

@@ -45,7 +45,7 @@ export class LoginViaAuthRequestComponent
stateService: StateService,
loginService: LoginService,
deviceTrustCryptoService: DeviceTrustCryptoServiceAbstraction,
authReqCryptoService: AuthRequestCryptoServiceAbstraction
authReqCryptoService: AuthRequestCryptoServiceAbstraction,
) {
super(
router,
@@ -64,7 +64,7 @@ export class LoginViaAuthRequestComponent
stateService,
loginService,
deviceTrustCryptoService,
authReqCryptoService
authReqCryptoService,
);
}
}

View File

@@ -64,7 +64,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
formBuilder: FormBuilder,
formValidationErrorService: FormValidationErrorsService,
loginService: LoginService,
webAuthnLoginService: WebAuthnLoginServiceAbstraction
webAuthnLoginService: WebAuthnLoginServiceAbstraction,
) {
super(
devicesApiService,
@@ -83,7 +83,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
formValidationErrorService,
route,
loginService,
webAuthnLoginService
webAuthnLoginService,
);
this.onSuccessfulLogin = async () => {
this.messagingService.send("setFullWidth");
@@ -122,7 +122,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
invite.organizationId,
invite.token,
invite.email,
invite.organizationUserId
invite.organizationUserId,
);
policyList = this.policyService.mapPoliciesFromToken(this.policies);
} catch (e) {
@@ -132,7 +132,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
if (policyList != null) {
const resetPasswordPolicy = this.policyService.getResetPasswordPolicyOptions(
policyList,
invite.organizationId
invite.organizationId,
);
// Set to true if policy enabled and auto-enroll enabled
this.showResetPasswordAutoEnrollWarning =
@@ -155,7 +155,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
if (this.enforcedPasswordPolicyOptions != null) {
const strengthResult = this.passwordStrengthService.getPasswordStrength(
masterPassword,
this.formGroup.value.email
this.formGroup.value.email,
);
const masterPasswordScore = strengthResult == null ? null : strengthResult.score;
@@ -164,7 +164,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
!this.policyService.evaluateMasterPassword(
masterPasswordScore,
masterPassword,
this.enforcedPasswordPolicyOptions
this.enforcedPasswordPolicyOptions,
)
) {
const policiesData: { [id: string]: PolicyData } = {};

View File

@@ -31,7 +31,7 @@ export class MigrateFromLegacyEncryptionComponent {
private migrationService: MigrateFromLegacyEncryptionService,
private cryptoService: CryptoService,
private messagingService: MessagingService,
private logService: LogService
private logService: LogService,
) {}
submit = async () => {
@@ -51,9 +51,8 @@ export class MigrateFromLegacyEncryptionComponent {
try {
// Create new user key
const [newUserKey, masterKeyEncUserKey] = await this.migrationService.createNewUserKey(
masterPassword
);
const [newUserKey, masterKeyEncUserKey] =
await this.migrationService.createNewUserKey(masterPassword);
// Update admin recover keys
await this.migrationService.updateAllAdminRecoveryKeys(masterPassword, newUserKey);
@@ -65,14 +64,14 @@ export class MigrateFromLegacyEncryptionComponent {
await this.migrationService.updateKeysAndEncryptedData(
masterPassword,
newUserKey,
masterKeyEncUserKey
masterKeyEncUserKey,
);
this.platformUtilsService.showToast(
"success",
this.i18nService.t("keyUpdated"),
this.i18nService.t("logBackInOthersToo"),
{ timeout: 15000 }
{ timeout: 15000 },
);
this.messagingService.send("logout");
} catch (e) {

View File

@@ -66,7 +66,7 @@ describe("migrateFromLegacyEncryptionService", () => {
cipherService,
folderService,
sendService,
stateService
stateService,
);
});
@@ -86,7 +86,7 @@ describe("migrateFromLegacyEncryptionService", () => {
cryptoService.isLegacyUser.mockResolvedValue(false);
await expect(
migrateFromLegacyEncryptionService.createNewUserKey(mockMasterPassword)
migrateFromLegacyEncryptionService.createNewUserKey(mockMasterPassword),
).rejects.toThrowError("Invalid master password or user may not be legacy");
});
});
@@ -109,7 +109,7 @@ describe("migrateFromLegacyEncryptionService", () => {
cryptoService.getPrivateKey.mockResolvedValue(new Uint8Array(64) as CsprngArray);
cryptoService.rsaEncrypt.mockResolvedValue(
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted")
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted"),
);
folderViews = new BehaviorSubject<FolderView[]>(mockFolders);
@@ -122,7 +122,7 @@ describe("migrateFromLegacyEncryptionService", () => {
encryptService.encrypt.mockImplementation((plainValue, userKey) => {
return Promise.resolve(
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted: " + plainValue)
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted: " + plainValue),
);
});
@@ -131,7 +131,7 @@ describe("migrateFromLegacyEncryptionService", () => {
encryptedFolder.id = folder.id;
encryptedFolder.name = new EncString(
EncryptionType.AesCbc256_HmacSha256_B64,
"Encrypted: " + folder.name
"Encrypted: " + folder.name,
);
return Promise.resolve(encryptedFolder);
});
@@ -141,7 +141,7 @@ describe("migrateFromLegacyEncryptionService", () => {
encryptedCipher.id = cipher.id;
encryptedCipher.name = new EncString(
EncryptionType.AesCbc256_HmacSha256_B64,
"Encrypted: " + cipher.name
"Encrypted: " + cipher.name,
);
return Promise.resolve(encryptedCipher);
});
@@ -151,7 +151,7 @@ describe("migrateFromLegacyEncryptionService", () => {
await migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
mockMasterPassword,
mockUserKey,
mockEncUserKey
mockEncUserKey,
);
expect(cryptoService.getOrDeriveMasterKey).toHaveBeenCalled();
@@ -161,7 +161,7 @@ describe("migrateFromLegacyEncryptionService", () => {
await migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
mockMasterPassword,
mockUserKey,
mockEncUserKey
mockEncUserKey,
);
expect(syncService.fullSync).toHaveBeenCalledWith(true);
});
@@ -173,8 +173,8 @@ describe("migrateFromLegacyEncryptionService", () => {
migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
mockMasterPassword,
mockUserKey,
mockEncUserKey
)
mockEncUserKey,
),
).rejects.toThrowError("sync failed");
expect(apiService.postAccountKey).not.toHaveBeenCalled();
@@ -189,8 +189,8 @@ describe("migrateFromLegacyEncryptionService", () => {
migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
mockMasterPassword,
mockUserKey,
mockEncUserKey
)
mockEncUserKey,
),
).rejects.toThrowError("Ciphers failed to be retrieved");
expect(apiService.postAccountKey).not.toHaveBeenCalled();
@@ -240,36 +240,36 @@ describe("migrateFromLegacyEncryptionService", () => {
it("Only updates organizations that are enrolled in admin recovery", async () => {
await migrateFromLegacyEncryptionService.updateAllAdminRecoveryKeys(
mockMasterPassword,
mockUserKey
mockUserKey,
);
expect(
organizationUserService.putOrganizationUserResetPasswordEnrollment
organizationUserService.putOrganizationUserResetPasswordEnrollment,
).toHaveBeenCalledWith(
"1",
expect.any(String),
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
);
expect(
organizationUserService.putOrganizationUserResetPasswordEnrollment
organizationUserService.putOrganizationUserResetPasswordEnrollment,
).toHaveBeenCalledWith(
"2",
expect.any(String),
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
);
expect(
organizationUserService.putOrganizationUserResetPasswordEnrollment
organizationUserService.putOrganizationUserResetPasswordEnrollment,
).not.toHaveBeenCalledWith(
"3",
expect.any(String),
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
);
expect(
organizationUserService.putOrganizationUserResetPasswordEnrollment
organizationUserService.putOrganizationUserResetPasswordEnrollment,
).not.toHaveBeenCalledWith(
"4",
expect.any(String),
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
);
});
});

View File

@@ -38,7 +38,7 @@ export class MigrateFromLegacyEncryptionService {
private cipherService: CipherService,
private folderService: FolderService,
private sendService: SendService,
private stateService: StateService
private stateService: StateService,
) {}
/**
@@ -51,7 +51,7 @@ export class MigrateFromLegacyEncryptionService {
masterPassword,
await this.stateService.getEmail(),
await this.stateService.getKdfType(),
await this.stateService.getKdfConfig()
await this.stateService.getKdfConfig(),
);
if (!masterKey) {
@@ -77,14 +77,14 @@ export class MigrateFromLegacyEncryptionService {
async updateKeysAndEncryptedData(
masterPassword: string,
newUserKey: UserKey,
newEncUserKey: EncString
newEncUserKey: EncString,
): Promise<void> {
// Create new request and add master key and hash
const request = new UpdateKeyRequest();
request.key = newEncUserKey.encryptedString;
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
masterPassword,
await this.cryptoService.getOrDeriveMasterKey(masterPassword)
await this.cryptoService.getOrDeriveMasterKey(masterPassword),
);
// Sync before encrypting to make sure we have latest data
@@ -132,13 +132,13 @@ export class MigrateFromLegacyEncryptionService {
request.resetPasswordKey = encryptedKey.encryptedString;
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
masterPassword,
await this.cryptoService.getOrDeriveMasterKey(masterPassword)
await this.cryptoService.getOrDeriveMasterKey(masterPassword),
);
await this.organizationUserService.putOrganizationUserResetPasswordEnrollment(
org.id,
org.userId,
request
request,
);
}
}
@@ -160,7 +160,7 @@ export class MigrateFromLegacyEncryptionService {
folders.map(async (folder) => {
const encryptedFolder = await this.folderService.encrypt(folder, newUserKey);
return new FolderWithIdRequest(encryptedFolder);
})
}),
);
}
@@ -173,7 +173,7 @@ export class MigrateFromLegacyEncryptionService {
ciphers.map(async (cipher) => {
const encryptedCipher = await this.cipherService.encrypt(cipher, newUserKey);
return new CipherWithIdRequest(encryptedCipher);
})
}),
);
}
@@ -187,7 +187,7 @@ export class MigrateFromLegacyEncryptionService {
const sendKey = await this.encryptService.decryptToBytes(send.key, null);
send.key = (await this.encryptService.encrypt(sendKey, newUserKey)) ?? send.key;
return new SendWithIdRequest(send);
})
}),
);
}
}

View File

@@ -20,7 +20,7 @@ export class RecoverDeleteComponent {
private apiService: ApiService,
private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService,
private logService: LogService
private logService: LogService,
) {}
async submit() {
@@ -32,7 +32,7 @@ export class RecoverDeleteComponent {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("deleteRecoverEmailSent")
this.i18nService.t("deleteRecoverEmailSent"),
);
this.router.navigate(["/"]);
} catch (e) {

View File

@@ -26,7 +26,7 @@ export class RecoverTwoFactorComponent {
private i18nService: I18nService,
private cryptoService: CryptoService,
private authService: AuthService,
private logService: LogService
private logService: LogService,
) {}
async submit() {
@@ -41,7 +41,7 @@ export class RecoverTwoFactorComponent {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("twoStepRecoverDisabled")
this.i18nService.t("twoStepRecoverDisabled"),
);
this.router.navigate(["/"]);
} catch (e) {

View File

@@ -46,7 +46,7 @@ export class RegisterFormComponent extends BaseRegisterComponent {
environmentService: EnvironmentService,
logService: LogService,
auditService: AuditService,
dialogService: DialogService
dialogService: DialogService,
) {
super(
formValidationErrorService,
@@ -62,7 +62,7 @@ export class RegisterFormComponent extends BaseRegisterComponent {
environmentService,
logService,
auditService,
dialogService
dialogService,
);
}
@@ -87,13 +87,13 @@ export class RegisterFormComponent extends BaseRegisterComponent {
!this.policyService.evaluateMasterPassword(
this.passwordStrengthResult.score,
this.formGroup.value.masterPassword,
this.enforcedPolicyOptions
this.enforcedPolicyOptions,
)
) {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("masterPasswordPolicyRequirementsNotMet")
this.i18nService.t("masterPasswordPolicyRequirementsNotMet"),
);
return;
}

View File

@@ -18,7 +18,7 @@
<hr />
<div class="card d-block">
<div class="card-body">
<p>{{ "convertOrganizationEncryptionDesc" | i18n : organization.name }}</p>
<p>{{ "convertOrganizationEncryptionDesc" | i18n: organization.name }}</p>
<button
type="button"

View File

@@ -36,7 +36,7 @@ export class SetPasswordComponent extends BaseSetPasswordComponent {
stateService: StateService,
organizationApiService: OrganizationApiServiceAbstraction,
organizationUserService: OrganizationUserService,
dialogService: DialogService
dialogService: DialogService,
) {
super(
i18nService,
@@ -53,7 +53,7 @@ export class SetPasswordComponent extends BaseSetPasswordComponent {
stateService,
organizationApiService,
organizationUserService,
dialogService
dialogService,
);
}
}

View File

@@ -71,7 +71,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
dialogService: DialogService,
private userVerificationService: UserVerificationService,
private deviceTrustCryptoService: DeviceTrustCryptoServiceAbstraction,
private configService: ConfigServiceAbstraction
private configService: ConfigServiceAbstraction,
) {
super(
i18nService,
@@ -81,13 +81,13 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
platformUtilsService,
policyService,
stateService,
dialogService
dialogService,
);
}
async ngOnInit() {
this.showWebauthnLoginSettings$ = this.configService.getFeatureFlag$(
FeatureFlag.PasswordlessLogin
FeatureFlag.PasswordlessLogin,
);
if (!(await this.userVerificationService.hasMasterPassword())) {
@@ -124,7 +124,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
if (learnMore) {
this.platformUtilsService.launchUri(
"https://bitwarden.com/help/attachments/#add-storage-space"
"https://bitwarden.com/help/attachments/#add-storage-space",
);
}
this.rotateUserKey = false;
@@ -153,7 +153,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("hintEqualsPassword")
this.i18nService.t("hintEqualsPassword"),
);
return;
}
@@ -171,7 +171,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("masterPasswordRequired")
this.i18nService.t("masterPasswordRequired"),
);
return false;
}
@@ -186,13 +186,13 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
async performSubmitActions(
newMasterPasswordHash: string,
newMasterKey: MasterKey,
newUserKey: [UserKey, EncString]
newUserKey: [UserKey, EncString],
) {
const masterKey = await this.cryptoService.getOrDeriveMasterKey(this.currentMasterPassword);
const request = new PasswordRequest();
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
this.currentMasterPassword,
masterKey
masterKey,
);
request.masterPasswordHint = this.masterPasswordHint;
request.newMasterPasswordHash = newMasterPasswordHash;
@@ -212,7 +212,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
this.platformUtilsService.showToast(
"success",
this.i18nService.t("masterPasswordChanged"),
this.i18nService.t("logBackIn")
this.i18nService.t("logBackIn"),
);
this.messagingService.send("logout");
} catch {
@@ -257,7 +257,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
const sendKey = await this.cryptoService.decryptToBytes(send.key, null);
send.key = (await this.cryptoService.encrypt(sendKey, newUserKey)) ?? send.key;
request.sends.push(new SendWithIdRequest(send));
})
}),
);
await this.deviceTrustCryptoService.rotateDevicesTrust(newUserKey, masterPasswordHash);
@@ -293,7 +293,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
await this.organizationUserService.putOrganizationUserResetPasswordEnrollment(
org.id,
org.userId,
request
request,
);
}
}

View File

@@ -22,7 +22,7 @@ export class DeauthorizeSessionsComponent {
private platformUtilsService: PlatformUtilsService,
private userVerificationService: UserVerificationService,
private messagingService: MessagingService,
private logService: LogService
private logService: LogService,
) {}
async submit() {
@@ -34,7 +34,7 @@ export class DeauthorizeSessionsComponent {
this.platformUtilsService.showToast(
"success",
this.i18nService.t("sessionsDeauthorized"),
this.i18nService.t("logBackIn")
this.i18nService.t("logBackIn"),
);
this.messagingService.send("logout");
} catch (e) {

View File

@@ -29,7 +29,7 @@ export class EmergencyAccessAttachmentsComponent extends BaseAttachmentsComponen
apiService: ApiService,
logService: LogService,
fileDownloadService: FileDownloadService,
dialogService: DialogService
dialogService: DialogService,
) {
super(
cipherService,
@@ -41,7 +41,7 @@ export class EmergencyAccessAttachmentsComponent extends BaseAttachmentsComponen
logService,
stateService,
fileDownloadService,
dialogService
dialogService,
);
}

View File

@@ -25,7 +25,7 @@ export class EmergencyAccessConfirmComponent implements OnInit {
private apiService: ApiService,
private cryptoService: CryptoService,
private stateService: StateService,
private logService: LogService
private logService: LogService,
) {}
async ngOnInit() {

View File

@@ -34,7 +34,7 @@ export class EmergencyAccessAddEditComponent implements OnInit {
private emergencyAccessService: EmergencyAccessService,
private i18nService: I18nService,
private platformUtilsService: PlatformUtilsService,
private logService: LogService
private logService: LogService,
) {}
async ngOnInit() {
@@ -54,7 +54,7 @@ export class EmergencyAccessAddEditComponent implements OnInit {
this.title = this.i18nService.t("editEmergencyContact");
try {
const emergencyAccess = await this.emergencyAccessService.getEmergencyAccess(
this.emergencyAccessId
this.emergencyAccessId,
);
this.type = emergencyAccess.type;
this.waitTime = emergencyAccess.waitTimeDays;
@@ -81,7 +81,7 @@ export class EmergencyAccessAddEditComponent implements OnInit {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t(this.editMode ? "editedUserId" : "invitedUsers", this.name)
this.i18nService.t(this.editMode ? "editedUserId" : "invitedUsers", this.name),
);
this.onSaved.emit();
} catch (e) {

Some files were not shown because too many files have changed in this diff Show More