feat: add licenses management module with filtering and listing functionality
- Introduced new constants and routes for licenses management. - Created components for licenses filter form and list display. - Implemented services for fetching licenses data from the API. - Added dialog components for creating and editing licenses. - Updated partner menu to include a link to licenses. - Refactored existing components to improve code structure and maintainability.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { Maybe } from '@/core';
|
||||
import { IListingResponse, IPaginatedResponse } from '@/core/models/service.model';
|
||||
import {
|
||||
IListingResponse,
|
||||
IPaginatedResponse,
|
||||
IResponseMetadata,
|
||||
} from '@/core/models/service.model';
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { catchError, finalize, Observable } from 'rxjs';
|
||||
import { IColumn } from '../components/pageDataList/page-data-list.component';
|
||||
@@ -16,6 +20,8 @@ export abstract class AbstractList<ResponseModel, RequestParams = null> {
|
||||
requestPayload = signal<Maybe<RequestParams>>(null);
|
||||
selectedItemForEdit = signal<Maybe<ResponseModel>>(null);
|
||||
editMode = signal(false);
|
||||
withPagination = signal(false);
|
||||
responseMetaData = signal<Maybe<IResponseMetadata>>(null);
|
||||
|
||||
ngOnInit() {
|
||||
this.setColumns();
|
||||
@@ -39,6 +45,9 @@ export abstract class AbstractList<ResponseModel, RequestParams = null> {
|
||||
}),
|
||||
)
|
||||
.subscribe((res) => {
|
||||
if ('meta' in res) {
|
||||
this.responseMetaData.set(res.meta);
|
||||
}
|
||||
this.items.set(res.data ?? []);
|
||||
});
|
||||
}
|
||||
@@ -71,4 +80,8 @@ export abstract class AbstractList<ResponseModel, RequestParams = null> {
|
||||
onCloseEdit() {
|
||||
this.visibleForm.set(false);
|
||||
}
|
||||
|
||||
changePage(page: number) {
|
||||
// this.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,6 +271,7 @@
|
||||
class="contnet"
|
||||
styleClass="!w-[80vw] md:!w-96 md:!max-w-96 !max-w-sm"
|
||||
>
|
||||
<hr class="mt-0!" />
|
||||
<div class="pt-2">
|
||||
<ng-container [ngTemplateOutlet]="filter" [ngTemplateOutletContext]="{ $implicit: columns }"> </ng-container>
|
||||
</div>
|
||||
|
||||
@@ -107,7 +107,7 @@ export class PageDataListComponent<I> {
|
||||
@Output() onDelete = new EventEmitter<I>();
|
||||
@Output() onDetails = new EventEmitter<I>();
|
||||
@Output() onAdd = new EventEmitter<void>();
|
||||
@Output() pageChange = new EventEmitter<any>();
|
||||
@Output() onChangePage = new EventEmitter<any>();
|
||||
@Output() onThumbnailClick = new EventEmitter<I>();
|
||||
@Output() onRefresh = new EventEmitter();
|
||||
|
||||
@@ -150,7 +150,7 @@ export class PageDataListComponent<I> {
|
||||
};
|
||||
|
||||
onPage = ($event: any) => {
|
||||
this.pageChange.emit($event);
|
||||
this.onChangePage.emit($event);
|
||||
};
|
||||
|
||||
openThumbnailModal = (item: I) => {
|
||||
|
||||
Reference in New Issue
Block a user