Polish Round 1 (#2396)
This commit is contained in:
parent
cf2c43d390
commit
02b002d81a
197 changed files with 1233 additions and 1751 deletions
|
|
@ -1,23 +0,0 @@
|
|||
import {inject, Pipe, PipeTransform} from '@angular/core';
|
||||
import { DevicePlatform } from 'src/app/_models/device/device-platform';
|
||||
import {TranslocoService} from "@ngneat/transloco";
|
||||
|
||||
@Pipe({
|
||||
name: 'devicePlatform',
|
||||
standalone: true
|
||||
})
|
||||
export class DevicePlatformPipe implements PipeTransform {
|
||||
|
||||
translocoService = inject(TranslocoService);
|
||||
|
||||
transform(value: DevicePlatform): string {
|
||||
switch(value) {
|
||||
case DevicePlatform.Kindle: return 'Kindle';
|
||||
case DevicePlatform.Kobo: return 'Kobo';
|
||||
case DevicePlatform.PocketBook: return 'PocketBook';
|
||||
case DevicePlatform.Custom: return this.translocoService.translate('device-platform-pipe.custom');
|
||||
default: return value + '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
import {inject, Pipe, PipeTransform} from '@angular/core';
|
||||
import { ThemeProvider } from 'src/app/_models/preferences/site-theme';
|
||||
import {TranslocoService} from "@ngneat/transloco";
|
||||
|
||||
|
||||
@Pipe({
|
||||
name: 'siteThemeProvider',
|
||||
standalone: true
|
||||
})
|
||||
export class SiteThemeProviderPipe implements PipeTransform {
|
||||
|
||||
translocoService = inject(TranslocoService);
|
||||
|
||||
transform(provider: ThemeProvider | undefined | null): string {
|
||||
if (provider === null || provider === undefined) return '';
|
||||
switch(provider) {
|
||||
case ThemeProvider.System:
|
||||
return this.translocoService.translate('site-theme-provider-pipe.system');
|
||||
case ThemeProvider.User:
|
||||
return this.translocoService.translate('site-theme-provider-pipe.user');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ import { AgeRating } from 'src/app/_models/metadata/age-rating';
|
|||
import { User } from 'src/app/_models/user';
|
||||
import { AccountService } from 'src/app/_services/account.service';
|
||||
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
|
||||
import { AgeRatingPipe } from '../../pipe/age-rating.pipe';
|
||||
import { AgeRatingPipe } from '../../_pipes/age-rating.pipe';
|
||||
import { RestrictionSelectorComponent } from '../restriction-selector/restriction-selector.component';
|
||||
import { NgbCollapse } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { NgIf, AsyncPipe } from '@angular/common';
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { Device } from 'src/app/_models/device/device';
|
|||
import { DevicePlatform, devicePlatforms } from 'src/app/_models/device/device-platform';
|
||||
import { DeviceService } from 'src/app/_services/device.service';
|
||||
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
|
||||
import { DevicePlatformPipe } from '../_pipes/device-platform.pipe';
|
||||
import { DevicePlatformPipe } from '../../_pipes/device-platform.pipe';
|
||||
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {NgIf, NgFor, NgTemplateOutlet} from '@angular/common';
|
||||
import {translate, TranslocoModule} from "@ngneat/transloco";
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { ToastrService } from 'ngx-toastr';
|
|||
import { Subject } from 'rxjs';
|
||||
import { Device } from 'src/app/_models/device/device';
|
||||
import { DeviceService } from 'src/app/_services/device.service';
|
||||
import { DevicePlatformPipe } from '../_pipes/device-platform.pipe';
|
||||
import { SentenceCasePipe } from '../../pipe/sentence-case.pipe';
|
||||
import { DevicePlatformPipe } from '../../_pipes/device-platform.pipe';
|
||||
import { SentenceCasePipe } from '../../_pipes/sentence-case.pipe';
|
||||
import { NgIf, NgFor } from '@angular/common';
|
||||
import { EditDeviceComponent } from '../edit-device/edit-device.component';
|
||||
import { NgbCollapse } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import { SiteTheme } from 'src/app/_models/preferences/site-theme';
|
|||
import { User } from 'src/app/_models/user';
|
||||
import { AccountService } from 'src/app/_services/account.service';
|
||||
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
|
||||
import { SiteThemeProviderPipe } from '../_pipes/site-theme-provider.pipe';
|
||||
import { SentenceCasePipe } from '../../pipe/sentence-case.pipe';
|
||||
import { SiteThemeProviderPipe } from '../../_pipes/site-theme-provider.pipe';
|
||||
import { SentenceCasePipe } from '../../_pipes/sentence-case.pipe';
|
||||
import { NgIf, NgFor, AsyncPipe } from '@angular/common';
|
||||
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {
|
|||
ChangeDetectionStrategy,
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
DestroyRef, importProvidersFrom,
|
||||
DestroyRef,
|
||||
inject,
|
||||
OnDestroy,
|
||||
OnInit
|
||||
|
|
@ -31,7 +31,7 @@ import {forkJoin} from 'rxjs';
|
|||
import { bookColorThemes } from 'src/app/book-reader/_components/reader-settings/reader-settings.component';
|
||||
import { BookService } from 'src/app/book-reader/_services/book.service';
|
||||
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
|
||||
import { SentenceCasePipe } from '../../pipe/sentence-case.pipe';
|
||||
import { SentenceCasePipe } from '../../_pipes/sentence-case.pipe';
|
||||
import { UserHoldsComponent } from '../user-holds/user-holds.component';
|
||||
import { UserScrobbleHistoryComponent } from '../../_single-module/user-scrobble-history/user-scrobble-history.component';
|
||||
import { UserStatsComponent } from '../../statistics/_components/user-stats/user-stats.component';
|
||||
|
|
@ -72,11 +72,11 @@ enum FragmentID {
|
|||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-user-preferences',
|
||||
templateUrl: './user-preferences.component.html',
|
||||
styleUrls: ['./user-preferences.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
selector: 'app-user-preferences',
|
||||
templateUrl: './user-preferences.component.html',
|
||||
styleUrls: ['./user-preferences.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [SideNavCompanionBarComponent, NgbNav, NgFor, NgbNavItem, NgbNavItemRole, NgbNavLink, RouterLink, NgbNavContent, NgIf, ChangeEmailComponent,
|
||||
ChangePasswordComponent, ChangeAgeRestrictionComponent, AnilistKeyComponent, ReactiveFormsModule, NgbAccordionDirective, NgbAccordionItem, NgbAccordionHeader,
|
||||
NgbAccordionToggle, NgbAccordionButton, NgbCollapse, NgbAccordionCollapse, NgbAccordionBody, NgbTooltip, NgTemplateOutlet, ColorPickerModule, ApiKeyComponent,
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AuthGuard } from '../_guards/auth.guard';
|
||||
import { UserPreferencesComponent } from './user-preferences/user-preferences.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{path: '**', component: UserPreferencesComponent, pathMatch: 'full'},
|
||||
{
|
||||
path: '',
|
||||
runGuardsAndResolvers: 'always',
|
||||
canActivate: [AuthGuard],
|
||||
children: [
|
||||
{path: '', component: UserPreferencesComponent, pathMatch: 'full'},
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes), ],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class UserSettingsRoutingModule { }
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import {CommonModule, NgOptimizedImage} from '@angular/common';
|
||||
import { UserPreferencesComponent } from './user-preferences/user-preferences.component';
|
||||
import {
|
||||
NgbAccordionBody,
|
||||
NgbAccordionButton, NgbAccordionCollapse,
|
||||
NgbAccordionDirective, NgbAccordionHeader, NgbAccordionItem,
|
||||
NgbCollapseModule,
|
||||
NgbNavModule,
|
||||
NgbTooltipModule
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { UserSettingsRoutingModule } from './user-settings-routing.module';
|
||||
import { ApiKeyComponent } from './api-key/api-key.component';
|
||||
import { SiteThemeProviderPipe } from './_pipes/site-theme-provider.pipe';
|
||||
import { ThemeManagerComponent } from './theme-manager/theme-manager.component';
|
||||
import { ColorPickerModule } from 'ngx-color-picker';
|
||||
import { ManageDevicesComponent } from './manage-devices/manage-devices.component';
|
||||
import { DevicePlatformPipe } from './_pipes/device-platform.pipe';
|
||||
import { EditDeviceComponent } from './edit-device/edit-device.component';
|
||||
import { ChangePasswordComponent } from './change-password/change-password.component';
|
||||
import { ChangeEmailComponent } from './change-email/change-email.component';
|
||||
import { ChangeAgeRestrictionComponent } from './change-age-restriction/change-age-restriction.component';
|
||||
import { RestrictionSelectorComponent } from './restriction-selector/restriction-selector.component';
|
||||
|
||||
import { AnilistKeyComponent } from './anilist-key/anilist-key.component';
|
||||
import {UserScrobbleHistoryComponent} from "../_single-module/user-scrobble-history/user-scrobble-history.component";
|
||||
import { UserHoldsComponent } from "./user-holds/user-holds.component";
|
||||
import {SentenceCasePipe} from "../pipe/sentence-case.pipe";
|
||||
import {AgeRatingPipe} from "../pipe/age-rating.pipe";
|
||||
import {LoadingComponent} from "../shared/loading/loading.component";
|
||||
import {
|
||||
SideNavCompanionBarComponent
|
||||
} from "../sidenav/_components/side-nav-companion-bar/side-nav-companion-bar.component";
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
ReactiveFormsModule,
|
||||
NgbNavModule,
|
||||
NgbTooltipModule,
|
||||
NgbCollapseModule,
|
||||
ColorPickerModule,
|
||||
UserSettingsRoutingModule,
|
||||
UserScrobbleHistoryComponent,
|
||||
UserHoldsComponent,
|
||||
NgOptimizedImage,
|
||||
SentenceCasePipe,
|
||||
AgeRatingPipe,
|
||||
LoadingComponent,
|
||||
SideNavCompanionBarComponent,
|
||||
NgbAccordionDirective,
|
||||
NgbAccordionItem,
|
||||
NgbAccordionHeader,
|
||||
NgbAccordionButton,
|
||||
NgbAccordionCollapse,
|
||||
NgbAccordionBody,
|
||||
UserPreferencesComponent,
|
||||
ApiKeyComponent,
|
||||
ThemeManagerComponent,
|
||||
SiteThemeProviderPipe,
|
||||
ManageDevicesComponent,
|
||||
DevicePlatformPipe,
|
||||
EditDeviceComponent,
|
||||
ChangePasswordComponent,
|
||||
ChangeEmailComponent,
|
||||
RestrictionSelectorComponent,
|
||||
ChangeAgeRestrictionComponent,
|
||||
AnilistKeyComponent,
|
||||
],
|
||||
exports: [
|
||||
SiteThemeProviderPipe,
|
||||
ApiKeyComponent,
|
||||
RestrictionSelectorComponent,
|
||||
]
|
||||
})
|
||||
export class UserSettingsModule { }
|
||||
Loading…
Add table
Add a link
Reference in a new issue