feat: add product management features and integrate role selection
- Added PRODUCTS_ROUTES to app routing. - Removed roles.const.ts and related references to central-auth-roles. - Updated login component to remove role selection logic. - Integrated ToastService for success notifications in customer, inventory, product brand, product category, supplier, and user forms. - Implemented product and category selection fields in product form. - Created reusable select components for product brands and categories. - Enhanced user form with password validation and role selection. - Established roles service for fetching roles from the API.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||
import {
|
||||
IColumn,
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { Component, signal, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { UserFormComponent } from '../components/form.component';
|
||||
import { IUserResponse } from '../models';
|
||||
import { UsersService } from '../services/main.service';
|
||||
@@ -10,20 +11,25 @@ import { UsersService } from '../services/main.service';
|
||||
@Component({
|
||||
selector: 'app-users',
|
||||
templateUrl: './list.component.html',
|
||||
imports: [PageDataListComponent, UserFormComponent],
|
||||
imports: [PageDataListComponent, UserFormComponent, CatalogRoleTagComponent],
|
||||
})
|
||||
export class UsersComponent {
|
||||
constructor(private userService: UsersService) {
|
||||
this.getData();
|
||||
}
|
||||
@ViewChild('role', { static: true }) roleTpl!: TemplateRef<any>;
|
||||
|
||||
columns = [
|
||||
{ field: 'id', header: 'شناسه' },
|
||||
{ field: 'firstName', header: 'نام' },
|
||||
{ field: 'lastName', header: 'نام خانوادگی' },
|
||||
{ field: 'mobileNumber', header: 'شماره موبایل' },
|
||||
{ field: 'roleId', header: 'نقش' },
|
||||
{ field: 'actions' },
|
||||
// { field: 'role', header: 'نقش', customDataModel: this.roleTpl },
|
||||
{
|
||||
field: 'role',
|
||||
header: 'نقش',
|
||||
customDataModel: (item: IUserResponse) => item.role.name ?? '-',
|
||||
},
|
||||
] as IColumn[];
|
||||
|
||||
loading = signal(false);
|
||||
|
||||
Reference in New Issue
Block a user