1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

[PM-14990] Add password prompt for ssh key import (#12105)

* Add password prompt for ssh key import

* Remove empty line

* Convert to switch statement
This commit is contained in:
Bernd Schoolmann
2024-11-27 08:29:36 -08:00
committed by GitHub
parent 2767851925
commit f79141c421
5 changed files with 147 additions and 30 deletions

View File

@@ -0,0 +1,46 @@
import { DialogRef } from "@angular/cdk/dialog";
import { CommonModule } from "@angular/common";
import { Component } from "@angular/core";
import { FormBuilder, ReactiveFormsModule, Validators } from "@angular/forms";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import {
AsyncActionsModule,
ButtonModule,
DialogModule,
FormFieldModule,
IconButtonModule,
} from "@bitwarden/components";
@Component({
templateUrl: "sshkey-password-prompt.component.html",
standalone: true,
imports: [
CommonModule,
JslibModule,
DialogModule,
FormFieldModule,
AsyncActionsModule,
ButtonModule,
IconButtonModule,
ReactiveFormsModule,
],
})
export class SshKeyPasswordPromptComponent {
protected formGroup = this.formBuilder.group({
sshKeyPassword: ["", Validators.required],
});
constructor(
public dialogRef: DialogRef,
protected formBuilder: FormBuilder,
) {}
submit = () => {
this.formGroup.markAsTouched();
if (!this.formGroup.valid) {
return;
}
this.dialogRef.close(this.formGroup.value.sshKeyPassword);
};
}