mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-26 22:38:45 +00:00
fix(console): Auth method dialog title, layout issues (#4216)
* fix(console): app auth method dialog title * lint
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { AddAppKeyResponse, AddMachineKeyResponse } from 'src/app/proto/generated/zitadel/management_pb';
|
||||
import { InfoSectionType } from '../info-section/info-section.component';
|
||||
|
||||
@Component({
|
||||
selector: 'cnsl-show-key-dialog',
|
||||
@@ -10,20 +11,18 @@ import { AddAppKeyResponse, AddMachineKeyResponse } from 'src/app/proto/generate
|
||||
})
|
||||
export class ShowKeyDialogComponent {
|
||||
public keyResponse!: AddMachineKeyResponse.AsObject | AddAppKeyResponse.AsObject;
|
||||
public InfoSectionType: any = InfoSectionType;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ShowKeyDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
) {
|
||||
constructor(public dialogRef: MatDialogRef<ShowKeyDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any) {
|
||||
this.keyResponse = data.key;
|
||||
}
|
||||
|
||||
public saveFile(): void {
|
||||
const json = atob(this.keyResponse.keyDetails.toString());
|
||||
const blob = new Blob([json], { type: 'text/plain;charset=utf-8' });
|
||||
const name = (this.keyResponse as AddMachineKeyResponse.AsObject).keyId ?
|
||||
(this.keyResponse as AddMachineKeyResponse.AsObject).keyId :
|
||||
(this.keyResponse as AddAppKeyResponse.AsObject).id;
|
||||
const name = (this.keyResponse as AddMachineKeyResponse.AsObject).keyId
|
||||
? (this.keyResponse as AddMachineKeyResponse.AsObject).keyId
|
||||
: (this.keyResponse as AddAppKeyResponse.AsObject).id;
|
||||
saveAs(blob, `${name}.json`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user