1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +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

@@ -34,6 +34,8 @@ const Controls = Object.freeze({
});
/** Options group for passphrases */
// 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-passphrase-settings",
templateUrl: "passphrase-settings.component.html",
@@ -57,6 +59,8 @@ export class PassphraseSettingsComponent implements OnInit, OnChanges, OnDestroy
*
* @warning this may reveal sensitive information in plaintext.
*/
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input()
debug: boolean = false;
@@ -67,6 +71,8 @@ export class PassphraseSettingsComponent implements OnInit, OnChanges, OnDestroy
* @remarks this is initialized to null but since it's a required input it'll
* never have that value in practice.
*/
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input({ required: true })
account: Account = null!;
@@ -79,10 +85,14 @@ export class PassphraseSettingsComponent implements OnInit, OnChanges, OnDestroy
}
/** When `true`, an options header is displayed by the component. Otherwise, the header is hidden. */
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input()
showHeader: boolean = true;
/** Removes bottom margin from `bit-section` */
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input({ transform: coerceBooleanProperty }) disableMargin = false;
/** Emits settings updates and completes if the settings become unavailable.
@@ -90,6 +100,8 @@ export class PassphraseSettingsComponent implements OnInit, OnChanges, OnDestroy
* to receive live settings updates including the initial update,
* use {@link CredentialGeneratorService.settings} instead.
*/
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@Output()
readonly onUpdated = new EventEmitter<PassphraseGenerationOptions>();