Migrate existing control flow directives to use new control-flow schematic
This commit is contained in:
committed by
Aditya Chandel
parent
246efdaa34
commit
0f852ef068
+15
-9
@@ -4,25 +4,31 @@
|
||||
<label class="w-40 text-right font-medium">Provider Name:</label>
|
||||
<input type="text" pInputText formControlName="name" placeholder="Enter provider name..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="emailProviderForm.get('name')?.invalid && (emailProviderForm.get('name')?.dirty || emailProviderForm.get('name')?.touched)">
|
||||
Provider name is required.
|
||||
</small>
|
||||
@if (emailProviderForm.get('name')?.invalid && (emailProviderForm.get('name')?.dirty || emailProviderForm.get('name')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Provider name is required.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Host:</label>
|
||||
<input type="text" pInputText formControlName="host" placeholder="Enter host..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="emailProviderForm.get('host')?.invalid && (emailProviderForm.get('host')?.dirty || emailProviderForm.get('host')?.touched)">
|
||||
Host is required.
|
||||
</small>
|
||||
@if (emailProviderForm.get('host')?.invalid && (emailProviderForm.get('host')?.dirty || emailProviderForm.get('host')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Host is required.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Port:</label>
|
||||
<input type="number" pInputText formControlName="port" placeholder="Enter port..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="emailProviderForm.get('port')?.invalid && (emailProviderForm.get('port')?.dirty || emailProviderForm.get('port')?.touched)">
|
||||
Port is required and must be a number.
|
||||
</small>
|
||||
@if (emailProviderForm.get('port')?.invalid && (emailProviderForm.get('port')?.dirty || emailProviderForm.get('port')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Port is required and must be a number.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Username:</label>
|
||||
|
||||
+2
-3
@@ -2,7 +2,7 @@ import { Component, inject, OnInit } from '@angular/core';
|
||||
import { Button } from 'primeng/button';
|
||||
import { Checkbox } from 'primeng/checkbox';
|
||||
import { InputText } from 'primeng/inputtext';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { EmailProviderService } from '../email-provider/email-provider.service';
|
||||
import { MessageService } from 'primeng/api';
|
||||
@@ -14,9 +14,8 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
||||
Button,
|
||||
Checkbox,
|
||||
InputText,
|
||||
NgIf,
|
||||
ReactiveFormsModule
|
||||
],
|
||||
],
|
||||
templateUrl: './create-email-provider-dialog.component.html',
|
||||
styleUrl: './create-email-provider-dialog.component.scss'
|
||||
})
|
||||
|
||||
+10
-6
@@ -4,17 +4,21 @@
|
||||
<label class="w-40 text-right font-medium">Recipient Name:</label>
|
||||
<input type="text" pInputText formControlName="name" placeholder="Enter recipient name..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="emailRecipientForm.get('name')?.invalid && (emailRecipientForm.get('name')?.dirty || emailRecipientForm.get('name')?.touched)">
|
||||
Recipient name is required.
|
||||
</small>
|
||||
@if (emailRecipientForm.get('name')?.invalid && (emailRecipientForm.get('name')?.dirty || emailRecipientForm.get('name')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Recipient name is required.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Email Address:</label>
|
||||
<input type="email" pInputText formControlName="email" placeholder="Enter email address..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="emailRecipientForm.get('email')?.invalid && (emailRecipientForm.get('email')?.dirty || emailRecipientForm.get('email')?.touched)">
|
||||
Valid email is required.
|
||||
</small>
|
||||
@if (emailRecipientForm.get('email')?.invalid && (emailRecipientForm.get('email')?.dirty || emailRecipientForm.get('email')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Valid email is required.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Default Recipient:</label>
|
||||
|
||||
+3
-4
@@ -5,7 +5,7 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
||||
import { Checkbox } from 'primeng/checkbox';
|
||||
import { Button } from 'primeng/button';
|
||||
import { InputText } from 'primeng/inputtext';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
import { EmailRecipientService } from '../email-recipient/email-recipient.service';
|
||||
|
||||
@Component({
|
||||
@@ -14,9 +14,8 @@ import { EmailRecipientService } from '../email-recipient/email-recipient.servic
|
||||
Checkbox,
|
||||
ReactiveFormsModule,
|
||||
Button,
|
||||
InputText,
|
||||
NgIf
|
||||
],
|
||||
InputText
|
||||
],
|
||||
templateUrl: './create-email-recipient-dialog.component.html',
|
||||
styleUrls: ['./create-email-recipient-dialog.component.scss']
|
||||
})
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<h2 class="text-lg flex items-center gap-2">
|
||||
Email Providers
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Configure email-sending services like Gmail, Outlook, or custom SMTP servers for sending books via email. The default email provider will be used for 'Quick Book Send' located in the Book Card menu"
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
pTooltip="Configure email-sending services like Gmail, Outlook, or custom SMTP servers for sending books via email. The default email provider will be used for 'Quick Book Send' located in the Book Card menu"
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
</h2>
|
||||
<p-button outlined="true" icon="pi pi-plus" label="Create New Provider" (onClick)="openCreateProviderDialog()"></p-button>
|
||||
</div>
|
||||
@@ -38,33 +38,57 @@
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.name" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!provider.isEditing">{{ provider.name }}</span>
|
||||
@if (provider.isEditing) {
|
||||
<input type="text" [(ngModel)]="provider.name" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!provider.isEditing) {
|
||||
<span>{{ provider.name }}</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.host" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!provider.isEditing">{{ provider.host }}</span>
|
||||
@if (provider.isEditing) {
|
||||
<input type="text" [(ngModel)]="provider.host" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!provider.isEditing) {
|
||||
<span>{{ provider.host }}</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="provider.isEditing" type="number" [(ngModel)]="provider.port" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!provider.isEditing">{{ provider.port }}</span>
|
||||
@if (provider.isEditing) {
|
||||
<input type="number" [(ngModel)]="provider.port" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!provider.isEditing) {
|
||||
<span>{{ provider.port }}</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.username" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!provider.isEditing">{{ provider.username }}</span>
|
||||
@if (provider.isEditing) {
|
||||
<input type="text" [(ngModel)]="provider.username" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!provider.isEditing) {
|
||||
<span>{{ provider.username }}</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="provider.isEditing" [(ngModel)]="provider.password" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!provider.isEditing" class="text-gray-400 italic">Hidden</span>
|
||||
@if (provider.isEditing) {
|
||||
<input [(ngModel)]="provider.password" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!provider.isEditing) {
|
||||
<span class="text-gray-400 italic">Hidden</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.fromAddress" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!provider.isEditing">{{ provider.fromAddress }}</span>
|
||||
@if (provider.isEditing) {
|
||||
<input type="text" [(ngModel)]="provider.fromAddress" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!provider.isEditing) {
|
||||
<span>{{ provider.fromAddress }}</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
@@ -84,9 +108,15 @@
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<p-button *ngIf="!provider.isEditing" icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(provider)"></p-button>
|
||||
<p-button *ngIf="provider.isEditing" icon="pi pi-check" outlined="true" severity="success" (onClick)="saveProvider(provider)"></p-button>
|
||||
<p-button *ngIf="provider.isEditing" icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(provider)"></p-button>
|
||||
@if (!provider.isEditing) {
|
||||
<p-button icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(provider)"></p-button>
|
||||
}
|
||||
@if (provider.isEditing) {
|
||||
<p-button icon="pi pi-check" outlined="true" severity="success" (onClick)="saveProvider(provider)"></p-button>
|
||||
}
|
||||
@if (provider.isEditing) {
|
||||
<p-button icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(provider)"></p-button>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {Button} from 'primeng/button';
|
||||
import {Checkbox} from 'primeng/checkbox';
|
||||
import {NgIf} from '@angular/common';
|
||||
|
||||
import {MessageService, PrimeTemplate} from 'primeng/api';
|
||||
import {RadioButton} from 'primeng/radiobutton';
|
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
@@ -17,14 +17,13 @@ import {CreateEmailProviderDialogComponent} from '../create-email-provider-dialo
|
||||
imports: [
|
||||
Button,
|
||||
Checkbox,
|
||||
NgIf,
|
||||
PrimeTemplate,
|
||||
RadioButton,
|
||||
ReactiveFormsModule,
|
||||
TableModule,
|
||||
Tooltip,
|
||||
FormsModule
|
||||
],
|
||||
],
|
||||
templateUrl: './email-provider.component.html',
|
||||
styleUrl: './email-provider.component.scss'
|
||||
})
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<h2 class="text-lg flex items-center gap-2">
|
||||
Recipient Emails
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Manage the list of recipients who will receive books via email. The 'Default' recipient will be used for 'Quick Book Send,' located in the Book Card menu."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
pTooltip="Manage the list of recipients who will receive books via email. The 'Default' recipient will be used for 'Quick Book Send,' located in the Book Card menu."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
</h2>
|
||||
<p-button outlined="true" icon="pi pi-plus" label="Add New Recipient" (onClick)="openAddRecipientDialog()"></p-button>
|
||||
</div>
|
||||
@@ -32,19 +32,33 @@
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="recipient.isEditing" type="email" [(ngModel)]="recipient.email" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!recipient.isEditing">{{ recipient.email }}</span>
|
||||
@if (recipient.isEditing) {
|
||||
<input type="email" [(ngModel)]="recipient.email" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!recipient.isEditing) {
|
||||
<span>{{ recipient.email }}</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input *ngIf="recipient.isEditing" type="text" [(ngModel)]="recipient.name" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!recipient.isEditing">{{ recipient.name }}</span>
|
||||
@if (recipient.isEditing) {
|
||||
<input type="text" [(ngModel)]="recipient.name" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!recipient.isEditing) {
|
||||
<span>{{ recipient.name }}</span>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<p-button *ngIf="!recipient.isEditing" icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
||||
<p-button *ngIf="recipient.isEditing" icon="pi pi-check" outlined="true" severity="success" (onClick)="saveRecipient(recipient)"></p-button>
|
||||
<p-button *ngIf="recipient.isEditing" icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
||||
@if (!recipient.isEditing) {
|
||||
<p-button icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
||||
}
|
||||
@if (recipient.isEditing) {
|
||||
<p-button icon="pi pi-check" outlined="true" severity="success" (onClick)="saveRecipient(recipient)"></p-button>
|
||||
}
|
||||
@if (recipient.isEditing) {
|
||||
<p-button icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {Button} from 'primeng/button';
|
||||
import {NgIf} from '@angular/common';
|
||||
|
||||
import {MessageService, PrimeTemplate} from 'primeng/api';
|
||||
import {RadioButton} from 'primeng/radiobutton';
|
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
@@ -18,14 +18,13 @@ import {CreateEmailRecipientDialogComponent} from '../create-email-recipient-dia
|
||||
selector: 'app-email-recipient',
|
||||
imports: [
|
||||
Button,
|
||||
NgIf,
|
||||
PrimeTemplate,
|
||||
RadioButton,
|
||||
ReactiveFormsModule,
|
||||
TableModule,
|
||||
Tooltip,
|
||||
FormsModule
|
||||
],
|
||||
],
|
||||
templateUrl: './email-recipient.component.html',
|
||||
styleUrl: './email-recipient.component.scss'
|
||||
})
|
||||
|
||||
+80
-79
@@ -17,88 +17,89 @@
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
|
||||
<div *ngIf="opdsEnabled" class="flex items-center gap-2 mt-4">
|
||||
<p class="text-lg py-1">OPDS Endpoint:</p>
|
||||
<div class="flex items-center gap-4">
|
||||
<input
|
||||
class="min-w-[500px] max-w-[800px]"
|
||||
type="text"
|
||||
pInputText
|
||||
[value]="opdsEndpoint"
|
||||
readonly/>
|
||||
<p-button
|
||||
icon="pi pi-copy"
|
||||
severity="info"
|
||||
(onClick)="copyOpdsEndpoint()"
|
||||
label="Copy"
|
||||
outlined="true">
|
||||
</p-button>
|
||||
@if (opdsEnabled) {
|
||||
<div class="flex items-center gap-2 mt-4">
|
||||
<p class="text-lg py-1">OPDS Endpoint:</p>
|
||||
<div class="flex items-center gap-4">
|
||||
<input
|
||||
class="min-w-[500px] max-w-[800px]"
|
||||
type="text"
|
||||
pInputText
|
||||
[value]="opdsEndpoint"
|
||||
readonly/>
|
||||
<p-button
|
||||
icon="pi pi-copy"
|
||||
severity="info"
|
||||
(onClick)="copyOpdsEndpoint()"
|
||||
label="Copy"
|
||||
outlined="true">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div *ngIf="opdsEnabled" class="mt-6">
|
||||
|
||||
|
||||
<div class="flex justify-between items-center">
|
||||
<h2 class="text-lg flex items-center gap-2">
|
||||
Current OPDS Users:
|
||||
</h2>
|
||||
<p-button
|
||||
label="Create OPDS User"
|
||||
icon="pi pi-plus"
|
||||
outlined="true"
|
||||
(onClick)="openCreateUserDialog()">
|
||||
</p-button>
|
||||
@if (opdsEnabled) {
|
||||
<div class="mt-6">
|
||||
<div class="flex justify-between items-center">
|
||||
<h2 class="text-lg flex items-center gap-2">
|
||||
Current OPDS Users:
|
||||
</h2>
|
||||
<p-button
|
||||
label="Create OPDS User"
|
||||
icon="pi pi-plus"
|
||||
outlined="true"
|
||||
(onClick)="openCreateUserDialog()">
|
||||
</p-button>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<p-table [value]="users" [responsiveLayout]="'scroll'">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>Password</th>
|
||||
<th>Reset Password</th>
|
||||
<th>Delete</th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-user>
|
||||
<tr>
|
||||
<td>{{ user.username }}</td>
|
||||
<td class="flex items-center gap-2">
|
||||
<p-password
|
||||
[(ngModel)]="dummyPassword"
|
||||
[disabled]="true">
|
||||
</p-password>
|
||||
<i
|
||||
class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="The password is hidden for security reasons and is only visible once during creation. You can reset the password if needed."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</td>
|
||||
<td>
|
||||
<p-button
|
||||
icon="pi pi-key"
|
||||
severity="warn"
|
||||
size="small"
|
||||
outlined="true"
|
||||
(onClick)="openResetPasswordDialog(user)">
|
||||
</p-button>
|
||||
</td>
|
||||
<td>
|
||||
<p-button
|
||||
icon="pi pi-trash"
|
||||
severity="danger"
|
||||
size="small"
|
||||
outlined="true"
|
||||
(onClick)="deleteUser(user.id)">
|
||||
</p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<p-table [value]="users" [responsiveLayout]="'scroll'">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>Password</th>
|
||||
<th>Reset Password</th>
|
||||
<th>Delete</th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-user>
|
||||
<tr>
|
||||
<td>{{ user.username }}</td>
|
||||
<td class="flex items-center gap-2">
|
||||
<p-password
|
||||
[(ngModel)]="dummyPassword"
|
||||
[disabled]="true">
|
||||
</p-password>
|
||||
<i
|
||||
class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="The password is hidden for security reasons and is only visible once during creation. You can reset the password if needed."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</td>
|
||||
<td>
|
||||
<p-button
|
||||
icon="pi pi-key"
|
||||
severity="warn"
|
||||
size="small"
|
||||
outlined="true"
|
||||
(onClick)="openResetPasswordDialog(user)">
|
||||
</p-button>
|
||||
</td>
|
||||
<td>
|
||||
<p-button
|
||||
icon="pi pi-trash"
|
||||
severity="danger"
|
||||
size="small"
|
||||
outlined="true"
|
||||
(onClick)="deleteUser(user.id)">
|
||||
</p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<p-dialog
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {NgIf} from '@angular/common';
|
||||
|
||||
import {TableModule} from 'primeng/table';
|
||||
import {Button} from 'primeng/button';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
@@ -21,7 +21,6 @@ import {ToggleSwitch} from 'primeng/toggleswitch';
|
||||
standalone: true,
|
||||
imports: [
|
||||
FormsModule,
|
||||
NgIf,
|
||||
TableModule,
|
||||
Button,
|
||||
InputText,
|
||||
@@ -29,7 +28,7 @@ import {ToggleSwitch} from 'primeng/toggleswitch';
|
||||
Tooltip,
|
||||
Password,
|
||||
ToggleSwitch
|
||||
],
|
||||
],
|
||||
templateUrl: './opds-settings.component.html',
|
||||
styleUrl: './opds-settings.component.scss'
|
||||
})
|
||||
|
||||
+43
-19
@@ -9,31 +9,47 @@
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Username</label>
|
||||
<p *ngIf="!isEditing" class="text-lg">{{ currentUser?.username || 'N/A' }}</p>
|
||||
<input *ngIf="isEditing" disabled id="username" type="text" pInputText [(ngModel)]="editUserData.username" class="w-full"/>
|
||||
@if (!isEditing) {
|
||||
<p class="text-lg">{{ currentUser?.username || 'N/A' }}</p>
|
||||
}
|
||||
@if (isEditing) {
|
||||
<input disabled id="username" type="text" pInputText [(ngModel)]="editUserData.username" class="w-full"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Full Name</label>
|
||||
<p *ngIf="!isEditing" class="text-lg">{{ currentUser?.name || 'N/A' }}</p>
|
||||
<input *ngIf="isEditing" id="fullname" type="text" pInputText [(ngModel)]="editUserData.name" class="w-full"/>
|
||||
@if (!isEditing) {
|
||||
<p class="text-lg">{{ currentUser?.name || 'N/A' }}</p>
|
||||
}
|
||||
@if (isEditing) {
|
||||
<input id="fullname" type="text" pInputText [(ngModel)]="editUserData.name" class="w-full"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="md:col-span-2">
|
||||
<label class="block text-sm font-medium mb-1">Email</label>
|
||||
<p *ngIf="!isEditing" class="text-lg">{{ currentUser?.email || 'N/A' }}</p>
|
||||
<input *ngIf="isEditing" id="email" type="email" pInputText [(ngModel)]="editUserData.email" class="w-full"/>
|
||||
@if (!isEditing) {
|
||||
<p class="text-lg">{{ currentUser?.email || 'N/A' }}</p>
|
||||
}
|
||||
@if (isEditing) {
|
||||
<input id="email" type="email" pInputText [(ngModel)]="editUserData.email" class="w-full"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-start mt-6">
|
||||
<div *ngIf="!isEditing">
|
||||
<p-button label="Edit" severity="info" icon="pi pi-pencil" (onClick)="toggleEdit()"></p-button>
|
||||
</div>
|
||||
<div *ngIf="isEditing" class="flex gap-2">
|
||||
<p-button label="Cancel" severity="secondary" icon="pi pi-times" (onClick)="toggleEdit()"></p-button>
|
||||
<p-button label="Save" severity="success" icon="pi pi-check" (onClick)="updateProfile()"></p-button>
|
||||
</div>
|
||||
@if (!isEditing) {
|
||||
<div>
|
||||
<p-button label="Edit" severity="info" icon="pi pi-pencil" (onClick)="toggleEdit()"></p-button>
|
||||
</div>
|
||||
}
|
||||
@if (isEditing) {
|
||||
<div class="flex gap-2">
|
||||
<p-button label="Cancel" severity="secondary" icon="pi pi-times" (onClick)="toggleEdit()"></p-button>
|
||||
<p-button label="Save" severity="success" icon="pi pi-check" (onClick)="updateProfile()"></p-button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,19 +66,25 @@
|
||||
<div class="p-field mb-4">
|
||||
<label for="currentPassword">Current Password</label>
|
||||
<p-password id="currentPassword" formControlName="currentPassword" [feedback]="false" fluid></p-password>
|
||||
<p-message *ngIf="changePasswordForm.get('currentPassword')?.invalid && changePasswordForm.get('currentPassword')?.touched" severity="error" text="Current password is required."></p-message>
|
||||
@if (changePasswordForm.get('currentPassword')?.invalid && changePasswordForm.get('currentPassword')?.touched) {
|
||||
<p-message severity="error" text="Current password is required."></p-message>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="p-field mb-4">
|
||||
<label for="newPassword">New Password (at least 6 characters)</label>
|
||||
<p-password id="newPassword" formControlName="newPassword" [feedback]="false" fluid></p-password>
|
||||
<p-message *ngIf="changePasswordForm.get('newPassword')?.errors?.['minlength'] && changePasswordForm.get('newPassword')?.touched" severity="error" text="Password must be at least 6 characters long."></p-message>
|
||||
@if (changePasswordForm.get('newPassword')?.errors?.['minlength'] && changePasswordForm.get('newPassword')?.touched) {
|
||||
<p-message severity="error" text="Password must be at least 6 characters long."></p-message>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="p-field mb-4">
|
||||
<label for="confirmNewPassword">Confirm New Password</label>
|
||||
<p-password id="confirmNewPassword" formControlName="confirmNewPassword" [feedback]="false" fluid></p-password>
|
||||
<p-message *ngIf="passwordsMismatch" severity="error" text="Passwords do not match."></p-message>
|
||||
@if (passwordsMismatch) {
|
||||
<p-message severity="error" text="Passwords do not match."></p-message>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-start pt-4">
|
||||
@@ -76,6 +98,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="!currentUser" class="flex items-center justify-center min-h-[50vh] text-lg">
|
||||
Loading user data...
|
||||
</div>
|
||||
@if (!currentUser) {
|
||||
<div class="flex items-center justify-center min-h-[50vh] text-lg">
|
||||
Loading user data...
|
||||
</div>
|
||||
}
|
||||
|
||||
+2
-3
@@ -3,7 +3,7 @@ import {Button} from 'primeng/button';
|
||||
import {Divider} from 'primeng/divider';
|
||||
import {FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
import {NgIf} from '@angular/common';
|
||||
|
||||
import {Password} from 'primeng/password';
|
||||
import {User, UserService} from '../../user-management/user.service';
|
||||
import {MessageService} from 'primeng/api';
|
||||
@@ -18,10 +18,9 @@ import {Message} from 'primeng/message';
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
InputText,
|
||||
NgIf,
|
||||
Password,
|
||||
Message
|
||||
],
|
||||
],
|
||||
templateUrl: './user-profile-dialog.component.html',
|
||||
styleUrls: ['./user-profile-dialog.component.scss']
|
||||
})
|
||||
|
||||
+162
-148
@@ -5,52 +5,58 @@
|
||||
<p class="text-lg pb-4 pt-4 ">
|
||||
Book Reader Settings: Global or Per-Book
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Select whether to apply the same reader settings (font, theme, spread, zoom, etc.) globally for all books or individually per book."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
pTooltip="Select whether to apply the same reader settings (font, theme, spread, zoom, etc.) globally for all books or individually per book."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</p>
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p class="py-1">PDF:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let item of scopeOptions" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="item"
|
||||
name="spread"
|
||||
[value]="item"
|
||||
[(ngModel)]="selectedPdfScope"
|
||||
(ngModelChange)="onPdfScopeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="item">{{ item }}</label>
|
||||
</div>
|
||||
@for (item of scopeOptions; track item) {
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="item"
|
||||
name="spread"
|
||||
[value]="item"
|
||||
[(ngModel)]="selectedPdfScope"
|
||||
(ngModelChange)="onPdfScopeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="item">{{ item }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<p class="py-1">Epub:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let item of scopeOptions" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="item"
|
||||
name="spread"
|
||||
[value]="item"
|
||||
[(ngModel)]="selectedEpubScope"
|
||||
(ngModelChange)="onEpubScopeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="item">{{ item }}</label>
|
||||
</div>
|
||||
@for (item of scopeOptions; track item) {
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="item"
|
||||
name="spread"
|
||||
[value]="item"
|
||||
[(ngModel)]="selectedEpubScope"
|
||||
(ngModelChange)="onEpubScopeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="item">{{ item }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<p class="py-1">CBX:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let item of scopeOptions" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="item"
|
||||
name="spread"
|
||||
[value]="item"
|
||||
[(ngModel)]="selectedCbxScope"
|
||||
(ngModelChange)="onCbxScopeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="item">{{ item }}</label>
|
||||
</div>
|
||||
@for (item of scopeOptions; track item) {
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="item"
|
||||
name="spread"
|
||||
[value]="item"
|
||||
[(ngModel)]="selectedCbxScope"
|
||||
(ngModelChange)="onCbxScopeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="item">{{ item }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,38 +67,42 @@
|
||||
<p class="text-lg pb-6 pt-4 ">
|
||||
PDF Reader: Global Preferences
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p class="py-1">Page Spread:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let spread of spreads" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="spread.key"
|
||||
name="spread"
|
||||
[value]="spread.key"
|
||||
[(ngModel)]="selectedSpread"
|
||||
(ngModelChange)="onSpreadChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="spread.key">{{ spread.name }}</label>
|
||||
</div>
|
||||
@for (spread of spreads; track spread) {
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="spread.key"
|
||||
name="spread"
|
||||
[value]="spread.key"
|
||||
[(ngModel)]="selectedSpread"
|
||||
(ngModelChange)="onSpreadChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="spread.key">{{ spread.name }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<p class="py-1">Page Zoom:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let zoom of zooms" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="zoom.key"
|
||||
name="zoom"
|
||||
[value]="zoom.key"
|
||||
[(ngModel)]="selectedZoom"
|
||||
(ngModelChange)="onZoomChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="zoom.key">{{ zoom.name }}</label>
|
||||
</div>
|
||||
@for (zoom of zooms; track zoom) {
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="zoom.key"
|
||||
name="zoom"
|
||||
[value]="zoom.key"
|
||||
[(ngModel)]="selectedZoom"
|
||||
(ngModelChange)="onZoomChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="zoom.key">{{ zoom.name }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,102 +113,106 @@
|
||||
<p class="text-lg pb-6 pt-4 ">
|
||||
Epub Reader: Global Preferences
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Set global EPUB reader options such as themes, font families, and font sizes applied to all EPUBs."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i></p>
|
||||
pTooltip="Set global EPUB reader options such as themes, font families, and font sizes applied to all EPUBs."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i></p>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p>Theme:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="themes"
|
||||
[(ngModel)]="selectedTheme"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Theme"
|
||||
class="w-full md:w-32"
|
||||
(ngModelChange)="onThemeChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<p>Font:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="fonts"
|
||||
[(ngModel)]="selectedFont"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Font"
|
||||
class="w-full md:w-32"
|
||||
(ngModelChange)="onFontChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<p>Flow:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="flowOptions"
|
||||
[(ngModel)]="selectedFlow"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Flow"
|
||||
class="w-full md:w-32"
|
||||
(ngModelChange)="onFlowChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<p class="py-1">Font Size:</p>
|
||||
<div class="flex gap-4 justify-start items-center">
|
||||
<p-button icon="pi pi-minus" size="small" (click)="decreaseFontSize()"></p-button>
|
||||
<p>{{ fontSize }}%</p>
|
||||
<p-button icon="pi pi-plus" size="small" (click)="increaseFontSize()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p-divider></p-divider>
|
||||
|
||||
<div class="p-4">
|
||||
<p class="text-lg pb-6 pt-4 ">
|
||||
CBX Reader: Global Preferences
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p class="py-1">Page Spread:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let spread of cbxSpreads" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="spread.key"
|
||||
name="spread"
|
||||
[value]="spread.key"
|
||||
[(ngModel)]="selectedCbxSpread"
|
||||
(ngModelChange)="onCbxSpreadChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="spread.key">{{ spread.name }}</label>
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p>Theme:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="themes"
|
||||
[(ngModel)]="selectedTheme"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Theme"
|
||||
class="w-full md:w-32"
|
||||
(ngModelChange)="onThemeChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="py-1">Page Zoom:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let mode of cbxViewModes" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="mode.key"
|
||||
name="zoom"
|
||||
[value]="mode.key"
|
||||
[(ngModel)]="selectedCbxViewMode"
|
||||
(ngModelChange)="onCbxViewModeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="mode.key">{{ mode.name }}</label>
|
||||
<p>Font:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="fonts"
|
||||
[(ngModel)]="selectedFont"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Font"
|
||||
class="w-full md:w-32"
|
||||
(ngModelChange)="onFontChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<p>Flow:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="flowOptions"
|
||||
[(ngModel)]="selectedFlow"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Flow"
|
||||
class="w-full md:w-32"
|
||||
(ngModelChange)="onFlowChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<p class="py-1">Font Size:</p>
|
||||
<div class="flex gap-4 justify-start items-center">
|
||||
<p-button icon="pi pi-minus" size="small" (click)="decreaseFontSize()"></p-button>
|
||||
<p>{{ fontSize }}%</p>
|
||||
<p-button icon="pi pi-plus" size="small" (click)="increaseFontSize()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p-divider></p-divider>
|
||||
|
||||
<div class="p-4">
|
||||
<p class="text-lg pb-6 pt-4 ">
|
||||
CBX Reader: Global Preferences
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p class="py-1">Page Spread:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
@for (spread of cbxSpreads; track spread) {
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="spread.key"
|
||||
name="spread"
|
||||
[value]="spread.key"
|
||||
[(ngModel)]="selectedCbxSpread"
|
||||
(ngModelChange)="onCbxSpreadChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="spread.key">{{ spread.name }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<p class="py-1">Page Zoom:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
@for (mode of cbxViewModes; track mode) {
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="mode.key"
|
||||
name="zoom"
|
||||
[value]="mode.key"
|
||||
[(ngModel)]="selectedCbxViewMode"
|
||||
(ngModelChange)="onCbxViewModeChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="mode.key">{{ mode.name }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {NgForOf} from '@angular/common';
|
||||
|
||||
import {Observable, Subscription} from 'rxjs';
|
||||
import {Select} from 'primeng/select';
|
||||
import {RadioButton} from 'primeng/radiobutton';
|
||||
@@ -16,7 +16,7 @@ import {CbxPageSpread, CbxPageViewMode} from '../../book/model/book.model';
|
||||
templateUrl: './reader-preferences.component.html',
|
||||
standalone: true,
|
||||
styleUrls: ['./reader-preferences.component.scss'],
|
||||
imports: [Select, FormsModule, NgForOf, RadioButton, Divider, Button, Tooltip]
|
||||
imports: [Select, FormsModule, RadioButton, Divider, Button, Tooltip]
|
||||
})
|
||||
export class ReaderPreferences implements OnInit, OnDestroy {
|
||||
|
||||
|
||||
@@ -1,43 +1,44 @@
|
||||
<div *ngIf="userService.userState$ | async as userData">
|
||||
<div class="rounded-xl overflow-hidden">
|
||||
<p-tabs [(value)]="activeTab" scrollable>
|
||||
<p-tablist>
|
||||
<p-tab [value]="SettingsTab.ReaderSettings">Reader Preferences</p-tab>
|
||||
<p-tab [value]="SettingsTab.ViewPreferences">View Preferences</p-tab>
|
||||
<ng-container *ngIf="userData.permissions.admin">
|
||||
<p-tab [value]="SettingsTab.MetadataSettings">Metadata Settings</p-tab>
|
||||
<p-tab [value]="SettingsTab.ApplicationSettings">Application Settings</p-tab>
|
||||
<p-tab [value]="SettingsTab.UserManagement">User Management</p-tab>
|
||||
<p-tab [value]="SettingsTab.EmailSettings">Email Settings</p-tab>
|
||||
<p-tab [value]="SettingsTab.AuthenticationSettings">Authentication</p-tab>
|
||||
</ng-container>
|
||||
</p-tablist>
|
||||
|
||||
<p-tabpanels>
|
||||
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
||||
<app-reader-preferences></app-reader-preferences>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
||||
<app-view-preferences-parent></app-view-preferences-parent>
|
||||
</p-tabpanel>
|
||||
<ng-container *ngIf="userData.permissions.admin">
|
||||
<p-tabpanel [value]="SettingsTab.MetadataSettings">
|
||||
<app-metadata-settings-component></app-metadata-settings-component>
|
||||
@if (userService.userState$ | async; as userData) {
|
||||
<div>
|
||||
<div class="rounded-xl overflow-hidden">
|
||||
<p-tabs [(value)]="activeTab" scrollable>
|
||||
<p-tablist>
|
||||
<p-tab [value]="SettingsTab.ReaderSettings">Reader Preferences</p-tab>
|
||||
<p-tab [value]="SettingsTab.ViewPreferences">View Preferences</p-tab>
|
||||
@if (userData.permissions.admin) {
|
||||
<p-tab [value]="SettingsTab.MetadataSettings">Metadata Settings</p-tab>
|
||||
<p-tab [value]="SettingsTab.ApplicationSettings">Application Settings</p-tab>
|
||||
<p-tab [value]="SettingsTab.UserManagement">User Management</p-tab>
|
||||
<p-tab [value]="SettingsTab.EmailSettings">Email Settings</p-tab>
|
||||
<p-tab [value]="SettingsTab.AuthenticationSettings">Authentication</p-tab>
|
||||
}
|
||||
</p-tablist>
|
||||
<p-tabpanels>
|
||||
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
||||
<app-reader-preferences></app-reader-preferences>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.ApplicationSettings">
|
||||
<app-global-preferences></app-global-preferences>
|
||||
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
||||
<app-view-preferences-parent></app-view-preferences-parent>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.UserManagement">
|
||||
<app-user-management></app-user-management>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.EmailSettings">
|
||||
<app-email></app-email>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.AuthenticationSettings">
|
||||
<app-authentication-settings></app-authentication-settings>
|
||||
</p-tabpanel>
|
||||
</ng-container>
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
@if (userData.permissions.admin) {
|
||||
<p-tabpanel [value]="SettingsTab.MetadataSettings">
|
||||
<app-metadata-settings-component></app-metadata-settings-component>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.ApplicationSettings">
|
||||
<app-global-preferences></app-global-preferences>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.UserManagement">
|
||||
<app-user-management></app-user-management>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.EmailSettings">
|
||||
<app-email></app-email>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel [value]="SettingsTab.AuthenticationSettings">
|
||||
<app-authentication-settings></app-authentication-settings>
|
||||
</p-tabpanel>
|
||||
}
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
||||
import {UserService} from './user-management/user.service';
|
||||
import {AsyncPipe, NgIf} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {EmailComponent} from './email/email.component';
|
||||
import {GlobalPreferencesComponent} from './global-preferences/global-preferences.component';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
@@ -30,7 +30,6 @@ export enum SettingsTab {
|
||||
Tab,
|
||||
TabPanels,
|
||||
TabPanel,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
EmailComponent,
|
||||
GlobalPreferencesComponent,
|
||||
@@ -39,7 +38,7 @@ export enum SettingsTab {
|
||||
ViewPreferencesParentComponent,
|
||||
ReaderPreferences,
|
||||
MetadataSettingsComponent
|
||||
],
|
||||
],
|
||||
templateUrl: './settings.component.html',
|
||||
styleUrl: './settings.component.scss'
|
||||
})
|
||||
|
||||
+25
-15
@@ -4,33 +4,41 @@
|
||||
<label class="w-40 text-right font-medium">Full Name:</label>
|
||||
<input type="text" pInputText formControlName="name" placeholder="Enter full name..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('name')?.invalid && (userForm.get('name')?.dirty || userForm.get('name')?.touched)">
|
||||
Name is required and must be at least 3 characters.
|
||||
</small>
|
||||
@if (userForm.get('name')?.invalid && (userForm.get('name')?.dirty || userForm.get('name')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Name is required and must be at least 3 characters.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Email:</label>
|
||||
<input type="email" pInputText formControlName="email" placeholder="Enter email..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('email')?.invalid && (userForm.get('email')?.dirty || userForm.get('email')?.touched)">
|
||||
Enter a valid email address.
|
||||
</small>
|
||||
@if (userForm.get('email')?.invalid && (userForm.get('email')?.dirty || userForm.get('email')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Enter a valid email address.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Username:</label>
|
||||
<input type="text" pInputText formControlName="username" placeholder="Enter username..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('username')?.invalid && (userForm.get('username')?.dirty || userForm.get('username')?.touched)">
|
||||
Username is required.
|
||||
</small>
|
||||
@if (userForm.get('username')?.invalid && (userForm.get('username')?.dirty || userForm.get('username')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Username is required.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Password:</label>
|
||||
<input type="password" pInputText formControlName="password" placeholder="Enter password..." class="w-full md:w-80"/>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched)">
|
||||
Password must be at least 6 characters long.
|
||||
</small>
|
||||
@if (userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
Password must be at least 6 characters long.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="w-40 text-right font-medium">Accessible Libraries:</label>
|
||||
@@ -44,9 +52,11 @@
|
||||
appendTo="body">
|
||||
</p-multiselect>
|
||||
</div>
|
||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('selectedLibraries')?.invalid && (userForm.get('selectedLibraries')?.dirty || userForm.get('selectedLibraries')?.touched)">
|
||||
At least one library must be selected.
|
||||
</small>
|
||||
@if (userForm.get('selectedLibraries')?.invalid && (userForm.get('selectedLibraries')?.dirty || userForm.get('selectedLibraries')?.touched)) {
|
||||
<small class="text-red-500 pl-44">
|
||||
At least one library must be selected.
|
||||
</small>
|
||||
}
|
||||
|
||||
<div>
|
||||
<p class="text-right w-40 font-medium">Permissions:</p>
|
||||
|
||||
+3
-4
@@ -9,7 +9,7 @@ import {LibraryService} from '../../../book/service/library.service';
|
||||
import {UserService} from '../user.service';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {NgIf} from '@angular/common';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-create-user-dialog',
|
||||
@@ -20,9 +20,8 @@ import {NgIf} from '@angular/common';
|
||||
FormsModule,
|
||||
Checkbox,
|
||||
MultiSelectModule,
|
||||
Button,
|
||||
NgIf
|
||||
],
|
||||
Button
|
||||
],
|
||||
templateUrl: './create-user-dialog.component.html',
|
||||
styleUrl: './create-user-dialog.component.scss'
|
||||
})
|
||||
|
||||
@@ -34,56 +34,97 @@
|
||||
</td>
|
||||
<td>{{ user.username }}</td>
|
||||
<td>
|
||||
<input *ngIf="user.isEditing" type="text" [(ngModel)]="user.name" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!user.isEditing">{{ user.name }}</span>
|
||||
@if (user.isEditing) {
|
||||
<input type="text" [(ngModel)]="user.name" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<span>{{ user.name }}</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<input *ngIf="user.isEditing" type="email" [(ngModel)]="user.email" class="p-inputtext w-full"/>
|
||||
<span *ngIf="!user.isEditing">{{ user.email }}</span>
|
||||
@if (user.isEditing) {
|
||||
<input type="email" [(ngModel)]="user.email" class="p-inputtext w-full"/>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<span>{{ user.email }}</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<p-multiSelect
|
||||
*ngIf="user.isEditing"
|
||||
[options]="allLibraries"
|
||||
optionLabel="name"
|
||||
optionValue="id"
|
||||
[(ngModel)]="editingLibraryIds"
|
||||
placeholder="Select Libraries"
|
||||
appendTo="body">
|
||||
</p-multiSelect>
|
||||
<span *ngIf="!user.isEditing">
|
||||
{{ user.libraryNames }}
|
||||
</span>
|
||||
@if (user.isEditing) {
|
||||
<p-multiSelect
|
||||
[options]="allLibraries"
|
||||
optionLabel="name"
|
||||
optionValue="id"
|
||||
[(ngModel)]="editingLibraryIds"
|
||||
placeholder="Select Libraries"
|
||||
appendTo="body">
|
||||
</p-multiSelect>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<span>
|
||||
{{ user.libraryNames }}
|
||||
</span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin" *ngIf="user.isEditing"></p-checkbox>
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin" disabled *ngIf="!user.isEditing"></p-checkbox>
|
||||
@if (user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin"></p-checkbox>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin" disabled></p-checkbox>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload" *ngIf="user.isEditing"></p-checkbox>
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload" disabled *ngIf="!user.isEditing"></p-checkbox>
|
||||
@if (user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload"></p-checkbox>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload" disabled></p-checkbox>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload" *ngIf="user.isEditing"></p-checkbox>
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload" disabled *ngIf="!user.isEditing"></p-checkbox>
|
||||
@if (user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload"></p-checkbox>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload" disabled></p-checkbox>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata" *ngIf="user.isEditing"></p-checkbox>
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata" disabled *ngIf="!user.isEditing"></p-checkbox>
|
||||
@if (user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata"></p-checkbox>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata" disabled></p-checkbox>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary" *ngIf="user.isEditing"></p-checkbox>
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary" disabled *ngIf="!user.isEditing"></p-checkbox>
|
||||
@if (user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary"></p-checkbox>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary" disabled></p-checkbox>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook" *ngIf="user.isEditing"></p-checkbox>
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook" disabled *ngIf="!user.isEditing"></p-checkbox>
|
||||
@if (user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook"></p-checkbox>
|
||||
}
|
||||
@if (!user.isEditing) {
|
||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook" disabled></p-checkbox>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<ng-container>
|
||||
<p-button *ngIf="!user.isEditing" icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(user)"></p-button>
|
||||
<p-button *ngIf="user.isEditing" icon="pi pi-check" outlined="true" severity="success" (onClick)="saveUser(user)"></p-button>
|
||||
<p-button *ngIf="user.isEditing" icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(user)"></p-button>
|
||||
@if (!user.isEditing) {
|
||||
<p-button icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(user)"></p-button>
|
||||
}
|
||||
@if (user.isEditing) {
|
||||
<p-button icon="pi pi-check" outlined="true" severity="success" (onClick)="saveUser(user)"></p-button>
|
||||
}
|
||||
@if (user.isEditing) {
|
||||
<p-button icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(user)"></p-button>
|
||||
}
|
||||
</ng-container>
|
||||
<p-button
|
||||
icon="pi pi-pencil"
|
||||
@@ -110,7 +151,9 @@
|
||||
<div class="flex flex-col gap-8 items-center">
|
||||
<p-password [(ngModel)]="newPassword" placeholder="New Password" [feedback]="false" class="w-full" fluid></p-password>
|
||||
<p-password [(ngModel)]="confirmNewPassword" placeholder="Confirm Password" [feedback]="false" class="w-full" fluid></p-password>
|
||||
<p *ngIf="passwordError" class="p-error text-red-500 w-full text-left">{{ passwordError }}</p>
|
||||
@if (passwordError) {
|
||||
<p class="p-error text-red-500 w-full text-left">{{ passwordError }}</p>
|
||||
}
|
||||
<div class="flex gap-4 w-full justify-end">
|
||||
<p-button label="Cancel" icon="pi pi-times" severity="secondary" (onClick)="isPasswordDialogVisible = false"></p-button>
|
||||
<p-button label="Change" icon="pi pi-check" severity="success" (onClick)="submitPasswordChange()"></p-button>
|
||||
|
||||
@@ -4,7 +4,7 @@ import {Button} from 'primeng/button';
|
||||
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {CreateUserDialogComponent} from './create-user-dialog/create-user-dialog.component';
|
||||
import {TableModule} from 'primeng/table';
|
||||
import {LowerCasePipe, NgIf, NgStyle, TitleCasePipe} from '@angular/common';
|
||||
import { LowerCasePipe, NgStyle, TitleCasePipe } from '@angular/common';
|
||||
import {User, UserService} from './user.service';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {Checkbox} from 'primeng/checkbox';
|
||||
@@ -21,7 +21,6 @@ import {filter, take} from 'rxjs/operators';
|
||||
FormsModule,
|
||||
Button,
|
||||
TableModule,
|
||||
NgIf,
|
||||
Checkbox,
|
||||
NgStyle,
|
||||
MultiSelect,
|
||||
@@ -29,7 +28,7 @@ import {filter, take} from 'rxjs/operators';
|
||||
Password,
|
||||
LowerCasePipe,
|
||||
TitleCasePipe
|
||||
],
|
||||
],
|
||||
templateUrl: './user-management.component.html',
|
||||
styleUrls: ['./user-management.component.scss'],
|
||||
})
|
||||
|
||||
+45
-49
@@ -2,20 +2,20 @@
|
||||
<p class="text-lg pb-6 pt-4">
|
||||
Library and Shelf View & Sort Preferences:
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
pTooltip="Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p>Default:</p>
|
||||
<div class="flex gap-4 pl-4">
|
||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="selectedSort" placeholder="Sort" class="w-full md:w-72"></p-select>
|
||||
[(ngModel)]="selectedSort" placeholder="Sort" class="w-full md:w-72"></p-select>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
||||
placeholder="Direction" class="w-full md:w-44"></p-select>
|
||||
placeholder="Direction" class="w-full md:w-44"></p-select>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
||||
placeholder="View" class="w-full md:w-44"></p-select>
|
||||
placeholder="View" class="w-full md:w-44"></p-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,49 +27,45 @@
|
||||
</div>
|
||||
|
||||
<div class="pl-2 pt-2 min-w-[400px] max-w-[1000px]">
|
||||
<p-table *ngIf="overrides.length > 0" [value]="overrides" class="relative z-0" [responsiveLayout]="'scroll'">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
||||
<th class="min-w-[220px] max-w-[280px]">Name</th>
|
||||
<th class="min-w-[190px] max-w-[250px]">Sort By</th>
|
||||
<th class="min-w-[125px]">Sort Dir</th>
|
||||
<th class="min-w-[125px]">View</th>
|
||||
<th class="w-[75px] text-center"></th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
|
||||
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
||||
<tr>
|
||||
<td><p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
|
||||
<td>
|
||||
<ng-container *ngIf="override.entityType">
|
||||
<p-select size="small"
|
||||
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
||||
[(ngModel)]="override.library"
|
||||
optionLabel="label" optionValue="value"
|
||||
class="w-full" appendTo="body"></p-select>
|
||||
</ng-container>
|
||||
</td>
|
||||
|
||||
<td><p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="override.sort" class="w-full" appendTo="body"></p-select></td>
|
||||
|
||||
<td><p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
|
||||
<td><p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
|
||||
<td class="text-center">
|
||||
<p-button icon="pi pi-trash" severity="danger" class="p-button-sm" [outlined]="true"
|
||||
(onClick)="removeOverride(rowIndex)"></p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
@if (overrides.length > 0) {
|
||||
<p-table [value]="overrides" class="relative z-0" [responsiveLayout]="'scroll'">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
||||
<th class="min-w-[220px] max-w-[280px]">Name</th>
|
||||
<th class="min-w-[190px] max-w-[250px]">Sort By</th>
|
||||
<th class="min-w-[125px]">Sort Dir</th>
|
||||
<th class="min-w-[125px]">View</th>
|
||||
<th class="w-[75px] text-center"></th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
||||
<tr>
|
||||
<td><p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
<td>
|
||||
@if (override.entityType) {
|
||||
<p-select size="small"
|
||||
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
||||
[(ngModel)]="override.library"
|
||||
optionLabel="label" optionValue="value"
|
||||
class="w-full" appendTo="body"></p-select>
|
||||
}
|
||||
</td>
|
||||
<td><p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="override.sort" class="w-full" appendTo="body"></p-select></td>
|
||||
<td><p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
<td><p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
<td class="text-center">
|
||||
<p-button icon="pi pi-trash" severity="danger" class="p-button-sm" [outlined]="true"
|
||||
(onClick)="removeOverride(rowIndex)"></p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-start px-6 pt-4">
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {Button} from 'primeng/button';
|
||||
import {NgIf} from '@angular/common';
|
||||
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {Select} from 'primeng/select';
|
||||
import {TableModule} from 'primeng/table';
|
||||
@@ -21,10 +21,9 @@ import {filter, take} from 'rxjs/operators';
|
||||
Tooltip,
|
||||
FormsModule,
|
||||
Button,
|
||||
NgIf,
|
||||
TableModule,
|
||||
ToastModule
|
||||
],
|
||||
],
|
||||
templateUrl: './view-preferences.component.html',
|
||||
styleUrl: './view-preferences.component.scss'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user