Refactor book service in BE and FE (#2013)
* Refactor book service in BE and FE * Add missing method --------- Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+2
-1
@@ -3,7 +3,7 @@ import {Tooltip} from 'primeng/tooltip';
|
||||
|
||||
export type DocType = 'kobo' | 'opds' | 'metadataManager' | 'koReader' | 'email'
|
||||
| 'amazonCookie' | 'fetchConfig' | 'hardcover' | 'taskManagement' | 'fileNamePatterns'
|
||||
| 'authentication';
|
||||
| 'authentication' | 'telemetry';
|
||||
|
||||
@Component({
|
||||
selector: 'app-external-doc-link',
|
||||
@@ -39,6 +39,7 @@ export class ExternalDocLinkComponent {
|
||||
taskManagement: `${this.BASE_URL}/tools/task-manager`,
|
||||
fileNamePatterns: `${this.BASE_URL}/metadata/file-naming-patterns`,
|
||||
authentication: `${this.BASE_URL}/authentication/overview#setting-up-oidc`,
|
||||
telemetry: `${this.BASE_URL}/tools/telemetry`
|
||||
};
|
||||
|
||||
@Input() docType!: DocType;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {DomSanitizer, SafeHtml} from '@angular/platform-browser';
|
||||
template: `
|
||||
@if (icon) {
|
||||
@if (icon.type === 'PRIME_NG') {
|
||||
<i [class]="getPrimeNgIconClass(icon.value)" [ngClass]="iconClass" [ngStyle]="iconStyle"></i>
|
||||
<i [class]="getPrimeNgIconClass(icon.value)" [ngClass]="iconClass" [ngStyle]="getPrimeNgStyle()"></i>
|
||||
} @else {
|
||||
<div
|
||||
class="svg-icon-inline"
|
||||
@@ -67,7 +67,7 @@ export class IconDisplayComponent implements OnInit, OnChanges {
|
||||
const previousIcon = changes['icon'].previousValue;
|
||||
|
||||
if (currentIcon?.type === 'CUSTOM_SVG' &&
|
||||
currentIcon?.value !== previousIcon?.value) {
|
||||
currentIcon?.value !== previousIcon?.value) {
|
||||
this.loadIconIfNeeded();
|
||||
}
|
||||
}
|
||||
@@ -114,4 +114,20 @@ export class IconDisplayComponent implements OnInit, OnChanges {
|
||||
...this.iconStyle
|
||||
};
|
||||
}
|
||||
|
||||
getPrimeNgStyle(): Record<string, string> {
|
||||
const fontSize = this.size.endsWith('px')
|
||||
? `${parseInt(this.size) * 0.85}px`
|
||||
: `calc(${this.size} * 0.85)`;
|
||||
|
||||
return {
|
||||
fontSize: fontSize,
|
||||
width: this.size,
|
||||
height: this.size,
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
...this.iconStyle
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user