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

Tools - Prefer signal & change detection (#16941)

This commit is contained in:
Oscar Hinton
2025-10-21 15:49:22 +02:00
committed by GitHub
parent 6abaaa7b13
commit f23f3f87bd
66 changed files with 329 additions and 11 deletions

View File

@@ -38,6 +38,8 @@ import { ImportType } from "../../models";
type ProfileOption = { id: string; name: string };
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "import-chrome",
templateUrl: "import-chrome.component.html",
@@ -70,14 +72,20 @@ export class ImportChromeComponent implements OnInit, OnDestroy {
profileList: ProfileOption[] = [];
format = input.required<ImportType>();
readonly format = input.required<ImportType>();
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input()
onLoadProfilesFromBrowser: (browser: string) => Promise<ProfileOption[]>;
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input()
onImportFromBrowser: (browser: string, profile: string) => Promise<any[]>;
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@Output() csvDataLoaded = new EventEmitter<string>();
constructor(

View File

@@ -12,6 +12,8 @@ import {
IconButtonModule,
} from "@bitwarden/components";
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
templateUrl: "file-password-prompt.component.html",
imports: [

View File

@@ -16,6 +16,8 @@ export interface ErrorListItem {
message: string;
}
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
templateUrl: "./import-error-dialog.component.html",
imports: [CommonModule, JslibModule, DialogModule, TableModule, ButtonModule],

View File

@@ -20,6 +20,8 @@ export interface ResultList {
count: number;
}
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
templateUrl: "./import-success-dialog.component.html",
imports: [CommonModule, JslibModule, DialogModule, TableModule, ButtonModule],

View File

@@ -12,6 +12,8 @@ import {
IconButtonModule,
} from "@bitwarden/components";
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
templateUrl: "sshkey-password-prompt.component.html",
imports: [

View File

@@ -86,6 +86,8 @@ import {
import { ImporterProviders } from "./importer-providers";
import { ImportLastPassComponent } from "./lastpass";
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "tools-import",
templateUrl: "import.component.html",
@@ -131,6 +133,8 @@ export class ImportComponent implements OnInit, OnDestroy, AfterViewInit {
* Enables the hosting control to pass in an organizationId
* If a organizationId is provided, the organization selection is disabled.
*/
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input() set organizationId(value: OrganizationId | string | undefined) {
if (Utils.isNullOrEmpty(value)) {
this._organizationId = undefined;
@@ -157,9 +161,13 @@ export class ImportComponent implements OnInit, OnDestroy, AfterViewInit {
});
}
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input()
onLoadProfilesFromBrowser: (browser: string) => Promise<any[]>;
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input()
onImportFromBrowser: (browser: string, profile: string) => Promise<any[]>;
@@ -191,15 +199,23 @@ export class ImportComponent implements OnInit, OnDestroy, AfterViewInit {
chromiumLoader: [Loader.file as DataLoader],
});
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@ViewChild(BitSubmitDirective)
private bitSubmit: BitSubmitDirective;
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@Output()
formLoading = new EventEmitter<boolean>();
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@Output()
formDisabled = new EventEmitter<boolean>();
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@Output()
onSuccessfulImport = new EventEmitter<string>();

View File

@@ -21,6 +21,8 @@ type LastPassMultifactorPromptData = {
variant: LastPassMultifactorPromptVariant;
};
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
templateUrl: "lastpass-multifactor-prompt.component.html",
imports: [

View File

@@ -15,6 +15,8 @@ import {
TypographyModule,
} from "@bitwarden/components";
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
templateUrl: "lastpass-password-prompt.component.html",
imports: [

View File

@@ -25,6 +25,8 @@ import {
import { LastPassDirectImportService } from "./lastpass-direct-import.service";
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "import-lastpass",
templateUrl: "import-lastpass.component.html",
@@ -60,6 +62,8 @@ export class ImportLastPassComponent implements OnInit, OnDestroy {
}),
);
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@Output() csvDataLoaded = new EventEmitter<string>();
constructor(