mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
Cleanup migrated components (#14625)
Cleans up migrated components by removing unnecessary old behaviour. - Removes ng-template and ViewChild used by the old Modal Service. - Remove aria-dismiss used by old Modals. - Remove aria-haspopup and aria-expanded on bitMenuTriggerFor since it's handled by the directive.
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
[bitMenuTriggerFor]="editCollectionMenu"
|
[bitMenuTriggerFor]="editCollectionMenu"
|
||||||
size="small"
|
size="small"
|
||||||
type="button"
|
type="button"
|
||||||
aria-haspopup="true"
|
|
||||||
></button>
|
></button>
|
||||||
<bit-menu #editCollectionMenu>
|
<bit-menu #editCollectionMenu>
|
||||||
<ng-container *ngIf="canEditCollection">
|
<ng-container *ngIf="canEditCollection">
|
||||||
|
|||||||
@@ -153,6 +153,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #attachments></ng-template>
|
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
<ng-template #collectionsModal></ng-template>
|
|
||||||
|
|||||||
@@ -374,4 +374,3 @@
|
|||||||
</cdk-virtual-scroll-viewport>
|
</cdk-virtual-scroll-viewport>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-template #resetPasswordTemplate></ng-template>
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component, ViewChild, ViewContainerRef } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
import {
|
import {
|
||||||
@@ -90,9 +90,6 @@ class MembersTableDataSource extends PeopleTableDataSource<OrganizationUserView>
|
|||||||
templateUrl: "members.component.html",
|
templateUrl: "members.component.html",
|
||||||
})
|
})
|
||||||
export class MembersComponent extends BaseMembersComponent<OrganizationUserView> {
|
export class MembersComponent extends BaseMembersComponent<OrganizationUserView> {
|
||||||
@ViewChild("resetPasswordTemplate", { read: ViewContainerRef, static: true })
|
|
||||||
resetPasswordModalRef: ViewContainerRef;
|
|
||||||
|
|
||||||
userType = OrganizationUserType;
|
userType = OrganizationUserType;
|
||||||
userStatusType = OrganizationUserStatusType;
|
userStatusType = OrganizationUserStatusType;
|
||||||
memberTab = MemberDialogTab;
|
memberTab = MemberDialogTab;
|
||||||
|
|||||||
@@ -35,5 +35,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</bit-table>
|
</bit-table>
|
||||||
<ng-template #editTemplate></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component, OnInit, ViewChild, ViewContainerRef } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
import { firstValueFrom, lastValueFrom, map, Observable, switchMap } from "rxjs";
|
import { firstValueFrom, lastValueFrom, map, Observable, switchMap } from "rxjs";
|
||||||
import { first } from "rxjs/operators";
|
import { first } from "rxjs/operators";
|
||||||
@@ -33,9 +33,6 @@ import { PolicyEditComponent, PolicyEditDialogResult } from "./policy-edit.compo
|
|||||||
templateUrl: "policies.component.html",
|
templateUrl: "policies.component.html",
|
||||||
})
|
})
|
||||||
export class PoliciesComponent implements OnInit {
|
export class PoliciesComponent implements OnInit {
|
||||||
@ViewChild("editTemplate", { read: ViewContainerRef, static: true })
|
|
||||||
editModalRef: ViewContainerRef;
|
|
||||||
|
|
||||||
loading = true;
|
loading = true;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
policies: BasePolicy[];
|
policies: BasePolicy[];
|
||||||
|
|||||||
@@ -93,7 +93,4 @@
|
|||||||
{{ "purgeVault" | i18n }}
|
{{ "purgeVault" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
</app-danger-zone>
|
</app-danger-zone>
|
||||||
|
|
||||||
<ng-template #apiKeyTemplate></ng-template>
|
|
||||||
<ng-template #rotateApiKeyTemplate></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component, OnDestroy, OnInit, ViewChild, ViewContainerRef } from "@angular/core";
|
import { Component, OnDestroy, OnInit } from "@angular/core";
|
||||||
import { FormBuilder, Validators } from "@angular/forms";
|
import { FormBuilder, Validators } from "@angular/forms";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
import {
|
import {
|
||||||
@@ -43,11 +43,6 @@ import { DeleteOrganizationDialogResult, openDeleteOrganizationDialog } from "./
|
|||||||
templateUrl: "account.component.html",
|
templateUrl: "account.component.html",
|
||||||
})
|
})
|
||||||
export class AccountComponent implements OnInit, OnDestroy {
|
export class AccountComponent implements OnInit, OnDestroy {
|
||||||
@ViewChild("apiKeyTemplate", { read: ViewContainerRef, static: true })
|
|
||||||
apiKeyModalRef: ViewContainerRef;
|
|
||||||
@ViewChild("rotateApiKeyTemplate", { read: ViewContainerRef, static: true })
|
|
||||||
rotateApiKeyModalRef: ViewContainerRef;
|
|
||||||
|
|
||||||
selfHosted = false;
|
selfHosted = false;
|
||||||
canEditSubscription = true;
|
canEditSubscription = true;
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|||||||
@@ -51,7 +51,4 @@
|
|||||||
{{ "deleteAccount" | i18n }}
|
{{ "deleteAccount" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
</app-danger-zone>
|
</app-danger-zone>
|
||||||
|
|
||||||
<ng-template #viewUserApiKeyTemplate></ng-template>
|
|
||||||
<ng-template #rotateUserApiKeyTemplate></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -272,7 +272,3 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</bit-section>
|
</bit-section>
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|
||||||
<ng-template #addEdit></ng-template>
|
|
||||||
<ng-template #takeoverTemplate></ng-template>
|
|
||||||
<ng-template #confirmTemplate></ng-template>
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component, OnInit, ViewChild, ViewContainerRef } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { lastValueFrom, Observable, firstValueFrom, switchMap } from "rxjs";
|
import { lastValueFrom, Observable, firstValueFrom, switchMap } from "rxjs";
|
||||||
|
|
||||||
import { UserNamePipe } from "@bitwarden/angular/pipes/user-name.pipe";
|
import { UserNamePipe } from "@bitwarden/angular/pipes/user-name.pipe";
|
||||||
@@ -44,12 +44,6 @@ import {
|
|||||||
templateUrl: "emergency-access.component.html",
|
templateUrl: "emergency-access.component.html",
|
||||||
})
|
})
|
||||||
export class EmergencyAccessComponent implements OnInit {
|
export class EmergencyAccessComponent implements OnInit {
|
||||||
@ViewChild("addEdit", { read: ViewContainerRef, static: true }) addEditModalRef: ViewContainerRef;
|
|
||||||
@ViewChild("takeoverTemplate", { read: ViewContainerRef, static: true })
|
|
||||||
takeoverModalRef: ViewContainerRef;
|
|
||||||
@ViewChild("confirmTemplate", { read: ViewContainerRef, static: true })
|
|
||||||
confirmModalRef: ViewContainerRef;
|
|
||||||
|
|
||||||
loaded = false;
|
loaded = false;
|
||||||
canAccessPremium$: Observable<boolean>;
|
canAccessPremium$: Observable<boolean>;
|
||||||
trustedContacts: GranteeEmergencyAccess[];
|
trustedContacts: GranteeEmergencyAccess[];
|
||||||
|
|||||||
@@ -51,5 +51,3 @@
|
|||||||
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
|
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
<ng-template #attachments></ng-template>
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit, ViewChild, ViewContainerRef } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
import { firstValueFrom } from "rxjs";
|
import { firstValueFrom } from "rxjs";
|
||||||
|
|
||||||
@@ -17,7 +17,6 @@ import { EmergencyViewDialogComponent } from "./emergency-view-dialog.component"
|
|||||||
providers: [{ provide: CipherFormConfigService, useClass: DefaultCipherFormConfigService }],
|
providers: [{ provide: CipherFormConfigService, useClass: DefaultCipherFormConfigService }],
|
||||||
})
|
})
|
||||||
export class EmergencyAccessViewComponent implements OnInit {
|
export class EmergencyAccessViewComponent implements OnInit {
|
||||||
@ViewChild("attachments", { read: ViewContainerRef, static: true })
|
|
||||||
id: EmergencyAccessId | null = null;
|
id: EmergencyAccessId | null = null;
|
||||||
ciphers: CipherView[] = [];
|
ciphers: CipherView[] = [];
|
||||||
loaded = false;
|
loaded = false;
|
||||||
|
|||||||
@@ -84,8 +84,3 @@
|
|||||||
</bit-item>
|
</bit-item>
|
||||||
</bit-item-group>
|
</bit-item-group>
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|
||||||
<ng-template #duoTemplate></ng-template>
|
|
||||||
<ng-template #emailTemplate></ng-template>
|
|
||||||
<ng-template #yubikeyTemplate></ng-template>
|
|
||||||
<ng-template #webAuthnTemplate></ng-template>
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component, OnDestroy, OnInit, ViewChild, ViewContainerRef } from "@angular/core";
|
import { Component, OnDestroy, OnInit } from "@angular/core";
|
||||||
import {
|
import {
|
||||||
first,
|
first,
|
||||||
firstValueFrom,
|
firstValueFrom,
|
||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
switchMap,
|
switchMap,
|
||||||
} from "rxjs";
|
} from "rxjs";
|
||||||
|
|
||||||
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
|
|
||||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||||
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
||||||
@@ -52,9 +51,6 @@ import { TwoFactorVerifyComponent } from "./two-factor-verify.component";
|
|||||||
imports: [ItemModule, LooseComponentsModule, SharedModule],
|
imports: [ItemModule, LooseComponentsModule, SharedModule],
|
||||||
})
|
})
|
||||||
export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
||||||
@ViewChild("yubikeyTemplate", { read: ViewContainerRef, static: true })
|
|
||||||
yubikeyModalRef: ViewContainerRef;
|
|
||||||
|
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
organization: Organization;
|
organization: Organization;
|
||||||
providers: any[] = [];
|
providers: any[] = [];
|
||||||
@@ -62,7 +58,6 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
|||||||
recoveryCodeWarningMessage: string;
|
recoveryCodeWarningMessage: string;
|
||||||
showPolicyWarning = false;
|
showPolicyWarning = false;
|
||||||
loading = true;
|
loading = true;
|
||||||
modal: ModalRef;
|
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
tabbedHeader = true;
|
tabbedHeader = true;
|
||||||
@@ -283,9 +278,6 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected updateStatus(enabled: boolean, type: TwoFactorProviderType) {
|
protected updateStatus(enabled: boolean, type: TwoFactorProviderType) {
|
||||||
if (!enabled && this.modal != null) {
|
|
||||||
this.modal.close();
|
|
||||||
}
|
|
||||||
this.providers.forEach((p) => {
|
this.providers.forEach((p) => {
|
||||||
if (p.type === type && enabled !== undefined) {
|
if (p.type === type && enabled !== undefined) {
|
||||||
p.enabled = enabled;
|
p.enabled = enabled;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Directive, ViewChild, ViewContainerRef, OnDestroy } from "@angular/core";
|
import { Directive, OnDestroy } from "@angular/core";
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
lastValueFrom,
|
lastValueFrom,
|
||||||
@@ -37,8 +37,6 @@ import { AdminConsoleCipherFormConfigService } from "../../../vault/org-vault/se
|
|||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class CipherReportComponent implements OnDestroy {
|
export class CipherReportComponent implements OnDestroy {
|
||||||
@ViewChild("cipherAddEdit", { read: ViewContainerRef, static: true })
|
|
||||||
cipherAddEditModalRef: ViewContainerRef;
|
|
||||||
isAdminConsoleActive = false;
|
isAdminConsoleActive = false;
|
||||||
|
|
||||||
loading = false;
|
loading = false;
|
||||||
|
|||||||
@@ -96,5 +96,4 @@
|
|||||||
</bit-table-scroll>
|
</bit-table-scroll>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -108,5 +108,4 @@
|
|||||||
>
|
>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -98,5 +98,4 @@
|
|||||||
</bit-table-scroll>
|
</bit-table-scroll>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -96,5 +96,4 @@
|
|||||||
</bit-table>
|
</bit-table>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -100,5 +100,4 @@
|
|||||||
</bit-table-scroll>
|
</bit-table-scroll>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
</bit-container>
|
</bit-container>
|
||||||
|
|||||||
@@ -206,4 +206,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ng-template #sendAddEdit></ng-template>
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<button bitButton buttonType="primary" bitFormButton type="submit">
|
<button bitButton buttonType="primary" bitFormButton type="submit">
|
||||||
<span>{{ "save" | i18n }}</span>
|
<span>{{ "save" | i18n }}</span>
|
||||||
</button>
|
</button>
|
||||||
<button bitButton buttonType="secondary" bitDialogClose type="button" data-dismiss="modal">
|
<button bitButton buttonType="secondary" bitDialogClose type="button">
|
||||||
{{ "cancel" | i18n }}
|
{{ "cancel" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<div class="tw-m-0 tw-ml-auto">
|
<div class="tw-m-0 tw-ml-auto">
|
||||||
|
|||||||
@@ -84,10 +84,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #attachments></ng-template>
|
|
||||||
<ng-template #folderAddEdit></ng-template>
|
|
||||||
<ng-template #cipherAddEdit></ng-template>
|
|
||||||
<ng-template #share></ng-template>
|
|
||||||
<ng-template #collectionsModal></ng-template>
|
|
||||||
<ng-template #updateKeyTemplate></ng-template>
|
|
||||||
|
|||||||
@@ -57,9 +57,6 @@
|
|||||||
bitMenuItem
|
bitMenuItem
|
||||||
buttonType="secondary"
|
buttonType="secondary"
|
||||||
type="button"
|
type="button"
|
||||||
data-toggle="dropdown"
|
|
||||||
aria-haspopup="true"
|
|
||||||
aria-expanded="false"
|
|
||||||
appA11yTitle="{{ 'options' | i18n }}"
|
appA11yTitle="{{ 'options' | i18n }}"
|
||||||
>
|
>
|
||||||
<i class="bwi bwi-cog bwi-lg" aria-hidden="true"></i>
|
<i class="bwi bwi-cog bwi-lg" aria-hidden="true"></i>
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
bitIconButton="bwi-ellipsis-h"
|
bitIconButton="bwi-ellipsis-h"
|
||||||
[bitMenuTriggerFor]="overflowMenu"
|
[bitMenuTriggerFor]="overflowMenu"
|
||||||
size="small"
|
size="small"
|
||||||
aria-haspopup
|
|
||||||
></button>
|
></button>
|
||||||
<bit-menu #overflowMenu>
|
<bit-menu #overflowMenu>
|
||||||
@for (breadcrumb of overflow; track breadcrumb) {
|
@for (breadcrumb of overflow; track breadcrumb) {
|
||||||
|
|||||||
Reference in New Issue
Block a user