Readme Change (#2190)
* Implemented the ability to login to the app by passing apiKey to the login. This is for an upcoming feature (but currently blocked by another story) * Added a comment * Ensure locales are sorted * Added a new status badge that shows how many active installs we have via users that use stats. * Bump all GA to latest versions * Bumped dependencies * Bumped backend notifications * Updated ngx-pdf-reader to upcoming beta which fixes some PDFs taking time to load. PDF reader will use browser locale to load localization rather than Kavita locale for now. * Downgraded pdf viewer as beta has lots of bugs.
This commit is contained in:
parent
d4e1e08b4f
commit
9f17f5daa7
17 changed files with 93 additions and 76 deletions
|
|
@ -50,14 +50,6 @@ export class AppComponent implements OnInit {
|
|||
if (!user) return false;
|
||||
return user.preferences.noTransitions;
|
||||
}), takeUntilDestroyed(this.destroyRef));
|
||||
|
||||
this.translocoService.events$.subscribe(event => {
|
||||
if (event.type === 'translationLoadSuccess') {
|
||||
console.log('Language has fully loaded!', translate('login.title'));
|
||||
}
|
||||
console.log('language event: ', event.type, translate('login.title'));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@HostListener('window:resize', ['$event'])
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
height="100vh"
|
||||
[(page)]="currentPage"
|
||||
[textLayer]="true"
|
||||
[useBrowserLocale]="false"
|
||||
[useBrowserLocale]="true"
|
||||
[showHandToolButton]="true"
|
||||
[showOpenFileButton]="false"
|
||||
[showPrintButton]="false"
|
||||
|
|
@ -30,7 +30,6 @@
|
|||
[showSecondaryToolbarButton]="true"
|
||||
[showBorders]="true"
|
||||
[theme]="theme"
|
||||
[formTheme]="theme"
|
||||
[backgroundColor]="backgroundColor"
|
||||
[customToolbar]="multiToolbar"
|
||||
[language]="user.preferences.locale"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import {AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit} from '@angular/core';
|
||||
import { FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import {ActivatedRoute, Router, RouterLink} from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { take } from 'rxjs/operators';
|
||||
|
|
@ -18,17 +18,10 @@ import {TRANSLOCO_SCOPE, TranslocoDirective} from "@ngneat/transloco";
|
|||
styleUrls: ['./user-login.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [SplashContainerComponent, NgIf, ReactiveFormsModule, RouterLink, TranslocoDirective],
|
||||
providers: [
|
||||
{
|
||||
provide: TRANSLOCO_SCOPE,
|
||||
useValue: 'login'
|
||||
}
|
||||
]
|
||||
imports: [SplashContainerComponent, NgIf, ReactiveFormsModule, RouterLink, TranslocoDirective]
|
||||
})
|
||||
export class UserLoginComponent implements OnInit {
|
||||
|
||||
//model: any = {username: '', password: ''};
|
||||
loginForm: FormGroup = new FormGroup({
|
||||
username: new FormControl('', [Validators.required]),
|
||||
password: new FormControl('', [Validators.required, Validators.maxLength(32), Validators.minLength(6), Validators.pattern("^.{6,32}$")])
|
||||
|
|
@ -45,8 +38,8 @@ export class UserLoginComponent implements OnInit {
|
|||
isSubmitting = false;
|
||||
|
||||
constructor(private accountService: AccountService, private router: Router, private memberService: MemberService,
|
||||
private toastr: ToastrService, private navService: NavService, private modalService: NgbModal,
|
||||
private readonly cdRef: ChangeDetectorRef) {
|
||||
private toastr: ToastrService, private navService: NavService,
|
||||
private readonly cdRef: ChangeDetectorRef, private route: ActivatedRoute) {
|
||||
this.navService.showNavBar();
|
||||
this.navService.hideSideNav();
|
||||
}
|
||||
|
|
@ -76,11 +69,21 @@ export class UserLoginComponent implements OnInit {
|
|||
|
||||
this.cdRef.markForCheck();
|
||||
});
|
||||
|
||||
this.route.queryParamMap.subscribe(params => {
|
||||
const val = params.get('apiKey');
|
||||
console.log('key: ', val);
|
||||
if (val != null && val.length > 0) {
|
||||
this.login(val);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
login() {
|
||||
|
||||
login(apiKey: string = '') {
|
||||
const model = this.loginForm.getRawValue();
|
||||
model.apiKey = apiKey;
|
||||
this.isSubmitting = true;
|
||||
this.cdRef.markForCheck();
|
||||
this.accountService.login(model).subscribe(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue