ui update, init to consumer statistics and manage pos user types
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@
|
||||
hint="مدت زمان لایسنسها ۱ ساله هستند."
|
||||
/>
|
||||
<!-- <uikit-datepicker label="تاریخ انقضای لایسنس" [control]="form.controls.expires_at" name="expires_at" /> -->
|
||||
<app-partner-select label="شریک تجاری" [control]="form.controls.partner_id" />
|
||||
<app-partner-select label="شریک تجاری" [control]="form.controls.partner_id" [showClear]="true" />
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
||||
@@ -16,12 +16,13 @@ export class SuperAdminConsumerPosLayoutComponent {
|
||||
readonly loading = computed(() => this.store.loading());
|
||||
readonly pageParams = computed(() => pageParamsUtils(this.route));
|
||||
|
||||
readonly consumerId = computed(() => this.pageParams()['consumerId']!);
|
||||
readonly businessId = computed(() => this.pageParams()['businessActivityId']!);
|
||||
readonly complexId = computed(() => this.pageParams()['complexId']!);
|
||||
readonly posId = computed(() => this.pageParams()['posId']!);
|
||||
|
||||
getData() {
|
||||
this.store.getData(this.businessId(), this.complexId(), this.posId());
|
||||
this.store.getData(this.consumerId(), this.businessId(), this.complexId(), this.posId());
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../constants/routes/businessActivities';
|
||||
import { IBusinessActivityResponse } from '../models';
|
||||
import { AdminConsumerBusinessActivitiesService } from '../services/businessActivities.service';
|
||||
|
||||
interface BusinessActivityState extends EntityState<IBusinessActivityResponse> {}
|
||||
interface BusinessActivityState extends EntityState<IBusinessActivityResponse> {
|
||||
breadcrumbItems: MenuItem[];
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -21,26 +25,47 @@ export class BusinessActivityStore extends EntityStore<
|
||||
entity: null,
|
||||
initialized: false,
|
||||
isRefreshing: false,
|
||||
breadcrumbItems: [],
|
||||
});
|
||||
}
|
||||
|
||||
getData(consumerId: string, business_id: string) {
|
||||
breadcrumbItems = computed(() => this._state().breadcrumbItems);
|
||||
|
||||
private setBreadcrumb(consumerId: string, businessId: string) {
|
||||
this.patchState({
|
||||
breadcrumbItems: [
|
||||
{
|
||||
...superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta,
|
||||
routerLink:
|
||||
superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta.pagePath!(
|
||||
consumerId,
|
||||
),
|
||||
},
|
||||
{
|
||||
title: this.entity()?.name,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta
|
||||
.pagePath!(consumerId, businessId),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
getData(consumerId: string, businessId: string) {
|
||||
this.patchState({ loading: true });
|
||||
this.service
|
||||
.getSingle(consumerId, business_id)
|
||||
.getSingle(consumerId, businessId)
|
||||
.pipe(
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
this.patchState({ entity });
|
||||
this.setBreadcrumb(consumerId, businessId);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,6 +76,7 @@ export class BusinessActivityStore extends EntityStore<
|
||||
entity: null,
|
||||
initialized: false,
|
||||
isRefreshing: false,
|
||||
breadcrumbItems: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { superAdminConsumerComplexesNamedRoutes } from '../constants/routes/complexes';
|
||||
import { IComplexResponse } from '../models';
|
||||
import { AdminComplexesService } from '../services/complexes.service';
|
||||
|
||||
interface ComplexState extends EntityState<IComplexResponse> {}
|
||||
interface ComplexState extends EntityState<IComplexResponse> {
|
||||
breadcrumbItems: MenuItem[];
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -18,6 +22,31 @@ export class ComplexStore extends EntityStore<IComplexResponse, ComplexState> {
|
||||
entity: null,
|
||||
initialized: false,
|
||||
isRefreshing: false,
|
||||
breadcrumbItems: [],
|
||||
});
|
||||
}
|
||||
|
||||
breadcrumbItems = computed(() => this._state().breadcrumbItems);
|
||||
|
||||
private setBreadcrumb(consumerId: string, businessId: string, complexId: string) {
|
||||
this.patchState({
|
||||
breadcrumbItems: [
|
||||
{
|
||||
...superAdminConsumerComplexesNamedRoutes.complexes.meta,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complexes.meta.pagePath!(
|
||||
consumerId,
|
||||
businessId,
|
||||
),
|
||||
},
|
||||
{
|
||||
title: this.entity()?.name,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complex.meta.pagePath!(
|
||||
consumerId,
|
||||
businessId,
|
||||
complexId,
|
||||
),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,15 +58,14 @@ export class ComplexStore extends EntityStore<IComplexResponse, ComplexState> {
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
this.patchState({ entity });
|
||||
this.setBreadcrumb(consumerId, businessId, complexId);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,6 +76,7 @@ export class ComplexStore extends EntityStore<IComplexResponse, ComplexState> {
|
||||
entity: null,
|
||||
initialized: false,
|
||||
isRefreshing: false,
|
||||
breadcrumbItems: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { superAdminConsumersNamedRoutes } from '../constants';
|
||||
import { IConsumerResponse } from '../models';
|
||||
import { ConsumersService } from '../services/main.service';
|
||||
|
||||
interface ConsumerState extends EntityState<IConsumerResponse> {}
|
||||
interface ConsumerState extends EntityState<IConsumerResponse> {
|
||||
breadcrumbItems: MenuItem[];
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -18,26 +22,43 @@ export class ConsumerStore extends EntityStore<IConsumerResponse, ConsumerState>
|
||||
entity: null,
|
||||
initialized: false,
|
||||
isRefreshing: false,
|
||||
breadcrumbItems: [],
|
||||
});
|
||||
}
|
||||
|
||||
getData(partnerId: string) {
|
||||
breadcrumbItems = computed(() => this._state().breadcrumbItems);
|
||||
|
||||
private setBreadcrumb(consumerId: string) {
|
||||
this.patchState({
|
||||
breadcrumbItems: [
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(consumerId),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
getData(consumerId: string) {
|
||||
this.patchState({ loading: true });
|
||||
this.service
|
||||
.getSingle(partnerId)
|
||||
.getSingle(consumerId)
|
||||
.pipe(
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
this.patchState({ entity });
|
||||
this.setBreadcrumb(consumerId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { superAdminConsumerPosesNamedRoutes } from '../constants/routes/poses';
|
||||
import { IPosResponse } from '../models';
|
||||
import { AdminPosesService } from '../services/poses.service';
|
||||
|
||||
interface PosState extends EntityState<IPosResponse> {}
|
||||
interface PosState extends EntityState<IPosResponse> {
|
||||
breadcrumbItems: MenuItem[];
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -18,10 +22,38 @@ export class PosStore extends EntityStore<IPosResponse, PosState> {
|
||||
entity: null,
|
||||
initialized: false,
|
||||
isRefreshing: false,
|
||||
breadcrumbItems: [],
|
||||
});
|
||||
}
|
||||
|
||||
getData(businessId: string, complexId: string, posId: string) {
|
||||
breadcrumbItems = computed(() => this._state().breadcrumbItems);
|
||||
|
||||
private setBreadcrumb(consumerId: string, businessId: string, complexId: string, posId: string) {
|
||||
this.patchState({
|
||||
breadcrumbItems: [
|
||||
{
|
||||
title: superAdminConsumerPosesNamedRoutes.poses.meta.title,
|
||||
routerLink: superAdminConsumerPosesNamedRoutes.poses.meta.pagePath!(
|
||||
consumerId,
|
||||
businessId,
|
||||
complexId,
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: this.entity()?.name,
|
||||
routerLink: superAdminConsumerPosesNamedRoutes.pos.meta.pagePath!(
|
||||
consumerId,
|
||||
businessId,
|
||||
complexId,
|
||||
posId,
|
||||
),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
getData(consumerId: string, businessId: string, complexId: string, posId: string) {
|
||||
this.patchState({ loading: true });
|
||||
this.service
|
||||
.getSingle(businessId, complexId, posId)
|
||||
@@ -29,15 +61,14 @@ export class PosStore extends EntityStore<IPosResponse, PosState> {
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
this.patchState({ entity });
|
||||
this.setBreadcrumb(consumerId, businessId, complexId, posId);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,6 +79,7 @@ export class PosStore extends EntityStore<IPosResponse, PosState> {
|
||||
entity: null,
|
||||
initialized: false,
|
||||
isRefreshing: false,
|
||||
breadcrumbItems: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { BreadcrumbService } from '@/core/services';
|
||||
import { Component, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerAccountListComponent } from '../../components/accounts/list.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||
import { superAdminConsumerAccountsNamedRoutes } from '../../constants/routes/accounts';
|
||||
import { ConsumerStore } from '../../store/consumer.store';
|
||||
|
||||
@@ -25,14 +24,7 @@ export class ConsumerAccountsComponent {
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.store.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
...this.store.breadcrumbItems(),
|
||||
{
|
||||
title: superAdminConsumerAccountsNamedRoutes.accounts.meta.title,
|
||||
},
|
||||
|
||||
+1
-9
@@ -4,7 +4,6 @@ import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerBusinessActivitiesComponent } from '../../components/businessActivities/list.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||
import { ConsumerStore } from '../../store/consumer.store';
|
||||
|
||||
@@ -27,14 +26,7 @@ export class SuperAdminUserBusinessActivitiesComponent {
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.consumerStore.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
...this.consumerStore.breadcrumbItems(),
|
||||
{
|
||||
title: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta.title,
|
||||
},
|
||||
|
||||
+2
-22
@@ -6,8 +6,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { ConsumerBusinessActivitiesFormComponent } from '../../components/businessActivities/form.component';
|
||||
import { ConsumerComplexesComponent } from '../../components/complexes/list.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
import { ConsumerStore } from '../../store/consumer.store';
|
||||
|
||||
@@ -50,26 +48,8 @@ export class SuperAdminUserBusinessActivityComponent {
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.consumerStore.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
...superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||
.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: this.businessActivity()?.name,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
...this.consumerStore.breadcrumbItems(),
|
||||
...this.store.breadcrumbItems(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerComplexesComponent } from '../../components/complexes/list.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||
import { superAdminConsumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
import { ConsumerStore } from '../../store/consumer.store';
|
||||
@@ -31,26 +29,8 @@ export class SuperAdminUserComplexesComponent {
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.consumerStore.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta.title,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||
.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: this.businessStore.entity()?.name,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
...this.consumerStore.breadcrumbItems(),
|
||||
...this.businessStore.breadcrumbItems(),
|
||||
{
|
||||
title: superAdminConsumerComplexesNamedRoutes.complexes.meta.title,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complexes.meta.pagePath!(
|
||||
|
||||
@@ -5,9 +5,6 @@ import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerComplexFormComponent } from '../../components/complexes/form.component';
|
||||
import { ConsumerPosesComponent } from '../../components/poses/list.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||
import { superAdminConsumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
import { ComplexStore } from '../../store/complex.store';
|
||||
import { ConsumerStore } from '../../store/consumer.store';
|
||||
@@ -54,41 +51,9 @@ export class SuperAdminUserComplexComponent {
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.consumerStore.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
...superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||
.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: this.businessStore.entity()?.name,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
{
|
||||
...superAdminConsumerComplexesNamedRoutes.complexes.meta,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complexes.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
{
|
||||
title: this.complex()?.name,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complex.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
this.complexId(),
|
||||
),
|
||||
},
|
||||
...this.consumerStore.breadcrumbItems(),
|
||||
...this.businessStore.breadcrumbItems(),
|
||||
...this.store.breadcrumbItems(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@ import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerPosesComponent } from '../../components/poses/list.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||
import { superAdminConsumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||
import { superAdminConsumerPosesNamedRoutes } from '../../constants/routes/poses';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
import { ComplexStore } from '../../store/complex.store';
|
||||
@@ -35,43 +32,9 @@ export class SuperAdminUserPosesComponent {
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.consumerStore.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta.title,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||
.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: this.businessStore.entity()?.name,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: superAdminConsumerComplexesNamedRoutes.complexes.meta.title,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complexes.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
{
|
||||
title: this.complexStore.entity()?.name,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complex.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
this.complexId(),
|
||||
),
|
||||
},
|
||||
|
||||
...this.consumerStore.breadcrumbItems(),
|
||||
...this.businessStore.breadcrumbItems(),
|
||||
...this.complexStore.breadcrumbItems(),
|
||||
{
|
||||
title: superAdminConsumerPosesNamedRoutes.poses.meta.title,
|
||||
routerLink: superAdminConsumerPosesNamedRoutes.poses.meta.pagePath!(
|
||||
|
||||
@@ -4,10 +4,6 @@ import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ConsumerPosFormComponent } from '../../components/poses/form.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||
import { superAdminConsumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||
import { superAdminConsumerPosesNamedRoutes } from '../../constants/routes/poses';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
import { ComplexStore } from '../../store/complex.store';
|
||||
import { ConsumerStore } from '../../store/consumer.store';
|
||||
@@ -46,72 +42,15 @@ export class SuperAdminUserPosComponent {
|
||||
readonly pos = computed(() => this.store.entity());
|
||||
|
||||
getData() {
|
||||
this.store.getData(this.businessId(), this.complexId(), this.posId());
|
||||
}
|
||||
|
||||
toPosLanding() {
|
||||
// @ts-ignore
|
||||
window.cookieStore.set('posId', this.posId());
|
||||
// window.open('pos')
|
||||
this.store.getData(this.consumerId(), this.businessId(), this.complexId(), this.posId());
|
||||
}
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.consumerStore.entity()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta.title,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||
.pagePath!(this.consumerId()),
|
||||
},
|
||||
{
|
||||
title: this.businessStore.entity()?.name,
|
||||
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: superAdminConsumerComplexesNamedRoutes.complexes.meta.title,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complexes.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
),
|
||||
},
|
||||
{
|
||||
title: this.complexStore.entity()?.name,
|
||||
routerLink: superAdminConsumerComplexesNamedRoutes.complex.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
this.complexId(),
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: superAdminConsumerPosesNamedRoutes.poses.meta.title,
|
||||
routerLink: superAdminConsumerPosesNamedRoutes.poses.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
this.complexId(),
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: this.pos()?.name,
|
||||
routerLink: superAdminConsumerPosesNamedRoutes.pos.meta.pagePath!(
|
||||
this.consumerId(),
|
||||
this.businessId(),
|
||||
this.complexId(),
|
||||
this.posId(),
|
||||
),
|
||||
},
|
||||
...this.consumerStore.breadcrumbItems(),
|
||||
...this.businessStore.breadcrumbItems(),
|
||||
...this.complexStore.breadcrumbItems(),
|
||||
...this.store.breadcrumbItems(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import { ConsumerAccountListComponent } from '../components/accounts/list.compon
|
||||
import { ConsumerBusinessActivitiesComponent } from '../components/businessActivities/list.component';
|
||||
import { ConsumerUserFormComponent } from '../components/form.component';
|
||||
import { ConsumerLicenseFormComponent } from '../components/licenses/form.component';
|
||||
import { superAdminConsumersNamedRoutes } from '../constants';
|
||||
import { ConsumerStore } from '../store/consumer.store';
|
||||
|
||||
@Component({
|
||||
@@ -62,16 +61,7 @@ export class ConsumerComponent {
|
||||
}
|
||||
|
||||
setBreadcrumb() {
|
||||
this.breadcrumbService.setItems([
|
||||
{
|
||||
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||
},
|
||||
{
|
||||
title: this.consumer()?.fullname,
|
||||
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||
},
|
||||
]);
|
||||
this.breadcrumbService.setItems(this.store.breadcrumbItems());
|
||||
}
|
||||
|
||||
openLicenseForm() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { IGuildResponse } from '../models';
|
||||
import { GuildsService } from '../services/main.service';
|
||||
|
||||
@@ -29,11 +29,9 @@ export class GuildStore extends EntityStore<IGuildResponse, GuildState> {
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
</div>
|
||||
</app-card-data>
|
||||
|
||||
<admin-guild-good-categories-list [guildId]="guildId()" />
|
||||
<admin-guild-goods-list [guildId]="guildId()" />
|
||||
<div class="max-h-[500px] flex">
|
||||
<admin-guild-good-categories-list [guildId]="guildId()" class="w-full" />
|
||||
</div>
|
||||
<div class="max-h-[500px] flex">
|
||||
<admin-guild-goods-list [guildId]="guildId()" class="w-full" />
|
||||
</div>
|
||||
|
||||
<admin-guild-form
|
||||
[(visible)]="editMode"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { IPartnerResponse } from '../models';
|
||||
import { PartnersService } from '../services/main.service';
|
||||
|
||||
@@ -29,11 +29,9 @@ export class PartnerStore extends EntityStore<IPartnerResponse, PartnerState> {
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { IUserResponse } from '../models';
|
||||
import { UsersService } from '../services/main.service';
|
||||
|
||||
@@ -29,11 +29,9 @@ export class UserStore extends EntityStore<IUserResponse, UserState> {
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
|
||||
Reference in New Issue
Block a user