updated form for edited all user
This commit is contained in:
@@ -40,16 +40,10 @@
|
||||
<td>
|
||||
<div style="justify-content: center; display: flex">
|
||||
<td>
|
||||
<app-modal-icon nameIcon="edit" [name]="'Modifier'">
|
||||
<app-update-author></app-update-author>
|
||||
</app-modal-icon>
|
||||
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<nz-icon nzType="delete" nzTheme="outline" (click)="delete()" class="text-red-600"></nz-icon>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"></nz-icon>
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
<nz-icon nzType="delete" nzTheme="outline" class="text-red-600 cursor-pointer"></nz-icon>
|
||||
</div>
|
||||
</td>
|
||||
</div>
|
||||
@@ -58,3 +52,9 @@
|
||||
}
|
||||
</tbody>
|
||||
</nz-table>
|
||||
|
||||
<div class="hidden">
|
||||
<app-modal-icon nameIcon="edit" [name]="'Modifier'">
|
||||
<app-update-author></app-update-author>
|
||||
</app-modal-icon>
|
||||
</div>
|
||||
|
||||
@@ -19,16 +19,10 @@
|
||||
<td>{{ book.releaseYear}}</td>
|
||||
<div style="justify-content: center; display: flex">
|
||||
<td>
|
||||
<app-modal-icon nameIcon="edit" [name]="'Modifier'">
|
||||
<app-update-book></app-update-book>
|
||||
</app-modal-icon>
|
||||
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<nz-icon nzType="delete" nzTheme="outline" (click)="delete()" class="text-red-600"></nz-icon>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"></nz-icon>
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
<nz-icon nzType="delete" nzTheme="outline" class="text-red-600 cursor-pointer"></nz-icon>
|
||||
</div>
|
||||
</td>
|
||||
</div>
|
||||
@@ -36,3 +30,9 @@
|
||||
}
|
||||
</tbody>
|
||||
</nz-table>
|
||||
|
||||
<div class="hidden">
|
||||
<app-modal-icon nameIcon="edit" [name]="'Modifier'">
|
||||
<app-update-book></app-update-book>
|
||||
</app-modal-icon>
|
||||
</div>
|
||||
@@ -20,20 +20,20 @@
|
||||
<td>{{ loan.effectiveReturningDate | date: 'dd/MM/yyyy'}}</td>
|
||||
<div style="justify-content: center; display: flex">
|
||||
<td>
|
||||
<app-modal-icon nameIcon="edit" [name]="'Modifier'">
|
||||
<app-update-loan></app-update-loan>
|
||||
</app-modal-icon>
|
||||
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<nz-icon nzType="delete" nzTheme="outline" (click)="delete()" class="text-red-600"></nz-icon>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"></nz-icon>
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
<nz-icon nzType="delete" nzTheme="outline" class="text-red-600 cursor-pointer"></nz-icon>
|
||||
</div>
|
||||
</td>
|
||||
</div>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-table>
|
||||
|
||||
<div class="hidden">
|
||||
<app-modal-icon nameIcon="edit" [name]="'Modifier'">
|
||||
<app-update-loan></app-update-loan>
|
||||
</app-modal-icon>
|
||||
</div>
|
||||
@@ -4,8 +4,6 @@ import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
|
||||
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
|
||||
import {NzInputDirective} from "ng-zorro-antd/input";
|
||||
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
|
||||
import {format} from "date-fns";
|
||||
import {firstValueFrom} from "rxjs";
|
||||
import {GetUserDto} from "../../services/api";
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<nz-table [nzData]="users()"
|
||||
[nzLoading]="usersLoading()"
|
||||
[nzFrontPagination]="false"
|
||||
>
|
||||
[nzFrontPagination]="false">
|
||||
<thead>
|
||||
<tr style="text-align: center">
|
||||
<th>Nom</th>
|
||||
@@ -9,20 +8,19 @@
|
||||
<th>Email</th>
|
||||
<th>Anniversaire</th>
|
||||
<th>Emprunt</th>
|
||||
<th style="display: flex; align-items: center;">Action</th>
|
||||
<th style="display: flex; align-items: center;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="text-align: center">
|
||||
@for (user of users(); track user.id) {
|
||||
<tr>
|
||||
<td>{{ user.name}}</td>
|
||||
<td>{{ user.name }}</td>
|
||||
<td>{{ user.firstName }}</td>
|
||||
<td>{{ user.email }}</td>
|
||||
<td>{{ user.birthDate | date: 'dd/MM/yyyy'}}</td>
|
||||
<td>
|
||||
<app-modal type="link" [name]="'Voir les emprunts'">
|
||||
<nz-table [nzData]="users()"
|
||||
[nzFrontPagination]="false">
|
||||
<nz-table [nzData]="user.loans" [nzFrontPagination]="false">
|
||||
<thead>
|
||||
<tr style="text-align: center">
|
||||
<th>Livre</th>
|
||||
@@ -44,24 +42,22 @@
|
||||
</td>
|
||||
<td>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div class="cursor-pointer">
|
||||
<app-modal-icon #modalIcon
|
||||
nameIcon="edit"
|
||||
[name]="'Modifier'"
|
||||
(ok)="onModalOk(selectedUser?.id, updateUser, modalIcon)"
|
||||
(cancel)="onModalCancel(modalIcon)"
|
||||
(click)="openEditModal(user)">
|
||||
<app-update-user #updateUser [user]="selectedUser"></app-update-user>
|
||||
</app-modal-icon>
|
||||
</div>
|
||||
|
||||
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
|
||||
(click)="openEditModal(user)">
|
||||
</nz-icon>
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
|
||||
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(user.id)" class="text-red-600 cursor-pointer">
|
||||
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(user.id)"
|
||||
class="text-red-600 cursor-pointer">
|
||||
</nz-icon>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-table>
|
||||
|
||||
<div class="hidden">
|
||||
<app-modal-icon #modalIcon nameIcon="edit" [name]="'Modifier'" (ok)="onModalOk(selectedUser?.id, updateUser, modalIcon)" (cancel)="onModalCancel(modalIcon)">
|
||||
<app-update-user #updateUser [user]="selectedUser"></app-update-user>
|
||||
</app-modal-icon>
|
||||
</div>
|
||||
|
||||
@@ -69,9 +69,9 @@ export class UserTable implements OnInit {
|
||||
await this.fetchUsers();
|
||||
}
|
||||
|
||||
selectedUser: GetUserDto;
|
||||
selectedUser: GetUserDto | null = null;
|
||||
openEditModal(user: GetUserDto) {
|
||||
this.selectedUser = user;
|
||||
this.selectedUser = { ...user };
|
||||
this.modal().showModal();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.gitignore
|
||||
.openapi-generator-ignore
|
||||
README.md
|
||||
api.base.service.ts
|
||||
api.module.ts
|
||||
|
||||
@@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder';
|
||||
import { Configuration } from './configuration';
|
||||
|
||||
export class BaseService {
|
||||
protected basePath = 'http://localhost:5228';
|
||||
protected basePath = 'https://localhost:44390';
|
||||
public defaultHeaders = new HttpHeaders();
|
||||
public configuration: Configuration;
|
||||
public encoder: HttpParameterCodec;
|
||||
|
||||
Reference in New Issue
Block a user