mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
Address issues with eslint rules regarding signals and OnPush change detection (#17057)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
32a40a91f5
commit
47975fda37
@@ -63,6 +63,8 @@ export type AutoConfirmPolicyDialogData = PolicyEditDialogData & {
|
|||||||
* Satisfies the PolicyDialogComponent interface structurally
|
* Satisfies the PolicyDialogComponent interface structurally
|
||||||
* via its static open() function.
|
* via its static open() function.
|
||||||
*/
|
*/
|
||||||
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||||
|
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "auto-confirm-edit-policy-dialog.component.html",
|
templateUrl: "auto-confirm-edit-policy-dialog.component.html",
|
||||||
imports: [SharedModule],
|
imports: [SharedModule],
|
||||||
@@ -73,8 +75,8 @@ export class AutoConfirmPolicyDialogComponent
|
|||||||
{
|
{
|
||||||
policyType = PolicyType;
|
policyType = PolicyType;
|
||||||
|
|
||||||
protected firstTimeDialog = signal(false);
|
protected readonly firstTimeDialog = signal(false);
|
||||||
protected currentStep = signal(0);
|
protected readonly currentStep = signal(0);
|
||||||
protected multiStepSubmit: Observable<MultiStepSubmit[]> = of([]);
|
protected multiStepSubmit: Observable<MultiStepSubmit[]> = of([]);
|
||||||
protected autoConfirmEnabled$: Observable<boolean> = this.accountService.activeAccount$.pipe(
|
protected autoConfirmEnabled$: Observable<boolean> = this.accountService.activeAccount$.pipe(
|
||||||
getUserId,
|
getUserId,
|
||||||
@@ -82,11 +84,13 @@ export class AutoConfirmPolicyDialogComponent
|
|||||||
map((policies) => policies.find((p) => p.type === PolicyType.AutoConfirm)?.enabled ?? false),
|
map((policies) => policies.find((p) => p.type === PolicyType.AutoConfirm)?.enabled ?? false),
|
||||||
);
|
);
|
||||||
|
|
||||||
private submitPolicy: Signal<TemplateRef<unknown> | undefined> = viewChild("step0");
|
private readonly submitPolicy: Signal<TemplateRef<unknown> | undefined> = viewChild("step0");
|
||||||
private openExtension: Signal<TemplateRef<unknown> | undefined> = viewChild("step1");
|
private readonly openExtension: Signal<TemplateRef<unknown> | undefined> = viewChild("step1");
|
||||||
|
|
||||||
private submitPolicyTitle: Signal<TemplateRef<unknown> | undefined> = viewChild("step0Title");
|
private readonly submitPolicyTitle: Signal<TemplateRef<unknown> | undefined> =
|
||||||
private openExtensionTitle: Signal<TemplateRef<unknown> | undefined> = viewChild("step1Title");
|
viewChild("step0Title");
|
||||||
|
private readonly openExtensionTitle: Signal<TemplateRef<unknown> | undefined> =
|
||||||
|
viewChild("step1Title");
|
||||||
|
|
||||||
override policyComponent: AutoConfirmPolicyEditComponent | undefined;
|
override policyComponent: AutoConfirmPolicyEditComponent | undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,16 @@ export class AutoConfirmPolicy extends BasePolicyEditDefinition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||||
|
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "auto-confirm-policy.component.html",
|
templateUrl: "auto-confirm-policy.component.html",
|
||||||
imports: [SharedModule],
|
imports: [SharedModule],
|
||||||
})
|
})
|
||||||
export class AutoConfirmPolicyEditComponent extends BasePolicyEditComponent implements OnInit {
|
export class AutoConfirmPolicyEditComponent extends BasePolicyEditComponent implements OnInit {
|
||||||
protected readonly autoConfirmSvg = AutoConfirmSvg;
|
protected readonly autoConfirmSvg = AutoConfirmSvg;
|
||||||
private policyForm: Signal<TemplateRef<any> | undefined> = viewChild("step0");
|
private readonly policyForm: Signal<TemplateRef<any> | undefined> = viewChild("step0");
|
||||||
private extensionButton: Signal<TemplateRef<any> | undefined> = viewChild("step1");
|
private readonly extensionButton: Signal<TemplateRef<any> | undefined> = viewChild("step1");
|
||||||
|
|
||||||
protected step: number = 0;
|
protected step: number = 0;
|
||||||
protected steps = [this.policyForm, this.extensionButton];
|
protected steps = [this.policyForm, this.extensionButton];
|
||||||
|
|||||||
Reference in New Issue
Block a user