Browse Source

better login dialog

pull/2124/head
bptrgx 2 years ago
committed by Thomas
parent
commit
b2d0b4c75c
  1. 8
      apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts
  2. 13
      apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.html
  3. 11
      apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.scss

8
apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts

@ -16,6 +16,8 @@ import { TokenStorageService } from '@ghostfolio/client/services/token-storage.s
templateUrl: 'login-with-access-token-dialog.html'
})
export class LoginWithAccessTokenDialog {
public hide = true;
public constructor(
@Inject(MAT_DIALOG_DATA) public data: any,
public dialogRef: MatDialogRef<LoginWithAccessTokenDialog>,
@ -47,4 +49,10 @@ export class LoginWithAccessTokenDialog {
this.router.navigate(['/']);
} catch {}
}
public onSubmit() {
if (this.data.accessToken) {
this.dialogRef.close(this.data);
}
}
}

13
apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.html

@ -6,15 +6,20 @@
<div class="py-3" mat-dialog-content>
<div class="align-items-center d-flex flex-column">
<form id="login" class="display-contents" (ngSubmit)="onSubmit()">
<mat-form-field appearance="outline" class="without-hint w-100">
<mat-label i18n>Security Token</mat-label>
<textarea
cdkTextareaAutosize
<input
matInput
type="text"
[type]="hide ? 'password' : 'text'"
name="password"
[(ngModel)]="data.accessToken"
></textarea>
/>
<div id="hide-password" matSuffix (click)="hide = !hide">
<ion-icon name="{{hide ? 'eye-outline' : 'eye-off-outline'}}"></ion-icon>
</div>
</mat-form-field>
</form>
<ng-container *ngIf="data.hasPermissionToUseSocialLogin">
<div class="my-3 text-center text-muted" i18n>or</div>
<div class="d-flex flex-column">

11
apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.scss

@ -1,3 +1,14 @@
:host {
display: block;
.display-contents {
display: contents;
}
#hide-password {
padding: 10px;
min-height: 44px;
display: flex;
align-items: center;
}
}

Loading…
Cancel
Save