update for build
This commit is contained in:
@@ -116,6 +116,10 @@
|
||||
}
|
||||
],
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/config.ts",
|
||||
"with": "src/tenants/tis/config.ts"
|
||||
},
|
||||
{
|
||||
"replace": "src/assets/images/brandingAssets.ts",
|
||||
"with": "src/tenants/tis/brandingAssets.ts"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
|
||||
"appData": {
|
||||
"appVersion": "0.0.0",
|
||||
"buildDate": "2026-05-11T09:56:45.724Z"
|
||||
"buildDate": "2026-05-11T10:08:38.776Z"
|
||||
},
|
||||
"assetGroups": [
|
||||
{
|
||||
|
||||
@@ -10,11 +10,20 @@ const ngswConfig = JSON.parse(fs.readFileSync(ngswConfigPath, 'utf8'));
|
||||
|
||||
const now = new Date();
|
||||
const buildDate = process.env.TIS_BUILD_DATE || now.toISOString();
|
||||
const appVersion = process.env.TIS_APP_VERSION || packageJson.version || '0.0.0';
|
||||
const previousAppVersion = ngswConfig.appData?.appVersion || packageJson.version || '0.0.0';
|
||||
const appVersion =
|
||||
process.env.TIS_APP_VERSION ||
|
||||
previousAppVersion.replace(
|
||||
/^(\d+)\.(\d+)\.(\d+)$/,
|
||||
(_, major, minor, patch) => `${major}.${minor}.${Number(patch) + 1}`,
|
||||
);
|
||||
const previousBuildNumber = Number(ngswConfig.appData?.buildNumber || 0);
|
||||
const buildNumber = Number(process.env.TIS_BUILD_NUMBER || previousBuildNumber + 1);
|
||||
|
||||
ngswConfig.appData = {
|
||||
...(ngswConfig.appData || {}),
|
||||
appVersion,
|
||||
buildNumber,
|
||||
buildDate,
|
||||
};
|
||||
|
||||
|
||||
@@ -10,11 +10,20 @@ const ngswConfig = JSON.parse(fs.readFileSync(ngswConfigPath, 'utf8'));
|
||||
|
||||
const now = new Date();
|
||||
const buildDate = process.env.BUILD_DATE || now.toISOString();
|
||||
const appVersion = process.env.APP_VERSION || packageJson.version || '0.0.0';
|
||||
const previousAppVersion = ngswConfig.appData?.appVersion || packageJson.version || '0.0.0';
|
||||
const appVersion =
|
||||
process.env.APP_VERSION ||
|
||||
previousAppVersion.replace(
|
||||
/^(\d+)\.(\d+)\.(\d+)$/,
|
||||
(_, major, minor, patch) => `${major}.${minor}.${Number(patch) + 1}`,
|
||||
);
|
||||
const previousBuildNumber = Number(ngswConfig.appData?.buildNumber || 0);
|
||||
const buildNumber = Number(process.env.BUILD_NUMBER || previousBuildNumber + 1);
|
||||
|
||||
ngswConfig.appData = {
|
||||
...(ngswConfig.appData || {}),
|
||||
appVersion,
|
||||
buildNumber,
|
||||
buildDate,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { NamedRoutes } from '@/core';
|
||||
import { Routes } from '@angular/router';
|
||||
import config from 'src/config';
|
||||
|
||||
export type TPosAboutRouteNames = 'about';
|
||||
const baseRoute = `${config.isPosApplication ? '' : '/pos'}/about`;
|
||||
|
||||
export const posAboutNamedRoutes: NamedRoutes<TPosAboutRouteNames> = {
|
||||
about: {
|
||||
@@ -9,7 +11,7 @@ export const posAboutNamedRoutes: NamedRoutes<TPosAboutRouteNames> = {
|
||||
loadComponent: () => import('../../views/root.component').then((m) => m.PosAboutPageComponent),
|
||||
meta: {
|
||||
title: 'درباره سیستم',
|
||||
pagePath: () => '/pos/about',
|
||||
pagePath: () => baseRoute,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,23 +1,28 @@
|
||||
import { NamedRoutes } from '@/core';
|
||||
import { Routes } from '@angular/router';
|
||||
import config from 'src/config';
|
||||
|
||||
export type TPosSaleInvoicesRouteNames = 'saleInvoices' | 'saleInvoice';
|
||||
|
||||
const baseRoute = `${config.isPosApplication ? '' : '/pos'}/sale_invoices`;
|
||||
|
||||
export const posSaleInvoicesNamedRoutes: NamedRoutes<TPosSaleInvoicesRouteNames> = {
|
||||
saleInvoices: {
|
||||
path: 'sale_invoices',
|
||||
loadComponent: () => import('../../views/list.component').then((m) => m.PosSaleInvoicesComponent),
|
||||
loadComponent: () =>
|
||||
import('../../views/list.component').then((m) => m.PosSaleInvoicesComponent),
|
||||
meta: {
|
||||
title: 'فاکتورها',
|
||||
pagePath: () => `/pos/sale_invoices`,
|
||||
pagePath: () => baseRoute,
|
||||
},
|
||||
},
|
||||
saleInvoice: {
|
||||
path: 'sale_invoices/:invoiceId',
|
||||
loadComponent: () => import('../../views/single.component').then((m) => m.PosSaleInvoiceComponent),
|
||||
loadComponent: () =>
|
||||
import('../../views/single.component').then((m) => m.PosSaleInvoiceComponent),
|
||||
meta: {
|
||||
title: 'جزئیات فاکتور',
|
||||
pagePath: (invoiceId: string) => `/pos/sale_invoices/${invoiceId}`,
|
||||
pagePath: (invoiceId: string) => `${baseRoute}/${invoiceId}`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { NamedRoutes } from '@/core';
|
||||
import { Routes } from '@angular/router';
|
||||
import config from 'src/config';
|
||||
|
||||
export type TPosSupportRouteNames = 'support';
|
||||
const baseRoute = `${config.isPosApplication ? '' : '/pos'}/support`;
|
||||
|
||||
export const posSupportNamedRoutes: NamedRoutes<TPosSupportRouteNames> = {
|
||||
support: {
|
||||
@@ -10,7 +12,7 @@ export const posSupportNamedRoutes: NamedRoutes<TPosSupportRouteNames> = {
|
||||
import('../../views/root.component').then((m) => m.PosSupportPageComponent),
|
||||
meta: {
|
||||
title: 'پشتیبانی',
|
||||
pagePath: () => '/pos/support',
|
||||
pagePath: () => baseRoute,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { Component, computed, ContentChild, inject, Renderer2, TemplateRef } from '@angular/core';
|
||||
import { NavigationEnd, Router, RouterModule } from '@angular/router';
|
||||
import { filter, Subscription } from 'rxjs';
|
||||
import config from 'src/config';
|
||||
import { LayoutService } from '../service/layout.service';
|
||||
import { AppFooter } from './app.footer.component';
|
||||
import { AppSidebar } from './app.sidebar.component';
|
||||
@@ -137,29 +138,33 @@ export class AppLayout {
|
||||
this.layoutService.topbarCenterSlot$.subscribe((tpl) => (this.topBarCenterAction = tpl));
|
||||
this.layoutService.topbarEndSlot$.subscribe((tpl) => (this.topBarEndAction = tpl));
|
||||
|
||||
// if (window.location.pathname === '/') {
|
||||
// if (!this.authService.currentAccount()) {
|
||||
// this.router.navigateByUrl('auth');
|
||||
// }
|
||||
// switch (this.authService.currentAccount()?.type) {
|
||||
// case 'ADMIN':
|
||||
// this.router.navigateByUrl('super_admin');
|
||||
// break;
|
||||
// case 'CONSUMER':
|
||||
// if (this.authService.currentAccount()?.role === 'OWNER')
|
||||
// this.router.navigateByUrl('consumer');
|
||||
// // else {
|
||||
// // this.router.navigateByUrl('pos');
|
||||
// // }
|
||||
// break;
|
||||
// case 'PARTNER':
|
||||
// this.router.navigateByUrl('partner');
|
||||
// break;
|
||||
// case 'PROVIDER':
|
||||
// this.router.navigateByUrl('provider');
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
if (window.location.pathname === '/') {
|
||||
if (!this.authService.currentAccount()) {
|
||||
this.router.navigateByUrl('auth');
|
||||
}
|
||||
|
||||
let redirectUrl = '';
|
||||
|
||||
switch (this.authService.currentAccount()?.type) {
|
||||
case 'ADMIN':
|
||||
redirectUrl = '/super_admin';
|
||||
break;
|
||||
case 'PROVIDER':
|
||||
redirectUrl = '/provider';
|
||||
break;
|
||||
case 'PARTNER':
|
||||
redirectUrl = '/partner';
|
||||
break;
|
||||
case 'CONSUMER':
|
||||
if (this.authService.currentAccount()?.role === 'OWNER') {
|
||||
redirectUrl = '/consumer';
|
||||
} else {
|
||||
redirectUrl = config.isPosApplication ? '/' : '/pos';
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.router.navigateByUrl(redirectUrl);
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ToastService } from '@/core/services/toast.service';
|
||||
import { Component, EventEmitter, inject, Input, Output, signal } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import images from 'src/assets/images';
|
||||
import config from 'src/config';
|
||||
import { LoginComponent } from './login/login.component';
|
||||
|
||||
type TSteps = 'login' | 'otp' | 'modifyLoginInfo' | 'signup';
|
||||
@@ -74,7 +75,7 @@ export class AuthComponent {
|
||||
break;
|
||||
case 'CONSUMER':
|
||||
if (this.accountRole() === 'OPERATOR') {
|
||||
redirectUrl = '/pos';
|
||||
redirectUrl = config.isPosApplication ? '/' : '/pos';
|
||||
} else {
|
||||
redirectUrl = '/consumer';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<form [formGroup]="loginForm" class="w-full flex flex-col gap-4" (ngSubmit)="submit()">
|
||||
<form [formGroup]="loginForm" (submit)="submit()">
|
||||
<uikit-field name="username" pSize="large" [control]="loginForm.controls.username" label="نام کاربری">
|
||||
<input
|
||||
pInputText
|
||||
@@ -36,59 +36,8 @@
|
||||
/>
|
||||
</uikit-field>
|
||||
|
||||
<!-- <div class="flex items-center justify-between mt-2 mb-8 gap-8">
|
||||
<div class="flex items-center">
|
||||
<p-checkbox formControlName="rememberMe" id="rememberMe" binary class="me-2"></p-checkbox>
|
||||
<uikit-label name="rememberMe" pSize="small">مرا به خاطر بسپار</uikit-label>
|
||||
</div>
|
||||
<span class="text-sm font-medium no-underline ms-2 text-right cursor-pointer text-primary">
|
||||
رمز را فراموش کردید؟
|
||||
</span>
|
||||
</div> -->
|
||||
<div class="mb-6 flex flex-col items-center gap-4 w-[16rem] mx-auto">
|
||||
<!-- <div
|
||||
class="relative bg-surface-ground rounded-xl overflow-hidden shadow shrink-0 border border-(--p-inputtext-border-color) w-full aspect-[2]"
|
||||
>
|
||||
<img p-image id="captchaImage" [src]="captchaImageSrc()" class="w-full object-contain" />
|
||||
@if (isCaptchaLoading()) {
|
||||
<div class="absolute! inset-0 bg-surface-hover/50 flex items-center justify-center">
|
||||
<p-progress-spinner
|
||||
strokeWidth="4"
|
||||
fill="transparent"
|
||||
animationDuration="1s"
|
||||
[style]="{ width: '48px', height: '48px' }"
|
||||
/>
|
||||
</div>
|
||||
} @else if (isCaptchaExpired()) {
|
||||
<div
|
||||
class="absolute! inset-0 bg-surface-hover/70 flex items-center justify-center text-center p-2 text-sm font-medium cursor-pointer"
|
||||
(click)="onRefreshCaptcha()"
|
||||
>
|
||||
<i class="pi pi-refresh text-3xl! text-gray-500"></i>
|
||||
</div>
|
||||
}
|
||||
</div> -->
|
||||
<!-- <p-inputgroup>
|
||||
<input
|
||||
pInputText
|
||||
id="captcha"
|
||||
type="text"
|
||||
placeholder="کد کپچا را وارد کنید"
|
||||
class="w-full"
|
||||
formControlName="captcha"
|
||||
/>
|
||||
|
||||
<p-inputgroup-addon>
|
||||
<p-button icon="pi pi-refresh" severity="secondary" variant="text" (click)="onRefreshCaptchaImage()" />
|
||||
</p-inputgroup-addon>
|
||||
</p-inputgroup> -->
|
||||
</div>
|
||||
<div class="mb-6 flex flex-col items-center gap-4 w-[16rem] mx-auto"></div>
|
||||
<div class="grid grid-cols-1 gap-3">
|
||||
<!-- @if (loginForm.controls.role.value === "TEACHER") {
|
||||
<span class="w-full text-center text-sm select-none">
|
||||
برای ثبت نام در سامانه <a class="text-primary cursor-pointer" (click)="toSignup()">اینجا</a> کلیک کنید.
|
||||
</span>
|
||||
} -->
|
||||
<p-button label="ورود" styleClass="w-full" size="large" [loading]="isLoading()" type="submit"></p-button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
isPosApplication: false,
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
isPosApplication: true,
|
||||
};
|
||||
Reference in New Issue
Block a user