1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-19 02:44:01 +00:00
Files
browser/apps/desktop/src/platform/components/approve-ssh-request.ts
Daniel James Smith 2a53735e55 [PM-29565] Delete deprecated callout component (#17895)
* Replace usages of app-callout with bit-callout

* Delete callout.component

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2026-02-17 09:25:09 -08:00

79 lines
1.9 KiB
TypeScript

import { CommonModule } from "@angular/common";
import { Component, Inject } from "@angular/core";
import { FormBuilder, ReactiveFormsModule } from "@angular/forms";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import {
DIALOG_DATA,
DialogRef,
AsyncActionsModule,
ButtonModule,
DialogModule,
FormFieldModule,
IconButtonModule,
DialogService,
CalloutModule,
} from "@bitwarden/components";
export interface ApproveSshRequestParams {
cipherName: string;
applicationName: string;
isAgentForwarding: boolean;
action: 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: "app-approve-ssh-request",
templateUrl: "approve-ssh-request.html",
imports: [
DialogModule,
CommonModule,
JslibModule,
ButtonModule,
IconButtonModule,
ReactiveFormsModule,
AsyncActionsModule,
FormFieldModule,
CalloutModule,
],
})
export class ApproveSshRequestComponent {
approveSshRequestForm = this.formBuilder.group({});
constructor(
@Inject(DIALOG_DATA) protected params: ApproveSshRequestParams,
private dialogRef: DialogRef<boolean>,
private formBuilder: FormBuilder,
) {}
static open(
dialogService: DialogService,
cipherName: string,
applicationName: string,
isAgentForwarding: boolean,
namespace: string,
) {
let actioni18nKey = "sshActionLogin";
if (namespace === "git") {
actioni18nKey = "sshActionGitSign";
} else if (namespace != null && namespace != "") {
actioni18nKey = "sshActionSign";
}
return dialogService.open<boolean, ApproveSshRequestParams>(ApproveSshRequestComponent, {
data: {
cipherName,
applicationName,
isAgentForwarding,
action: actioni18nKey,
},
});
}
submit = async () => {
this.dialogRef.close(true);
};
}