feat: refactor password input handling across multiple components
- Replaced individual password and confirm password fields with a shared-password-input component in the following components: - Partner Account Password Form - Consumer Account Form - Consumer User Form - Consumer Pos Form - Super Admin Consumer Account Form - Super Admin Partner Account Form - Super Admin Provider Form - Super Admin User Account Form - Modify Login Info Page - Introduced a new SharedPasswordInputComponent to encapsulate password input logic and validation messages. - Updated form handling to utilize reactive forms with shared components for better maintainability and consistency. - Added a ChangePasswordFormDialogComponent for changing passwords with validation. - Created API routes for business activity goods in the consumer module.
This commit is contained in:
@@ -46,17 +46,17 @@
|
||||
<div class="grid grid-cols-3 gap-4 items-center">
|
||||
@if (invoice.customer.type === "INDIVIDUAL") {
|
||||
<app-key-value label="نوع مشتری" value="حقیقی" />
|
||||
<app-key-value label="نام" [value]="invoice.customer.customer_individual?.first_name" />
|
||||
<app-key-value label="نام خانوادگی" [value]="invoice.customer.customer_individual?.last_name" />
|
||||
<app-key-value label="کد اقتصادی" [value]="invoice.customer.customer_individual?.economic_code" />
|
||||
<app-key-value label="کد ملی" [value]="invoice.customer.customer_individual?.national_id" />
|
||||
<app-key-value label="کد پستی" [value]="invoice.customer.customer_individual?.postal_code" />
|
||||
<app-key-value label="نام" [value]="invoice.customer.individual?.first_name" />
|
||||
<app-key-value label="نام خانوادگی" [value]="invoice.customer.individual?.last_name" />
|
||||
<app-key-value label="کد اقتصادی" [value]="invoice.customer.individual?.economic_code" />
|
||||
<app-key-value label="کد ملی" [value]="invoice.customer.individual?.national_id" />
|
||||
<app-key-value label="کد پستی" [value]="invoice.customer.individual?.postal_code" />
|
||||
} @else {
|
||||
<app-key-value label="نوع مشتری" value="حقوقی" />
|
||||
<app-key-value label="نام شرکت" [value]="invoice.customer.customer_legal?.company_name" />
|
||||
<app-key-value label="کد اقتصادی" [value]="invoice.customer.customer_legal?.economic_code" />
|
||||
<app-key-value label="کد ثبتی" [value]="invoice.customer.customer_legal?.registration_number" />
|
||||
<app-key-value label="کد پستی" [value]="invoice.customer.customer_legal?.postal_code" />
|
||||
<app-key-value label="نام شرکت" [value]="invoice.customer.legal?.company_name" />
|
||||
<app-key-value label="کد اقتصادی" [value]="invoice.customer.legal?.economic_code" />
|
||||
<app-key-value label="کد ثبتی" [value]="invoice.customer.legal?.registration_number" />
|
||||
<app-key-value label="کد پستی" [value]="invoice.customer.legal?.postal_code" />
|
||||
}
|
||||
</div>
|
||||
} @else if (invoice.unknown_customer) {
|
||||
|
||||
@@ -30,8 +30,8 @@ interface Payment {
|
||||
interface Customer {
|
||||
id: string;
|
||||
type: string;
|
||||
customer_legal?: CustomerLegal;
|
||||
customer_individual?: CustomerIndividual;
|
||||
legal?: CustomerLegal;
|
||||
individual?: CustomerIndividual;
|
||||
}
|
||||
|
||||
interface CustomerIndividual {
|
||||
|
||||
@@ -7,34 +7,10 @@
|
||||
(onHide)="close()"
|
||||
>
|
||||
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-1 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { MustMatch, password } from '@/core/validators';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IAccountRequest, IAccountResponse } from '../models';
|
||||
import { AccountsService } from '../services/main.service';
|
||||
|
||||
@Component({
|
||||
selector: 'account-password-form',
|
||||
templateUrl: './form.component.html',
|
||||
imports: [ReactiveFormsModule, Dialog, FormFooterActionsComponent, UikitFieldComponent, Password],
|
||||
imports: [ReactiveFormsModule, Dialog, FormFooterActionsComponent, SharedPasswordInputComponent],
|
||||
})
|
||||
export class ConsumerAccountPasswordFormComponent extends AbstractFormDialog<
|
||||
IAccountRequest,
|
||||
|
||||
+13
-11
@@ -7,11 +7,14 @@ import { Dialog } from 'primeng/dialog';
|
||||
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { CatalogGuildGoodCategoriesSelectComponent } from '@/shared/catalog/guildGoodCategories';
|
||||
import { IConsumerComplexGoodRequest, IConsumerComplexGoodResponse } from '../../models/goods_io';
|
||||
import { GuildGoodsService } from '../../services/goods.service';
|
||||
import {
|
||||
IConsumerBusinessActivityGoodRequest,
|
||||
IConsumerBusinessActivityGoodResponse,
|
||||
} from '../../models/goods_io';
|
||||
import { BusinessActivityGoodsService } from '../../services/goods.service';
|
||||
|
||||
@Component({
|
||||
selector: 'consumer-complex-good-form',
|
||||
selector: 'consumer-businessActivity-good-form',
|
||||
templateUrl: './form.component.html',
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
@@ -22,16 +25,15 @@ import { GuildGoodsService } from '../../services/goods.service';
|
||||
CatalogGuildGoodCategoriesSelectComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerComplexGoodFormComponent extends AbstractFormDialog<
|
||||
IConsumerComplexGoodRequest,
|
||||
IConsumerComplexGoodResponse
|
||||
export class ConsumerBusinessActivityGoodFormComponent extends AbstractFormDialog<
|
||||
IConsumerBusinessActivityGoodRequest,
|
||||
IConsumerBusinessActivityGoodResponse
|
||||
> {
|
||||
@Input({ required: true }) businessId!: string;
|
||||
@Input({ required: true }) complexId!: string;
|
||||
@Input({ required: true }) guildId!: string;
|
||||
@Input() categoryId?: string;
|
||||
|
||||
private service = inject(GuildGoodsService);
|
||||
private service = inject(BusinessActivityGoodsService);
|
||||
|
||||
form = this.fb.group({
|
||||
name: [this.initialValues?.name || '', [Validators.required]],
|
||||
@@ -46,10 +48,10 @@ export class ConsumerComplexGoodFormComponent extends AbstractFormDialog<
|
||||
return `${this.editMode ? 'ویرایش' : 'ایجاد'} کالا`;
|
||||
}
|
||||
|
||||
override submitForm(payload: IConsumerComplexGoodRequest) {
|
||||
override submitForm(payload: IConsumerBusinessActivityGoodRequest) {
|
||||
if (this.editMode) {
|
||||
return this.service.update(this.businessId, this.complexId, this.categoryId!, payload);
|
||||
return this.service.update(this.businessId, this.categoryId!, payload);
|
||||
}
|
||||
return this.service.create(this.businessId, this.complexId, payload);
|
||||
return this.service.create(this.businessId, payload);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -14,9 +14,8 @@
|
||||
(onAdd)="openAddForm()"
|
||||
(onRefresh)="refresh()"
|
||||
/>
|
||||
<consumer-complex-good-form
|
||||
<consumer-businessActivity-good-form
|
||||
[businessId]="businessId"
|
||||
[complexId]="complexId"
|
||||
[guildId]="guildId"
|
||||
[(visible)]="visibleForm"
|
||||
[initialValues]="selectedItemForEdit() || undefined"
|
||||
|
||||
+8
-9
@@ -5,18 +5,17 @@ import {
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { IConsumerComplexGoodResponse } from '../../models/goods_io';
|
||||
import { GuildGoodsService } from '../../services/goods.service';
|
||||
import { ConsumerComplexGoodFormComponent } from './form.component';
|
||||
import { IConsumerBusinessActivityGoodResponse } from '../../models/goods_io';
|
||||
import { BusinessActivityGoodsService } from '../../services/goods.service';
|
||||
import { ConsumerBusinessActivityGoodFormComponent } from './form.component';
|
||||
|
||||
@Component({
|
||||
selector: 'consumer-complex-goods-list',
|
||||
selector: 'consumer-businessActivity-goods-list',
|
||||
templateUrl: './list.component.html',
|
||||
imports: [PageDataListComponent, ConsumerComplexGoodFormComponent],
|
||||
imports: [PageDataListComponent, ConsumerBusinessActivityGoodFormComponent],
|
||||
})
|
||||
export class ConsumerComplexGoodsListComponent extends AbstractList<IConsumerComplexGoodResponse> {
|
||||
export class ConsumerBusinessActivityGoodsListComponent extends AbstractList<IConsumerBusinessActivityGoodResponse> {
|
||||
@Input({ required: true }) businessId!: string;
|
||||
@Input({ required: true }) complexId!: string;
|
||||
@Input({ required: true }) guildId!: string;
|
||||
@Input() fullHeight?: boolean;
|
||||
@Input() header: IColumn[] = [
|
||||
@@ -35,13 +34,13 @@ export class ConsumerComplexGoodsListComponent extends AbstractList<IConsumerCom
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
service = inject(GuildGoodsService);
|
||||
service = inject(BusinessActivityGoodsService);
|
||||
|
||||
override setColumns(): void {
|
||||
this.columns = this.header;
|
||||
}
|
||||
|
||||
override getDataRequest() {
|
||||
return this.service.getAll(this.businessId, this.complexId);
|
||||
return this.service.getAll(this.businessId);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-35
@@ -20,41 +20,10 @@
|
||||
@if (!editMode) {
|
||||
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||
<uikit-field label="رمز عبور" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="new-password"
|
||||
class="w-full"
|
||||
[toggleMask]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
[inputStyle]="{
|
||||
width: '100%',
|
||||
}"
|
||||
/>
|
||||
|
||||
<span class="text-xs mt-1 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
class="w-full"
|
||||
[toggleMask]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
[inputStyle]="{
|
||||
width: '100%',
|
||||
}"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
}
|
||||
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
|
||||
+2
-5
@@ -4,14 +4,12 @@ import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { CatalogProviderSelectComponent } from '@/shared/catalog';
|
||||
import { CatalogDeviceSelectComponent } from '@/shared/catalog/devices';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IPosRequest, IPosResponse } from '../../models';
|
||||
import { ConsumerPosesService } from '../../services/poses.service';
|
||||
|
||||
@@ -26,9 +24,8 @@ import { ConsumerPosesService } from '../../services/poses.service';
|
||||
CatalogDeviceSelectComponent,
|
||||
CatalogProviderSelectComponent,
|
||||
EnumSelectComponent,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
Divider,
|
||||
SharedPasswordInputComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerPosFormComponent extends AbstractFormDialog<IPosRequest, IPosResponse> {
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
const baseUrl = (businessId: string) => `/api/v1/consumer/business_activities/${businessId}/goods`;
|
||||
|
||||
export const CONSUMER_BUSINESS_ACTIVITY_GOODS_API_ROUTES = {
|
||||
list: (businessId: string) => `${baseUrl(businessId)}`,
|
||||
single: (businessId: string, id: string) => `${baseUrl(businessId)}/${id}`,
|
||||
};
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
const baseUrl = (businessId: string, complexId: string) =>
|
||||
`/api/v1/consumer/business_activities/${businessId}/complexes/${complexId}/goods`;
|
||||
|
||||
export const CONSUMER_COMPLEX_GOODS_API_ROUTES = {
|
||||
list: (businessId: string, complexId: string) => `${baseUrl(businessId, complexId)}`,
|
||||
single: (businessId: string, complexId: string, id: string) =>
|
||||
`${baseUrl(businessId, complexId)}/${id}`,
|
||||
};
|
||||
@@ -3,18 +3,19 @@ import { Routes } from '@angular/router';
|
||||
|
||||
export type TGoodsRouteNames = 'goods';
|
||||
|
||||
const baseUrl = (businessId: string, complexId: string) =>
|
||||
`/consumer/business_activities/${businessId}/complexes/${complexId}/goods`;
|
||||
const baseUrl = (businessId: string) => `/consumer/business_activities/${businessId}/goods`;
|
||||
|
||||
export const consumerComplexGoodsNamedRoutes: NamedRoutes<TGoodsRouteNames> = {
|
||||
export const consumerBusinessActivityGoodsNamedRoutes: NamedRoutes<TGoodsRouteNames> = {
|
||||
goods: {
|
||||
path: 'goods',
|
||||
loadComponent: () =>
|
||||
import('../../views/goods/list.component').then((m) => m.ConsumerComplexGoodsComponent),
|
||||
import('../../views/goods/list.component').then(
|
||||
(m) => m.ConsumerBusinessActivityGoodsComponent,
|
||||
),
|
||||
// @ts-ignore
|
||||
meta: {
|
||||
title: 'کالاها',
|
||||
pagePath: (businessId: string, complexId: string) => baseUrl(businessId, complexId),
|
||||
pagePath: (businessId: string) => baseUrl(businessId),
|
||||
},
|
||||
},
|
||||
// good: {
|
||||
@@ -25,15 +26,15 @@ export const consumerComplexGoodsNamedRoutes: NamedRoutes<TGoodsRouteNames> = {
|
||||
// meta: {
|
||||
// title: 'پایانهی فروش',
|
||||
// pagePath: (businessId: string, complexId: string, goodId: string) =>
|
||||
// `${baseUrl(businessId, complexId)}/${goodId}`,
|
||||
// `${baseUrl(businessId)}/${goodId}`,
|
||||
// },
|
||||
// },
|
||||
};
|
||||
|
||||
export const CONSUMER_COMPLEX_GOODS_ROUTES: Routes = [
|
||||
consumerComplexGoodsNamedRoutes.goods,
|
||||
export const CONSUMER_BUSINESS_ACTIVITY_GOODS_ROUTES: Routes = [
|
||||
consumerBusinessActivityGoodsNamedRoutes.goods,
|
||||
// {
|
||||
// path: consumerComplexGoodsNamedRoutes.good.path,
|
||||
// path: consumerBusinessActivityGoodsNamedRoutes.good.path,
|
||||
// loadComponent: () =>
|
||||
// import('../../components/goods/layout.component').then(
|
||||
// (m) => m.SuperAdminConsumerPosLayoutComponent,
|
||||
@@ -41,7 +42,7 @@ export const CONSUMER_COMPLEX_GOODS_ROUTES: Routes = [
|
||||
// children: [
|
||||
// {
|
||||
// path: '',
|
||||
// loadComponent: consumerComplexGoodsNamedRoutes.good.loadComponent,
|
||||
// loadComponent: consumerBusinessActivityGoodsNamedRoutes.good.loadComponent,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { NamedRoutes } from '@/core';
|
||||
import { Routes } from '@angular/router';
|
||||
import { CONSUMER_COMPLEXES_ROUTES } from './complexes';
|
||||
import { CONSUMER_BUSINESS_ACTIVITY_GOODS_ROUTES } from './goods';
|
||||
|
||||
export type TConsumerBusinessActivityRouteNames = 'businessActivities' | 'businessActivity';
|
||||
|
||||
@@ -38,6 +39,7 @@ export const CONSUMER_BUSINESS_ACTIVITIES_ROUTES: Routes = [
|
||||
...consumerBusinessActivityNamedRoutes.businessActivity,
|
||||
path: '',
|
||||
},
|
||||
...CONSUMER_BUSINESS_ACTIVITY_GOODS_ROUTES,
|
||||
...CONSUMER_COMPLEXES_ROUTES,
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ISummary from '@/core/models';
|
||||
|
||||
export interface IConsumerComplexGoodRawResponse {
|
||||
export interface IConsumerBusinessActivityGoodRawResponse {
|
||||
id: string;
|
||||
name: string;
|
||||
sku: string;
|
||||
@@ -11,9 +11,9 @@ export interface IConsumerComplexGoodRawResponse {
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
export interface IConsumerComplexGoodResponse extends IConsumerComplexGoodRawResponse {}
|
||||
export interface IConsumerBusinessActivityGoodResponse extends IConsumerBusinessActivityGoodRawResponse {}
|
||||
|
||||
export interface IConsumerComplexGoodRequest {
|
||||
export interface IConsumerBusinessActivityGoodRequest {
|
||||
name: string;
|
||||
sku: string;
|
||||
category_id: string;
|
||||
|
||||
@@ -2,56 +2,49 @@ import { IPaginatedResponse } from '@/core/models/service.model';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { CONSUMER_COMPLEX_GOODS_API_ROUTES } from '../constants/apiRoutes/complexGoods';
|
||||
import { CONSUMER_BUSINESS_ACTIVITY_GOODS_API_ROUTES } from '../constants/apiRoutes/businessActivityGoods';
|
||||
import {
|
||||
IConsumerComplexGoodRawResponse,
|
||||
IConsumerComplexGoodRequest,
|
||||
IConsumerComplexGoodResponse,
|
||||
IConsumerBusinessActivityGoodRawResponse,
|
||||
IConsumerBusinessActivityGoodRequest,
|
||||
IConsumerBusinessActivityGoodResponse,
|
||||
} from '../models/goods_io';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class GuildGoodsService {
|
||||
export class BusinessActivityGoodsService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
private apiRoutes = CONSUMER_COMPLEX_GOODS_API_ROUTES;
|
||||
private apiRoutes = CONSUMER_BUSINESS_ACTIVITY_GOODS_API_ROUTES;
|
||||
|
||||
getAll(
|
||||
businessId: string,
|
||||
complexId: string,
|
||||
): Observable<IPaginatedResponse<IConsumerComplexGoodResponse>> {
|
||||
return this.http.get<IPaginatedResponse<IConsumerComplexGoodRawResponse>>(
|
||||
this.apiRoutes.list(businessId, complexId),
|
||||
): Observable<IPaginatedResponse<IConsumerBusinessActivityGoodResponse>> {
|
||||
return this.http.get<IPaginatedResponse<IConsumerBusinessActivityGoodRawResponse>>(
|
||||
this.apiRoutes.list(businessId),
|
||||
);
|
||||
}
|
||||
getSingle(
|
||||
businessId: string,
|
||||
complexId: string,
|
||||
id: string,
|
||||
): Observable<IConsumerComplexGoodResponse> {
|
||||
return this.http.get<IConsumerComplexGoodRawResponse>(
|
||||
this.apiRoutes.single(businessId, complexId, id),
|
||||
getSingle(businessId: string, id: string): Observable<IConsumerBusinessActivityGoodResponse> {
|
||||
return this.http.get<IConsumerBusinessActivityGoodRawResponse>(
|
||||
this.apiRoutes.single(businessId, id),
|
||||
);
|
||||
}
|
||||
|
||||
create(
|
||||
businessId: string,
|
||||
complexId: string,
|
||||
data: IConsumerComplexGoodRequest,
|
||||
): Observable<IConsumerComplexGoodResponse> {
|
||||
return this.http.post<IConsumerComplexGoodResponse>(
|
||||
this.apiRoutes.list(businessId, complexId),
|
||||
data: IConsumerBusinessActivityGoodRequest,
|
||||
): Observable<IConsumerBusinessActivityGoodResponse> {
|
||||
return this.http.post<IConsumerBusinessActivityGoodResponse>(
|
||||
this.apiRoutes.list(businessId),
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
update(
|
||||
businessId: string,
|
||||
complexId: string,
|
||||
id: string,
|
||||
data: IConsumerComplexGoodRequest,
|
||||
): Observable<IConsumerComplexGoodResponse> {
|
||||
return this.http.patch<IConsumerComplexGoodResponse>(
|
||||
this.apiRoutes.single(businessId, complexId, id),
|
||||
data: IConsumerBusinessActivityGoodRequest,
|
||||
): Observable<IConsumerBusinessActivityGoodResponse> {
|
||||
return this.http.patch<IConsumerBusinessActivityGoodResponse>(
|
||||
this.apiRoutes.single(businessId, id),
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
-1
@@ -10,7 +10,6 @@
|
||||
</app-card-data>
|
||||
|
||||
<consumer-poses-list [businessId]="businessId()" [complexId]="complexId()" />
|
||||
<consumer-complex-goods-list [businessId]="businessId()" [complexId]="complexId()" [guildId]="business()!.guild.id" />
|
||||
|
||||
<consumer-complex-form
|
||||
[(visible)]="editMode"
|
||||
|
||||
-2
@@ -4,7 +4,6 @@ import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerComplexFormComponent } from '../../components/complexes/form.component';
|
||||
import { ConsumerComplexGoodsListComponent } from '../../components/goods/list.component';
|
||||
import { ConsumerPosesComponent } from '../../components/poses/list.component';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
import { ConsumerComplexStore } from '../../store/complex.store';
|
||||
@@ -17,7 +16,6 @@ import { ConsumerComplexStore } from '../../store/complex.store';
|
||||
KeyValueComponent,
|
||||
ConsumerComplexFormComponent,
|
||||
ConsumerPosesComponent,
|
||||
ConsumerComplexGoodsListComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerComplexComponent {
|
||||
|
||||
@@ -1 +1 @@
|
||||
<consumer-complex-goods-list [businessId]="businessId()" [complexId]="complexId()" [guildId]="business()?.guild!.id" />
|
||||
<consumer-businessActivity-goods-list [businessId]="businessId()" [guildId]="business()?.guild!.id" />
|
||||
|
||||
@@ -3,26 +3,23 @@ import { BreadcrumbService } from '@/core/services';
|
||||
import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerComplexGoodsListComponent } from '../../components/goods/list.component';
|
||||
import { consumerComplexGoodsNamedRoutes } from '../../constants/routes/goods';
|
||||
import { ConsumerBusinessActivityGoodsListComponent } from '../../components/goods/list.component';
|
||||
import { consumerBusinessActivityGoodsNamedRoutes } from '../../constants/routes/goods';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
import { ConsumerComplexStore } from '../../store/complex.store';
|
||||
|
||||
@Component({
|
||||
selector: 'consumer-complex-goods',
|
||||
selector: 'consumer-businessActivity-goods',
|
||||
templateUrl: './list.component.html',
|
||||
imports: [ConsumerComplexGoodsListComponent],
|
||||
imports: [ConsumerBusinessActivityGoodsListComponent],
|
||||
})
|
||||
export class ConsumerComplexGoodsComponent {
|
||||
export class ConsumerBusinessActivityGoodsComponent {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly breadcrumbService = inject(BreadcrumbService);
|
||||
|
||||
private readonly businessStore = inject(BusinessActivityStore);
|
||||
private readonly complexStore = inject(ConsumerComplexStore);
|
||||
|
||||
pageParams = computed(() => pageParamsUtils(this.route));
|
||||
businessId = signal<string>(this.pageParams()['businessActivityId']);
|
||||
complexId = signal<string>(this.pageParams()['complexId']);
|
||||
|
||||
business = computed(() => this.businessStore.entity());
|
||||
|
||||
@@ -33,12 +30,10 @@ export class ConsumerComplexGoodsComponent {
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
...this.businessStore.breadcrumbItems(),
|
||||
...this.complexStore.breadcrumbItems(),
|
||||
{
|
||||
title: consumerComplexGoodsNamedRoutes.goods.meta.title,
|
||||
routerLink: consumerComplexGoodsNamedRoutes.goods.meta.pagePath!(
|
||||
title: consumerBusinessActivityGoodsNamedRoutes.goods.meta.title,
|
||||
routerLink: consumerBusinessActivityGoodsNamedRoutes.goods.meta.pagePath!(
|
||||
this.businessId(),
|
||||
this.complexId(),
|
||||
),
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<div class="flex flex-col gap-6">
|
||||
<app-card-data cardTitle="اطلاعات فعالیت اقتصادی" [editable]="true" [(editMode)]="editMode">
|
||||
<ng-template #moreActions> </ng-template>
|
||||
<ng-template #moreActions>
|
||||
<a routerLink pButton [routerLink]="goodsPageRoute()" outlined>مدیریت کالاها</a>
|
||||
</ng-template>
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="grid grid-cols-3 gap-4 items-center">
|
||||
<app-key-value label="عنوان" [value]="business()?.name" />
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { BreadcrumbService } from '@/core/services';
|
||||
import { AppCardComponent, KeyValueComponent } from '@/shared/components';
|
||||
import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { ButtonDirective } from 'primeng/button';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { ConsumerComplexListComponent } from '../components/complexes/list.component';
|
||||
import { ConsumerBusinessActivityFormComponent } from '../components/form.component';
|
||||
import { consumerBusinessActivityGoodsNamedRoutes } from '../constants/routes/goods';
|
||||
import { BusinessActivityStore } from '../store/businessActivity.store';
|
||||
|
||||
@Component({
|
||||
@@ -16,9 +18,19 @@ import { BusinessActivityStore } from '../store/businessActivity.store';
|
||||
ConsumerBusinessActivityFormComponent,
|
||||
ConsumerComplexListComponent,
|
||||
Divider,
|
||||
ButtonDirective,
|
||||
RouterLink,
|
||||
],
|
||||
})
|
||||
export class ConsumerBusinessActivityComponent {
|
||||
constructor() {
|
||||
effect(() => {
|
||||
if (this.business()?.id) {
|
||||
this.setBreadcrumb();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private readonly store = inject(BusinessActivityStore);
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly breadcrumbService = inject(BreadcrumbService);
|
||||
@@ -30,13 +42,11 @@ export class ConsumerBusinessActivityComponent {
|
||||
readonly business = computed(() => this.store.entity());
|
||||
readonly businessBreadcrumb = computed(() => this.store.breadcrumbItems());
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
if (this.business()?.id) {
|
||||
this.setBreadcrumb();
|
||||
}
|
||||
});
|
||||
}
|
||||
readonly goodsPageRoute = computed(() =>
|
||||
this.business()
|
||||
? consumerBusinessActivityGoodsNamedRoutes.goods.meta.pagePath!(this.business()!.id)
|
||||
: '',
|
||||
);
|
||||
|
||||
getData() {
|
||||
this.store.getData(this.businessId());
|
||||
|
||||
@@ -25,18 +25,15 @@ export class ConsumerCustomerIndividualFormComponent extends AbstractForm<
|
||||
|
||||
initForm = () => {
|
||||
return this.fb.group({
|
||||
first_name: [
|
||||
this.initialValues?.customer_individual?.first_name || '',
|
||||
[Validators.required],
|
||||
],
|
||||
last_name: [this.initialValues?.customer_individual?.last_name || '', [Validators.required]],
|
||||
first_name: [this.initialValues?.individual?.first_name || '', [Validators.required]],
|
||||
last_name: [this.initialValues?.individual?.last_name || '', [Validators.required]],
|
||||
national_id: [
|
||||
this.initialValues?.customer_individual?.national_id || '',
|
||||
this.initialValues?.individual?.national_id || '',
|
||||
[Validators.required, nationalIdValidator()],
|
||||
],
|
||||
economic_code: [this.initialValues?.customer_individual?.economic_code || ''],
|
||||
economic_code: [this.initialValues?.individual?.economic_code || ''],
|
||||
postal_code: [
|
||||
this.initialValues?.customer_individual?.postal_code || '',
|
||||
this.initialValues?.individual?.postal_code || '',
|
||||
[Validators.required, postalCodeValidator()],
|
||||
],
|
||||
});
|
||||
|
||||
@@ -23,17 +23,14 @@ export class ConsumerCustomerLegalFormComponent extends AbstractForm<
|
||||
|
||||
private initForm() {
|
||||
const form = this.fb.group({
|
||||
company_name: [this.initialValues?.customer_legal?.company_name || '', [Validators.required]],
|
||||
company_name: [this.initialValues?.legal?.company_name || '', [Validators.required]],
|
||||
registration_number: [
|
||||
this.initialValues?.customer_legal?.registration_number || '',
|
||||
[Validators.required],
|
||||
],
|
||||
economic_code: [
|
||||
this.initialValues?.customer_legal?.economic_code || '',
|
||||
this.initialValues?.legal?.registration_number || '',
|
||||
[Validators.required],
|
||||
],
|
||||
economic_code: [this.initialValues?.legal?.economic_code || '', [Validators.required]],
|
||||
postal_code: [
|
||||
this.initialValues?.customer_legal?.postal_code || '',
|
||||
this.initialValues?.legal?.postal_code || '',
|
||||
[Validators.required, postalCodeValidator()],
|
||||
],
|
||||
});
|
||||
|
||||
@@ -33,9 +33,9 @@ export class ConsumerCustomerListComponent extends AbstractList<ICustomerRespons
|
||||
header: 'عنوان',
|
||||
customDataModel(item: ICustomerResponse) {
|
||||
if (item.type === 'LEGAL') {
|
||||
return item.customer_legal!.company_name;
|
||||
return item.legal!.company_name;
|
||||
}
|
||||
return `${item.customer_individual!.first_name} ${item.customer_individual!.last_name}`;
|
||||
return `${item.individual!.first_name} ${item.individual!.last_name}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -43,9 +43,9 @@ export class ConsumerCustomerListComponent extends AbstractList<ICustomerRespons
|
||||
header: 'کد اقتصادی',
|
||||
customDataModel(item: ICustomerResponse) {
|
||||
if (item.type === 'LEGAL') {
|
||||
return item.customer_legal!.economic_code;
|
||||
return item.legal!.economic_code;
|
||||
}
|
||||
return item.customer_individual!.economic_code;
|
||||
return item.individual!.economic_code;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -5,8 +5,8 @@ export interface ICustomerRawResponse {
|
||||
type: string;
|
||||
is_favorite: boolean;
|
||||
created_at: string;
|
||||
customer_individual: Maybe<CustomerIndividual>;
|
||||
customer_legal: Maybe<CustomerLegal>;
|
||||
individual: Maybe<CustomerIndividual>;
|
||||
legal: Maybe<CustomerLegal>;
|
||||
}
|
||||
export interface ICustomerResponse extends ICustomerRawResponse {}
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ export class ConsumerCustomerStore extends EntityStore<ICustomerResponse, Consum
|
||||
{
|
||||
title:
|
||||
this.entity()?.type === 'LEGAL'
|
||||
? this.entity()?.customer_legal!.company_name
|
||||
: `${this.entity()?.customer_individual!.first_name} ${this.entity()?.customer_individual!.last_name}`,
|
||||
? this.entity()?.legal!.company_name
|
||||
: `${this.entity()?.individual!.first_name} ${this.entity()?.individual!.last_name}`,
|
||||
routerLink: consumerCustomersNamedRoutes.customer.meta.pagePath!(customerId),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
<div class="flex flex-col gap-4">
|
||||
@if (customer()?.type === "LEGAL") {
|
||||
<div class="grid grid-cols-3 gap-4 items-center">
|
||||
<app-key-value label="عنوان" [value]="customer()?.customer_legal?.company_name" />
|
||||
<app-key-value label="کد اقتصادی" [value]="customer()?.customer_legal?.economic_code" />
|
||||
<app-key-value label="شماره ثبت" [value]="customer()?.customer_legal?.registration_number" />
|
||||
<app-key-value label="کد پستی" [value]="customer()?.customer_legal?.postal_code" />
|
||||
<app-key-value label="عنوان" [value]="customer()?.legal?.company_name" />
|
||||
<app-key-value label="کد اقتصادی" [value]="customer()?.legal?.economic_code" />
|
||||
<app-key-value label="شماره ثبت" [value]="customer()?.legal?.registration_number" />
|
||||
<app-key-value label="کد پستی" [value]="customer()?.legal?.postal_code" />
|
||||
</div>
|
||||
} @else if (customer()?.type === "INDIVIDUAL") {
|
||||
<div class="grid grid-cols-3 gap-4 items-center">
|
||||
<app-key-value label="نام" [value]="customer()?.customer_individual?.first_name" />
|
||||
<app-key-value label="نام خانوادگی" [value]="customer()?.customer_individual?.last_name" />
|
||||
<app-key-value label="عنوان" [value]="customer()?.customer_individual?.national_id" />
|
||||
<app-key-value label="کد اقتصادی" [value]="customer()?.customer_individual?.economic_code" />
|
||||
<app-key-value label="کد پستی" [value]="customer()?.customer_individual?.postal_code" />
|
||||
<app-key-value label="نام" [value]="customer()?.individual?.first_name" />
|
||||
<app-key-value label="نام خانوادگی" [value]="customer()?.individual?.last_name" />
|
||||
<app-key-value label="عنوان" [value]="customer()?.individual?.national_id" />
|
||||
<app-key-value label="کد اقتصادی" [value]="customer()?.individual?.economic_code" />
|
||||
<app-key-value label="کد پستی" [value]="customer()?.individual?.postal_code" />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -7,34 +7,10 @@
|
||||
(onHide)="close()"
|
||||
>
|
||||
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-1 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { MustMatch, password } from '@/core/validators';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IAccountRequest, IAccountResponse } from '../models';
|
||||
import { AccountsService } from '../services/main.service';
|
||||
|
||||
@Component({
|
||||
selector: 'account-password-form',
|
||||
templateUrl: './form.component.html',
|
||||
imports: [ReactiveFormsModule, Dialog, FormFooterActionsComponent, UikitFieldComponent, Password],
|
||||
imports: [ReactiveFormsModule, Dialog, FormFooterActionsComponent, SharedPasswordInputComponent],
|
||||
})
|
||||
export class PartnerAccountPasswordFormComponent extends AbstractFormDialog<
|
||||
IAccountRequest,
|
||||
|
||||
@@ -9,34 +9,10 @@
|
||||
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" />
|
||||
<app-enum-select [control]="form.controls.role" name="role" type="consumerRole" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-2 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
||||
@@ -2,13 +2,11 @@ import { MustMatch, password } from '@/core/validators';
|
||||
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IConsumerAccountRequest, IConsumerAccountResponse } from '../../models';
|
||||
import { PartnerConsumerAccountsService } from '../../services/accounts.service';
|
||||
|
||||
@@ -20,8 +18,7 @@ import { PartnerConsumerAccountsService } from '../../services/accounts.service'
|
||||
Dialog,
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
SharedPasswordInputComponent,
|
||||
EnumSelectComponent,
|
||||
],
|
||||
})
|
||||
|
||||
@@ -16,34 +16,10 @@
|
||||
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||
<!-- @ts-ignore -->
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-1 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
<p-divider align="center"> اطلاعات لایسنس </p-divider>
|
||||
<uikit-datepicker
|
||||
label="تاریخ شروع لایسنس"
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { mobileValidator, MustMatch } from '@/core/validators';
|
||||
import { nationalIdValidator } from '@/core/validators/national-id.validator';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent, UikitFlatpickrJalaliComponent } from '@/uikit';
|
||||
import { UikitFlatpickrJalaliComponent } from '@/uikit';
|
||||
import { nowJalali } from '@/utils';
|
||||
import { Component, computed, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IConsumerRequest, IConsumerResponse } from '../models';
|
||||
import { ConsumersService } from '../services/main.service';
|
||||
|
||||
@@ -22,9 +21,8 @@ import { ConsumersService } from '../services/main.service';
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
Divider,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
UikitFlatpickrJalaliComponent,
|
||||
SharedPasswordInputComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerUserFormComponent extends AbstractFormDialog<
|
||||
|
||||
@@ -11,31 +11,10 @@
|
||||
@if (!editMode) {
|
||||
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||
<uikit-field label="رمز عبور" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="new-password"
|
||||
inputStyleClass="w-full"
|
||||
[toggleMask]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
inputStyleClass="w-full"
|
||||
[toggleMask]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
}
|
||||
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
|
||||
@@ -4,13 +4,11 @@ import { AbstractForm } from '@/shared/abstractClasses';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { CatalogProviderSelectComponent } from '@/shared/catalog';
|
||||
import { CatalogDeviceSelectComponent } from '@/shared/catalog/devices';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IPosRequest, IPosResponse } from '../../models';
|
||||
import { PartnerPosesService } from '../../services/poses.service';
|
||||
|
||||
@@ -24,9 +22,8 @@ import { PartnerPosesService } from '../../services/poses.service';
|
||||
CatalogDeviceSelectComponent,
|
||||
CatalogProviderSelectComponent,
|
||||
EnumSelectComponent,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
Divider,
|
||||
SharedPasswordInputComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerPosFormContentComponent extends AbstractForm<IPosRequest, IPosResponse> {
|
||||
|
||||
+4
-28
@@ -9,34 +9,10 @@
|
||||
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" />
|
||||
<app-enum-select [control]="form.controls.role" name="role" type="consumerRole" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-2 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
||||
@@ -2,13 +2,11 @@ import { MustMatch, password } from '@/core/validators';
|
||||
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IConsumerAccountRequest, IConsumerAccountResponse } from '../../models';
|
||||
import { AdminConsumerAccountsService } from '../../services/accounts.service';
|
||||
|
||||
@@ -20,8 +18,7 @@ import { AdminConsumerAccountsService } from '../../services/accounts.service';
|
||||
Dialog,
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
SharedPasswordInputComponent,
|
||||
EnumSelectComponent,
|
||||
],
|
||||
})
|
||||
|
||||
@@ -14,34 +14,10 @@
|
||||
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||
<!-- @ts-ignore -->
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-1 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
<p-divider align="center"> اطلاعات لایسنس </p-divider>
|
||||
<uikit-datepicker
|
||||
label="تاریخ شروع لایسنس"
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { mobileValidator, MustMatch } from '@/core/validators';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent, UikitFlatpickrJalaliComponent } from '@/uikit';
|
||||
import { UikitFlatpickrJalaliComponent } from '@/uikit';
|
||||
import { Component, computed, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { Password } from 'primeng/password';
|
||||
import { PartnerSelectComponent } from '../../partners/shared/select.component';
|
||||
import { IConsumerRequest, IConsumerResponse } from '../models';
|
||||
import { ConsumersService } from '../services/main.service';
|
||||
@@ -21,10 +20,9 @@ import { ConsumersService } from '../services/main.service';
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
Divider,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
UikitFlatpickrJalaliComponent,
|
||||
PartnerSelectComponent,
|
||||
SharedPasswordInputComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerUserFormComponent extends AbstractFormDialog<
|
||||
|
||||
+4
-28
@@ -9,34 +9,10 @@
|
||||
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" />
|
||||
<app-enum-select [control]="form.controls.type" name="type" type="accountType" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-2 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
||||
@@ -2,13 +2,11 @@ import { MustMatch, password } from '@/core/validators';
|
||||
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IPartnerAccountRequest, IPartnerAccountResponse } from '../../models';
|
||||
import { AdminPartnerAccountsService } from '../../services/accounts.service';
|
||||
|
||||
@@ -20,8 +18,7 @@ import { AdminPartnerAccountsService } from '../../services/accounts.service';
|
||||
Dialog,
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
SharedPasswordInputComponent,
|
||||
EnumSelectComponent,
|
||||
],
|
||||
})
|
||||
|
||||
@@ -13,34 +13,10 @@
|
||||
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||
<!-- @ts-ignore -->
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-1 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
}
|
||||
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { MustMatch } from '@/core/validators';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, computed, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IPartnerRequest, IPartnerResponse } from '../models';
|
||||
import { PartnersService } from '../services/main.service';
|
||||
|
||||
@@ -20,8 +18,7 @@ import { PartnersService } from '../services/main.service';
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
Divider,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
SharedPasswordInputComponent,
|
||||
],
|
||||
})
|
||||
export class GuildFormComponent extends AbstractFormDialog<IPartnerRequest, IPartnerResponse> {
|
||||
|
||||
@@ -14,34 +14,10 @@
|
||||
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||
<!-- @ts-ignore -->
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-1 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
}
|
||||
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { MustMatch } from '@/core/validators';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, computed, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IProviderRequest, IProviderResponse } from '../models';
|
||||
import { ProvidersService } from '../services/main.service';
|
||||
|
||||
@@ -20,8 +18,7 @@ import { ProvidersService } from '../services/main.service';
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
Divider,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
SharedPasswordInputComponent,
|
||||
],
|
||||
})
|
||||
export class ProviderFormComponent extends AbstractFormDialog<IProviderRequest, IProviderResponse> {
|
||||
|
||||
@@ -9,34 +9,10 @@
|
||||
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" />
|
||||
<app-enum-select [control]="form.controls.type" name="type" type="accountType" />
|
||||
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-2 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||
/>
|
||||
</uikit-field>
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
[confirmPasswordControl]="form.controls.confirmPassword"
|
||||
/>
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
||||
@@ -2,13 +2,11 @@ import { MustMatch, password } from '@/core/validators';
|
||||
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { UikitFieldComponent } from '@/uikit';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { Password } from 'primeng/password';
|
||||
import { IAccountRequest, IAccountResponse } from '../../models';
|
||||
import { AdminUserAccountsService } from '../../services/accounts.service';
|
||||
|
||||
@@ -20,9 +18,8 @@ import { AdminUserAccountsService } from '../../services/accounts.service';
|
||||
Dialog,
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
UikitFieldComponent,
|
||||
Password,
|
||||
EnumSelectComponent,
|
||||
SharedPasswordInputComponent,
|
||||
],
|
||||
})
|
||||
export class UserAccountFormComponent extends AbstractFormDialog<
|
||||
|
||||
@@ -10,36 +10,7 @@
|
||||
<app-input label="نام" [control]="form.controls.first_name" name="first_name" />
|
||||
<app-input label="نام خانوادگی" [control]="form.controls.last_name" name="last_name" />
|
||||
<app-input label="شماره موبایل" [control]="form.controls.mobile_number" name="mobile_number" type="mobile" />
|
||||
<!-- <app-enum-select [control]="form.controls.role" name="role" type="accountType" /> -->
|
||||
<!-- <catalog-roles-select [control]="form.controls.roleId" /> -->
|
||||
<!-- <uikit-field label="رمز عبور" class="" [control]="form.get('password')">
|
||||
<p-password
|
||||
id="password1"
|
||||
name="password"
|
||||
formControlName="password"
|
||||
autocomplete="password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.get('password')?.touched && form.get('password')?.invalid"
|
||||
/>
|
||||
<span class="text-xs mt-2 text-muted-color">
|
||||
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||
</span>
|
||||
</uikit-field>
|
||||
|
||||
<uikit-field label="تکرار رمز عبور" class="" [control]="form.get('confirmPassword')">
|
||||
<p-password
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
formControlName="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
[feedback]="false"
|
||||
[invalid]="form.get('confirmPassword')?.touched && form.get('confirmPassword')?.invalid"
|
||||
/>
|
||||
</uikit-field> -->
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
||||
Reference in New Issue
Block a user