diff --git a/src/app/domains/pos/components/change-password.component.ts b/src/app/domains/pos/components/change-password.component.ts index cf1ba49..5bbb080 100644 --- a/src/app/domains/pos/components/change-password.component.ts +++ b/src/app/domains/pos/components/change-password.component.ts @@ -1,9 +1,11 @@ import { ToastService } from '@/core/services/toast.service'; import { AbstractDialog } from '@/shared/abstractClasses/abstract-dialog'; -import { ChangePasswordFormDialogComponent } from '@/shared/components'; +import { + ChangePasswordFormDialogComponent, + IChangePasswordSubmitPayload, +} from '@/shared/components'; import { Component, inject, signal } from '@angular/core'; import { finalize } from 'rxjs'; -import { IChangePasswordSubmitPayload } from '../modules/configs/components/changePassword/model'; import { PosChangePasswordService } from '../services/password'; @Component({ diff --git a/src/app/domains/pos/modules/configs/components/changePassword/form.component.html b/src/app/domains/pos/modules/configs/components/changePassword/form.component.html deleted file mode 100644 index 8ff522d..0000000 --- a/src/app/domains/pos/modules/configs/components/changePassword/form.component.html +++ /dev/null @@ -1,11 +0,0 @@ - -
- - -
- -
- -
diff --git a/src/app/domains/pos/modules/configs/components/changePassword/form.component.ts b/src/app/domains/pos/modules/configs/components/changePassword/form.component.ts deleted file mode 100644 index 24cb9b7..0000000 --- a/src/app/domains/pos/modules/configs/components/changePassword/form.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { MustMatch } from '@/core/validators'; -import { AbstractForm } from '@/shared/abstractClasses'; -import { AppCardComponent } from '@/shared/components'; -import { SharedPasswordInputComponent } from '@/shared/components/passwordInput/password-input.component'; -import { fieldControl } from '@/shared/constants'; -import { CommonModule } from '@angular/common'; -import { Component, inject } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { ButtonDirective } from 'primeng/button'; -import { tap } from 'rxjs'; -import { IChangePasswordSubmitPayload } from './model'; -import { PosChangePasswordService } from './services/main.service'; - -@Component({ - selector: 'pos-change-password-form', - templateUrl: './form.component.html', - imports: [ - ReactiveFormsModule, - SharedPasswordInputComponent, - CommonModule, - ButtonDirective, - AppCardComponent, - ], -}) -export class PosChangePasswordFormDialogComponent extends AbstractForm< - IChangePasswordSubmitPayload, - any -> { - private readonly changePasswordService = inject(PosChangePasswordService); - - form = this.fb.group( - { - password: fieldControl.password(), - confirmPassword: fieldControl.confirmPassword(), - }, - { - validators: [MustMatch('password', 'confirmPassword')], - } - ); - - override submitForm() { - const payload = this.form.getRawValue().password!; - return this.changePasswordService.changePassword({ password: payload }).pipe( - tap({ - next: (res) => { - this.form.reset(); - }, - }) - ); - } -} diff --git a/src/app/domains/pos/modules/configs/components/changePassword/model/index.ts b/src/app/domains/pos/modules/configs/components/changePassword/model/index.ts deleted file mode 100644 index 22abae3..0000000 --- a/src/app/domains/pos/modules/configs/components/changePassword/model/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IChangePasswordSubmitPayload { - password: string; -} diff --git a/src/app/domains/pos/modules/configs/components/changePassword/services/main.service.ts b/src/app/domains/pos/modules/configs/components/changePassword/services/main.service.ts deleted file mode 100644 index 0496867..0000000 --- a/src/app/domains/pos/modules/configs/components/changePassword/services/main.service.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { IChangePasswordSubmitPayload } from '../model'; - -@Injectable({ - providedIn: 'root', -}) -export class PosChangePasswordService { - constructor(private readonly http: HttpClient) {} - - changePassword(payload: IChangePasswordSubmitPayload): Observable { - return this.http.put('/api/v1/pos/update-password', payload); - } -} diff --git a/src/app/domains/pos/modules/configs/views/root.component.html b/src/app/domains/pos/modules/configs/views/root.component.html index 7430eca..6e75683 100644 --- a/src/app/domains/pos/modules/configs/views/root.component.html +++ b/src/app/domains/pos/modules/configs/views/root.component.html @@ -1,19 +1,28 @@ -
- -
- @if (info()?.guild!.code.toLocaleLowerCase() === 'gold') { - -
- } - -
- -
-
- - - هریک از موارد زیر را که می‌خواهید در چاپ صورت‌حساب‌ نمایش داده‌ شوند را انتخاب کنید - - - +
+ + + تنظیمات صدور صورت‌حساب + تنظیمات پرینت + + + +
+ @if (info()?.guild!.code.toLocaleLowerCase() === 'gold') { + +
+ } + +
+ +
+
+ + + + هریک از موارد زیر را که می‌خواهید در چاپ صورت‌حساب‌ نمایش داده‌ شوند را انتخاب کنید + + + +
+
diff --git a/src/app/domains/pos/modules/configs/views/root.component.ts b/src/app/domains/pos/modules/configs/views/root.component.ts index 2d9f79f..f73fc73 100644 --- a/src/app/domains/pos/modules/configs/views/root.component.ts +++ b/src/app/domains/pos/modules/configs/views/root.component.ts @@ -1,8 +1,8 @@ import { PosInfoStore } from '@/domains/pos/store'; -import { AppCardComponent } from '@/shared/components'; import { Component, computed, inject } from '@angular/core'; import { Router } from '@angular/router'; import { Message } from 'primeng/message'; +import { TabsModule } from 'primeng/tabs'; import { PosConfigGoldPriceFormComponent } from '../components/goldPrice/form.component'; import { PosConfigPrintFormComponent } from '../components/print/form.component'; import { PosConfigRapidInvoiceFormComponent } from '../components/rapidInvoice/form.component'; @@ -13,8 +13,8 @@ import { PosConfigSendToFiscalActivationFormComponent } from '../components/send templateUrl: './root.component.html', imports: [ PosConfigPrintFormComponent, - AppCardComponent, Message, + TabsModule, PosConfigGoldPriceFormComponent, PosConfigRapidInvoiceFormComponent, PosConfigSendToFiscalActivationFormComponent, @@ -25,6 +25,7 @@ export class PosConfigPageComponent { private readonly posInfoStore = inject(PosInfoStore); readonly info = computed(() => this.posInfoStore.entity()); + activeTabIndex = 0; returnToMainPage() { this.router.navigateByUrl('/');