Compare commits
3 Commits
main
...
angular_up
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63d143bbb7 | ||
|
|
02842c7a96 | ||
|
|
6ce776f218 |
15
.browserslistrc
Normal file
15
.browserslistrc
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||||
|
# For additional information regarding the format and rule options, please see:
|
||||||
|
# https://github.com/browserslist/browserslist#queries
|
||||||
|
|
||||||
|
# For the full list of supported browsers by the Angular framework, please see:
|
||||||
|
# https://angular.io/guide/browser-support
|
||||||
|
|
||||||
|
# You can see what browsers were selected by your queries by running:
|
||||||
|
# npx browserslist
|
||||||
|
|
||||||
|
last 1 Chrome version
|
||||||
|
last 1 Firefox version
|
||||||
|
last 2 Edge major versions
|
||||||
|
last 2 iOS major versions
|
||||||
|
Firefox ESR
|
||||||
16
.editorconfig
Normal file
16
.editorconfig
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Editor configuration, see https://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.ts]
|
||||||
|
quote_type = single
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
max_line_length = off
|
||||||
|
trim_trailing_whitespace = false
|
||||||
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# compiled output
|
||||||
|
/dist
|
||||||
|
/tmp
|
||||||
|
/out-tsc
|
||||||
|
# Only exists if Bazel was run
|
||||||
|
/bazel-out
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
|
||||||
|
# profiling files
|
||||||
|
chrome-profiler-events*.json
|
||||||
|
|
||||||
|
# IDEs and editors
|
||||||
|
/.idea
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
.c9/
|
||||||
|
*.launch
|
||||||
|
.settings/
|
||||||
|
*.sublime-workspace
|
||||||
|
|
||||||
|
# IDE - VSCode
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.history/*
|
||||||
|
|
||||||
|
# misc
|
||||||
|
/.angular/cache
|
||||||
|
/.sass-cache
|
||||||
|
/connect.lock
|
||||||
|
/coverage
|
||||||
|
/libpeerconnection.log
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
testem.log
|
||||||
|
/typings
|
||||||
|
|
||||||
|
# System Files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
3
.vs/ProjectSettings.json
Normal file
3
.vs/ProjectSettings.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"CurrentProjectSetting": null
|
||||||
|
}
|
||||||
8
.vs/VSWorkspaceState.json
Normal file
8
.vs/VSWorkspaceState.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"ExpandedNodes": [
|
||||||
|
"",
|
||||||
|
"\\src",
|
||||||
|
"\\src\\environments"
|
||||||
|
],
|
||||||
|
"PreviewInSolutionExplorer": false
|
||||||
|
}
|
||||||
Binary file not shown.
0
.vs/extranet_ui_ng/FileContentIndex/read.lock
Normal file
0
.vs/extranet_ui_ng/FileContentIndex/read.lock
Normal file
BIN
.vs/extranet_ui_ng/v17/.suo
Normal file
BIN
.vs/extranet_ui_ng/v17/.suo
Normal file
Binary file not shown.
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM node:20.11.1 as builder
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
RUN npm install && npm run build-dev
|
||||||
|
|
||||||
|
FROM nginx:1.14.2-alpine
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=builder /usr/src/app/dist/ExtraNet /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
265
angular.json
Normal file
265
angular.json
Normal file
@@ -0,0 +1,265 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"cli": {
|
||||||
|
"analytics": "f4854f29-3f5d-460e-b705-561313912e45"
|
||||||
|
},
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"ExtraNet": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"projectType": "application",
|
||||||
|
"prefix": "app",
|
||||||
|
"schematics": {},
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"progress": false,
|
||||||
|
"outputPath": "dist/ExtraNet",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "tsconfig.app.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": ["src/favicon.ico", "src/assets"],
|
||||||
|
"styles": [
|
||||||
|
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
|
||||||
|
"./node_modules/primeng/resources/themes/saga-blue/theme.css",
|
||||||
|
"./node_modules/primeicons/primeicons.css",
|
||||||
|
"./node_modules/primeng/resources/primeng.min.css",
|
||||||
|
"./node_modules/quill/dist/quill.core.css",
|
||||||
|
"./node_modules/quill/dist/quill.snow.css",
|
||||||
|
"./src/scss/default.scss",
|
||||||
|
"./src/styles.scss"
|
||||||
|
],
|
||||||
|
"vendorChunk": true,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"buildOptimizer": false,
|
||||||
|
"sourceMap": true,
|
||||||
|
"optimization": false,
|
||||||
|
"namedChunks": true
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"dev": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.dev.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"deployUrl": "",
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "512kb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "1mb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"uat": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.uat.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"deployUrl": "",
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "512kb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "1mb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"preprod": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.preprod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"deployUrl": "",
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "512kb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "1mb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"prod": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"deployUrl": "",
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "512kb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "1mb",
|
||||||
|
"maximumError": "3mb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": ""
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"port": 52725,
|
||||||
|
"buildTarget": "ExtraNet:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "ExtraNet:build:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"buildTarget": "ExtraNet:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "src/test.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "tsconfig.spec.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"karmaConfig": "karma.conf.js",
|
||||||
|
"styles": [
|
||||||
|
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
|
||||||
|
"src/styles.scss",
|
||||||
|
"src/scss/default.scss",
|
||||||
|
"node_modules/quill/dist/quill.core.css",
|
||||||
|
"node_modules/quill/dist/quill.snow.css"
|
||||||
|
],
|
||||||
|
"scripts": [
|
||||||
|
"node_modules/quill/dist/quill.min.js"
|
||||||
|
],
|
||||||
|
"assets": [
|
||||||
|
"src/assets"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"tsconfig.app.json",
|
||||||
|
"tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"builder": "@angular-devkit/build-angular:server",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist-server",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"tsConfig": "src/tsconfig.server.json",
|
||||||
|
"sourceMap": true,
|
||||||
|
"optimization": false
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"dev": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true
|
||||||
|
},
|
||||||
|
"production": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ExtraNet-e2e": {
|
||||||
|
"root": "e2e/",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "e2e/protractor.conf.js",
|
||||||
|
"devServerTarget": "ExtraNet:serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": "e2e/tsconfig.e2e.json",
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
114
azure-pipelines-dev.yaml
Normal file
114
azure-pipelines-dev.yaml
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
# Deploy to Azure Kubernetes Service
|
||||||
|
# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service
|
||||||
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
batch: true
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- repo: self
|
||||||
|
|
||||||
|
variables:
|
||||||
|
|
||||||
|
# Container registry service connection established during pipeline creation
|
||||||
|
dockerRegistryServiceConnection: 'aosdevacr'
|
||||||
|
imageRepository: 'extranetui'
|
||||||
|
containerRegistry: 'aosdevacr.azurecr.io'
|
||||||
|
dockerfilePath: './Dockerfile'
|
||||||
|
tag: 'dev-$(Build.BuildId)'
|
||||||
|
imagePullSecret: 'acr-pull'
|
||||||
|
|
||||||
|
# Agent VM image name
|
||||||
|
vmImageName: 'ubuntu-latest'
|
||||||
|
|
||||||
|
# SonarQube service connection
|
||||||
|
sonarQubeServiceConnection: 'SonarQube-Server'
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Build
|
||||||
|
displayName: Build stage
|
||||||
|
jobs:
|
||||||
|
- job: Build
|
||||||
|
displayName: Build and Analyze
|
||||||
|
pool:
|
||||||
|
vmImage: $(vmImageName)
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- task: SonarQubePrepare@6
|
||||||
|
displayName: Prepare analysis on SonarQube
|
||||||
|
inputs:
|
||||||
|
SonarQube: 'SonarQube-Server'
|
||||||
|
scannerMode: 'CLI'
|
||||||
|
configMode: 'manual'
|
||||||
|
cliProjectKey: 'AOS_TravelApplication.ExtranetUI_AZGeG15Wr_tZQyWvXGx3'
|
||||||
|
cliProjectName: 'AOS-ExtranetUI'
|
||||||
|
cliSources: '.'
|
||||||
|
extraProperties: |
|
||||||
|
# Additional properties that will be passed to the scanner,
|
||||||
|
# Put one key=value per line, example:
|
||||||
|
# sonar.exclusions=**/*.bin
|
||||||
|
sonar.java.binaries=.
|
||||||
|
|
||||||
|
- task: SonarQubeAnalyze@6
|
||||||
|
displayName: Run SonarQube analysis
|
||||||
|
|
||||||
|
- task: SonarQubePublish@6
|
||||||
|
displayName: Publish quality gate result
|
||||||
|
inputs:
|
||||||
|
pollingTimeoutSec: '300'
|
||||||
|
|
||||||
|
- task: Docker@2
|
||||||
|
displayName: Build and push an image to container registry
|
||||||
|
inputs:
|
||||||
|
command: buildAndPush
|
||||||
|
repository: $(imageRepository)
|
||||||
|
dockerfile: $(dockerfilePath)
|
||||||
|
containerRegistry: $(dockerRegistryServiceConnection)
|
||||||
|
tags: |
|
||||||
|
$(tag)
|
||||||
|
|
||||||
|
- upload: kustomize/manifests
|
||||||
|
artifact: kustomize/manifests
|
||||||
|
|
||||||
|
#- stage: Deploy
|
||||||
|
# displayName: Deploy stage
|
||||||
|
# dependsOn: Build
|
||||||
|
#
|
||||||
|
# jobs:
|
||||||
|
# - deployment: Deploy
|
||||||
|
# displayName: Deploy
|
||||||
|
# pool:
|
||||||
|
# vmImage: $(vmImageName)
|
||||||
|
# #name: 'Az-agent-pool'
|
||||||
|
# environment: 'aos-dev-aks'
|
||||||
|
# strategy:
|
||||||
|
# runOnce:
|
||||||
|
# deploy:
|
||||||
|
# steps:
|
||||||
|
# - task: KubernetesManifest@0
|
||||||
|
# displayName: Create imagePullSecret
|
||||||
|
# inputs:
|
||||||
|
# connectionType: 'Kubernetes Service Connection'
|
||||||
|
# kubernetesServiceConnection: 'aos-dev-aks'
|
||||||
|
# namespace: 'dev'
|
||||||
|
# action: createSecret
|
||||||
|
# secretName: $(imagePullSecret)
|
||||||
|
# dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
|
||||||
|
#
|
||||||
|
# - task: KubernetesManifest@0
|
||||||
|
# displayName: Deploy to Kubernetes cluster
|
||||||
|
# inputs:
|
||||||
|
# connectionType: 'Kubernetes Service Connection'
|
||||||
|
# kubernetesServiceConnection: 'aos-dev-aks'
|
||||||
|
# namespace: 'dev'
|
||||||
|
# action: deploy
|
||||||
|
# manifests: |
|
||||||
|
# $(Pipeline.Workspace)/kustomize/manifests/dev.yaml
|
||||||
|
# imagePullSecrets: |
|
||||||
|
# $(imagePullSecret)
|
||||||
|
# containers: |
|
||||||
|
# $(containerRegistry)/$(imageRepository):$(tag)
|
||||||
|
#
|
||||||
89
azure-pipelines-preprod.yaml
Normal file
89
azure-pipelines-preprod.yaml
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Deploy to Azure Kubernetes Service
|
||||||
|
# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service
|
||||||
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
tags:
|
||||||
|
include:
|
||||||
|
- 'v-*'
|
||||||
|
branches:
|
||||||
|
exclude:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- repo: self
|
||||||
|
|
||||||
|
variables:
|
||||||
|
|
||||||
|
# Container registry service connection established during pipeline creation
|
||||||
|
dockerRegistryServiceConnection: 'aosprodacr'
|
||||||
|
imageRepository: 'extranetui'
|
||||||
|
containerRegistry: 'aosprodacr.azurecr.io'
|
||||||
|
dockerfilePath: './preprod.Dockerfile'
|
||||||
|
tag: 'preprod-$(Build.BuildId)'
|
||||||
|
imagePullSecret: 'acr-pull'
|
||||||
|
|
||||||
|
# Agent VM image name
|
||||||
|
vmImageName: 'ubuntu-latest'
|
||||||
|
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Build
|
||||||
|
displayName: Build stage
|
||||||
|
jobs:
|
||||||
|
- job: Build
|
||||||
|
displayName: Build
|
||||||
|
pool:
|
||||||
|
vmImage: $(vmImageName)
|
||||||
|
steps:
|
||||||
|
- task: Docker@2
|
||||||
|
displayName: Build and push an image to container registry
|
||||||
|
inputs:
|
||||||
|
command: buildAndPush
|
||||||
|
repository: $(imageRepository)
|
||||||
|
dockerfile: $(dockerfilePath)
|
||||||
|
containerRegistry: $(dockerRegistryServiceConnection)
|
||||||
|
tags: |
|
||||||
|
$(tag)
|
||||||
|
|
||||||
|
- upload: kustomize/manifests/preprod
|
||||||
|
artifact: kustomize/manifests/preprod
|
||||||
|
|
||||||
|
- stage: Deploy
|
||||||
|
displayName: Deploy stage
|
||||||
|
dependsOn: Build
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- deployment: Deploy
|
||||||
|
displayName: Deploy
|
||||||
|
pool:
|
||||||
|
vmImage: $(vmImageName)
|
||||||
|
environment: 'aos-preprod-aks'
|
||||||
|
strategy:
|
||||||
|
runOnce:
|
||||||
|
deploy:
|
||||||
|
steps:
|
||||||
|
- task: KubernetesManifest@0
|
||||||
|
displayName: Create imagePullSecret
|
||||||
|
inputs:
|
||||||
|
connectionType: 'Kubernetes Service Connection'
|
||||||
|
kubernetesServiceConnection: 'aos-preprod-aks'
|
||||||
|
namespace: 'preprod'
|
||||||
|
action: createSecret
|
||||||
|
secretName: $(imagePullSecret)
|
||||||
|
dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
|
||||||
|
|
||||||
|
- task: KubernetesManifest@0
|
||||||
|
displayName: Deploy to Kubernetes cluster
|
||||||
|
inputs:
|
||||||
|
connectionType: 'Kubernetes Service Connection'
|
||||||
|
kubernetesServiceConnection: 'aos-preprod-aks'
|
||||||
|
namespace: 'preprod'
|
||||||
|
action: deploy
|
||||||
|
manifests: |
|
||||||
|
$(Pipeline.Workspace)/kustomize/manifests/preprod/preprod.yaml
|
||||||
|
imagePullSecrets: |
|
||||||
|
$(imagePullSecret)
|
||||||
|
containers: |
|
||||||
|
$(containerRegistry)/$(imageRepository):$(tag)
|
||||||
|
|
||||||
89
azure-pipelines-prod.yaml
Normal file
89
azure-pipelines-prod.yaml
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Deploy to Azure Kubernetes Service
|
||||||
|
# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service
|
||||||
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
tags:
|
||||||
|
include:
|
||||||
|
- 'p-*'
|
||||||
|
branches:
|
||||||
|
exclude:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- repo: self
|
||||||
|
|
||||||
|
variables:
|
||||||
|
|
||||||
|
# Container registry service connection established during pipeline creation
|
||||||
|
dockerRegistryServiceConnection: 'aosprodacr'
|
||||||
|
imageRepository: 'extranetui'
|
||||||
|
containerRegistry: 'aosprodacr.azurecr.io'
|
||||||
|
dockerfilePath: './prod.Dockerfile'
|
||||||
|
tag: 'prod-$(Build.BuildId)'
|
||||||
|
imagePullSecret: 'acr-pull'
|
||||||
|
|
||||||
|
# Agent VM image name
|
||||||
|
vmImageName: 'ubuntu-latest'
|
||||||
|
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Build
|
||||||
|
displayName: Build stage
|
||||||
|
jobs:
|
||||||
|
- job: Build
|
||||||
|
displayName: Build
|
||||||
|
pool:
|
||||||
|
vmImage: $(vmImageName)
|
||||||
|
steps:
|
||||||
|
- task: Docker@2
|
||||||
|
displayName: Build and push an image to container registry
|
||||||
|
inputs:
|
||||||
|
command: buildAndPush
|
||||||
|
repository: $(imageRepository)
|
||||||
|
dockerfile: $(dockerfilePath)
|
||||||
|
containerRegistry: $(dockerRegistryServiceConnection)
|
||||||
|
tags: |
|
||||||
|
$(tag)
|
||||||
|
|
||||||
|
- upload: kustomize/manifests/prod
|
||||||
|
artifact: kustomize/manifests/prod
|
||||||
|
|
||||||
|
- stage: Deploy
|
||||||
|
displayName: Deploy stage
|
||||||
|
dependsOn: Build
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- deployment: Deploy
|
||||||
|
displayName: Deploy
|
||||||
|
pool:
|
||||||
|
vmImage: $(vmImageName)
|
||||||
|
environment: 'aos-prod-aks'
|
||||||
|
strategy:
|
||||||
|
runOnce:
|
||||||
|
deploy:
|
||||||
|
steps:
|
||||||
|
- task: KubernetesManifest@0
|
||||||
|
displayName: Create imagePullSecret
|
||||||
|
inputs:
|
||||||
|
connectionType: 'Kubernetes Service Connection'
|
||||||
|
kubernetesServiceConnection: 'aos-prod-aks'
|
||||||
|
namespace: 'prod'
|
||||||
|
action: createSecret
|
||||||
|
secretName: $(imagePullSecret)
|
||||||
|
dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
|
||||||
|
|
||||||
|
- task: KubernetesManifest@0
|
||||||
|
displayName: Deploy to Kubernetes cluster
|
||||||
|
inputs:
|
||||||
|
connectionType: 'Kubernetes Service Connection'
|
||||||
|
kubernetesServiceConnection: 'aos-prod-aks'
|
||||||
|
namespace: 'prod'
|
||||||
|
action: deploy
|
||||||
|
manifests: |
|
||||||
|
$(Pipeline.Workspace)/kustomize/manifests/prod/prod.yaml
|
||||||
|
imagePullSecrets: |
|
||||||
|
$(imagePullSecret)
|
||||||
|
containers: |
|
||||||
|
$(containerRegistry)/$(imageRepository):$(tag)
|
||||||
|
|
||||||
85
azure-pipelines-uat.yaml
Normal file
85
azure-pipelines-uat.yaml
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
# Deploy to Azure Kubernetes Service
|
||||||
|
# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service
|
||||||
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
|
||||||
|
|
||||||
|
trigger: none
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- repo: self
|
||||||
|
|
||||||
|
variables:
|
||||||
|
|
||||||
|
# Container registry service connection established during pipeline creation
|
||||||
|
dockerRegistryServiceConnection: 'aosdevacr'
|
||||||
|
imageRepository: 'extranetui'
|
||||||
|
containerRegistry: 'aosdevacr.azurecr.io'
|
||||||
|
dockerfilePath: './uat.Dockerfile'
|
||||||
|
tag: 'uat-$(Build.BuildId)'
|
||||||
|
imagePullSecret: 'acr-pull'
|
||||||
|
|
||||||
|
# Agent VM image name
|
||||||
|
vmImageName: 'ubuntu-latest'
|
||||||
|
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Build
|
||||||
|
displayName: Build stage
|
||||||
|
jobs:
|
||||||
|
- job: Build
|
||||||
|
displayName: Build
|
||||||
|
pool:
|
||||||
|
vmImage: $(vmImageName)
|
||||||
|
#name: 'Az-agent-pool'
|
||||||
|
steps:
|
||||||
|
- task: Docker@2
|
||||||
|
displayName: Build and push an image to container registry
|
||||||
|
inputs:
|
||||||
|
command: buildAndPush
|
||||||
|
repository: $(imageRepository)
|
||||||
|
dockerfile: $(dockerfilePath)
|
||||||
|
containerRegistry: $(dockerRegistryServiceConnection)
|
||||||
|
tags: |
|
||||||
|
$(tag)
|
||||||
|
|
||||||
|
- upload: kustomize/manifests/uat
|
||||||
|
artifact: kustomize/manifests/uat
|
||||||
|
|
||||||
|
- stage: Deploy
|
||||||
|
displayName: Deploy stage
|
||||||
|
dependsOn: Build
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- deployment: Deploy
|
||||||
|
displayName: Deploy
|
||||||
|
pool:
|
||||||
|
vmImage: $(vmImageName)
|
||||||
|
#name: 'Az-agent-pool'
|
||||||
|
environment: 'aos-uat-aks'
|
||||||
|
strategy:
|
||||||
|
runOnce:
|
||||||
|
deploy:
|
||||||
|
steps:
|
||||||
|
- task: KubernetesManifest@0
|
||||||
|
displayName: Create imagePullSecret
|
||||||
|
inputs:
|
||||||
|
connectionType: 'Kubernetes Service Connection'
|
||||||
|
kubernetesServiceConnection: 'aos-uat-aks'
|
||||||
|
namespace: 'uat'
|
||||||
|
action: createSecret
|
||||||
|
secretName: $(imagePullSecret)
|
||||||
|
dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
|
||||||
|
|
||||||
|
- task: KubernetesManifest@0
|
||||||
|
displayName: Deploy to Kubernetes cluster
|
||||||
|
inputs:
|
||||||
|
connectionType: 'Kubernetes Service Connection'
|
||||||
|
kubernetesServiceConnection: 'aos-uat-aks'
|
||||||
|
namespace: 'uat'
|
||||||
|
action: deploy
|
||||||
|
manifests: |
|
||||||
|
$(Pipeline.Workspace)/kustomize/manifests/uat/uat.yaml
|
||||||
|
imagePullSecrets: |
|
||||||
|
$(imagePullSecret)
|
||||||
|
containers: |
|
||||||
|
$(containerRegistry)/$(imageRepository):$(tag)
|
||||||
|
|
||||||
44
karma.conf.js
Normal file
44
karma.conf.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
// Karma configuration file, see link for more information
|
||||||
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||||
|
|
||||||
|
module.exports = function (config) {
|
||||||
|
config.set({
|
||||||
|
basePath: '',
|
||||||
|
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||||
|
plugins: [
|
||||||
|
require('karma-jasmine'),
|
||||||
|
require('karma-chrome-launcher'),
|
||||||
|
require('karma-jasmine-html-reporter'),
|
||||||
|
require('karma-coverage'),
|
||||||
|
require('@angular-devkit/build-angular/plugins/karma')
|
||||||
|
],
|
||||||
|
client: {
|
||||||
|
jasmine: {
|
||||||
|
// you can add configuration options for Jasmine here
|
||||||
|
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
||||||
|
// for example, you can disable the random execution with `random: false`
|
||||||
|
// or set a specific seed with `seed: 4321`
|
||||||
|
},
|
||||||
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
|
},
|
||||||
|
jasmineHtmlReporter: {
|
||||||
|
suppressAll: true // removes the duplicated traces
|
||||||
|
},
|
||||||
|
coverageReporter: {
|
||||||
|
dir: require('path').join(__dirname, './coverage/ExtraNet'),
|
||||||
|
subdir: '.',
|
||||||
|
reporters: [
|
||||||
|
{ type: 'html' },
|
||||||
|
{ type: 'text-summary' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
reporters: ['progress', 'kjhtml'],
|
||||||
|
port: 9876,
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
autoWatch: true,
|
||||||
|
browsers: ['Chrome'],
|
||||||
|
singleRun: false,
|
||||||
|
restartOnFileChange: true
|
||||||
|
});
|
||||||
|
};
|
||||||
53
kustomize/base/deployment.yaml
Normal file
53
kustomize/base/deployment.yaml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: extranetui
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: extranetui
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
linkerd.io/inject: enabled
|
||||||
|
labels:
|
||||||
|
app: extranetui
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: extranetui
|
||||||
|
image: aosdevacr.azurecr.io/extranetui
|
||||||
|
imagePullPolicy: Always
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: "768M"
|
||||||
|
cpu: "500m"
|
||||||
|
requests:
|
||||||
|
memory: "512M"
|
||||||
|
cpu: "300m"
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 80
|
||||||
|
volumeMounts:
|
||||||
|
- name: config-volume
|
||||||
|
mountPath: "/app/appsettings.json"
|
||||||
|
subPath: "appsettings.json"
|
||||||
|
volumes:
|
||||||
|
- name: config-volume
|
||||||
|
configMap:
|
||||||
|
name: app-config
|
||||||
|
restartPolicy: Always
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: acr-pull
|
||||||
12
kustomize/base/hpa.yaml
Normal file
12
kustomize/base/hpa.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: autoscaling/v1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: extranetui-hpa
|
||||||
|
spec:
|
||||||
|
maxReplicas: 10
|
||||||
|
minReplicas: 2
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: extranetui
|
||||||
|
targetCPUUtilizationPercentage: 50
|
||||||
10
kustomize/base/kustomization.yaml
Normal file
10
kustomize/base/kustomization.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
generatorOptions:
|
||||||
|
annotations:
|
||||||
|
generated: "true"
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
resources:
|
||||||
|
- service.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- hpa.yaml
|
||||||
15
kustomize/base/service.yaml
Normal file
15
kustomize/base/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: extranetui-service
|
||||||
|
labels:
|
||||||
|
app: extranetui-service
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: extranetui
|
||||||
|
ports:
|
||||||
|
- name: extranetui-service-port
|
||||||
|
port: 80
|
||||||
|
targetPort: http
|
||||||
|
sessionAffinity: ClientIP
|
||||||
82
kustomize/manifests/dev.yaml
Normal file
82
kustomize/manifests/dev.yaml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: extranetui-service
|
||||||
|
name: extranetui-service
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: extranetui-service-port
|
||||||
|
port: 80
|
||||||
|
targetPort: http
|
||||||
|
selector:
|
||||||
|
app: extranetui
|
||||||
|
sessionAffinity: ClientIP
|
||||||
|
type: NodePort
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: extranetui
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: extranetui
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
linkerd.io/inject: enabled
|
||||||
|
labels:
|
||||||
|
app: extranetui
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: aosdevacr.azurecr.io/extranetui
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
name: extranetui
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
name: http
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 768M
|
||||||
|
requests:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 512M
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /app/appsettings.json
|
||||||
|
name: config-volume
|
||||||
|
subPath: appsettings.json
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: acr-pull
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: app-config
|
||||||
|
name: config-volume
|
||||||
|
---
|
||||||
|
apiVersion: autoscaling/v1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: extranetui-hpa
|
||||||
|
spec:
|
||||||
|
maxReplicas: 5
|
||||||
|
minReplicas: 1
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: extranetui
|
||||||
|
targetCPUUtilizationPercentage: 50
|
||||||
82
kustomize/manifests/preprod/preprod.yaml
Normal file
82
kustomize/manifests/preprod/preprod.yaml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: extranetui-service
|
||||||
|
name: extranetui-service
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: extranetui-service-port
|
||||||
|
port: 80
|
||||||
|
targetPort: http
|
||||||
|
selector:
|
||||||
|
app: extranetui
|
||||||
|
sessionAffinity: ClientIP
|
||||||
|
type: NodePort
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: extranetui
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: extranetui
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
linkerd.io/inject: enabled
|
||||||
|
labels:
|
||||||
|
app: extranetui
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: aosprodacr.azurecr.io/extranetui
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
name: extranetui
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
name: http
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 768M
|
||||||
|
requests:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 512M
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /app/appsettings.json
|
||||||
|
name: config-volume
|
||||||
|
subPath: appsettings.json
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: acr-pull
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: app-config
|
||||||
|
name: config-volume
|
||||||
|
---
|
||||||
|
apiVersion: autoscaling/v1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: extranetui-hpa
|
||||||
|
spec:
|
||||||
|
maxReplicas: 5
|
||||||
|
minReplicas: 1
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: extranetui
|
||||||
|
targetCPUUtilizationPercentage: 50
|
||||||
82
kustomize/manifests/prod/prod.yaml
Normal file
82
kustomize/manifests/prod/prod.yaml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: extranetui-service
|
||||||
|
name: extranetui-service
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: extranetui-service-port
|
||||||
|
port: 80
|
||||||
|
targetPort: http
|
||||||
|
selector:
|
||||||
|
app: extranetui
|
||||||
|
sessionAffinity: ClientIP
|
||||||
|
type: NodePort
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: extranetui
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: extranetui
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
linkerd.io/inject: enabled
|
||||||
|
labels:
|
||||||
|
app: extranetui
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: aosprodacr.azurecr.io/extranetui
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
name: extranetui
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
name: http
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 768M
|
||||||
|
requests:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 512M
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /app/appsettings.json
|
||||||
|
name: config-volume
|
||||||
|
subPath: appsettings.json
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: acr-pull
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: app-config
|
||||||
|
name: config-volume
|
||||||
|
---
|
||||||
|
apiVersion: autoscaling/v1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: extranetui-hpa
|
||||||
|
spec:
|
||||||
|
maxReplicas: 5
|
||||||
|
minReplicas: 2
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: extranetui
|
||||||
|
targetCPUUtilizationPercentage: 50
|
||||||
82
kustomize/manifests/uat/uat.yaml
Normal file
82
kustomize/manifests/uat/uat.yaml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: extranetui-service
|
||||||
|
name: extranetui-service
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: extranetui-service-port
|
||||||
|
port: 80
|
||||||
|
targetPort: http
|
||||||
|
selector:
|
||||||
|
app: extranetui
|
||||||
|
sessionAffinity: ClientIP
|
||||||
|
type: NodePort
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: extranetui
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: extranetui
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
linkerd.io/inject: enabled
|
||||||
|
labels:
|
||||||
|
app: extranetui
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: aosdevacr.azurecr.io/extranetui
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
name: extranetui
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
name: http
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthcheck
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 768M
|
||||||
|
requests:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 512M
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /app/appsettings.json
|
||||||
|
name: config-volume
|
||||||
|
subPath: appsettings.json
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: acr-pull
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: app-config
|
||||||
|
name: config-volume
|
||||||
|
---
|
||||||
|
apiVersion: autoscaling/v1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: extranetui-hpa
|
||||||
|
spec:
|
||||||
|
maxReplicas: 5
|
||||||
|
minReplicas: 1
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: extranetui
|
||||||
|
targetCPUUtilizationPercentage: 50
|
||||||
12
kustomize/overlays/dev/hpa.yaml
Normal file
12
kustomize/overlays/dev/hpa.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: autoscaling/v1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: extranetui-hpa
|
||||||
|
spec:
|
||||||
|
maxReplicas: 5
|
||||||
|
minReplicas: 1
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: extranetui
|
||||||
|
targetCPUUtilizationPercentage: 50
|
||||||
11
kustomize/overlays/dev/kustomization.yaml
Normal file
11
kustomize/overlays/dev/kustomization.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
generatorOptions:
|
||||||
|
annotations:
|
||||||
|
generated: "true"
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
|
patches:
|
||||||
|
- path: hpa.yaml
|
||||||
|
|
||||||
0
kustomize/overlays/pre-prod/kustomization.yaml
Normal file
0
kustomize/overlays/pre-prod/kustomization.yaml
Normal file
0
kustomize/overlays/prod/kustomization.yaml
Normal file
0
kustomize/overlays/prod/kustomization.yaml
Normal file
0
kustomize/overlays/uat/kustomization.yaml
Normal file
0
kustomize/overlays/uat/kustomization.yaml
Normal file
14
nginx.conf
Normal file
14
nginx.conf
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
events{}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13987
package-lock.json
generated
Normal file
13987
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
69
package.json
Normal file
69
package.json
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
"name": "extra-net",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"ng": "ng",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
|
"build-dev": "ng build --configuration=dev",
|
||||||
|
"build-uat": "ng build --configuration=uat",
|
||||||
|
"build-preprod": "ng build --configuration=preprod",
|
||||||
|
"build-prod": "ng build --configuration=prod",
|
||||||
|
"test": "ng test",
|
||||||
|
"lint": "ng lint",
|
||||||
|
"e2e": "ng e2e",
|
||||||
|
"post-build": "node ./build/post-build.js",
|
||||||
|
"serve": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/cdk": "^20.1.2",
|
||||||
|
"@angular/common": "^20.1.0",
|
||||||
|
"@angular/compiler": "^20.1.0",
|
||||||
|
"@angular/core": "^20.1.0",
|
||||||
|
"@angular/forms": "^20.1.0",
|
||||||
|
"@angular/material": "^20.1.2",
|
||||||
|
"@angular/platform-browser": "^20.1.0",
|
||||||
|
"@angular/platform-browser-dynamic": "^20.1.2",
|
||||||
|
"@angular/router": "^20.1.0",
|
||||||
|
"@fullcalendar/angular": "^6.1.15",
|
||||||
|
"@fullcalendar/daygrid": "^6.1.15",
|
||||||
|
"@ng-select/ng-option-highlight": "^13.7.0",
|
||||||
|
"@ng-select/ng-select": "^20.1.2",
|
||||||
|
"@ngx-translate/core": "^17.0.0",
|
||||||
|
"ag-grid-angular": "^32.0.2",
|
||||||
|
"ag-grid-community": "^32.0.2",
|
||||||
|
"angular-calendar": "^0.31.1",
|
||||||
|
"crypto-js": "^4.2.0",
|
||||||
|
"date-fns": "^3.6.0",
|
||||||
|
"file-saver": "^2.0.5",
|
||||||
|
"jsencrypt": "^3.3.2",
|
||||||
|
"jspdf": "^3.0.1",
|
||||||
|
"jspdf-autotable": "^5.0.2",
|
||||||
|
"moment": "^2.30.1",
|
||||||
|
"ng-otp-input": "^2.0.8",
|
||||||
|
"ngx-cookie-service": "^20.0.1",
|
||||||
|
"primeng": "^20.0.0",
|
||||||
|
"quill": "^2.0.3",
|
||||||
|
"rxjs": "~7.8.0",
|
||||||
|
"tslib": "^2.3.0",
|
||||||
|
"xlsx": "^0.18.5",
|
||||||
|
"zone.js": "~0.15.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular/build": "^20.1.1",
|
||||||
|
"@angular/cli": "^20.1.1",
|
||||||
|
"@angular/compiler-cli": "^20.1.0",
|
||||||
|
"@types/file-saver": "^2.0.7",
|
||||||
|
"@types/node": "^22.1.0",
|
||||||
|
"@types/jasmine": "~5.1.0",
|
||||||
|
"jasmine-core": "~5.8.0",
|
||||||
|
"karma": "~6.4.0",
|
||||||
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
|
"karma-coverage": "~2.2.0",
|
||||||
|
"karma-jasmine": "~5.1.0",
|
||||||
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
|
"typescript": "~5.8.2",
|
||||||
|
"webpack": "^5.93.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
16
preprod.Dockerfile
Normal file
16
preprod.Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM node:20.11.1 as builder
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
RUN npm install && npm run build-preprod
|
||||||
|
|
||||||
|
FROM nginx:1.14.2-alpine
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=builder /usr/src/app/dist/ExtraNet /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
16
prod.Dockerfile
Normal file
16
prod.Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM node:16 as builder
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
RUN npm install && npm run build-prod
|
||||||
|
|
||||||
|
FROM nginx:1.14.2-alpine
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=builder /usr/src/app/dist/ExtraNet /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
20
readme.md
20
readme.md
@@ -0,0 +1,20 @@
|
|||||||
|
# Introduction
|
||||||
|
TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.
|
||||||
|
|
||||||
|
# Getting Started
|
||||||
|
TODO: Guide users through getting your code up and running on their own system. In this section you can talk about:
|
||||||
|
1. Installation process
|
||||||
|
2. Software dependencies
|
||||||
|
3. Latest releases
|
||||||
|
4. API references
|
||||||
|
|
||||||
|
# Build and Test
|
||||||
|
TODO: Describe and show how to build your code and run the tests.
|
||||||
|
|
||||||
|
# Contribute
|
||||||
|
TODO: Explain how other users and developers can contribute to make your code better.
|
||||||
|
|
||||||
|
If you want to learn more about creating good readme files then refer the following [guidelines](https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops). You can also seek inspiration from the below readme files:
|
||||||
|
- [ASP.NET Core](https://github.com/aspnet/Home)
|
||||||
|
- [Visual Studio Code](https://github.com/Microsoft/vscode)
|
||||||
|
- [Chakra Core](https://github.com/Microsoft/ChakraCore)
|
||||||
22
src/app/app-routing.module.ts
Normal file
22
src/app/app-routing.module.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'Auth',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('./modules/auth/auth.module').then((m) => m.AuthModule),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('./layouts/theme.module').then((m) => m.ThemeModule),
|
||||||
|
},
|
||||||
|
{ path: '**', redirectTo: 'Error/404', pathMatch: 'full' },
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload' })],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class AppRoutingModule {}
|
||||||
67
src/app/app.component.html
Normal file
67
src/app/app.component.html
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<router-outlet></router-outlet>
|
||||||
|
<app-loader></app-loader>
|
||||||
|
<p-toast [preventOpenDuplicates]="true"></p-toast>
|
||||||
|
<div class="SSExpireWarning">
|
||||||
|
<p-dialog (onHide)="Close(false)" header="" [(visible)]="commonService.displayPosition" position="center" [modal]="true"
|
||||||
|
[style]="{width: '450px'}" [draggable]="false" [resizable]="false" [showHeader]="false">
|
||||||
|
<div class="SSExpire-Modal">
|
||||||
|
<span class="text-center">
|
||||||
|
<svg focusable="false" color="secondary" fill="none" aria-hidden="true" role="presentation"
|
||||||
|
viewBox="0 0 56 56" preserveAspectRatio="xMidYMid meet" size="62" width="56"
|
||||||
|
class="sc-hMqMXs jdbxAS">
|
||||||
|
<circle cx="28" cy="28" r="22" fill="#F7F9FA"></circle>
|
||||||
|
<path
|
||||||
|
d="M11.7862 43.553L12.1367 47.0874C12.2074 47.8 12.469 49.8536 13.185 49.845C18.1263 49.7855 24.0454 49.7758 29.3073 49.8157C31.2661 49.8306 33.17 49.0367 33.3633 47.0875L33.7138 43.553C34.0697 39.9639 31.7579 36.6164 28.6804 34.7356L25.2072 32.6132C24.6538 32.275 24.3163 31.6731 24.3163 31.0245C24.3163 30.375 24.6511 29.7714 25.2021 29.4276L28.7998 27.1827C31.8564 25.2753 33.7138 21.927 33.7138 18.3241V15.1723C33.7138 13.2835 31.3584 12.7625 29.4695 12.7567C27.3296 12.75 25.0078 12.75 22.75 12.75H22.7359C20.4026 12.75 18.2578 12.75 16.0308 12.7574C14.1421 12.7636 11.7862 13.2836 11.7862 15.1723L11.7862 18.3241C11.7862 21.927 13.6436 25.2753 16.7002 27.1827L20.2979 29.4276C20.8489 29.7714 21.1837 30.375 21.1837 31.0245C21.1837 31.6731 20.8462 32.275 20.2928 32.6132L16.8196 34.7356C13.7421 36.6164 11.4303 39.9639 11.7862 43.553Z"
|
||||||
|
fill="white"></path>
|
||||||
|
<path
|
||||||
|
d="M21.1844 29.9803L18.581 28.3848L16.2747 26.935C17.1373 24.9676 19.2659 23.8796 21.3658 24.3327L22.6353 24.6067C25.0208 25.1215 27.5067 24.4248 29.2771 22.7451L29.3496 22.6764C30.2896 21.7846 31.6285 21.4515 32.8768 21.7987L31.6261 25.2815L29.5378 27.3699L24.3169 29.9803L24.0255 31.5101C23.8721 32.3157 23.7948 33.134 23.7948 33.9542V34.1774C23.7948 34.9871 24.1725 35.7504 24.8161 36.2416L29.496 39.8131C32.0788 41.7841 33.3173 45.0513 32.6903 48.2392C32.6786 48.2989 32.6275 48.3429 32.5667 48.3455L22.7507 48.7739L12.9347 48.3455C12.8739 48.3429 12.8228 48.2989 12.811 48.2392C12.184 45.0513 13.4226 41.7841 16.0053 39.8131L20.6852 36.2416C21.3288 35.7504 21.7065 34.9871 21.7065 34.1774V33.9542C21.7065 33.134 21.6293 32.3157 21.4758 31.5101L21.1844 29.9803Z"
|
||||||
|
fill="#D8DCDE"></path>
|
||||||
|
<path opacity="0.23"
|
||||||
|
d="M21.1844 29.9803L18.581 28.3847L15.4087 26.1522L19.3337 27.5522C21.1653 28.2054 23.2078 27.7932 24.6427 26.4807C25.4876 25.7079 26.5619 25.2323 27.7021 25.1266L28.3238 25.0689C29.5704 24.9532 30.7644 24.5104 31.7849 23.7853L32.1993 23.4909C32.2732 23.4384 32.3696 23.5157 32.3344 23.5992L31.6261 25.2815L29.5377 27.3698L24.3169 29.9803L24.0255 31.5101C23.872 32.3157 23.7948 33.134 23.7948 33.9541V34.1774C23.7948 34.9871 24.1725 35.7504 24.8161 36.2416L29.4961 39.8132C32.0788 41.7841 33.3173 45.0512 32.6903 48.239C32.6786 48.2988 32.6273 48.3428 32.5664 48.3453L22.3106 48.7739L12.9344 48.3457C12.8737 48.3429 12.8228 48.299 12.811 48.2394C12.184 45.0514 13.4226 41.7841 16.0054 39.8129L20.6851 36.2416C21.3288 35.7504 21.7065 34.9871 21.7065 34.1774V33.9541C21.7065 33.134 21.6292 32.3157 21.4758 31.5101L21.1844 29.9803Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M22.7369 13.25C20.4031 13.25 18.2589 13.25 16.0327 13.2574C15.12 13.2604 14.138 13.3893 13.4036 13.7158C12.6841 14.0357 12.2864 14.4963 12.2864 15.1723L12.2864 18.3241C12.2864 21.7545 14.0548 24.9425 16.9651 26.7585L20.5628 29.0034C21.2602 29.4386 21.6839 30.2025 21.6839 31.0245C21.6839 31.8473 21.2557 32.6108 20.5537 33.0398L17.0806 35.1623C14.1085 36.9786 11.9529 40.1651 12.284 43.5037L12.6345 47.0381C12.6692 47.3881 12.7491 48.0457 12.9015 48.6053C12.9787 48.8891 13.0655 49.1122 13.1535 49.2533C13.1844 49.3029 13.2074 49.3303 13.2215 49.3445C18.1578 49.2855 24.0614 49.2759 29.3113 49.3158C30.231 49.3227 31.0993 49.1382 31.7432 48.7577C32.3696 48.3875 32.787 47.8339 32.8659 47.0381L33.2164 43.5037C33.5475 40.1651 31.3919 36.9786 28.4198 35.1623L24.9467 33.0398C24.2446 32.6108 23.8164 31.8473 23.8164 31.0245C23.8164 30.2025 24.2402 29.4386 24.9376 29.0034L28.5353 26.7585C31.4455 24.9425 33.214 21.7545 33.214 18.3241V15.1723C33.214 14.4961 32.8163 14.0353 32.0969 13.7152C31.3626 13.3885 30.3808 13.2595 29.4682 13.2566C27.3291 13.25 25.0082 13.25 22.7502 13.25H22.7369ZM22.736 12.25H22.7502C25.0076 12.25 27.3306 12.25 29.4713 12.2567C30.4475 12.2597 31.5878 12.3941 32.5034 12.8015C33.434 13.2156 34.214 13.9597 34.214 15.1723V18.3241C34.214 22.0995 32.2677 25.6082 29.0647 27.6068L25.467 29.8518C25.0623 30.1043 24.8164 30.5476 24.8164 31.0245C24.8164 31.4989 25.0633 31.9392 25.4681 32.1865L28.9413 34.309C32.1244 36.2542 34.5923 39.7626 34.2115 43.6024L33.8611 47.1368C33.7467 48.2903 33.1155 49.1082 32.2519 49.6186C31.4058 50.1187 30.3428 50.3236 29.3037 50.3157C24.0448 50.2758 18.129 50.2856 13.1912 50.3449C12.7431 50.3503 12.4594 50.03 12.3051 49.7826C12.1404 49.5188 12.0231 49.1856 11.9366 48.868C11.7615 48.2249 11.6753 47.4994 11.6393 47.1368L11.2888 43.6024C10.9081 39.7626 13.376 36.2542 16.5591 34.309L20.0322 32.1865C20.437 31.9392 20.6839 31.4989 20.6839 31.0245C20.6839 30.5476 20.438 30.1043 20.0334 29.8518L16.4357 27.6068C13.2327 25.6082 11.2864 22.0995 11.2864 18.3241L11.2864 15.1723C11.2864 13.9596 12.0667 13.2158 12.9973 12.8021C13.913 12.3949 15.0533 12.2606 16.0294 12.2574C18.2573 12.25 20.4029 12.25 22.736 12.25Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M9.25 12.75C9.52614 12.75 9.75 12.9739 9.75 13.25V48.25C9.75 48.5261 9.52614 48.75 9.25 48.75C8.97386 48.75 8.75 48.5261 8.75 48.25V13.25C8.75 12.9739 8.97386 12.75 9.25 12.75Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M36.25 12.75C35.9739 12.75 35.75 12.9739 35.75 13.25V48.25C35.75 48.5261 35.9739 48.75 36.25 48.75C36.5261 48.75 36.75 48.5261 36.75 48.25V13.25C36.75 12.9739 36.5261 12.75 36.25 12.75Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path d="M6.75 11.25H38.75V14.25H6.75V11.25Z" fill="#D8DCDE"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M5.25 14.75C5.25 14.4739 5.47386 14.25 5.75 14.25H39.75C40.0261 14.25 40.25 14.4739 40.25 14.75C40.25 15.0261 40.0261 15.25 39.75 15.25H5.75C5.47386 15.25 5.25 15.0261 5.25 14.75Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M5.25 11.25C5.25 10.9739 5.47386 10.75 5.75 10.75H39.75C40.0261 10.75 40.25 10.9739 40.25 11.25C40.25 11.5261 40.0261 11.75 39.75 11.75H5.75C5.47386 11.75 5.25 11.5261 5.25 11.25Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path d="M6.75 47.25H38.75V50.25H6.75V47.25Z" fill="#D8DCDE"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M5.25 50.75C5.25 50.4739 5.47386 50.25 5.75 50.25H39.75C40.0261 50.25 40.25 50.4739 40.25 50.75C40.25 51.0261 40.0261 51.25 39.75 51.25H5.75C5.47386 51.25 5.25 51.0261 5.25 50.75Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M5.25 47.25C5.25 46.9739 5.47386 46.75 5.75 46.75H39.75C40.0261 46.75 40.25 46.9739 40.25 47.25C40.25 47.5261 40.0261 47.75 39.75 47.75H5.75C5.47386 47.75 5.25 47.5261 5.25 47.25Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path
|
||||||
|
d="M50.25 17.5C50.25 24.2655 44.7655 29.75 38 29.75C31.2345 29.75 25.75 24.2655 25.75 17.5C25.75 10.7345 31.2345 5.25 38 5.25C44.7655 5.25 50.25 10.7345 50.25 17.5Z"
|
||||||
|
fill="white"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M38 5.75C31.5107 5.75 26.25 11.0107 26.25 17.5C26.25 23.9893 31.5107 29.25 38 29.25C44.4893 29.25 49.75 23.9893 49.75 17.5C49.75 11.0107 44.4893 5.75 38 5.75ZM25.25 17.5C25.25 10.4584 30.9584 4.75 38 4.75C45.0416 4.75 50.75 10.4584 50.75 17.5C50.75 24.5416 45.0416 30.25 38 30.25C30.9584 30.25 25.25 24.5416 25.25 17.5Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
<path
|
||||||
|
d="M48.5 17.5C48.5 23.299 43.799 28 38 28C32.201 28 27.5 23.299 27.5 17.5C27.5 11.701 32.201 7 38 7C43.799 7 48.5 11.701 48.5 17.5Z"
|
||||||
|
fill="#EDF1F3"></path>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M35.6919 11.9279C36.794 11.4714 38.0067 11.3519 39.1766 11.5846C40.3466 11.8174 41.4213 12.3918 42.2647 13.2353L43.9303 14.9008H42.1687C41.8925 14.9008 41.6687 15.1247 41.6687 15.4008C41.6687 15.677 41.8925 15.9008 42.1687 15.9008H45.1374C45.4136 15.9008 45.6374 15.677 45.6374 15.4008V12.4321C45.6374 12.1559 45.4136 11.9321 45.1374 11.9321C44.8613 11.9321 44.6374 12.1559 44.6374 12.4321V14.1937L42.9718 12.5282C41.9885 11.5448 40.7357 10.8752 39.3717 10.6039C38.0078 10.3326 36.594 10.4718 35.3093 11.004C34.0245 11.5362 32.9263 12.4374 32.1537 13.5936C31.3811 14.7499 30.9688 16.1094 30.9688 17.5C30.9688 18.8907 31.3811 20.2501 32.1537 21.4064C32.9263 22.5626 34.0245 23.4639 35.3093 23.996C36.594 24.5282 38.0078 24.6675 39.3717 24.3962C40.7357 24.1248 41.9885 23.4552 42.9718 22.4718C43.1671 22.2766 43.1671 21.96 42.9718 21.7647C42.7766 21.5695 42.46 21.5695 42.2647 21.7647C41.4213 22.6082 40.3466 23.1826 39.1766 23.4154C38.0067 23.6481 36.794 23.5286 35.6919 23.0722C34.5899 22.6157 33.6479 21.8426 32.9852 20.8508C32.3225 19.859 31.9688 18.6929 31.9688 17.5C31.9688 16.3071 32.3225 15.1411 32.9852 14.1492C33.6479 13.1574 34.5899 12.3843 35.6919 11.9279Z"
|
||||||
|
fill="#66797F"></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<div class="ExpireHeader"> Session Expire Warning </div>
|
||||||
|
<div class="ExpireDesc">Your session will expire in {{commonService.remainingTime}} seconds. </div>
|
||||||
|
<div class="ExpireDesc">Do you want to extend the session? </div>
|
||||||
|
<span class="btnExtend">
|
||||||
|
<button pButton class="btn-primary" label="Extend Now" (click)="extendJWTTime()"></button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</p-dialog>
|
||||||
|
</div>
|
||||||
108
src/app/app.component.ts
Normal file
108
src/app/app.component.ts
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
import { Component, Renderer2 } from '@angular/core';
|
||||||
|
import * as moment from 'moment';
|
||||||
|
import { Subscription, interval } from 'rxjs';
|
||||||
|
import { CommonFunctionService } from './core/common/common-function.service';
|
||||||
|
import { API } from './core/services/api.service';
|
||||||
|
import { RouteChangeService } from './core/common/RouteChangeService.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
})
|
||||||
|
export class AppComponent {
|
||||||
|
// displayPosition = false;
|
||||||
|
// position: string;
|
||||||
|
title = "AngularStructure";
|
||||||
|
constructor(private renderer: Renderer2, public commonService: CommonFunctionService, private ApiSer: API, private routeChangeService: RouteChangeService) {
|
||||||
|
// Check if userId exists in sessionStorage
|
||||||
|
if (sessionStorage.getItem('LoginUserData')) {
|
||||||
|
// Set up an interval that runs every second
|
||||||
|
this.commonService.StartTimer();
|
||||||
|
} else {
|
||||||
|
// If userId doesn't exist in sessionStorage
|
||||||
|
// Set displayPosition to false, remove 'excd' from sessionStorage, and unsubscribe from the subscription
|
||||||
|
this.commonService.displayPosition = false;
|
||||||
|
sessionStorage.removeItem('excd');
|
||||||
|
this.commonService.subscription?.unsubscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
stopTimer() {
|
||||||
|
if (this.commonService.subscription) {
|
||||||
|
this.commonService.subscription.unsubscribe();
|
||||||
|
this.commonService.subscription = undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
//sessionStorage.getItem("userId")
|
||||||
|
// ? ""
|
||||||
|
// : (window.location.href = "/Login/Login");
|
||||||
|
// const links = this.renderer.createElement("link");
|
||||||
|
// links.setAttribute("rel", "stylesheet");
|
||||||
|
// links.setAttribute("type", "text/css");
|
||||||
|
// links.setAttribute(
|
||||||
|
// "href",
|
||||||
|
// isTheme ? "../assets/css/empire/e-default.css" : "../assets/css/retina/r-default.css"
|
||||||
|
// );
|
||||||
|
// this.renderer.appendChild(document.head, links);
|
||||||
|
// const link = this.renderer.createElement("link");
|
||||||
|
// link.setAttribute("rel", "stylesheet");
|
||||||
|
// link.setAttribute("type", "text/css");
|
||||||
|
// link.setAttribute(
|
||||||
|
// "href",
|
||||||
|
// isTheme ? "../assets/css/empire.css" : "../assets/css/retina.css"
|
||||||
|
// );
|
||||||
|
// this.renderer.appendChild(document.head, link);
|
||||||
|
// this.commonService.GetOrgDetails();
|
||||||
|
// this.route.queryParams.subscribe(obj => {
|
||||||
|
// console.log(obj)
|
||||||
|
// // if(obj.key) CommonFunctions.DecryptReq("UfCP%2FE7upxltDZyVLfTj%2F8fMMbudOAFfwLCR1RVqPXNvD%203jblAZ3pQ0i9LtrXpE0DFYbSnyHNj353T2bJx9Zg%3D%3D");
|
||||||
|
|
||||||
|
// })
|
||||||
|
// sessionStorage.getItem('userId') ? '' : window.location.href = '/Login/Login'
|
||||||
|
}
|
||||||
|
|
||||||
|
showPositionDialog(position: string) {
|
||||||
|
this.commonService.position = position;
|
||||||
|
this.commonService.displayPosition = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
// Unsubscribe from the observable to prevent memory leaks
|
||||||
|
this.commonService.subscription.unsubscribe();
|
||||||
|
}
|
||||||
|
extendJWTTime() {
|
||||||
|
this.stopTimer();
|
||||||
|
let postdata = {
|
||||||
|
"JwtToken": sessionStorage.getItem('JwtToken'),
|
||||||
|
"RefreshToken": sessionStorage.getItem('RefreshToken')
|
||||||
|
};
|
||||||
|
this.ApiSer.AdminPost('/JWT/RefreshToken', postdata).subscribe(res => {
|
||||||
|
if (!res.Status) {
|
||||||
|
this.commonService.loginOut();
|
||||||
|
} else {
|
||||||
|
sessionStorage.setItem('JwtToken', res.JwtToken);
|
||||||
|
sessionStorage.setItem('RefreshToken', res.RefreshToken);
|
||||||
|
sessionStorage.setItem('JwtTokenExpiry', res.JwtTokenExpiry);
|
||||||
|
this.Close(true)
|
||||||
|
this.commonService.StartTimer();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
// remainingTime: number;
|
||||||
|
exit() {
|
||||||
|
this.commonService.displayPosition = false;
|
||||||
|
sessionStorage.removeItem('excd');
|
||||||
|
this.commonService.loginOut();
|
||||||
|
};
|
||||||
|
Close(check) {
|
||||||
|
this.commonService.displayPosition = false;
|
||||||
|
sessionStorage.setItem('excd', 'OK')
|
||||||
|
if (check) {
|
||||||
|
setTimeout(function () {
|
||||||
|
sessionStorage.removeItem('excd');
|
||||||
|
}, 10000); // 10000 milliseconds = 10 second
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
42
src/app/app.module.ts
Normal file
42
src/app/app.module.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { InterceptLoader } from './core/common/intercept-loader.service';
|
||||||
|
import { MessageService } from 'primeng/api';
|
||||||
|
import { ToastModule } from 'primeng/toast';
|
||||||
|
import { AuthGuard } from './core/guard/auth.guard';
|
||||||
|
import { DialogModule } from 'primeng/dialog';
|
||||||
|
import { ButtonModule } from 'primeng/button';
|
||||||
|
import { LoaderComponent } from './core/shared/intercept-loader/intercept-loader.component';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
AppComponent,
|
||||||
|
LoaderComponent,
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
HttpClientModule,
|
||||||
|
BrowserAnimationsModule,
|
||||||
|
AppRoutingModule,
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
ToastModule,
|
||||||
|
ButtonModule,
|
||||||
|
DialogModule
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
TranslateService, MessageService,
|
||||||
|
AuthGuard,
|
||||||
|
{ provide: HTTP_INTERCEPTORS, useClass: InterceptLoader, multi: true }
|
||||||
|
],
|
||||||
|
bootstrap: [AppComponent]
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
||||||
|
|
||||||
51
src/app/core/common/RouteChangeService.service.ts
Normal file
51
src/app/core/common/RouteChangeService.service.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Router, NavigationEnd } from '@angular/router';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
import { MessageService } from 'primeng/api';
|
||||||
|
import { API } from '../services/api.service';
|
||||||
|
import { securityFunctions } from './security';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class RouteChangeService {
|
||||||
|
constructor(private router: Router, private apiService: API) {
|
||||||
|
this.setupRouteChangeSubscription();
|
||||||
|
// this.checkSessionMsg()
|
||||||
|
}
|
||||||
|
|
||||||
|
private setupRouteChangeSubscription() {
|
||||||
|
this.router.events
|
||||||
|
.pipe(filter(event => event instanceof NavigationEnd))
|
||||||
|
.subscribe(() => {
|
||||||
|
const currentUrl = this.router.url;
|
||||||
|
// Check the current route's URL
|
||||||
|
|
||||||
|
if (currentUrl.includes('Unauthorized') || currentUrl == '/' || currentUrl.includes('/404') || currentUrl.includes('/error') || currentUrl.includes('/Auth') || currentUrl.includes('/Home') || currentUrl.includes('/Login')) {
|
||||||
|
// console.log('Not making API call for 404 or error route:', currentUrl);
|
||||||
|
} else {
|
||||||
|
let LoginUserData = JSON.parse(securityFunctions.getSessionStorage('LoginUserData'));
|
||||||
|
// Call your API function here
|
||||||
|
let url = currentUrl
|
||||||
|
if (currentUrl.includes('?')) {
|
||||||
|
url = currentUrl.split('?')[0]
|
||||||
|
}
|
||||||
|
let obj = {
|
||||||
|
"page_url": url,
|
||||||
|
"user_id": LoginUserData.user_id,
|
||||||
|
"project_id": '2405170833594899108'
|
||||||
|
}
|
||||||
|
this.apiService.AdminPost('/MenuMasterNew/IsAuthorizedPage', obj).subscribe(
|
||||||
|
(response) => {
|
||||||
|
if (!response.resp) {
|
||||||
|
this.router.navigate(['/Unauthorized']);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
this.router.navigate(['/'])
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
657
src/app/core/common/common-function.service.ts
Normal file
657
src/app/core/common/common-function.service.ts
Normal file
@@ -0,0 +1,657 @@
|
|||||||
|
import { MessageService } from "primeng/api";
|
||||||
|
import { API } from "../services/api.service";
|
||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import { Title } from "@angular/platform-browser";
|
||||||
|
import { ValidationService } from "./validation.service";
|
||||||
|
import * as moment from "moment";
|
||||||
|
import { FileUpload } from "primeng/fileupload";
|
||||||
|
import jsPDF from "jspdf";
|
||||||
|
import * as FileSaver from "file-saver";
|
||||||
|
import autoTable from 'jspdf-autotable';
|
||||||
|
import { UserLoginData } from "../models/common-model/userModel";
|
||||||
|
import { securityFunctions } from "./security";
|
||||||
|
import { UserLog } from "../models/common-model/user-logout.model";
|
||||||
|
import { Subscription, interval } from "rxjs";
|
||||||
|
import { environment } from "src/environments/environment";
|
||||||
|
import { Router, NavigationEnd } from '@angular/router';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class CommonFunctionService {
|
||||||
|
LoginUserData: UserLoginData
|
||||||
|
constructor(
|
||||||
|
public MsgService: MessageService,
|
||||||
|
public ApiServ: API,
|
||||||
|
public validationService: ValidationService,
|
||||||
|
public titleService: Title,
|
||||||
|
public router:Router
|
||||||
|
) {
|
||||||
|
this.LoginUserData = securityFunctions.getSessionStorage('LoginUserData') ? JSON.parse(securityFunctions.getSessionStorage('LoginUserData')) : null
|
||||||
|
this.clientId = environment.client_id
|
||||||
|
}
|
||||||
|
clientId = ''
|
||||||
|
logo;
|
||||||
|
AllMenu;
|
||||||
|
ChangeStatusAllowed = false;
|
||||||
|
DownloadFilesAllowed = false;
|
||||||
|
environmentObj = environment;
|
||||||
|
ddLoader = {
|
||||||
|
country: false,
|
||||||
|
city: false,
|
||||||
|
Currency: false,
|
||||||
|
vendor: false,
|
||||||
|
};
|
||||||
|
MenuTabList = {
|
||||||
|
Overview: { val:false, link:'Services/Hotel/HotelManage/OverView', IsActive: false, Download: false},
|
||||||
|
MealAddOn: { val:false, link:'Services/Hotel/HotelManage/HotelMealAdd', IsActive: false, Download: false},
|
||||||
|
Rooms: { val:false, link:'Services/Hotel/HotelManage/HotelAddRoom', IsActive: false, Download: false},
|
||||||
|
HotelSeason: { val:false, link:'Services/Hotel/HotelManage/AddSeason', IsActive: false, Download: false},
|
||||||
|
RoomContract: { val:false, link:'Services/Hotel/HotelManage/RoomContractAdd', IsActive: false, Download: false},
|
||||||
|
MinStay: { val:false, link:'Services/Hotel/HotelManage/AddMinStay', IsActive: false, Download: false},
|
||||||
|
RoomAllocation: { val:false, link:'Services/Hotel/HotelManage/AddAllocation', IsActive: false, Download: false},
|
||||||
|
HotelBlockDates: { val:false, link:'Services/Hotel/HotelManage/HotelAddBlockDate', IsActive: false, Download: false},
|
||||||
|
HotelOffers: { val:false, link:'Services/Hotel/HotelManage/AddOffer', IsActive: false, Download: false},
|
||||||
|
HotelSupplements: { val:false, link:'Services/Hotel/HotelManage/AddSuppliment', IsActive: false, Download: false},
|
||||||
|
}
|
||||||
|
CurrencyList = [];
|
||||||
|
CountryList = [];
|
||||||
|
CityList = [];
|
||||||
|
agencyData = [];
|
||||||
|
timer;
|
||||||
|
AllVendor = []
|
||||||
|
// =============================== normal function ==========================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this function for show message
|
||||||
|
* @param check boolean
|
||||||
|
* @param message text
|
||||||
|
*/
|
||||||
|
public showMessage(check, message, type?) {
|
||||||
|
this.MsgService.add({
|
||||||
|
severity: type ? type : check ? "success" : "error",
|
||||||
|
detail: message,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ayaan kazi
|
||||||
|
* last updated by Abdul Razzak on 03-06-2024
|
||||||
|
* @param otpInp
|
||||||
|
* @param otpBox
|
||||||
|
*/
|
||||||
|
focusEmptyOtpInp(otpInp, otpBox) {
|
||||||
|
let targetOtpInput = otpInp.target;
|
||||||
|
const otpInputWrapper = targetOtpInput.closest('.ng-otp-input-wrapper');
|
||||||
|
const inputList = [...otpInputWrapper.querySelectorAll('input')];
|
||||||
|
let ind = inputList.findIndex(z => z.getAttribute('id') == targetOtpInput.id);
|
||||||
|
if (ind == -1 || inputList[ind].value == '') {
|
||||||
|
for (let i = 0; i <= inputList.length; i++) {
|
||||||
|
let inp = inputList[i];
|
||||||
|
if (inp?.value == '') {
|
||||||
|
let id = inp.getAttribute('id');
|
||||||
|
otpBox.focusTo(id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// check Token expire time
|
||||||
|
/**
|
||||||
|
* @param check pass boolean for check time expire or not
|
||||||
|
*/
|
||||||
|
CheckTokenExpireTime(check) {
|
||||||
|
const currentISOString = moment.utc(this.ApiServ.getAdjustedLocalTime()).format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const time1 = moment.utc(sessionStorage.getItem('JwtTokenExpiry')).subtract(3, 'seconds').format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const isTime1AfterTime2 = this.isTime1AfterTime2(time1, currentISOString);
|
||||||
|
if (isTime1AfterTime2) {
|
||||||
|
let postdata = {
|
||||||
|
"JwtToken": sessionStorage.getItem('JwtToken'),
|
||||||
|
"RefreshToken": sessionStorage.getItem('RefreshToken')
|
||||||
|
}
|
||||||
|
this.ApiServ.AdminPost('/JWT/RefreshToken', postdata).subscribe(res => {
|
||||||
|
if (!res.Status) {
|
||||||
|
this.loginOut();
|
||||||
|
} else {
|
||||||
|
sessionStorage.setItem('JwtToken', res.JwtToken);
|
||||||
|
sessionStorage.setItem('RefreshToken', res.RefreshToken);
|
||||||
|
sessionStorage.setItem('JwtTokenExpiry', res.JwtTokenExpiry);
|
||||||
|
check ? window.location.href = "/Home/Dashboard" : '';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
check ? window.location.href = "/Home/Dashboard" : '';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
isTime1AfterTime2(time1, time2) {
|
||||||
|
const date1 = new Date(time1); // Create a Date object for time1
|
||||||
|
const date2 = new Date(time2); // Create a Date object for time2
|
||||||
|
return date1 < date2 ? true : false; // Compare the two Date objects
|
||||||
|
};
|
||||||
|
// ---------------------------------------------- Export file ----------------------------------------------
|
||||||
|
/**
|
||||||
|
* this function for download excel
|
||||||
|
* @param GetallData all data
|
||||||
|
* @param title_list header and property list
|
||||||
|
* @param file_name file name
|
||||||
|
*/
|
||||||
|
public exportExcel(GetallData, title_list, file_name) {
|
||||||
|
let bookResultResp = GetallData.map(el => {
|
||||||
|
let obj = {}
|
||||||
|
title_list.forEach(title => obj[title.header] = el[title.field])
|
||||||
|
return obj;
|
||||||
|
});
|
||||||
|
import("xlsx").then((xlsx) => {
|
||||||
|
console.log(xlsx);
|
||||||
|
const worksheet = xlsx.utils.json_to_sheet(bookResultResp);
|
||||||
|
const workbook = { Sheets: { data: worksheet }, SheetNames: ["data"] };
|
||||||
|
const excelBuffer: any = xlsx.write(workbook, {
|
||||||
|
bookType: "xlsx",
|
||||||
|
type: "array",
|
||||||
|
});
|
||||||
|
this.saveAsExcelFile(excelBuffer, file_name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param buffer
|
||||||
|
* @param fileName
|
||||||
|
*/
|
||||||
|
saveAsExcelFile(buffer: any, fileName: string): void {
|
||||||
|
import("file-saver").then((abc) => {
|
||||||
|
let EXCEL_TYPE =
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8";
|
||||||
|
let EXCEL_EXTENSION = ".xlsx";
|
||||||
|
const data: Blob = new Blob([buffer], {
|
||||||
|
type: EXCEL_TYPE,
|
||||||
|
});
|
||||||
|
console.log(FileSaver);
|
||||||
|
FileSaver.saveAs(
|
||||||
|
data,
|
||||||
|
fileName + "_export_" + new Date().getTime() + EXCEL_EXTENSION
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* this function for download PDF
|
||||||
|
* @param GetallData all data
|
||||||
|
* @param title_list header and property list
|
||||||
|
* @param file_name file name
|
||||||
|
*/
|
||||||
|
public exportPdf(GetallData, title_list, file_name) {
|
||||||
|
let bookResultResp = GetallData.map(el => {
|
||||||
|
let data_Array = [];
|
||||||
|
title_list.forEach(title => data_Array.push(el[title.field]))
|
||||||
|
return data_Array
|
||||||
|
});
|
||||||
|
let key_Array = [];
|
||||||
|
title_list.forEach(title => key_Array.push(title.header))
|
||||||
|
const head = [key_Array]
|
||||||
|
const doc = new jsPDF("l", "ex", [100, 280]);
|
||||||
|
autoTable(doc, {
|
||||||
|
head: head,
|
||||||
|
body: bookResultResp,
|
||||||
|
didDrawCell: (bookResultResp) => { },
|
||||||
|
});
|
||||||
|
doc.save(file_name);
|
||||||
|
}
|
||||||
|
// ---------------------------------------------- amount Formater ----------------------------------------------
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param amount
|
||||||
|
* @param amountFormat
|
||||||
|
* @param amountFormatDecimalSpliter
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
public amountFormater(amount, amountFormat, amountFormatDecimalSpliter) {
|
||||||
|
amountFormat = amountFormat != null && amountFormat != '' ? amountFormat : '#,###,###,###.##';
|
||||||
|
amountFormatDecimalSpliter = amountFormatDecimalSpliter != null && amountFormatDecimalSpliter != '' ? amountFormatDecimalSpliter : '.';
|
||||||
|
let outputAmount = amount;
|
||||||
|
let splitAmount = amount.toString().split('.');
|
||||||
|
let splitAmountFormat = amountFormat
|
||||||
|
.toString()
|
||||||
|
.split(amountFormatDecimalSpliter);
|
||||||
|
let amountSplitList =
|
||||||
|
splitAmount != null && splitAmount.length > 0
|
||||||
|
? splitAmount[0].split('').reverse()
|
||||||
|
: [];
|
||||||
|
let decimalAmountSplitList =
|
||||||
|
splitAmount != null && splitAmount.length > 1
|
||||||
|
? splitAmount[1].split('')
|
||||||
|
: [];
|
||||||
|
let amountFormatSplitList =
|
||||||
|
splitAmountFormat != null && splitAmountFormat.length > 0
|
||||||
|
? splitAmountFormat[0].split('').reverse()
|
||||||
|
: [];
|
||||||
|
let decimalAmountFormatSplitList =
|
||||||
|
splitAmountFormat != null && splitAmountFormat.length > 1
|
||||||
|
? splitAmountFormat[1].split('')
|
||||||
|
: [];
|
||||||
|
|
||||||
|
decimalAmountFormatSplitList.forEach((x, index) => {
|
||||||
|
decimalAmountFormatSplitList[index] = decimalAmountSplitList[index]
|
||||||
|
? decimalAmountSplitList[index]
|
||||||
|
: '0';
|
||||||
|
});
|
||||||
|
let amountSplitListTemp = [];
|
||||||
|
let amountIndex = 0;
|
||||||
|
amountFormatSplitList.forEach((x, index) => {
|
||||||
|
if (amountFormatSplitList[index] == '#' && amountSplitList[amountIndex]) {
|
||||||
|
amountSplitListTemp.push(amountSplitList[amountIndex]);
|
||||||
|
amountIndex += 1;
|
||||||
|
} else if (amountSplitList[amountIndex]) {
|
||||||
|
amountSplitListTemp.push(amountFormatSplitList[index]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (decimalAmountFormatSplitList && decimalAmountFormatSplitList.length > 0) {
|
||||||
|
outputAmount =
|
||||||
|
amountSplitListTemp.reverse().join('') +
|
||||||
|
amountFormatDecimalSpliter +
|
||||||
|
decimalAmountFormatSplitList.join('');
|
||||||
|
} else {
|
||||||
|
outputAmount =
|
||||||
|
amountSplitListTemp.reverse().join('')
|
||||||
|
}
|
||||||
|
return outputAmount;
|
||||||
|
}
|
||||||
|
// ---------------------------------------------- passsword update functions ---------------------------------------------------------
|
||||||
|
|
||||||
|
// This function for password criteria
|
||||||
|
password_criteria(password_Value) {
|
||||||
|
password_Value.length >= 8 ? this.password_criteria_obj.is_length = true : this.password_criteria_obj.is_length = false;
|
||||||
|
password_Value.match(this.validationService.regExps.lower_case) ? this.password_criteria_obj.is_lowerCase = true : this.password_criteria_obj.is_lowerCase = false;
|
||||||
|
password_Value.match(this.validationService.regExps.Capital_case) ? this.password_criteria_obj.is_Uppercase = true : this.password_criteria_obj.is_Uppercase = false;
|
||||||
|
password_Value.match(this.validationService.regExps.numbers) ? this.password_criteria_obj.is_numbers = true : this.password_criteria_obj.is_numbers = false;
|
||||||
|
password_Value.match(this.validationService.regExps.special_characters) ? this.password_criteria_obj.is_special_characters = true : this.password_criteria_obj.is_special_characters = false;
|
||||||
|
};
|
||||||
|
password_criteria_obj = {
|
||||||
|
is_lowerCase: false,
|
||||||
|
is_Uppercase: false,
|
||||||
|
is_Capital_case: false,
|
||||||
|
is_numbers: false,
|
||||||
|
is_special_characters: false,
|
||||||
|
is_length: false
|
||||||
|
};
|
||||||
|
|
||||||
|
public isFormControlHasError(e, validationType) {
|
||||||
|
let result = e.hasError(validationType) && (e.dirty || e.touched);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
// for create priority update array of object
|
||||||
|
// createPriorityObj(data, rule) {
|
||||||
|
// return data.map(e => ({ priority: e.priority, [rule]: e[rule] }));
|
||||||
|
// };
|
||||||
|
// /**
|
||||||
|
// * Updates the priority and sets the 'is_change' flag for an element in the given list
|
||||||
|
// * based on a specified rule identifier property.
|
||||||
|
// *
|
||||||
|
// * @param listToUpdate - The array of objects
|
||||||
|
// * @param targetRuleId - The value of the rule identifier to find the target element.
|
||||||
|
// * @param newPriority - The new priority value to set.
|
||||||
|
// * @param ruleIdProperty - The property name representing the rule identifier in each object.
|
||||||
|
// */
|
||||||
|
// updatePriorityByRuleId(listToUpdate, targetRuleId, newPriority, ruleIdProperty) {
|
||||||
|
// if (newPriority !== "") {
|
||||||
|
// const targetElement = listToUpdate.find(item => item[ruleIdProperty] === targetRuleId);
|
||||||
|
// if (targetElement) {
|
||||||
|
// targetElement.is_change = true;
|
||||||
|
// targetElement.priority = parseInt(newPriority);
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|
||||||
|
// -------------------------------------------------------------Date Formmat function --------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Converts a UTC date to a formatted local time string.
|
||||||
|
* @author Abdul Razzak
|
||||||
|
* @param date
|
||||||
|
* @param format
|
||||||
|
*/
|
||||||
|
UtcToLocaleTime(date, format = 'DD MMM YYYY, HH:mm:ss') {
|
||||||
|
let localeTime = moment.utc(date).local();
|
||||||
|
let formattedTime = localeTime.format(format);
|
||||||
|
return formattedTime;
|
||||||
|
}
|
||||||
|
GetTimeZoneGMT() {
|
||||||
|
let _date = new Date().getTimezoneOffset();
|
||||||
|
return `${((_date / 60) > 0 ? "-" : "+")}${Math.floor(Math.abs(_date / 60))} hours ${Math.abs(_date % 60)} minutes`
|
||||||
|
};
|
||||||
|
|
||||||
|
convertDateToSave(date: Date) {
|
||||||
|
return moment(date).format('YYYY-MM-DD') + 'T00:00:00Z'
|
||||||
|
};
|
||||||
|
convertDateToSaveWithoutTime(date: Date) {
|
||||||
|
return moment(date).format('YYYY-MM-DD')
|
||||||
|
};
|
||||||
|
convertDateWithTimeToShow(date: Date) {
|
||||||
|
return moment(date).format('DD MMM YYYY, HH:mm:ss')
|
||||||
|
};
|
||||||
|
convertDateToShow(date: Date) {
|
||||||
|
return moment(date).format('DD MMM YYYY')
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------- image update function ------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* for check image file
|
||||||
|
* @param file
|
||||||
|
* @param controls
|
||||||
|
* @param filedata
|
||||||
|
* @author Abdul Razzak
|
||||||
|
*/
|
||||||
|
checkImageFile(file, controls, filedata: FileUpload) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.readAsText(file); // Read as binary data
|
||||||
|
reader.onload = (e) => {
|
||||||
|
const binaryString = e.target.result as string;
|
||||||
|
const hasScriptTag = this.hasScriptTagInBinary(binaryString);
|
||||||
|
if (hasScriptTag) {
|
||||||
|
filedata.clear();
|
||||||
|
this.showMessage(false, 'Invalid file (contains script tag)');
|
||||||
|
} else {
|
||||||
|
controls.setValue(file);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Image script validation
|
||||||
|
* @author Abdul Razzak
|
||||||
|
*/
|
||||||
|
hasScriptTagInBinary(binaryData: string) {
|
||||||
|
// This is a simplified and potentially unreliable approach
|
||||||
|
const scriptTagRegex = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/g;
|
||||||
|
return scriptTagRegex.test(binaryData);
|
||||||
|
};
|
||||||
|
|
||||||
|
// ------------------------------------------------------------ api calls function---------------------------------------------------------
|
||||||
|
GetCurrencyList(val) {
|
||||||
|
if (val.length >= 2 || val == 'ALL') {
|
||||||
|
this.ddLoader.Currency = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
let request = {
|
||||||
|
"langcode": "en",
|
||||||
|
"query": val == 'ALL' ? '' : val
|
||||||
|
}
|
||||||
|
this.ApiServ.AdminGoPost(`/MasterSearch/GetAllCurrency`, request).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.CurrencyList = res?.Result;
|
||||||
|
this.ddLoader.Currency = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
};
|
||||||
|
if (!val) {
|
||||||
|
this.CurrencyList = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this function for get standalone feature by code
|
||||||
|
* @param pageId page id
|
||||||
|
*/
|
||||||
|
getFeatures(pageId) {
|
||||||
|
return this.ApiServ.Get("/MenuMasterNew/GetAllFeatureCode/2110180851430030870/" + pageId)
|
||||||
|
}
|
||||||
|
|
||||||
|
getCountryBySearch(val) {
|
||||||
|
if (val.length >= 2) {
|
||||||
|
this.ddLoader.country = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.ApiServ.AdminGet(`/MasterSearch/GetAllCountry/en/` + val).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.CountryList = res;
|
||||||
|
this.ddLoader.country = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
if (!val) {
|
||||||
|
this.CountryList = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// This function is used for country search by name.
|
||||||
|
|
||||||
|
checkCountryExist = false;
|
||||||
|
getCitySearchByCountryCode(val, country_code) {
|
||||||
|
if (country_code) {
|
||||||
|
this.checkCountryExist = false;
|
||||||
|
if (val.length >= 2) {
|
||||||
|
this.ddLoader.city = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.ApiServ.AdminGet(`/MasterSearch/GetCitySearch/en/${country_code}/` + val).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.CityList = res;
|
||||||
|
this.ddLoader.city = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
if (!val) {
|
||||||
|
this.CityList = [];
|
||||||
|
}
|
||||||
|
} else this.checkCountryExist = true;
|
||||||
|
};
|
||||||
|
ExtranetVendorMaster(val, check) {
|
||||||
|
if (val.length >= 2) {
|
||||||
|
this.ddLoader.vendor = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.FetchExtranetVendorMaster(val, check)
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
if (!val) {
|
||||||
|
this.AllVendor = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
FetchExtranetVendorMaster(val, check) {
|
||||||
|
let searchObj = {
|
||||||
|
vendor_name: check ? val : '',
|
||||||
|
extranet_vendor_id: !check ? val : '',
|
||||||
|
};
|
||||||
|
return this.ApiServ.AdminGoPost('/ExtranetVendorMaster/GetAll', searchObj)
|
||||||
|
};
|
||||||
|
loginOut() {
|
||||||
|
let loginData = sessionStorage.getItem('IP');
|
||||||
|
this.LoginUserData = JSON.parse(securityFunctions.getSessionStorage('LoginUserData'));
|
||||||
|
try {
|
||||||
|
let userLogModel = new UserLog();
|
||||||
|
userLogModel.ip = loginData['iP'];
|
||||||
|
userLogModel.ip_city = loginData['city'];
|
||||||
|
userLogModel.ip_country_code = loginData['countryCode'];
|
||||||
|
userLogModel.ip_lat = loginData['lat'];
|
||||||
|
userLogModel.ip_lon = loginData['lon'];
|
||||||
|
userLogModel.ip_proxy = loginData['proxy'];
|
||||||
|
userLogModel.user_id = this.LoginUserData.user_id;
|
||||||
|
userLogModel.user_type = this.LoginUserData.user_type;
|
||||||
|
this.ApiServ.AdminPost("/Log/SaveLogoutLog", userLogModel).subscribe(d => {
|
||||||
|
securityFunctions.resetSessionStoage('lastLogin')
|
||||||
|
securityFunctions.resetSessionStoage('LoginUserData')
|
||||||
|
securityFunctions.resetSessionStoage('IP')
|
||||||
|
securityFunctions.resetSessionStoage('userName')
|
||||||
|
securityFunctions.resetSessionStoage('JwtToken')
|
||||||
|
securityFunctions.resetSessionStoage('RefreshToken')
|
||||||
|
securityFunctions.resetSessionStoage('JwtTokenExpiry')
|
||||||
|
sessionStorage.removeItem('selMenu');
|
||||||
|
window.location.href = '/Auth/Login';
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
window.location.href = '/Auth/Login';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
displayPosition = false;
|
||||||
|
position: string;
|
||||||
|
public subscription: Subscription;
|
||||||
|
remainingTime: number;
|
||||||
|
StartTimer() {
|
||||||
|
const source = interval(1000);
|
||||||
|
// Subscribe to the interval observable
|
||||||
|
this.subscription = source.subscribe(() => {
|
||||||
|
// Get the current time in milliseconds
|
||||||
|
const currentTime = moment.utc(this.ApiServ.getAdjustedLocalTime()).valueOf();
|
||||||
|
const LastEndpointCallTime = moment.utc(sessionStorage.getItem('LastEndpointCallTime')).valueOf();
|
||||||
|
// Get the token expiry time from sessionStorage
|
||||||
|
const tokenExpiry = moment.utc(sessionStorage.getItem('JwtTokenExpiry'));
|
||||||
|
// Calculate the time difference between token expiry and current time in milliseconds
|
||||||
|
const timeDifference = tokenExpiry.valueOf() - currentTime;
|
||||||
|
// Calculate the diffence between current time and the last endpoint call time.
|
||||||
|
const diff_between_endpoint_call = currentTime - LastEndpointCallTime
|
||||||
|
|
||||||
|
// Check if time difference is less than or equal to 2 minutes (120000 milliseconds)
|
||||||
|
if (timeDifference <= 120000) {
|
||||||
|
if (this.displayPosition && this.remainingTime <= 0) {
|
||||||
|
this.exit();
|
||||||
|
} else {
|
||||||
|
if (diff_between_endpoint_call >= 780000) {
|
||||||
|
// If excd is not set and displayPosition is not already true, set displayPosition to true
|
||||||
|
if (!sessionStorage.getItem('excd') && !this.displayPosition) {
|
||||||
|
this.displayPosition = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate remaining time in seconds
|
||||||
|
const remainingTimeSeconds = tokenExpiry.diff(moment.utc(this.ApiServ.getAdjustedLocalTime()), 'seconds');
|
||||||
|
// Update remainingTime property
|
||||||
|
this.remainingTime = remainingTimeSeconds;
|
||||||
|
// If remaining time is less than or equal to 0, call exit function
|
||||||
|
if (this.remainingTime <= 0) {
|
||||||
|
this.exit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.extendJWTTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exit() {
|
||||||
|
this.displayPosition = false;
|
||||||
|
sessionStorage.removeItem('excd');
|
||||||
|
this.loginOut();
|
||||||
|
};
|
||||||
|
extendJWTTime() {
|
||||||
|
this.stopTimer();
|
||||||
|
let postdata = {
|
||||||
|
"JwtToken": sessionStorage.getItem('JwtToken'),
|
||||||
|
"RefreshToken": sessionStorage.getItem('RefreshToken')
|
||||||
|
};
|
||||||
|
this.ApiServ.AdminPost('/JWT/RefreshToken', postdata).subscribe(res => {
|
||||||
|
if (!res.Status) {
|
||||||
|
this.loginOut();
|
||||||
|
} else {
|
||||||
|
sessionStorage.setItem('JwtToken', res.JwtToken);
|
||||||
|
sessionStorage.setItem('RefreshToken', res.RefreshToken);
|
||||||
|
sessionStorage.setItem('JwtTokenExpiry', res.JwtTokenExpiry);
|
||||||
|
sessionStorage.setItem('RefreshTokenExpireAt', res.RefreshTokenExpireAt);
|
||||||
|
this.Close(true);
|
||||||
|
this.StartTimer();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
stopTimer() {
|
||||||
|
if (this.subscription) {
|
||||||
|
this.subscription.unsubscribe();
|
||||||
|
this.subscription = undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Close(check) {
|
||||||
|
this.displayPosition = false;
|
||||||
|
sessionStorage.setItem('excd', 'OK')
|
||||||
|
if (check) {
|
||||||
|
setTimeout(function () {
|
||||||
|
sessionStorage.removeItem('excd');
|
||||||
|
}, 10000); // 10000 milliseconds = 10 second
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AffiliateDetails(value, target, check, agencytype?, is_active?, is_cug?) {
|
||||||
|
let obj = {
|
||||||
|
AgencyId: check ? value : null,
|
||||||
|
AgencyName: !check ? value : ''
|
||||||
|
}
|
||||||
|
if (value.length >= 3) {
|
||||||
|
this.ddLoader[target] = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.ApiServ.PostGo(`/AgencyDetail/GetAllAffiliateDetail`, obj).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.agencyData = res.result;
|
||||||
|
if (agencytype) {
|
||||||
|
if (agencytype == '211526104324609556' || agencytype == '211526104324609557') {
|
||||||
|
if (agencytype == '211526104324609556') this.agencyData = this.agencyData.filter(z => z.AgencyType == 'B2C');
|
||||||
|
if (agencytype == '211526104324609557') this.agencyData = this.agencyData.filter(z => z.AgencyType == 'B2B');
|
||||||
|
}
|
||||||
|
else this.agencyData = this.agencyData.filter(z => z.AgencyType == agencytype);
|
||||||
|
};
|
||||||
|
if(is_active) this.agencyData = res.result.filter(z => z.AgencyType == 'B2B' && z.IsActive);
|
||||||
|
if(is_cug) this.agencyData = res.result.filter(z => (z.AgencyType === "B2B" || z.is_cug) && z.IsActive);
|
||||||
|
if(!is_active && is_cug) this.agencyData = res.result.filter(z => (z.AgencyType === "B2B" || z.is_cug));
|
||||||
|
this.ddLoader[target] = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
} else {
|
||||||
|
this.agencyData = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public amountDefiner(amount, definer) {
|
||||||
|
let outputAmount = amount;
|
||||||
|
let splitAmount = amount.toString().split(".");
|
||||||
|
if (splitAmount.length > 1 && splitAmount[1].length > 0) {
|
||||||
|
let decimals = splitAmount[1].substr(0, definer);
|
||||||
|
outputAmount = parseFloat(decimals.length > 0 ? `${splitAmount[0]}.${decimals}` : amount).toFixed(definer);
|
||||||
|
} else {
|
||||||
|
outputAmount = parseFloat(`${splitAmount[0]}.0}`).toFixed(definer)
|
||||||
|
}
|
||||||
|
return outputAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeaderSize(logoElem) {
|
||||||
|
const logo = logoElem.nativeElement;
|
||||||
|
let header_height = 0;
|
||||||
|
if (logo) {
|
||||||
|
header_height = logo.clientHeight;
|
||||||
|
}
|
||||||
|
return header_height;
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckActiveTabMenus(menulist){
|
||||||
|
this.AllMenu = menulist;
|
||||||
|
Object.keys(this.MenuTabList).forEach(e=>{
|
||||||
|
const Menu = menulist.find(d=>d.page_data.includes(this.MenuTabList[e].link));
|
||||||
|
if(Menu){
|
||||||
|
this.MenuTabList[e].val = true;
|
||||||
|
this.MenuTabList[e].Download = Menu.permission.Download;
|
||||||
|
this.MenuTabList[e].IsActive = Menu.permission.Status;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.onRouteChange();
|
||||||
|
this.router.events
|
||||||
|
.pipe(filter(event => event instanceof NavigationEnd)) // Filter to get NavigationEnd event
|
||||||
|
.subscribe(() => {
|
||||||
|
this.onRouteChange(); // Trigger your function
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
onRouteChange(): void {
|
||||||
|
const currentUrl = this.router.url;
|
||||||
|
const currentUrlMenu = this.AllMenu.find(d=>{
|
||||||
|
if(d.page_data){
|
||||||
|
const page_data = JSON.parse(d.page_data);
|
||||||
|
return page_data.some(e=>currentUrl.includes(e.page_url.replaceAll('/$','')))
|
||||||
|
}else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(currentUrlMenu){
|
||||||
|
this.DownloadFilesAllowed = currentUrlMenu.permission.Download;
|
||||||
|
this.ChangeStatusAllowed = currentUrlMenu.permission.Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
264
src/app/core/common/intercept-loader.service.ts
Normal file
264
src/app/core/common/intercept-loader.service.ts
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
import { HttpHandler, HttpRequest, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable, Subject, throwError } from 'rxjs';
|
||||||
|
import { catchError, exhaustMap, finalize, take } from 'rxjs/operators';
|
||||||
|
import * as moment from 'moment';
|
||||||
|
import { MessageService } from 'primeng/api';
|
||||||
|
import { LoaderService } from './loader.service';
|
||||||
|
import { API } from '../services/api.service';
|
||||||
|
import { securityFunctions } from './security';
|
||||||
|
import { UserLog } from '../models/common-model/user-logout.model';
|
||||||
|
import { UserLoginData } from '../models/common-model/userModel';
|
||||||
|
import { CommonFunctionService } from './common-function.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class InterceptLoader {
|
||||||
|
private readonly requests: HttpRequest<any>[] = [];
|
||||||
|
LoginUserData: UserLoginData
|
||||||
|
constructor(
|
||||||
|
private readonly loaderService: LoaderService,
|
||||||
|
private readonly apiServ: API,
|
||||||
|
public MsgService: MessageService,
|
||||||
|
private readonly commonService: CommonFunctionService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
removeRequest(req: HttpRequest<any>) {
|
||||||
|
const i = this.requests.indexOf(req);
|
||||||
|
if (i >= 0) {
|
||||||
|
this.requests.splice(i, 1);
|
||||||
|
}
|
||||||
|
if (!req.url.includes('RetryInvoice') && !req.url.includes('invoice/GetCustomer') && !req.url.includes('UserMachine/CheckUserVerified')) {
|
||||||
|
this.loaderService.isLoading.next(this.requests.length > 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private readonly refreshToken$ = new Subject<void>();
|
||||||
|
private refreshInProgress = false;
|
||||||
|
intercept(req: HttpRequest<any>, next: HttpHandler) {
|
||||||
|
const modifiedRequest = this.headerSetup(req);
|
||||||
|
const adjustedTime = this.apiServ.getAdjustedLocalTime(); // Get adjusted local time
|
||||||
|
const currentISOString = moment.utc(adjustedTime).format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const time1 = moment.utc(sessionStorage.getItem('JwtTokenExpiry')).subtract(3, 'seconds').format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const isTime1AfterTime2 = this.isTime1AfterTime2(time1, currentISOString);
|
||||||
|
const isRefreshTokenUrl = req.url.toLowerCase().includes('/jwt/refreshtoken');
|
||||||
|
const isLogoutLogUrl = req.url.toLowerCase().includes('/log/savelogoutlog');
|
||||||
|
let UGT = sessionStorage.getItem('UGT');
|
||||||
|
const isServerUTCTimeUrl = req.url.includes('/Server/GetServerUTCTime');
|
||||||
|
if (((isTime1AfterTime2) && !isRefreshTokenUrl && !isLogoutLogUrl) || (!UGT && !isServerUTCTimeUrl)) {
|
||||||
|
// If a token refresh is in progress, wait for it to complete before proceeding
|
||||||
|
if (this.refreshInProgress) {
|
||||||
|
return this.refreshToken$.pipe(
|
||||||
|
take(1),
|
||||||
|
exhaustMap(() => {
|
||||||
|
const modifiedRequest = this.headerSetup(req);
|
||||||
|
this.requests.push(modifiedRequest);
|
||||||
|
if (!req.url.includes('RetryInvoice') && !req.url.includes('invoice/GetCustomer') && !req.url.includes('UserMachine/CheckUserVerified')) {
|
||||||
|
this.loaderService.isLoading.next(true);
|
||||||
|
}
|
||||||
|
return this.ObservableReturn(modifiedRequest, next)
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// Trigger token refresh and queue other requests
|
||||||
|
this.refreshInProgress = true;
|
||||||
|
this.refreshToken$.next();
|
||||||
|
if (!UGT && !isServerUTCTimeUrl) {
|
||||||
|
return this.GetServerTime(req, next);
|
||||||
|
} else {
|
||||||
|
return this.GetJWTToKen(req, next);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.requests.push(modifiedRequest);
|
||||||
|
if (!req.url.includes('RetryInvoice') && !req.url.includes('invoice/GetCustomer') && !req.url.includes('UserMachine/CheckUserVerified')) {
|
||||||
|
this.loaderService.isLoading.next(true);
|
||||||
|
}
|
||||||
|
return this.ObservableReturn(modifiedRequest, next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
isTime1AfterTime2(time1, time2) {
|
||||||
|
const date1 = new Date(time1); // Create a Date object for time1
|
||||||
|
const date2 = new Date(time2); // Create a Date object for time2
|
||||||
|
return date1 < date2 ? true : false; // Compare the two Date objects
|
||||||
|
}
|
||||||
|
|
||||||
|
ObservableReturn(req, next) {
|
||||||
|
return Observable.create(observer => {
|
||||||
|
const subscription = next.handle(req).subscribe(
|
||||||
|
event => {
|
||||||
|
if (event instanceof HttpResponse) {
|
||||||
|
|
||||||
|
this.removeRequest(req);
|
||||||
|
observer.next(event);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
if (err.status === 401) {
|
||||||
|
// Response status is 401, so you can run your function here
|
||||||
|
const customResponse = err; // Pass the response to your function
|
||||||
|
// updated by Abdul Razzak on 23 mar 2024
|
||||||
|
if (err.url.toLowerCase().includes('/log/savelogoutlog')) {
|
||||||
|
window.location.href = '/Auth/Login';
|
||||||
|
} else {
|
||||||
|
this.handleUnauthorizedResponse(customResponse.error); // Replace this with your actual function
|
||||||
|
}
|
||||||
|
this.removeRequest(req);
|
||||||
|
} else if (err.status === 429) {
|
||||||
|
this.MsgService.add({
|
||||||
|
severity: "error",
|
||||||
|
detail: err.error["metadata"]?.message ? err.error["metadata"]?.message : 'Service is currently unavailable',
|
||||||
|
});
|
||||||
|
this.removeRequest(req);
|
||||||
|
} else {
|
||||||
|
this.removeRequest(req);
|
||||||
|
console.log('error' + err);
|
||||||
|
observer.error(err);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.removeRequest(req);
|
||||||
|
observer.complete();
|
||||||
|
});
|
||||||
|
// remove request from queue when cancelled
|
||||||
|
return () => {
|
||||||
|
this.removeRequest(req);
|
||||||
|
subscription.unsubscribe();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleUnauthorizedResponse(Response) {
|
||||||
|
if (Response.AuthResponseType == 2 || Response.AuthResponseType == 1 || Response.AuthResponseType == 4 || Response.AuthResponseType == 5 || Response.AuthResponseType == 6 || Response.AuthResponseType == 7 || Response.AuthResponseType == 8) {
|
||||||
|
this.loginOut();
|
||||||
|
}
|
||||||
|
if (Response.AuthResponseType == 3) {
|
||||||
|
this.MsgService.add({
|
||||||
|
severity: "error",
|
||||||
|
detail: Response["message"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loginOut() {
|
||||||
|
let loginData = sessionStorage.getItem('IP');
|
||||||
|
let LoginUserData = JSON.parse(securityFunctions.getSessionStorage('LoginUserData'));
|
||||||
|
try {
|
||||||
|
let userLogModel = new UserLog();
|
||||||
|
userLogModel.ip = loginData['iP'];
|
||||||
|
userLogModel.ip_city = loginData['city'];
|
||||||
|
userLogModel.ip_country_code = loginData['countryCode'];
|
||||||
|
userLogModel.ip_lat = loginData['lat'];
|
||||||
|
userLogModel.ip_lon = loginData['lon'];
|
||||||
|
userLogModel.ip_proxy = loginData['proxy'];
|
||||||
|
userLogModel.user_id = LoginUserData.user_id;
|
||||||
|
userLogModel.user_type = LoginUserData.user_type;
|
||||||
|
this.apiServ.AdminPost("/Log/SaveLogoutLog", userLogModel).subscribe(d => {
|
||||||
|
securityFunctions.resetSessionStoage('lastLogin')
|
||||||
|
securityFunctions.resetSessionStoage('LoginUserData')
|
||||||
|
securityFunctions.resetSessionStoage('IP')
|
||||||
|
securityFunctions.resetSessionStoage('userName')
|
||||||
|
securityFunctions.resetSessionStoage('userType')
|
||||||
|
securityFunctions.resetSessionStoage('JwtToken')
|
||||||
|
securityFunctions.resetSessionStoage('RefreshToken')
|
||||||
|
securityFunctions.resetSessionStoage('JwtTokenExpiry')
|
||||||
|
sessionStorage.removeItem('selMenu');
|
||||||
|
window.location.href = '/Auth/Login';
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
window.location.href = '/Auth/Login';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GetJWTToKen(req,next) {
|
||||||
|
let postdata = {
|
||||||
|
"JwtToken": sessionStorage.getItem('JwtToken'),
|
||||||
|
"RefreshToken": sessionStorage.getItem('RefreshToken')
|
||||||
|
};
|
||||||
|
return this.apiServ.AdminPost('/JWT/RefreshToken', postdata).pipe(
|
||||||
|
catchError((error) => {
|
||||||
|
// return throwError(error);
|
||||||
|
if (error.status === 401) {
|
||||||
|
// Response status is 401, so you can run your function here
|
||||||
|
const customResponse = error; // Pass the response to your function
|
||||||
|
// updated by Abdul Razzak on 04 apr 2024
|
||||||
|
this.handleUnauthorizedResponse(customResponse.error); // Replace this with your actual function
|
||||||
|
this.removeRequest(req);
|
||||||
|
return throwError(error);
|
||||||
|
} else {
|
||||||
|
console.log('Error:', error);
|
||||||
|
this.removeRequest(req);
|
||||||
|
return throwError(error);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
finalize(() => {
|
||||||
|
this.refreshInProgress = false;
|
||||||
|
this.refreshToken$.next(); // Signal completion of token refresh
|
||||||
|
}),
|
||||||
|
exhaustMap((res: any) => {
|
||||||
|
if (!res.Status) {
|
||||||
|
this.loginOut();
|
||||||
|
const modifiedRequest = this.headerSetup(req);
|
||||||
|
this.requests.push(modifiedRequest);
|
||||||
|
} else {
|
||||||
|
sessionStorage.setItem('JwtToken', res.JwtToken);
|
||||||
|
sessionStorage.setItem('RefreshToken', res.RefreshToken);
|
||||||
|
sessionStorage.setItem('JwtTokenExpiry', res.JwtTokenExpiry);
|
||||||
|
const modifiedRequest = this.headerSetup(req);
|
||||||
|
if (!req.url.includes('RetryInvoice') && !req.url.includes('invoice/GetCustomer') && !req.url.includes('UserMachine/CheckUserVerified') && !req.url.toLowerCase().includes('/jwt/refreshtoken')) {
|
||||||
|
this.loaderService.isLoading.next(true);
|
||||||
|
}
|
||||||
|
this.commonService.StartTimer();
|
||||||
|
return this.ObservableReturn(modifiedRequest, next);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetServerTime(req, next) {
|
||||||
|
return this.apiServ.GetGo('/Server/GetServerUTCTime').pipe(
|
||||||
|
catchError((error) => {
|
||||||
|
console.log('Error:', error);
|
||||||
|
this.removeRequest(req);
|
||||||
|
return throwError(error);
|
||||||
|
}),
|
||||||
|
finalize(() => {
|
||||||
|
this.refreshInProgress = false;
|
||||||
|
this.refreshToken$.next(); // Signal completion of token refresh
|
||||||
|
}),
|
||||||
|
exhaustMap((res) => {
|
||||||
|
this.SetuserLocalGapTime(res)
|
||||||
|
this.loaderService.isLoading.next(true);
|
||||||
|
let modifiedRequest = this.headerSetup(req);
|
||||||
|
return this.ObservableReturn(modifiedRequest, next);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
SetuserLocalGapTime(data) {
|
||||||
|
let gaptime = data.server_utc_time - new Date().getTime();
|
||||||
|
sessionStorage.setItem('UGT', gaptime.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
headerSetup(req) {
|
||||||
|
this.LoginUserData = securityFunctions.getSessionStorage('LoginUserData') ? JSON.parse(securityFunctions.getSessionStorage('LoginUserData')) : '';
|
||||||
|
let domain = document.location.host
|
||||||
|
// let domain = 'extranet.dev.futuretravelplatform.com'
|
||||||
|
let domainName = domain.replace(/^(https?:\/\/)?/, '');
|
||||||
|
const adjustedTime = this.apiServ.getAdjustedLocalTime(); // Get adjusted local time
|
||||||
|
// Handle vendor id in token
|
||||||
|
// Don't remove '~' as there was a length undefined in the API to get vendor id
|
||||||
|
let domain_time = domainName + '~' + adjustedTime + '~' + '' + '~' + '' + '~' + '' + '~' + (this.LoginUserData ? this.LoginUserData.extranet_vendor_id : '');
|
||||||
|
let key = securityFunctions.rsa_public_key;
|
||||||
|
let encrypted_string = securityFunctions.encryptRSA(key, domain_time).toString();
|
||||||
|
if (!req.url.toLowerCase().includes('/jwt/refreshtoken')) {
|
||||||
|
sessionStorage.setItem('LastEndpointCallTime', moment.utc(adjustedTime).format('YYYY-MM-DD HH:mm:ss'));
|
||||||
|
}
|
||||||
|
return req.clone({
|
||||||
|
setHeaders: {
|
||||||
|
'Authorization': 'Bearer ' + sessionStorage.getItem('JwtToken'),
|
||||||
|
'token': encrypted_string
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
src/app/core/common/loader.service.ts
Normal file
11
src/app/core/common/loader.service.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { BehaviorSubject } from 'rxjs';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class LoaderService {
|
||||||
|
|
||||||
|
public isLoading = new BehaviorSubject(false);
|
||||||
|
constructor() { }
|
||||||
|
}
|
||||||
154
src/app/core/common/security.ts
Normal file
154
src/app/core/common/security.ts
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
import * as CryptoJS from 'crypto-js';
|
||||||
|
import { JSEncrypt } from 'jsencrypt';
|
||||||
|
export class securityFunctions {
|
||||||
|
|
||||||
|
static yek = "$uPer@dm1n~dI@z7";
|
||||||
|
static sayek = "$uper@dmin~diaZ1"
|
||||||
|
static savi = "$uper@dmin~diaZ1"
|
||||||
|
static rsa_public_key = `-----BEGIN PUBLIC KEY-----
|
||||||
|
MIICITANBgkqhkiG9w0BAQEFAAOCAg4AMIICCQKCAgB0rRSHGZK/FtK15IRfQxtl
|
||||||
|
dN5ToPtfXGzTNBe1vGhow5xqp6BLubMKKPwCj3zOJiAm1Ip1VNqqYxWnaL8ZErBF
|
||||||
|
rErtE0r7kn50QgGgJCpdrWJ4unhaoe1su207d9oY6D6OBH90v1aXA6ZjN7zTJmiq
|
||||||
|
FJZOOTQE6t/XwNAOphq/B6Lcr1iQSQmSqaMozy4OQ4NvIzNTQn5tcs9qJBMsKFeU
|
||||||
|
cSp8VK76JBNEqSuEHNmbV2d/IQ5XAqVUiAs34kH2xWRSbBmy0WK3c3QKGzC1MRWM
|
||||||
|
9JauLN56TKUFOmUSjfWY3caJru6HxsiMTGKnvflXHfgA2aLAPxu72pIHoCTy5Hxj
|
||||||
|
AUoKM7qXUn/kQj4Ci0M/0LRF4boqd37wpbyVNeXNvqm+dLjxklf/+NHMfNL2Wvb4
|
||||||
|
ekHUVI8nMVPgswIcQ7q/Njf9DC+LA+/duf8m9JDjI3J6r9y1gQugdkLETGzF2Gj1
|
||||||
|
ToU0Pocrg6CFHImqq2z+cOeWnURrV0f0I1UWWGCb79OZxZ5oDjM9uCLRsoe8+Npg
|
||||||
|
ACZNf4AbnM7OUNj5TEYs6t/tUYouvTB7gH452I3EH6KWBl+ZTgCg0RFkOMazNOjn
|
||||||
|
4J0yfbaPvpVgKzF2WRyn63mTO2tdLRl5s9uqMFhXmCs6IzEqBpxMKL1aS6ONZLDG
|
||||||
|
5qPtpCPJnUFQEBTVlSO15QIDAQAB
|
||||||
|
-----END PUBLIC KEY-----`
|
||||||
|
/**
|
||||||
|
* encrypting text using cryptoJS with 128/8 key size
|
||||||
|
* used CBC mode
|
||||||
|
* used Pkcs7 padding
|
||||||
|
* returning encrypted text
|
||||||
|
* @param plainText text to be encrypted
|
||||||
|
*/
|
||||||
|
//encrypt text using AES
|
||||||
|
public static encryptText(plainText) {
|
||||||
|
var key = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
var iv = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
|
||||||
|
var encryptedText = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(plainText), key,
|
||||||
|
{
|
||||||
|
keySize: 128 / 8,
|
||||||
|
iv: iv,
|
||||||
|
mode: CryptoJS.mode.CBC,
|
||||||
|
padding: CryptoJS.pad.Pkcs7
|
||||||
|
}).toString();
|
||||||
|
return encryptedText;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* decryption method for decrypt text that was decrypted in encrypt text method
|
||||||
|
* @param cipherText text to be encrypt
|
||||||
|
*/
|
||||||
|
//decrypt cypher text using AES
|
||||||
|
public static decryptText(cipherText) {
|
||||||
|
var key = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
var iv = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
|
||||||
|
var decryptedText = CryptoJS.AES.decrypt(cipherText, key,
|
||||||
|
{
|
||||||
|
keySize: 128 / 8,
|
||||||
|
iv: iv,
|
||||||
|
mode: CryptoJS.mode.CBC,
|
||||||
|
padding: CryptoJS.pad.Pkcs7
|
||||||
|
}).toString(CryptoJS.enc.Utf8);
|
||||||
|
return decryptedText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static setLocalStoage(key: string, value) {
|
||||||
|
localStorage.setItem(key, this.encryptText(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static getLocalStoage(key: string) {
|
||||||
|
var value = localStorage.getItem(key);
|
||||||
|
if (value) {
|
||||||
|
return this.decryptText(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static setSessionStorage(key: string, value) {
|
||||||
|
sessionStorage.setItem(key, this.encryptText(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static getSessionStorage(key: string) {
|
||||||
|
var value = sessionStorage.getItem(key);
|
||||||
|
if (value) {
|
||||||
|
return this.decryptText(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static resetLocalStoage(key: string) {
|
||||||
|
localStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
public static resetSessionStoage(key: string) {
|
||||||
|
sessionStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
public static getSaUrlKey(userId) {
|
||||||
|
var key = CryptoJS.enc.Utf8.parse(this.sayek);
|
||||||
|
var iv = CryptoJS.enc.Utf8.parse(this.savi);
|
||||||
|
|
||||||
|
var encryptedText = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(userId), key,
|
||||||
|
{
|
||||||
|
keySize: 128 / 8,
|
||||||
|
iv: iv,
|
||||||
|
mode: CryptoJS.mode.CBC,
|
||||||
|
padding: CryptoJS.pad.Pkcs7
|
||||||
|
}).toString();
|
||||||
|
return encryptedText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DecryptReq(data) {
|
||||||
|
var key = CryptoJS.enc.Utf8.parse(this.sayek);
|
||||||
|
var iv = CryptoJS.enc.Utf8.parse(this.savi);
|
||||||
|
|
||||||
|
// encrypt data using AES
|
||||||
|
var encrypted = CryptoJS.AES.decrypt(data, key, { iv: iv });
|
||||||
|
|
||||||
|
return encrypted.toString(CryptoJS.enc.Utf8)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to add restrict for priority
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
checkLength(e, input) {
|
||||||
|
const functionalKeys = ['Backspace', 'ArrowRight', 'ArrowLeft'];
|
||||||
|
if (functionalKeys.indexOf(e.key) !== -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const keyValue = +e.key;
|
||||||
|
if (isNaN(keyValue)) {
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let newValue;
|
||||||
|
newValue = input.value + keyValue.toString();
|
||||||
|
if (+newValue > 100 || +newValue == 0 || newValue.length > 3) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static EncryptReq(data) {
|
||||||
|
var key = CryptoJS.enc.Utf8.parse(this.sayek);
|
||||||
|
var iv = CryptoJS.enc.Utf8.parse(this.savi);
|
||||||
|
|
||||||
|
// encrypt data using AES
|
||||||
|
var encrypted = CryptoJS.AES.encrypt(data, key, { iv: iv });
|
||||||
|
|
||||||
|
// convert encrypted data to base64 string for transport
|
||||||
|
var encryptedBase64 = encrypted.toString();
|
||||||
|
return encryptedBase64
|
||||||
|
}
|
||||||
|
|
||||||
|
public static encryptRSA(publicKey: string, jsonString: string) {
|
||||||
|
const encryptor = new JSEncrypt();
|
||||||
|
encryptor.setPublicKey(publicKey);
|
||||||
|
|
||||||
|
const encrypted = encryptor.encrypt(jsonString);
|
||||||
|
|
||||||
|
return encrypted;
|
||||||
|
}
|
||||||
|
}
|
||||||
269
src/app/core/common/static-data.service.ts
Normal file
269
src/app/core/common/static-data.service.ts
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class StaticDataService {
|
||||||
|
|
||||||
|
ActivityOverViewtab = 0;
|
||||||
|
Hours = [
|
||||||
|
{ id: 0, name: '00' },
|
||||||
|
{ id: 1, name: '01' },
|
||||||
|
{ id: 2, name: '02' },
|
||||||
|
{ id: 3, name: '03' },
|
||||||
|
{ id: 4, name: '04' },
|
||||||
|
{ id: 5, name: '05' },
|
||||||
|
{ id: 6, name: '06' },
|
||||||
|
{ id: 7, name: '07' },
|
||||||
|
{ id: 8, name: '08' },
|
||||||
|
{ id: 9, name: '09' },
|
||||||
|
{ id: 10, name: '10' },
|
||||||
|
{ id: 11, name: '11' },
|
||||||
|
{ id: 12, name: '12' },
|
||||||
|
{ id: 13, name: '13' },
|
||||||
|
{ id: 14, name: '14' },
|
||||||
|
{ id: 15, name: '15' },
|
||||||
|
{ id: 16, name: '16' },
|
||||||
|
{ id: 17, name: '17' },
|
||||||
|
{ id: 18, name: '18' },
|
||||||
|
{ id: 19, name: '19' },
|
||||||
|
{ id: 20, name: '20' },
|
||||||
|
{ id: 21, name: '21' },
|
||||||
|
{ id: 22, name: '22' },
|
||||||
|
{ id: 23, name: '23' },
|
||||||
|
];
|
||||||
|
HoursAndMinutes = [
|
||||||
|
{ hour: '00', minute: '00' },
|
||||||
|
{ hour: '00', minute: '30' },
|
||||||
|
{ hour: '01', minute: '00' },
|
||||||
|
{ hour: '01', minute: '30' },
|
||||||
|
{ hour: '02', minute: '00' },
|
||||||
|
{ hour: '02', minute: '30' },
|
||||||
|
{ hour: '03', minute: '00' },
|
||||||
|
{ hour: '03', minute: '30' },
|
||||||
|
{ hour: '04', minute: '00' },
|
||||||
|
{ hour: '04', minute: '30' },
|
||||||
|
{ hour: '05', minute: '00' },
|
||||||
|
{ hour: '05', minute: '30' },
|
||||||
|
{ hour: '06', minute: '00' },
|
||||||
|
{ hour: '06', minute: '30' },
|
||||||
|
{ hour: '07', minute: '00' },
|
||||||
|
{ hour: '07', minute: '30' },
|
||||||
|
{ hour: '08', minute: '00' },
|
||||||
|
{ hour: '08', minute: '30' },
|
||||||
|
{ hour: '09', minute: '00' },
|
||||||
|
{ hour: '09', minute: '30' },
|
||||||
|
{ hour: '10', minute: '00' },
|
||||||
|
{ hour: '10', minute: '30' },
|
||||||
|
{ hour: '11', minute: '00' },
|
||||||
|
{ hour: '11', minute: '30' },
|
||||||
|
{ hour: '12', minute: '00' },
|
||||||
|
{ hour: '12', minute: '30' },
|
||||||
|
{ hour: '13', minute: '00' },
|
||||||
|
{ hour: '13', minute: '30' },
|
||||||
|
{ hour: '14', minute: '00' },
|
||||||
|
{ hour: '14', minute: '30' },
|
||||||
|
{ hour: '15', minute: '00' },
|
||||||
|
{ hour: '15', minute: '30' },
|
||||||
|
{ hour: '16', minute: '00' },
|
||||||
|
{ hour: '16', minute: '30' },
|
||||||
|
{ hour: '17', minute: '00' },
|
||||||
|
{ hour: '17', minute: '30' },
|
||||||
|
{ hour: '18', minute: '00' },
|
||||||
|
{ hour: '18', minute: '30' },
|
||||||
|
{ hour: '19', minute: '00' },
|
||||||
|
{ hour: '19', minute: '30' },
|
||||||
|
{ hour: '20', minute: '00' },
|
||||||
|
{ hour: '20', minute: '30' },
|
||||||
|
{ hour: '21', minute: '00' },
|
||||||
|
{ hour: '21', minute: '30' },
|
||||||
|
{ hour: '22', minute: '00' },
|
||||||
|
{ hour: '22', minute: '30' },
|
||||||
|
{ hour: '23', minute: '00' },
|
||||||
|
{ hour: '23', minute: '30' },
|
||||||
|
];
|
||||||
|
days = [
|
||||||
|
{ id: 0, name: '00' },
|
||||||
|
{ id: 1, name: '01' },
|
||||||
|
{ id: 2, name: '02' },
|
||||||
|
{ id: 3, name: '03' },
|
||||||
|
{ id: 4, name: '04' },
|
||||||
|
{ id: 5, name: '05' },
|
||||||
|
{ id: 6, name: '06' },
|
||||||
|
{ id: 7, name: '07' },
|
||||||
|
{ id: 8, name: '08' },
|
||||||
|
{ id: 9, name: '09' },
|
||||||
|
{ id: 10, name: '10' },
|
||||||
|
{ id: 11, name: '11' },
|
||||||
|
{ id: 12, name: '12' },
|
||||||
|
{ id: 13, name: '13' },
|
||||||
|
{ id: 14, name: '14' },
|
||||||
|
{ id: 15, name: '15' },
|
||||||
|
{ id: 16, name: '16' },
|
||||||
|
{ id: 17, name: '17' },
|
||||||
|
{ id: 18, name: '18' },
|
||||||
|
{ id: 19, name: '19' },
|
||||||
|
{ id: 20, name: '20' },
|
||||||
|
{ id: 21, name: '21' },
|
||||||
|
{ id: 22, name: '22' },
|
||||||
|
{ id: 23, name: '23' },
|
||||||
|
{ id: 24, name: '24' },
|
||||||
|
{ id: 25, name: '25' },
|
||||||
|
{ id: 26, name: '26' },
|
||||||
|
{ id: 27, name: '27' },
|
||||||
|
{ id: 28, name: '28' },
|
||||||
|
{ id: 29, name: '29' },
|
||||||
|
{ id: 30, name: '30' },
|
||||||
|
{ id: 31, name: '31' }
|
||||||
|
];
|
||||||
|
minutes = [
|
||||||
|
{ id: 0, name: '00' },
|
||||||
|
{ id: 1, name: '01' },
|
||||||
|
{ id: 2, name: '02' },
|
||||||
|
{ id: 3, name: '03' },
|
||||||
|
{ id: 4, name: '04' },
|
||||||
|
{ id: 5, name: '05' },
|
||||||
|
{ id: 6, name: '06' },
|
||||||
|
{ id: 7, name: '07' },
|
||||||
|
{ id: 8, name: '08' },
|
||||||
|
{ id: 9, name: '09' },
|
||||||
|
{ id: 10, name: '10' },
|
||||||
|
{ id: 11, name: '11' },
|
||||||
|
{ id: 12, name: '12' },
|
||||||
|
{ id: 13, name: '13' },
|
||||||
|
{ id: 14, name: '14' },
|
||||||
|
{ id: 15, name: '15' },
|
||||||
|
{ id: 16, name: '16' },
|
||||||
|
{ id: 17, name: '17' },
|
||||||
|
{ id: 18, name: '18' },
|
||||||
|
{ id: 19, name: '19' },
|
||||||
|
{ id: 20, name: '20' },
|
||||||
|
{ id: 21, name: '21' },
|
||||||
|
{ id: 22, name: '22' },
|
||||||
|
{ id: 23, name: '23' },
|
||||||
|
{ id: 24, name: '24' },
|
||||||
|
{ id: 25, name: '25' },
|
||||||
|
{ id: 26, name: '26' },
|
||||||
|
{ id: 27, name: '27' },
|
||||||
|
{ id: 28, name: '28' },
|
||||||
|
{ id: 29, name: '29' },
|
||||||
|
{ id: 30, name: '30' },
|
||||||
|
{ id: 31, name: '31' },
|
||||||
|
{ id: 32, name: '32' },
|
||||||
|
{ id: 33, name: '33' },
|
||||||
|
{ id: 34, name: '34' },
|
||||||
|
{ id: 35, name: '35' },
|
||||||
|
{ id: 36, name: '36' },
|
||||||
|
{ id: 37, name: '37' },
|
||||||
|
{ id: 38, name: '38' },
|
||||||
|
{ id: 39, name: '39' },
|
||||||
|
{ id: 40, name: '40' },
|
||||||
|
{ id: 41, name: '41' },
|
||||||
|
{ id: 42, name: '42' },
|
||||||
|
{ id: 43, name: '43' },
|
||||||
|
{ id: 44, name: '44' },
|
||||||
|
{ id: 45, name: '45' },
|
||||||
|
{ id: 46, name: '46' },
|
||||||
|
{ id: 47, name: '47' },
|
||||||
|
{ id: 48, name: '48' },
|
||||||
|
{ id: 49, name: '49' },
|
||||||
|
{ id: 50, name: '50' },
|
||||||
|
{ id: 51, name: '51' },
|
||||||
|
{ id: 52, name: '52' },
|
||||||
|
{ id: 53, name: '53' },
|
||||||
|
{ id: 54, name: '54' },
|
||||||
|
{ id: 55, name: '55' },
|
||||||
|
{ id: 56, name: '56' },
|
||||||
|
{ id: 57, name: '57' },
|
||||||
|
{ id: 58, name: '58' },
|
||||||
|
{ id: 59, name: '59' },
|
||||||
|
];
|
||||||
|
AtoZ = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
|
||||||
|
WeekDaysList = [
|
||||||
|
{
|
||||||
|
"ItemKey": "MONDAY",
|
||||||
|
"Itemkey2": "Monday",
|
||||||
|
"ItemToDisplay": "Mon",
|
||||||
|
"ItemOrder": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ItemKey": "TUESDAY",
|
||||||
|
"Itemkey2": "Tuesday",
|
||||||
|
"ItemToDisplay": "Tue",
|
||||||
|
"ItemOrder": 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ItemKey": "WEDNESDAY",
|
||||||
|
"Itemkey2": "Wednesday",
|
||||||
|
"ItemToDisplay": "Wed",
|
||||||
|
"ItemOrder": 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ItemKey": "THURSDAY",
|
||||||
|
"Itemkey2": "Thursday",
|
||||||
|
"ItemToDisplay": "Thu",
|
||||||
|
"ItemOrder": 4,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ItemKey": "FRIDAY",
|
||||||
|
"Itemkey2": "Friday",
|
||||||
|
"ItemToDisplay": "Fri",
|
||||||
|
"ItemOrder": 5,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ItemKey": "SATURDAY",
|
||||||
|
"Itemkey2": "Saturday",
|
||||||
|
"ItemToDisplay": "Sat",
|
||||||
|
"ItemOrder": 6,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ItemKey": "SUNDAY",
|
||||||
|
"Itemkey2": "Sunday",
|
||||||
|
"ItemToDisplay": "Sun",
|
||||||
|
"ItemOrder": 7,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
// flight contract
|
||||||
|
CabinsClassType = [
|
||||||
|
{ value: 'Y', displayName: 'Economy' },
|
||||||
|
{ value: 'W', displayName: 'Premium Economy' },
|
||||||
|
{ value: 'C', displayName: 'Business Class' },
|
||||||
|
{ value: 'F', displayName: 'First Class' },
|
||||||
|
];
|
||||||
|
RefundType = [
|
||||||
|
{ value: 'REFUNDABLE', displayName: 'Refundable' },
|
||||||
|
{ value: 'NONREFUNDABLE', displayName: 'Non-Refundable' },
|
||||||
|
];
|
||||||
|
ConfirmationType = [
|
||||||
|
{ value: 'YES', displayName: 'Instant' },
|
||||||
|
{ value: 'NO', displayName: 'Manual' },
|
||||||
|
];
|
||||||
|
PaxTypes = [
|
||||||
|
{ value: 'A', displayName: 'Adult' },
|
||||||
|
{ value: 'C', displayName: 'Child' },
|
||||||
|
{ value: 'I', displayName: 'Infant' },
|
||||||
|
];
|
||||||
|
AmountType = [
|
||||||
|
{ value: 'FIXED', displayName: 'Fixed' },
|
||||||
|
{ value: 'PERCENTAGE', displayName: 'Percentage' },
|
||||||
|
];
|
||||||
|
BagUnit = [
|
||||||
|
{ value: 'KG', displayName: 'KG' },
|
||||||
|
{ value: 'POUNDS', displayName: 'Pounds' },
|
||||||
|
{ value: 'PIECE', displayName: 'Piece' },
|
||||||
|
{ value: 'TEXT', displayName: 'Text' },
|
||||||
|
];
|
||||||
|
dateType = [
|
||||||
|
{ value: '1', displayName: 'Departure Date' },
|
||||||
|
{ value: '2', displayName: 'Return Date' },
|
||||||
|
];
|
||||||
|
FareTypeApp = [
|
||||||
|
{ value: 'ONEWAY', displayName: 'Oneway Only' },
|
||||||
|
{ value: 'ROUNDTRIP', displayName: 'Roundtrip / Multicity Only' },
|
||||||
|
{ value: 'BOTH', displayName: 'Both' },
|
||||||
|
];
|
||||||
|
Confirmation_Type = [
|
||||||
|
{ value: 'INSTANT', displayName: 'Instant' },
|
||||||
|
{ value: 'MANUAL', displayName: 'Manual' },
|
||||||
|
];
|
||||||
|
}
|
||||||
156
src/app/core/common/validation.service.ts
Normal file
156
src/app/core/common/validation.service.ts
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { AbstractControl, FormControl, ValidatorFn, Validators } from '@angular/forms';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
|
||||||
|
export class ValidationService {
|
||||||
|
regExps = {
|
||||||
|
password: /^[0-9]{6}$/,
|
||||||
|
passwordV2: /(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,<>\/?~])(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,}/,
|
||||||
|
mobCode: /^[0-9]{2,4}$/,
|
||||||
|
mobNum: /^[0-9]*$/,
|
||||||
|
numbers: /[0-9]/,
|
||||||
|
decimal: /^(0|[1-9.]\d*)(\.\d+)?$/,
|
||||||
|
alpha_numeric: /^[a-zA-Z ]*$/,
|
||||||
|
lower_case: /[a-z]/,
|
||||||
|
Capital_case: /[A-Z]/,
|
||||||
|
special_characters: /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,
|
||||||
|
lat_long: /^-?(?=.*\d\.\d)(?!.*\.\d*\.)\d+\.?\d*$/
|
||||||
|
};
|
||||||
|
get email() {
|
||||||
|
return new FormControl('', [Validators.required, Validators.email]);
|
||||||
|
}
|
||||||
|
get email_non_required() {
|
||||||
|
return new FormControl('', [Validators.email]);
|
||||||
|
}
|
||||||
|
get passwordV2() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern(this.regExps['passwordV2']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get passwordV2_non_required() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern(this.regExps['passwordV2']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get password() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern(this.regExps['password']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get password_non_required() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.pattern(this.regExps['password']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get number() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern(this.regExps['mobNum']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get mobNo() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.pattern(this.regExps['mobNum']),
|
||||||
|
Validators.required,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get alpha_numeric() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.pattern(this.regExps['alpha_numeric'])
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get alphaNumericWithReq() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.pattern(this.regExps['alpha_numeric']),
|
||||||
|
Validators.required,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get required() {
|
||||||
|
return new FormControl(null, [Validators.required]);
|
||||||
|
}
|
||||||
|
|
||||||
|
get decimal() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.pattern(this.regExps['decimal']),
|
||||||
|
Validators.required,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get numreq() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.pattern(this.regExps['mobNum']),
|
||||||
|
Validators.required,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
get lat_long() {
|
||||||
|
return new FormControl('', [
|
||||||
|
Validators.pattern(this.regExps['lat_long']),
|
||||||
|
Validators.required,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
onBlur(Control, validationType) {
|
||||||
|
return Control.hasError(validationType) && Control.touched;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getFormArrControls(formArrayName, index, controlName) {
|
||||||
|
return formArrayName.controls[index].controls[controlName];
|
||||||
|
}
|
||||||
|
|
||||||
|
showValidationsMsg(form) {
|
||||||
|
form.markAllAsTouched();
|
||||||
|
}
|
||||||
|
|
||||||
|
prioirtyValidation(alldata) {
|
||||||
|
let message = null
|
||||||
|
let pri_arr = alldata.filter((el, ind) => {
|
||||||
|
return alldata.findIndex(e => e.priority == el.priority) != ind;
|
||||||
|
});
|
||||||
|
let negative_pr = alldata.filter(e => e.priority < 0);
|
||||||
|
let max_pr = alldata.filter(e => e.priority > 100);
|
||||||
|
let zero_pr = alldata.filter(e => e.priority == 0)
|
||||||
|
if (negative_pr.length > 0) {
|
||||||
|
message = "Priority can't be negative"
|
||||||
|
} else if (pri_arr.length > 0) {
|
||||||
|
message = "Priority can't be same"
|
||||||
|
} else if (max_pr.length > 0) {
|
||||||
|
message = "Priority can't be above 100"
|
||||||
|
} else if (zero_pr.length > 0) {
|
||||||
|
message = "Priority can't be 0"
|
||||||
|
}
|
||||||
|
return message
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
scrollTo(el: Element): void {
|
||||||
|
if (el) {
|
||||||
|
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scrollToError(): void {
|
||||||
|
const errorInput = document.querySelector('.ErrorWrapper');
|
||||||
|
const errorspan = document.querySelector('.errorspan');
|
||||||
|
this.scrollTo(errorInput ? errorInput : errorspan);
|
||||||
|
}
|
||||||
|
dateRangeValidation(): ValidatorFn {
|
||||||
|
return (control: AbstractControl): { [key: string]: boolean } | null => {
|
||||||
|
if (control.value) {
|
||||||
|
if (control.value.length <= 1 || control.value[1] == null) {
|
||||||
|
return { 'todate': true };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
43
src/app/core/guard/auth.guard.ts
Normal file
43
src/app/core/guard/auth.guard.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// Angular
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
|
||||||
|
// RxJS
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { securityFunctions } from '../common/security';
|
||||||
|
@Injectable()
|
||||||
|
export class AuthGuard implements CanActivate {
|
||||||
|
constructor(
|
||||||
|
private router: Router) { }
|
||||||
|
|
||||||
|
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
|
||||||
|
if (securityFunctions.getSessionStorage('LoginUserData')) {
|
||||||
|
let userdata = securityFunctions.getSessionStorage('LoginUserData') ? JSON.parse(securityFunctions.getSessionStorage('LoginUserData')) : null
|
||||||
|
if (userdata) {
|
||||||
|
if (userdata.user_id) {
|
||||||
|
// let tpinApplicable = sessionStorage.getItem('TpinApplicable') == 'true' ? true : false;
|
||||||
|
// let tpinActivated = sessionStorage.getItem('T_Activated') == 'true' ? true : false;
|
||||||
|
// let tpinExpired = sessionStorage.getItem('T_Expired') == 'true' ? true : false;
|
||||||
|
// if (tpinApplicable) {
|
||||||
|
// if (!tpinActivated || tpinExpired) {
|
||||||
|
// let userId = sessionStorage.getItem('userId')
|
||||||
|
// const now = new Date();
|
||||||
|
// const formattedDate = now.toISOString().slice(0, 19).replace('T', ' ');
|
||||||
|
// let keyVal = securityFunctions.EncryptReq(userId + '~' + formattedDate + '~' + (tpinExpired ? 'expired' : 'create')).trim()
|
||||||
|
// this.router.navigate(['/Login/TPIN'], { queryParams: { key: keyVal } })
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// return true
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
window.location.href = '/Auth/Login';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
export class ActivityContent {
|
||||||
|
activity_content_id: string | null;
|
||||||
|
org_id: string | null;
|
||||||
|
activity_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
language_code: string;
|
||||||
|
activity_name: string;
|
||||||
|
departure_point: string;
|
||||||
|
meeting_point: string;
|
||||||
|
drop_point: string;
|
||||||
|
activity_highlight: string;
|
||||||
|
activity_description: string;
|
||||||
|
activity_restriction: string;
|
||||||
|
activities_details: string;
|
||||||
|
activity_inclusion: string;
|
||||||
|
activity_exclusion: string;
|
||||||
|
revision_nbr: number | null;
|
||||||
|
created_by: string | null;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean;
|
||||||
|
is_deleted: boolean;
|
||||||
|
additional_pick_up_details: string;
|
||||||
|
daywise_itinerary: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
export class AllocationItems {
|
||||||
|
activity_allocation_id: string | null;
|
||||||
|
activity_contract_id: string | null;
|
||||||
|
activity_slot_id: string | null;
|
||||||
|
_date: string;
|
||||||
|
allocation_count: number | null;
|
||||||
|
release_days: number | null;
|
||||||
|
_allocation_type: string | null;
|
||||||
|
is_active: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class UpdateAllocation {
|
||||||
|
activity_contract_id: string | null;
|
||||||
|
activity_slot_id: string | null;
|
||||||
|
allocationItems: AllocationItems[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AllocationOverview {
|
||||||
|
activity_allocation_id: string | null;
|
||||||
|
activity_contract_id: string | null;
|
||||||
|
activity_slot_id: string | null;
|
||||||
|
_date: string;
|
||||||
|
allocation_count: number | null;
|
||||||
|
release_days: number | null;
|
||||||
|
booking_count: number | null;
|
||||||
|
remaining_count: number | null;
|
||||||
|
_allocation_type: string | null;
|
||||||
|
is_active: boolean;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
export class CancellationDisplay {
|
||||||
|
activity_cancellation_policy_id: string;
|
||||||
|
date: string;
|
||||||
|
_cancellation_policy_type: string;
|
||||||
|
from: number;
|
||||||
|
to: number;
|
||||||
|
_charge_type: string;
|
||||||
|
charge_value: number;
|
||||||
|
}
|
||||||
|
export class GetCancellationPolicy {
|
||||||
|
contract_id: string;
|
||||||
|
from_date: string | null;
|
||||||
|
to_date: string | null;
|
||||||
|
slot_id: string | null;
|
||||||
|
seasonId: string[] | null;
|
||||||
|
days: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class UpdateCancellationPolicy {
|
||||||
|
activity_contract_id: string;
|
||||||
|
_no_show_policy_type: string;
|
||||||
|
no_show_value: number;
|
||||||
|
cancellation_policy: CancellationDisplay[];
|
||||||
|
}
|
||||||
|
|
||||||
|
// export class UpdateCancellationPolicy {
|
||||||
|
// activity_contract_id: string;
|
||||||
|
// cancellation_policy: CancellationDisplay[];
|
||||||
|
// }
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
export class EditActivityContractDetail {
|
||||||
|
contract_id: string;
|
||||||
|
option_name: string;
|
||||||
|
currency_code: string;
|
||||||
|
language_code: string;
|
||||||
|
include_nationality_code: string;
|
||||||
|
exclude_nationality_code: string;
|
||||||
|
_nationality_type: string;
|
||||||
|
is_exclude_nationality: boolean;
|
||||||
|
rate_inclusion: string;
|
||||||
|
contract_remark: string;
|
||||||
|
is_pickup_included: boolean;
|
||||||
|
is_drop_off_included: boolean;
|
||||||
|
is_guide_included: boolean;
|
||||||
|
guide_languages: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export class ActivityAllContract {
|
||||||
|
activity_id: string;
|
||||||
|
option_name: string | null;
|
||||||
|
is_pickup_included: boolean;
|
||||||
|
is_drop_off_included: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GetRateDetails {
|
||||||
|
contract_id: string;
|
||||||
|
slot_id: string | null;
|
||||||
|
from_date: string | null;
|
||||||
|
to_date: string | null;
|
||||||
|
dates: string | null;
|
||||||
|
seasonId: string[] | null;
|
||||||
|
days: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// export class GetTieredRateDetail {
|
||||||
|
// contract_id: string;
|
||||||
|
// slot_id: string;
|
||||||
|
// dates: string;
|
||||||
|
// days: string;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
export class EditActivityContractRate {
|
||||||
|
activity_contract_id: string;
|
||||||
|
activity_slot_id: string;
|
||||||
|
perPaxPrices: PaxRates[] | null;
|
||||||
|
perVehicleRates: VehicleRates[] | null;
|
||||||
|
tieredPricings: TieredPricingList[] | null;
|
||||||
|
privateTransfer: ActivityPrivateTransfer[] | null;
|
||||||
|
sharedTransfer: ActivitySharedTransfer | null;
|
||||||
|
}
|
||||||
|
export class PaxRates {
|
||||||
|
activity_rate_per_pax_id: string;
|
||||||
|
date: string;
|
||||||
|
adult_rate: number;
|
||||||
|
senior_rate: number;
|
||||||
|
youth_rate: number;
|
||||||
|
child_rate: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class VehicleRates {
|
||||||
|
activity_rate_per_vehicle_id: string;
|
||||||
|
vehicle_supplier_id: string;
|
||||||
|
vehicle_id: string;
|
||||||
|
vehicle_max_occupancy: string;
|
||||||
|
date: string;
|
||||||
|
rate: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class TieredPricingList {
|
||||||
|
id: string;
|
||||||
|
pricing: PaxPricing[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PaxPricing {
|
||||||
|
pax_type: string;
|
||||||
|
sequence: number;
|
||||||
|
rate: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivityPrivateTransfer {
|
||||||
|
vehicle_id: string;
|
||||||
|
vehicle_occupancy: string;
|
||||||
|
vehicle_supplier_id: string;
|
||||||
|
rate: number;
|
||||||
|
}
|
||||||
|
export class ActivitySharedTransfer {
|
||||||
|
vehicle_supplier_id: string;
|
||||||
|
adult_rate: number;
|
||||||
|
senior_rate: number;
|
||||||
|
youth_rate: number;
|
||||||
|
child_rate: number;
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export class SaveActivityContractDetails {
|
||||||
|
activityContract: ActivityContract;
|
||||||
|
activityContractDetails: ActivityDetails[];
|
||||||
|
privateTransfer: ActivityPrivateTransfer[];
|
||||||
|
sharedTransfer: ActivitySharedTransfer;
|
||||||
|
incNationalityCodes: string[] | null;
|
||||||
|
excNationalityCodes: string[] | null;
|
||||||
|
seasonIdsForRateDates: string[] | null;
|
||||||
|
datesForRates: DateRange[];
|
||||||
|
slotDetails: SlotDetails[] | null;
|
||||||
|
activityCancellationDetails: ActivityCancellationDetails[] | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivityPrivateTransfer {
|
||||||
|
vehicle_id: string;
|
||||||
|
vehicle_occupancy: string;
|
||||||
|
vehicle_supplier_id: string;
|
||||||
|
rate: number;
|
||||||
|
}
|
||||||
|
export class ActivitySharedTransfer {
|
||||||
|
vehicle_supplier_id: string;
|
||||||
|
adult_rate: number;
|
||||||
|
senior_rate: number;
|
||||||
|
youth_rate: number;
|
||||||
|
child_rate: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Specific {
|
||||||
|
specificTimeSlot: DateRange[];
|
||||||
|
specificSlotRateRange: RateRange;
|
||||||
|
activityPaxRate: ActivityPaxRate;
|
||||||
|
activityVehicleRate: ActivityVehicleRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SlotDetails {
|
||||||
|
slot: Slot[];
|
||||||
|
applicableDays: string;
|
||||||
|
rateRange: RateRange | null;
|
||||||
|
activityPaxRate: ActivityPaxRate | null;
|
||||||
|
activityVehicleRate: ActivityVehicleRate[] | null;
|
||||||
|
activityCancellationDetails: ActivityCancellationDetails[] | null;
|
||||||
|
}
|
||||||
|
export class Slot {
|
||||||
|
slotId: string;
|
||||||
|
is_private_transfer: boolean;
|
||||||
|
is_shared_transfer: boolean;
|
||||||
|
is_without_transfer: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class ActivityContract {
|
||||||
|
activity_contract_id: string | null;
|
||||||
|
org_id: string | null;
|
||||||
|
supplier_id: string;
|
||||||
|
activity_id: string | null;
|
||||||
|
currency_code: string;
|
||||||
|
_nationality_type: string;
|
||||||
|
is_exclude_nationality: boolean;
|
||||||
|
_period_type: string;
|
||||||
|
season_id: string;
|
||||||
|
is_pickup_included: boolean;
|
||||||
|
is_drop_off_included: boolean;
|
||||||
|
is_private_transfer_price_included: boolean;
|
||||||
|
is_shared_transfer_price_included: boolean;
|
||||||
|
is_slot_wise_cancellation_policy: boolean;
|
||||||
|
is_guide_included: boolean;
|
||||||
|
guide_languages: string;
|
||||||
|
_rate_type: string;
|
||||||
|
_pricing_type: string;
|
||||||
|
_no_show_policy_type: string;
|
||||||
|
no_show_charge_value: number;
|
||||||
|
is_approved: boolean;
|
||||||
|
is_rejected: boolean;
|
||||||
|
reviewed_by: string;
|
||||||
|
reviewer_comments: string;
|
||||||
|
reviewer_user_type: string;
|
||||||
|
reviewed_on: string | null;
|
||||||
|
revision_nbr: number | null;
|
||||||
|
created_by: string | null;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean;
|
||||||
|
is_deleted: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivityDetails {
|
||||||
|
language_code: string;
|
||||||
|
option_name: string;
|
||||||
|
rate_inclusion: string;
|
||||||
|
contract_remark: string;
|
||||||
|
}
|
||||||
|
export class DateRange {
|
||||||
|
Start: string;
|
||||||
|
End: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AgeRange {
|
||||||
|
from_count: number;
|
||||||
|
to_count: number;
|
||||||
|
sequence: number;
|
||||||
|
rate: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class RateRange {
|
||||||
|
adultAgeRange: AgeRange[];
|
||||||
|
youthAgeRange: AgeRange[];
|
||||||
|
seniorAgeRange: AgeRange[];
|
||||||
|
childAgeRange: AgeRange[];
|
||||||
|
allocationDetails: AllocationDetails | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class ActivityPaxRate {
|
||||||
|
date: string;
|
||||||
|
adult_rate: number;
|
||||||
|
senior_rate: number;
|
||||||
|
youth_rate: number;
|
||||||
|
child_rate: number;
|
||||||
|
allocationDetails: AllocationDetails | null;
|
||||||
|
}
|
||||||
|
export class Slots {
|
||||||
|
slotId: string;
|
||||||
|
is_private_transfer: boolean;
|
||||||
|
is_shared_transfer: boolean;
|
||||||
|
is_without_transfer: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivityVehicleRate {
|
||||||
|
rate: number;
|
||||||
|
vehicle_supplier_id: number;
|
||||||
|
vehicle_id: number;
|
||||||
|
vehicle_max_occupancy: number;
|
||||||
|
allocationDetails: AllocationDetails | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivityCancellationDetails {
|
||||||
|
from: number;
|
||||||
|
to: number;
|
||||||
|
CP_Type: string;
|
||||||
|
CP_Value: number;
|
||||||
|
cancellation_Type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AllocationDetails {
|
||||||
|
_allocation_type: string;
|
||||||
|
allocation_count: number;
|
||||||
|
booking_count: number;
|
||||||
|
vehicle_id: string;
|
||||||
|
remaining_count: number;
|
||||||
|
_release_type: string;
|
||||||
|
date: string;
|
||||||
|
release_days: number;
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
|
||||||
|
export class experience_add {
|
||||||
|
activity_id: string;
|
||||||
|
org_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
activity_code: number;
|
||||||
|
category_id: string;
|
||||||
|
emergency_phone_code: string;
|
||||||
|
emergency_phone_nbr: string;
|
||||||
|
default_lang_code: string;
|
||||||
|
_service_language: string;
|
||||||
|
service_days: number;
|
||||||
|
service_hours: number;
|
||||||
|
service_minutes: number;
|
||||||
|
starting_city: string;
|
||||||
|
is_pickup_included: boolean;
|
||||||
|
_pickup_point_type: string;
|
||||||
|
_hotel_pickup_type: string;
|
||||||
|
pickup_hotel: string;
|
||||||
|
hotel_zone: string;
|
||||||
|
pickup_before_hour: number;
|
||||||
|
pickup_before_minute: number;
|
||||||
|
meeting_before_hour: number;
|
||||||
|
meeting_before_minute: number;
|
||||||
|
is_drop_included: boolean;
|
||||||
|
min_pax: number;
|
||||||
|
max_pax: number;
|
||||||
|
is_adult: boolean;
|
||||||
|
adult_age_from: number;
|
||||||
|
adult_age_to: number;
|
||||||
|
is_senior: boolean;
|
||||||
|
senior_age_from: number;
|
||||||
|
senior_age_to: number;
|
||||||
|
is_youth: boolean;
|
||||||
|
youth_age_from: number;
|
||||||
|
youth_age_to: number;
|
||||||
|
is_child: boolean;
|
||||||
|
child_age_from: number;
|
||||||
|
child_age_to: number;
|
||||||
|
max_child_count: number;
|
||||||
|
free_child_age_from: number;
|
||||||
|
free_child_age_to: number;
|
||||||
|
is_child_seat: boolean;
|
||||||
|
thumbnail_image: string;
|
||||||
|
activity_images: string;
|
||||||
|
activity_videos: string;
|
||||||
|
requirements: string;
|
||||||
|
revision_nbr: number;
|
||||||
|
created_by: string;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean | null;
|
||||||
|
is_deleted: boolean | null;
|
||||||
|
category_name: string;
|
||||||
|
sub_category_id: string;
|
||||||
|
country_code: string;
|
||||||
|
city_id: string;
|
||||||
|
activityContents: ActivityContent[];
|
||||||
|
activity_content_json: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivityContent {
|
||||||
|
activity_content_id: string;
|
||||||
|
org_id: string;
|
||||||
|
activity_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
language_code: string;
|
||||||
|
activity_name: string;
|
||||||
|
departure_point: string;
|
||||||
|
meeting_point: string;
|
||||||
|
drop_point: string;
|
||||||
|
activity_highlight: string;
|
||||||
|
activity_description: string;
|
||||||
|
activity_restriction: string;
|
||||||
|
activities_details: string;
|
||||||
|
activity_inclusion: string;
|
||||||
|
activity_exclusion: string;
|
||||||
|
revision_nbr: number;
|
||||||
|
created_by: string;
|
||||||
|
created_on: string;
|
||||||
|
updated_by: string;
|
||||||
|
updated_on: string;
|
||||||
|
is_active: boolean;
|
||||||
|
is_deleted: boolean;
|
||||||
|
additional_pick_up_details: string;
|
||||||
|
daywise_itinerary: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
export class ActivitySeasonDetails {
|
||||||
|
activitySeason: ActivitySeason;
|
||||||
|
seasondateRange: ActivitySeasonDateRange[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivitySeasonDateRange {
|
||||||
|
fromDate: string;
|
||||||
|
toDate: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivitySeason {
|
||||||
|
activity_season_id: string;
|
||||||
|
org_id: string;
|
||||||
|
activity_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
season_name: string;
|
||||||
|
created_by: string;
|
||||||
|
created_on: string;
|
||||||
|
updated_by: string;
|
||||||
|
updated_on: string;
|
||||||
|
is_active: boolean;
|
||||||
|
is_deleted: boolean;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
export class ActivitySlot {
|
||||||
|
activity_slot_id: string;
|
||||||
|
org_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
activity_id: string;
|
||||||
|
start_time: string;
|
||||||
|
end_time: string;
|
||||||
|
cut_off_time: string | null;
|
||||||
|
timezone: string | null;
|
||||||
|
revision_nbr: number;
|
||||||
|
created_by: string | null;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean | null;
|
||||||
|
is_deleted: boolean | null;
|
||||||
|
}
|
||||||
|
export class GetActivitySlot {
|
||||||
|
activity_id: string;
|
||||||
|
from_hour: string | null;
|
||||||
|
from_minute: string | null;
|
||||||
|
to_hour: string | null;
|
||||||
|
to_minute: string | null;
|
||||||
|
}
|
||||||
58
src/app/core/models/common-model/Sign-in.model.ts
Normal file
58
src/app/core/models/common-model/Sign-in.model.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
export class LoginModel {
|
||||||
|
EmailID: string
|
||||||
|
Password: string
|
||||||
|
domain: string
|
||||||
|
ProjectId: string
|
||||||
|
MachineId: string
|
||||||
|
Platform: string
|
||||||
|
Browser: string
|
||||||
|
City: string
|
||||||
|
CountryCode: string
|
||||||
|
Lat: number
|
||||||
|
Lon: number
|
||||||
|
Proxy: boolean
|
||||||
|
IP: string
|
||||||
|
time: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OTPModel {
|
||||||
|
oTP: string;
|
||||||
|
userId: string;
|
||||||
|
city: string;
|
||||||
|
ProjectId: string;
|
||||||
|
countryCode: string;
|
||||||
|
lat: number;
|
||||||
|
lon: number;
|
||||||
|
proxy: boolean;
|
||||||
|
iP: string;
|
||||||
|
platform: string | null;
|
||||||
|
browser: string | null;
|
||||||
|
macId: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SSOModel {
|
||||||
|
emailID: string;
|
||||||
|
domain: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class dtoKey {
|
||||||
|
key: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class agency_data {
|
||||||
|
is_pay_at_agency: boolean;
|
||||||
|
time_zone: string;
|
||||||
|
b2c_agency_code: string;
|
||||||
|
utc: string;
|
||||||
|
pay_at_agency_disclaimer: string;
|
||||||
|
org_id: string;
|
||||||
|
b2c_agency_id: string;
|
||||||
|
project: string;
|
||||||
|
domain: string;
|
||||||
|
is_active: boolean;
|
||||||
|
}
|
||||||
|
export class SSOLoginModel {
|
||||||
|
isSSO: boolean
|
||||||
|
isLoggedIn: boolean
|
||||||
|
token: string
|
||||||
|
}
|
||||||
11
src/app/core/models/common-model/user-logout.model.ts
Normal file
11
src/app/core/models/common-model/user-logout.model.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
export class UserLog{
|
||||||
|
user_id:string;
|
||||||
|
user_type:string;
|
||||||
|
IsMFAApplicable:boolean;
|
||||||
|
ip_city:string;
|
||||||
|
ip_country_code:string;
|
||||||
|
ip_lat:number;
|
||||||
|
ip_lon:number;
|
||||||
|
ip_proxy:boolean;
|
||||||
|
ip:string;
|
||||||
|
}
|
||||||
66
src/app/core/models/common-model/userModel.ts
Normal file
66
src/app/core/models/common-model/userModel.ts
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
export class changeUserLoginPassword {
|
||||||
|
user_id: string;
|
||||||
|
org_id: string;
|
||||||
|
first_name: string;
|
||||||
|
middle_name: string;
|
||||||
|
last_name: string;
|
||||||
|
user_mobile_country_code: string;
|
||||||
|
user_mobile: string;
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
country: string;
|
||||||
|
city: string;
|
||||||
|
user_type: string;
|
||||||
|
affiliate_id: string;
|
||||||
|
affiliate_type: string;
|
||||||
|
user_profile: string;
|
||||||
|
user_role: string;
|
||||||
|
is_active: boolean;
|
||||||
|
created_by: string;
|
||||||
|
updated_by: string;
|
||||||
|
created_on: string;
|
||||||
|
updated_on: string;
|
||||||
|
time_zone: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class UserLoginData {
|
||||||
|
user_id: string;
|
||||||
|
org_id: number;
|
||||||
|
first_name: string;
|
||||||
|
middle_name: string;
|
||||||
|
last_name: string;
|
||||||
|
user_mobile_country_code: string;
|
||||||
|
user_mobile: string;
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
country: string;
|
||||||
|
city: string;
|
||||||
|
user_type: string;
|
||||||
|
user_profile: string;
|
||||||
|
user_role: string;
|
||||||
|
is_active: boolean;
|
||||||
|
created_on: Date;
|
||||||
|
created_by: string;
|
||||||
|
updated_on: Date;
|
||||||
|
updated_by: string;
|
||||||
|
affiliate_id: number;
|
||||||
|
markup_type: string;
|
||||||
|
is_mfa_applicable: boolean;
|
||||||
|
is_inactive_wrong_attempt: boolean;
|
||||||
|
is_cancel_pnr: boolean;
|
||||||
|
is_cancel_ticketed_pnr: boolean;
|
||||||
|
is_import_pnr_access: boolean;
|
||||||
|
is_allow_void_ticket: boolean;
|
||||||
|
last_log_on: Date;
|
||||||
|
is_password_expired: boolean;
|
||||||
|
is_login_expired: boolean;
|
||||||
|
role_id: number;
|
||||||
|
jwt_token_id: number;
|
||||||
|
refresh_token: string;
|
||||||
|
refresh_token_expire_at: Date;
|
||||||
|
change_default_password: boolean;
|
||||||
|
is_b2b_surcharge: boolean;
|
||||||
|
is_reserve_hotel_booking: boolean;
|
||||||
|
extranet_vendor_id: string;
|
||||||
|
timezone: string;
|
||||||
|
}
|
||||||
221
src/app/core/models/flight-service/flight-contracts.model.ts
Normal file
221
src/app/core/models/flight-service/flight-contracts.model.ts
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export class FlightContractDTO {
|
||||||
|
contract_id: string | null;
|
||||||
|
org_id: string | null;
|
||||||
|
supplier_id: string;
|
||||||
|
contract_name: string;
|
||||||
|
contract_description: string;
|
||||||
|
pnr: string;
|
||||||
|
is_instant_confirmation: boolean;
|
||||||
|
_trip_type: string;
|
||||||
|
no_of_legs: number;
|
||||||
|
from_airport: string;
|
||||||
|
to_airport: string;
|
||||||
|
is_economy: boolean;
|
||||||
|
is_premium_economy: boolean;
|
||||||
|
is_business: boolean;
|
||||||
|
is_first_class: boolean;
|
||||||
|
is_all_pax_type: boolean;
|
||||||
|
is_adult: boolean;
|
||||||
|
is_child: boolean;
|
||||||
|
is_infant: boolean;
|
||||||
|
currency_code: string;
|
||||||
|
validating_airline: string;
|
||||||
|
is_multi_day: boolean;
|
||||||
|
is_multi_day_range: boolean;
|
||||||
|
outbound_date: string;
|
||||||
|
return_date: string;
|
||||||
|
operation_from: string;
|
||||||
|
operation_to: string;
|
||||||
|
revision_nbr: number | null;
|
||||||
|
created_by: string | null;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean | null;
|
||||||
|
is_deleted: boolean | null;
|
||||||
|
outbound_days: string | null;
|
||||||
|
outbound_dates: string | null;
|
||||||
|
flightDetail: FlightDetailDto[];
|
||||||
|
flightRate: FlightsRateDto[];
|
||||||
|
}
|
||||||
|
export class FlightsRateDto {
|
||||||
|
rate_id: string | null;
|
||||||
|
org_id: string | null;
|
||||||
|
supplier_id: string | null;
|
||||||
|
contract_id: string | null;
|
||||||
|
contract_date_unique_id: string | null;
|
||||||
|
outbound_date: string;
|
||||||
|
return_date: string;
|
||||||
|
rbd: string;
|
||||||
|
cabin_class: string;
|
||||||
|
adt_base_fare: number;
|
||||||
|
adt_tax: number;
|
||||||
|
chd_base_fare: number;
|
||||||
|
chd_tax: number;
|
||||||
|
inf_base_fare: number;
|
||||||
|
inf_tax: number;
|
||||||
|
seat_allocation: number;
|
||||||
|
seat_booked: number;
|
||||||
|
seat_remaining: number;
|
||||||
|
adt_check_bag: number;
|
||||||
|
chd_check_bag: number;
|
||||||
|
inf_check_bag: number;
|
||||||
|
_check_bag_unit: number;
|
||||||
|
adt_cabin_bag: number;
|
||||||
|
chd_cabin_bag: number;
|
||||||
|
inf_cabin_bag: number;
|
||||||
|
_cabin_bag_unit: number;
|
||||||
|
_fare_type: number;
|
||||||
|
adt_fare_rule: string;
|
||||||
|
chd_fare_rule: string;
|
||||||
|
inf_fare_rule: string;
|
||||||
|
is_meal_included: boolean;
|
||||||
|
meal_details: string;
|
||||||
|
inclusions: string;
|
||||||
|
pnr: string;
|
||||||
|
is_instant_confirmation: boolean;
|
||||||
|
is_stop_sale: boolean;
|
||||||
|
revision_nbr: number | null;
|
||||||
|
created_by: string | null;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean | null;
|
||||||
|
is_deleted: boolean | null;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
export class FlightContractReq {
|
||||||
|
FlightContract: FlightContracts;
|
||||||
|
FlightDetails: FlightDetailDto[];
|
||||||
|
FlightRates: FlightRateArray[];
|
||||||
|
}
|
||||||
|
export class FlightContracts {
|
||||||
|
contract_name: string;
|
||||||
|
contract_description: string;
|
||||||
|
trip_type: string;
|
||||||
|
origin: string;
|
||||||
|
destination: string;
|
||||||
|
no_of_legs: number;
|
||||||
|
currency_code: string;
|
||||||
|
contracted_cabin_class: string;
|
||||||
|
contracted_pax_type: string;
|
||||||
|
validating_airline: string;
|
||||||
|
is_multi_day: boolean;
|
||||||
|
is_oneway_sale_allowed: boolean;
|
||||||
|
multi_day_operation_type: string;
|
||||||
|
operation_from: string; // Assuming you'll handle date parsing separately
|
||||||
|
operation_to: string; // Assuming you'll handle date parsing separately
|
||||||
|
departure_date: string; // Assuming you'll handle date parsing separately
|
||||||
|
return_date: string; // Assuming you'll handle date parsing separately
|
||||||
|
departure_days: string;
|
||||||
|
departure_dates: string;
|
||||||
|
is_nearby_airports: boolean;
|
||||||
|
is_active: boolean;
|
||||||
|
nearby_from_airports: string;
|
||||||
|
nearby_to_airports: string;
|
||||||
|
is_instant_confirmation: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FlightDetailDto {
|
||||||
|
flight_details_id: string | null;
|
||||||
|
org_id: string | null;
|
||||||
|
supplier_id: string | null;
|
||||||
|
contract_id: string | null;
|
||||||
|
airline_code: string;
|
||||||
|
flight_no: string;
|
||||||
|
aircraft_type_id: string;
|
||||||
|
from_airport: string;
|
||||||
|
to_airport: string;
|
||||||
|
departure_date: string;
|
||||||
|
departure_time: string;
|
||||||
|
is_next_day_departure: boolean;
|
||||||
|
departure_terminal: string;
|
||||||
|
is_next_day_arrival: boolean;
|
||||||
|
arrival_date: string;
|
||||||
|
arrival_time: string;
|
||||||
|
arrival_terminal: string;
|
||||||
|
flying_duration: string;
|
||||||
|
sector_nbr: number | null;
|
||||||
|
_sector_type: string;
|
||||||
|
leg_nbr: number;
|
||||||
|
seg_nbr: number;
|
||||||
|
contract_date_unique_id: string | null;
|
||||||
|
revision_nbr: number | null;
|
||||||
|
created_by: string | null;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean | null;
|
||||||
|
is_deleted: boolean | null;
|
||||||
|
}
|
||||||
|
export class FlightRateArray {
|
||||||
|
rate_id: string;
|
||||||
|
org_id: string;
|
||||||
|
contract_id: string;
|
||||||
|
contract_date_unique_id: string;
|
||||||
|
departure_date: Date;
|
||||||
|
rbd: string;
|
||||||
|
fare_family_group_id: string;
|
||||||
|
fare_family_name: string;
|
||||||
|
cabin_class: string;
|
||||||
|
adt_base_fare: number;
|
||||||
|
adt_tax: number;
|
||||||
|
chd_base_fare: number;
|
||||||
|
chd_tax: number;
|
||||||
|
inf_base_fare: number;
|
||||||
|
inf_tax: number;
|
||||||
|
fare_type_applicability: string;
|
||||||
|
round_trip_discount_type: string;
|
||||||
|
is_apply_discount_with_same_vc_only: boolean;
|
||||||
|
adult_round_trip_discount: number;
|
||||||
|
child_round_trip_discount: number;
|
||||||
|
infant_round_trip_discount: number;
|
||||||
|
seat_allocation: number;
|
||||||
|
seat_booked: number;
|
||||||
|
seat_cancelled: number;
|
||||||
|
is_checked_bag_included: boolean;
|
||||||
|
adt_check_bag: string;
|
||||||
|
chd_check_bag: string;
|
||||||
|
inf_check_bag: string;
|
||||||
|
_check_bag_unit: string;
|
||||||
|
adt_cabin_bag: string;
|
||||||
|
chd_cabin_bag: string;
|
||||||
|
inf_cabin_bag: string;
|
||||||
|
_cabin_bag_unit: string;
|
||||||
|
refund_type: string;
|
||||||
|
adt_fare_rule: string;
|
||||||
|
chd_fare_rule: string;
|
||||||
|
inf_fare_rule: string;
|
||||||
|
is_meal_included: boolean;
|
||||||
|
meal_details: string;
|
||||||
|
inclusions: string;
|
||||||
|
pnr: string;
|
||||||
|
is_instant_confirmation: boolean;
|
||||||
|
is_stop_sale: boolean;
|
||||||
|
updated_by: string;
|
||||||
|
}
|
||||||
|
export class FlightDetailsSearchModel {
|
||||||
|
contract_name: string;
|
||||||
|
vendor_id: string;
|
||||||
|
validating_airline: string;
|
||||||
|
trip_type: string;
|
||||||
|
flight_no: string;
|
||||||
|
cabin_class: string;
|
||||||
|
origin: string;
|
||||||
|
destination: string;
|
||||||
|
departure_days: string;
|
||||||
|
date_type: string;
|
||||||
|
from_date: string;
|
||||||
|
to_date: string;
|
||||||
|
pnr: string;
|
||||||
|
currency_code: string;
|
||||||
|
refund_type: string;
|
||||||
|
rbd: string;
|
||||||
|
is_instant_confirmation: boolean;
|
||||||
|
is_multi_day: boolean;
|
||||||
|
is_oneway_sale_allowed: boolean;
|
||||||
|
airline_code: any;
|
||||||
|
confirmation_type: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
export class FlightRateobj {
|
||||||
|
_id: string;
|
||||||
|
_from_date: string;
|
||||||
|
_to_date: string;
|
||||||
|
days: string;
|
||||||
|
_rbd: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export class UpdateFlightRate {
|
||||||
|
contract_id: string;
|
||||||
|
flight_rate: dtoFlightRate[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class dtoFlightRate {
|
||||||
|
rate_id: string;
|
||||||
|
outbound_date: string;
|
||||||
|
adt_base_fare: number;
|
||||||
|
adt_tax: number;
|
||||||
|
chd_base_fare: number;
|
||||||
|
chd_tax: number;
|
||||||
|
inf_base_fare: number;
|
||||||
|
inf_tax: number;
|
||||||
|
seat_allocation: number;
|
||||||
|
adt_check_bag: number;
|
||||||
|
chd_check_bag: number;
|
||||||
|
inf_check_bag: number;
|
||||||
|
_check_bag_unit: number;
|
||||||
|
adt_cabin_bag: number;
|
||||||
|
chd_cabin_bag: number;
|
||||||
|
inf_cabin_bag: number;
|
||||||
|
_cabin_bag_unit: number;
|
||||||
|
_fare_type: number;
|
||||||
|
adt_fare_rule: string;
|
||||||
|
chd_fare_rule: string;
|
||||||
|
inf_fare_rule: string;
|
||||||
|
is_meal_included: boolean;
|
||||||
|
meal_details: string;
|
||||||
|
inclusions: string;
|
||||||
|
pnr: string;
|
||||||
|
is_instant_confirmation: boolean;
|
||||||
|
is_stop_sale: boolean;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
export class ContractDetailDto {
|
||||||
|
contract_id: string;
|
||||||
|
contract_name: string;
|
||||||
|
contract_description: string;
|
||||||
|
is_premium_economy: boolean;
|
||||||
|
is_economy: boolean;
|
||||||
|
is_business: boolean;
|
||||||
|
is_first_class: boolean;
|
||||||
|
is_all_pax_type: boolean;
|
||||||
|
is_adult: boolean;
|
||||||
|
is_child: boolean;
|
||||||
|
is_infant: boolean;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
export class UpdateFlightDetail {
|
||||||
|
contract_id: string;
|
||||||
|
departure_dates: string;
|
||||||
|
outbound_days: string;
|
||||||
|
flight_detail: FlightDetailobj[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FlightDetailobj {
|
||||||
|
airline_code: string;
|
||||||
|
flight_no: string;
|
||||||
|
_aircraft_type: string;
|
||||||
|
from_airport: string;
|
||||||
|
to_airport: string;
|
||||||
|
departure_time: string;
|
||||||
|
is_next_day_departure: boolean;
|
||||||
|
departure_terminal: string;
|
||||||
|
is_next_day_arrival: boolean;
|
||||||
|
arrival_time: string;
|
||||||
|
arrival_terminal: string;
|
||||||
|
flying_duration: string;
|
||||||
|
sector_nbr: number | null;
|
||||||
|
_sector_type: string;
|
||||||
|
leg_nbr: number;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
export class FlightContractSearhObj {
|
||||||
|
contract_name: string;
|
||||||
|
supplier_name: string;
|
||||||
|
_trip_type: string;
|
||||||
|
airline_code: string;
|
||||||
|
flight_no: string;
|
||||||
|
from_airport: string;
|
||||||
|
to_airport: string;
|
||||||
|
dep_from_date: string;
|
||||||
|
dep_to_date: string;
|
||||||
|
ret_from_date: string;
|
||||||
|
ret_to_date: string;
|
||||||
|
dep_days: string;
|
||||||
|
ret_days: string;
|
||||||
|
is_multi_day: boolean;
|
||||||
|
pnr: string;
|
||||||
|
rbd: string;
|
||||||
|
currency_code: string;
|
||||||
|
fare_type: number;
|
||||||
|
is_instant_confirmation: boolean;
|
||||||
|
is_economy: boolean;
|
||||||
|
is_premium_economy: boolean;
|
||||||
|
is_business: boolean;
|
||||||
|
is_first_class: boolean;
|
||||||
|
}
|
||||||
73
src/app/core/models/hotelService/AddRoom/Room.model.ts
Normal file
73
src/app/core/models/hotelService/AddRoom/Room.model.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export class ContractRoom {
|
||||||
|
room_id: string;
|
||||||
|
org_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
room_category_name_code: number;
|
||||||
|
is_living_room: boolean;
|
||||||
|
living_room_count: number;
|
||||||
|
living_bed_count: number;
|
||||||
|
living_bed_type: number;
|
||||||
|
is_living_bed:boolean
|
||||||
|
is_bedroom: boolean;
|
||||||
|
bedroom_count: number;
|
||||||
|
bed_count: string;
|
||||||
|
is_bathroom: boolean;
|
||||||
|
bathroom_count: number;
|
||||||
|
is_bathtub: boolean;
|
||||||
|
is_jacuzzi: boolean;
|
||||||
|
room_size: number;
|
||||||
|
room_measure_unit: string;
|
||||||
|
room_images: string;
|
||||||
|
thumbnail_image: string;
|
||||||
|
display_room_name: string;
|
||||||
|
extra_bed_type: number;
|
||||||
|
hotel_id: string;
|
||||||
|
hotel_code: number;
|
||||||
|
room_view_code: number;
|
||||||
|
room_type_code: number;
|
||||||
|
room_code: number;
|
||||||
|
max_adult: number;
|
||||||
|
max_child: number;
|
||||||
|
min_total_occupancy: number;
|
||||||
|
max_total_occupancy: number;
|
||||||
|
min_adult_age: number;
|
||||||
|
min_child_age: number;
|
||||||
|
max_child_age: number;
|
||||||
|
is_extra_bed_supported: boolean;
|
||||||
|
max_extra_bed_count: number;
|
||||||
|
free_child_count: number;
|
||||||
|
free_child_age_from: number;
|
||||||
|
free_child_age_to: number;
|
||||||
|
is_group_rate: boolean;
|
||||||
|
is_paid_child_age_range: boolean;
|
||||||
|
room_amenity_codes: string;
|
||||||
|
revision_nbr: number;
|
||||||
|
is_deleted: boolean;
|
||||||
|
is_active: boolean;
|
||||||
|
created_by: string;
|
||||||
|
created_on: string;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
contract_paid_child_age_range: ContractRoomPaidChildAgeRange[];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class ContractRoomPaidChildAgeRange {
|
||||||
|
contract_paid_child_age_range_id: string;
|
||||||
|
org_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
room_id: string;
|
||||||
|
from_age: number;
|
||||||
|
to_age: number;
|
||||||
|
sequence: number;
|
||||||
|
revision_nbr: number;
|
||||||
|
is_deleted: boolean;
|
||||||
|
is_active: boolean;
|
||||||
|
created_by: string;
|
||||||
|
created_on: string;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_child_range: boolean;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
export class OverViewData {
|
||||||
|
Date: any[];
|
||||||
|
RoomDetails : roomsOverViewData[];
|
||||||
|
}
|
||||||
|
export class roomsOverViewData {
|
||||||
|
room_name: string;
|
||||||
|
room_id: string;
|
||||||
|
currency_code: string;
|
||||||
|
status: string[];
|
||||||
|
allocation: AllocationDet[];
|
||||||
|
allocation_id: any[];
|
||||||
|
net_sold: any[];
|
||||||
|
availability: any[];
|
||||||
|
RoomContractDetails: ContractDetails[];
|
||||||
|
}
|
||||||
|
export class AllocationDet{
|
||||||
|
id:string;
|
||||||
|
value:any;
|
||||||
|
}
|
||||||
|
export class ContractDetails {
|
||||||
|
contract_name: string;
|
||||||
|
aria_collapse: boolean;
|
||||||
|
rate_plan: string;
|
||||||
|
meal_plan: string;
|
||||||
|
child_age_range_1: string;
|
||||||
|
child_age_range_2: string;
|
||||||
|
min_stay: string[];
|
||||||
|
ChildDataRange1: ChildDetailsArr[];
|
||||||
|
ChildDataRange2: ChildDetailsArr[];
|
||||||
|
AdultData: ChildDetailsArr[];
|
||||||
|
}
|
||||||
|
export class ChildDetailsArr {
|
||||||
|
value: string[];
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
export class ViewSeason {
|
||||||
|
season: ContractSeason;
|
||||||
|
seasondateRange: SeasonDateRange[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SeasonDateRange {
|
||||||
|
|
||||||
|
fromDate: string;
|
||||||
|
toDate: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export class ContractSeason {
|
||||||
|
season_id: string;
|
||||||
|
org_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
hotel_id: string;
|
||||||
|
hotel_code: string;
|
||||||
|
season_name: string;
|
||||||
|
created_by: string;
|
||||||
|
created_on: string;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean;
|
||||||
|
is_deleted: boolean;
|
||||||
|
}
|
||||||
43
src/app/core/models/optional-ons/optional-ons.model.ts
Normal file
43
src/app/core/models/optional-ons/optional-ons.model.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export class ActivityAddOn {
|
||||||
|
activity_add_on_id: string | null;
|
||||||
|
org_id: string | null;
|
||||||
|
supplier_id: string | null;
|
||||||
|
activity_id: string | null;
|
||||||
|
_rate_type: string | null;
|
||||||
|
currency_code: string | null;
|
||||||
|
per_service_rate: number;
|
||||||
|
revision_nbr: number | null;
|
||||||
|
created_by: string | null;
|
||||||
|
created_on: string | null;
|
||||||
|
updated_by: string | null;
|
||||||
|
updated_on: string | null;
|
||||||
|
is_active: boolean;
|
||||||
|
is_deleted: boolean;
|
||||||
|
adult_rate: number;
|
||||||
|
senior_rate: number;
|
||||||
|
youth_rate: number;
|
||||||
|
child_rate: number;
|
||||||
|
activityAddOnDetails: ActivityAddOnDetails[];
|
||||||
|
activity_addon_details_json: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ActivityAddOnDetails {
|
||||||
|
activity_add_on_details_id: string;
|
||||||
|
org_id: string;
|
||||||
|
supplier_id: string;
|
||||||
|
activity_id: string;
|
||||||
|
activity_add_on_id: string;
|
||||||
|
language_code: string;
|
||||||
|
add_on_name: string;
|
||||||
|
add_on_description: string;
|
||||||
|
add_on_image: string;
|
||||||
|
revision_nbr: number;
|
||||||
|
created_by: string;
|
||||||
|
created_on: string;
|
||||||
|
updated_by: string;
|
||||||
|
updated_on: string;
|
||||||
|
is_active: boolean;
|
||||||
|
is_deleted: boolean;
|
||||||
|
}
|
||||||
61
src/app/core/models/user-role-management/user-role.model.ts
Normal file
61
src/app/core/models/user-role-management/user-role.model.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
export class dtoRoleMaster_Root {
|
||||||
|
roleMaster: dtoRoleMaster;
|
||||||
|
roleAccessMapping: dtoRoleAccessMapping[];
|
||||||
|
json_role_master: string;
|
||||||
|
json_role_access_mapping: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class dtoRoleMaster {
|
||||||
|
role_id: string;
|
||||||
|
org_id: string;
|
||||||
|
role_name: string;
|
||||||
|
reporting_role_id: string;
|
||||||
|
role_description: string;
|
||||||
|
role_type: string;
|
||||||
|
affiliate_id: string;
|
||||||
|
extranet_vendor_id: string;
|
||||||
|
is_active: boolean | null;
|
||||||
|
created_on: string;
|
||||||
|
created_by: string;
|
||||||
|
updated_on: string;
|
||||||
|
updated_by: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class dtoRoleAccessMapping {
|
||||||
|
role_access_id: string;
|
||||||
|
org_id: string;
|
||||||
|
role_id: string;
|
||||||
|
project_id: string;
|
||||||
|
menu_id: string;
|
||||||
|
permission: string;
|
||||||
|
is_active: boolean | null;
|
||||||
|
created_on: string;
|
||||||
|
created_by: string;
|
||||||
|
updated_on: string;
|
||||||
|
updated_by: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class dtoRoleUserAccessUnmapping {
|
||||||
|
user_access_un_map_id: string;
|
||||||
|
org_id: string;
|
||||||
|
user_id: string;
|
||||||
|
role_id: string;
|
||||||
|
project_id: string;
|
||||||
|
menu_id: string;
|
||||||
|
permission: string;
|
||||||
|
is_active: boolean | null;
|
||||||
|
created_on: string | null;
|
||||||
|
created_by: string;
|
||||||
|
updated_on: string | null;
|
||||||
|
updated_by: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class dtoRoleUserAccessUnMappingModel {
|
||||||
|
user_id: string;
|
||||||
|
user_access_unmapping_list: dtoRoleUserAccessUnmapping[];
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
import { HttpClient } from "@angular/common/http";
|
||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import { environment } from "src/environments/environment";
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class HotelBookingManagementService {
|
||||||
|
|
||||||
|
private headers = { 'Content-Type': 'application/json; charset=utf-8' };
|
||||||
|
|
||||||
|
constructor(private http: HttpClient) {
|
||||||
|
if(sessionStorage.getItem('userId')){
|
||||||
|
this.headers['LoggedInUser'] = sessionStorage.getItem('userId');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// listing page
|
||||||
|
getAllAgency() {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/AgencyDetail/GetAllAffiliates', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getAllCompany() {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/CompanyMaster/GetAllCompanyDetails', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getAllEntity() {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/EntityMaster/GetAllEntity', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getAllHotelSupplier() {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/HotelSupplier/GetAllHotelSupplier', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getAllHotelSupplierV2() {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/HotelSupplierV2/GetAllHotelSupplierV2s', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getAllHotelCountry() {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/hotel/CountryList/en', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getAllHotelCityByCountry(country_code) {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/hotel/CityList/' + country_code+ '/en', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getHotelBookingList(reqData) {
|
||||||
|
return this.http.post<any>(environment.APIBaseUrl + '/HotelBooking/GetBookingList', reqData, { headers: this.headers })
|
||||||
|
}
|
||||||
|
bookingQualityCheck(trip_tbl_id) {
|
||||||
|
return this.http.post<any>(environment.APIBaseUrl + '/Booking/UpdateQualityCheck/' + trip_tbl_id, null, { headers: this.headers })
|
||||||
|
}
|
||||||
|
|
||||||
|
// View page
|
||||||
|
getAllCurrency() {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + '/CurrencyMaster/GetAllCurrencies', { headers: this.headers })
|
||||||
|
}
|
||||||
|
getCustomerDetails(trip_id) {
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/GetCustomerDetails/${trip_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
GetItenaryDetails(trip_id) {
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/GetItenaryDetails/${trip_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
getPassengerDetails(trip_id) {
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/GetPassengerDetails/${trip_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
getCostingDetails(trip_id) {
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/GetCostingDetails/${trip_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
getPaymentDetails(trip_id) {
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/GetPaymentDetails/${trip_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
getDocumentDetails(trip_id) {
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/GetDocumentDetails/${trip_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
getNotesDetail(trip_id) {
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/GetNotesDetail/${trip_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
getHotelBookingDetail(booking_id) {
|
||||||
|
const org_id = sessionStorage.getItem('org_id');
|
||||||
|
return this.http.get<any>(`${environment.hotelApiBaseUrl}/hotel/BookingDetails?org_id=${org_id}&booking_id=${booking_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
saveConfirmationNumber(reqData) {
|
||||||
|
return this.http.post<any>(`${environment.APIBaseUrl}/HotelBooking/SaveConfirmationNumber`, reqData, { headers: this.headers })
|
||||||
|
}
|
||||||
|
saveNotesDetail(reqData){
|
||||||
|
return this.http.post<any>(`${environment.APIBaseUrl}/HotelBooking/SaveNotesDetail`, reqData, { headers: this.headers })
|
||||||
|
}
|
||||||
|
printInvoiceDocument(document_number){
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/SendInvoiceEmail/${document_number}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
sendInvoiceDocumentMail(document_number, email_id){
|
||||||
|
return this.http.get<any>(`${environment.APIBaseUrl}/HotelBooking/SendInvoiceEmail/${document_number}/${email_id}`, { headers: this.headers })
|
||||||
|
}
|
||||||
|
sendItineraryDocumentMail(reqData){
|
||||||
|
return this.http.post<any>(`${environment.APIBaseUrl}/HotelBooking/SendItineraryEmail`, reqData, { headers: this.headers })
|
||||||
|
}
|
||||||
|
sendVoucherDocumentMail(reqData){
|
||||||
|
return this.http.post<any>(`${environment.APIBaseUrl}/HotelBooking/SendVoucherEmail`, reqData, { headers: this.headers })
|
||||||
|
}
|
||||||
|
UpdateBooking(reqData){
|
||||||
|
return this.http.post<any>(`${environment.APIBaseUrl}/HotelBooking/UpdateBooking`, reqData, { headers: this.headers })
|
||||||
|
};
|
||||||
|
GethotelCityName(reqData){
|
||||||
|
return this.http.post<any>(`${environment.hotelApiBaseUrl}/hotel/hotelcitylist`, reqData, { headers: this.headers })
|
||||||
|
};
|
||||||
|
GetCancelBooking(reqData){
|
||||||
|
return this.http.post<any>(`${environment.hotelApiBaseUrl}/hotel/cancelfee`, reqData, { headers: this.headers })
|
||||||
|
};
|
||||||
|
}
|
||||||
11
src/app/core/services/HotelServices/manage-hotel.service.ts
Normal file
11
src/app/core/services/HotelServices/manage-hotel.service.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ManageHotelService {
|
||||||
|
|
||||||
|
Extranet_Hotel_Id;
|
||||||
|
Active_tab = 'OverView';
|
||||||
|
constructor() { }
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { ContractRoom } from 'src/app/core/models/hotelService/AddRoom/Room.model';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
// import { CommonFunctions } from 'src/app/core/common/common-functions';
|
||||||
|
// import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
|
||||||
|
export class AddRoomService {
|
||||||
|
SaveRoom(dataPost: ContractRoom) {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
constructor(private http: HttpClient) { }
|
||||||
|
getAllRoomCategory() {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/RoomCategoryName/GetAllRoomCategory")
|
||||||
|
};
|
||||||
|
GetAllHotelAmenity() {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/HotelAmenity/GetAllHotelAmenity")
|
||||||
|
};
|
||||||
|
GetAllRoomViewName() {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/RoomViewName/GetAllRoomViewName")
|
||||||
|
};
|
||||||
|
GetAllRoomBedType() {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/BedTypeMaster/GetAllBedType")
|
||||||
|
};
|
||||||
|
SaveRoomContract(roomDetails) {
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/RoomContract/SaveContractRoom", roomDetails)
|
||||||
|
};
|
||||||
|
UpdateRoomContract(roomDetails) {
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/RoomContract/UpdateContractRoom", roomDetails)
|
||||||
|
};
|
||||||
|
saveImage(file) {
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/FileUpload/SaveFile", file)
|
||||||
|
};
|
||||||
|
getlovtype() {
|
||||||
|
let formdata = {
|
||||||
|
"lov_types": [{ "lov_type": "MeasureUnit" }],
|
||||||
|
"lov_lang": "en"
|
||||||
|
}
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/LovMaster/GetLov", formdata)
|
||||||
|
};
|
||||||
|
GetRoomContractById(Id) {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/RoomContract/GetContractRoom/" + Id)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
// import { CommonFunctions } from 'src/app/core/common/common-functions';
|
||||||
|
// import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
|
||||||
|
export class RoomContractService {
|
||||||
|
constructor(private http: HttpClient) { }
|
||||||
|
|
||||||
|
GetAllRoomContract() {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/RoomContract/GetAllContractRoom")
|
||||||
|
};
|
||||||
|
|
||||||
|
UpdateStatus(form) {
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/RoomContract/UpdateStatus", form)
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
// import { CommonFunctions } from 'src/app/core/common/common-functions';
|
||||||
|
// import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
|
||||||
|
export class SeasonSettingService {
|
||||||
|
constructor(private http: HttpClient) { }
|
||||||
|
GetAllSeason() {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/SeasonContract/GetAllSeason")
|
||||||
|
};
|
||||||
|
UpdateStatus(formData) {
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/SeasonContract/UpdateSeasonStatus", formData)
|
||||||
|
};
|
||||||
|
SaveSeason(formData) {
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/SeasonContract/SaveSeason", formData)
|
||||||
|
};
|
||||||
|
UpdateSeason(formData) {
|
||||||
|
return this.http.post(environment.APIBaseUrl + "/SeasonContract/UpdateSeason", formData)
|
||||||
|
};
|
||||||
|
GetContractSeasonById(id) {
|
||||||
|
return this.http.get(environment.APIBaseUrl + "/SeasonContract/GetContractSeasonById/"+ id)
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
46
src/app/core/services/active-sidebar.service.ts
Normal file
46
src/app/core/services/active-sidebar.service.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { BreakpointObserver, Breakpoints } from "@angular/cdk/layout";
|
||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import { Subject, takeUntil } from "rxjs";
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: "root",
|
||||||
|
})
|
||||||
|
export class ActiveSidebarService {
|
||||||
|
activeSide = "IsActive";
|
||||||
|
MobileShow = true;
|
||||||
|
destroyed = new Subject<void>();
|
||||||
|
isTouchEvent!: boolean;
|
||||||
|
constructor(
|
||||||
|
breakpointObserver: BreakpointObserver,
|
||||||
|
) {
|
||||||
|
breakpointObserver.observe([Breakpoints.XSmall, Breakpoints.Small])
|
||||||
|
.pipe(takeUntil(this.destroyed))
|
||||||
|
.subscribe((result) => {
|
||||||
|
if (
|
||||||
|
result.breakpoints["(max-width: 599.98px)"] ||
|
||||||
|
result.breakpoints["(min-width: 600px) and (max-width: 959.98px)"]
|
||||||
|
) {
|
||||||
|
this.MobileShow = true;
|
||||||
|
} else {
|
||||||
|
this.MobileShow = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
SideBar(ele: string) {
|
||||||
|
// if (this.MobileShow) {
|
||||||
|
if (this.activeSide == ele) {
|
||||||
|
this.activeSide = "";
|
||||||
|
//a.type == 'mouseenter' ? this.activeSide = "" : this.activeSide = "IsActive";
|
||||||
|
} else {
|
||||||
|
this.activeSide = "IsActive";
|
||||||
|
//a.type == 'mouseenter' ? this.activeSide = "IsActive" : this.activeSide = "";
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//ActiveSideBar(ele) {
|
||||||
|
// this.activeSide = "";
|
||||||
|
//}
|
||||||
|
//DisActiveSideBar(ele) {
|
||||||
|
// this.activeSide = "IsActive";
|
||||||
|
//}
|
||||||
|
}
|
||||||
123
src/app/core/services/api.service.ts
Normal file
123
src/app/core/services/api.service.ts
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
|
||||||
|
export class API {
|
||||||
|
constructor(private http: HttpClient) {
|
||||||
|
}
|
||||||
|
private headers = {
|
||||||
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
|
// 'LoggedInUser': sessionStorage.getItem('userId')
|
||||||
|
};
|
||||||
|
// Extranet API Base Url
|
||||||
|
Post(url, obj) {
|
||||||
|
return this.http.post<any>(environment.ExtranetAPIBaseUrl + url, obj,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Put(url, obj) {
|
||||||
|
return this.http.put<any>(environment.ExtranetAPIBaseUrl + url, obj,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Delete(url) {
|
||||||
|
return this.http.delete<any>(environment.ExtranetAPIBaseUrl + url,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Get(url) {
|
||||||
|
return this.http.get<any>(environment.ExtranetAPIBaseUrl + url,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// Admin API Base Url
|
||||||
|
AdminPost(url, obj) {
|
||||||
|
return this.http.post<any>(environment.APIBaseUrl + url, obj,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminPut(url, obj) {
|
||||||
|
return this.http.put<any>(environment.APIBaseUrl + url, obj,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminDelete(url) {
|
||||||
|
return this.http.delete<any>(environment.APIBaseUrl + url,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminGet(url) {
|
||||||
|
return this.http.get<any>(environment.APIBaseUrl + url,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// admin api go
|
||||||
|
AdminGoPost(url, obj) {
|
||||||
|
return this.http.post<any>(environment.AdminAPIGOBaseUrl + url, obj,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminGOPut(url, obj) {
|
||||||
|
return this.http.put<any>(environment.AdminAPIGOBaseUrl + url, obj,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminGODelete(url) {
|
||||||
|
return this.http.delete<any>(environment.AdminAPIGOBaseUrl + url,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminGOGet(url) {
|
||||||
|
return this.http.get<any>(environment.AdminAPIGOBaseUrl + url,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
PostFile(url, obj) {
|
||||||
|
return this.http.post<any>(environment.APIBaseUrl + url, obj,);
|
||||||
|
}
|
||||||
|
|
||||||
|
PostFileExtranet(url, obj){
|
||||||
|
return this.http.post<any>(environment.ExtranetAPIBaseUrl + url, obj,);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Admin API GO
|
||||||
|
PostGo(url, obj, customHeaders = null) {
|
||||||
|
let postHeaders = JSON.parse(JSON.stringify(this.headers))
|
||||||
|
if (customHeaders != null) {
|
||||||
|
postHeaders = { ...postHeaders, ...customHeaders }
|
||||||
|
}
|
||||||
|
return this.http.post<any>(environment.APIBaseGoUrl + url, obj,
|
||||||
|
{ headers: postHeaders }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetGo(url) {
|
||||||
|
return this.http.get<any>(environment.APIBaseGoUrl + url,
|
||||||
|
{ headers: this.headers }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
PostFileGo(url, obj) {
|
||||||
|
return this.http.post<any>(environment.APIBaseGoUrl + url, obj,);
|
||||||
|
}
|
||||||
|
getAdjustedLocalTime(): number {
|
||||||
|
const calculatedTime = sessionStorage.getItem('UGT') || '0';
|
||||||
|
const localTime = new Date().getTime();
|
||||||
|
return localTime + parseInt(calculatedTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
38
src/app/core/services/breakpoints.services.ts
Normal file
38
src/app/core/services/breakpoints.services.ts
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
|
||||||
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class BreakpointsService {
|
||||||
|
public IsMobile = new BehaviorSubject(false);
|
||||||
|
destroyed = new Subject<void>();
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.destroyed.next();
|
||||||
|
this.destroyed.complete();
|
||||||
|
}
|
||||||
|
constructor(private breakpointObserver: BreakpointObserver) {
|
||||||
|
this.checkTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkTest() {
|
||||||
|
this.breakpointObserver
|
||||||
|
.observe([Breakpoints.XSmall, Breakpoints.Small])
|
||||||
|
.pipe(takeUntil(this.destroyed))
|
||||||
|
.subscribe((result) => {
|
||||||
|
if (
|
||||||
|
result.breakpoints['(max-width: 599.98px)'] ||
|
||||||
|
result.breakpoints['(min-width: 600px) and (max-width: 959.98px)']
|
||||||
|
) {
|
||||||
|
this.IsMobile.next(true);
|
||||||
|
} else {
|
||||||
|
this.IsMobile.next(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
checkMob() {
|
||||||
|
return this.IsMobile.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
58
src/app/core/services/common.service.ts
Normal file
58
src/app/core/services/common.service.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import * as CryptoJS from 'crypto-js';
|
||||||
|
|
||||||
|
export class CommonService{
|
||||||
|
static yek = "$uPer@dm1n~dI@z7";
|
||||||
|
|
||||||
|
private static encryptText(plainText) {
|
||||||
|
var key = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
var iv = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
|
||||||
|
var encryptedText = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(plainText), key,
|
||||||
|
{
|
||||||
|
keySize: 128 / 8,
|
||||||
|
iv: iv,
|
||||||
|
mode: CryptoJS.mode.CBC,
|
||||||
|
padding: CryptoJS.pad.Pkcs7
|
||||||
|
}).toString();
|
||||||
|
return encryptedText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static decryptText(cipherText) {
|
||||||
|
var key = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
var iv = CryptoJS.enc.Utf8.parse(this.yek);
|
||||||
|
|
||||||
|
var decryptedText = CryptoJS.AES.decrypt(cipherText, key,
|
||||||
|
{
|
||||||
|
keySize: 128 / 8,
|
||||||
|
iv: iv,
|
||||||
|
mode: CryptoJS.mode.CBC,
|
||||||
|
padding: CryptoJS.pad.Pkcs7
|
||||||
|
}).toString(CryptoJS.enc.Utf8);
|
||||||
|
return decryptedText;
|
||||||
|
}
|
||||||
|
public static setSessionStorage(key: string, value) {
|
||||||
|
sessionStorage.setItem(key, this.encryptText(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static getSessionStoage(key: string) {
|
||||||
|
var value = sessionStorage.getItem(key);
|
||||||
|
if (value) {
|
||||||
|
return this.decryptText(value);
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
|
public static resetLocalStoage(key: string) {
|
||||||
|
localStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
public static setLocalStoage(key: string, value) {
|
||||||
|
value = JSON.stringify(value);
|
||||||
|
localStorage.setItem(key, this.encryptText(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static getLocalStoage(key: string) {
|
||||||
|
var value = localStorage.getItem(key);
|
||||||
|
if (value) {
|
||||||
|
return JSON.parse(this.decryptText(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/app/core/services/event-utils.ts
Normal file
27
src/app/core/services/event-utils.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
let eventGuid = 0;
|
||||||
|
const TODAY_STR = new Date().toISOString().replace(/T.*$/, ''); // YYYY-MM-DD of today
|
||||||
|
|
||||||
|
export const INITIAL_EVENTS = [
|
||||||
|
{
|
||||||
|
id: createEventId(),
|
||||||
|
title: 'All-day event',
|
||||||
|
start: TODAY_STR
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: createEventId(),
|
||||||
|
title: 'Timed event',
|
||||||
|
start: TODAY_STR + 'T00:00:00',
|
||||||
|
end: TODAY_STR + 'T03:00:00'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: createEventId(),
|
||||||
|
title: 'Timed event',
|
||||||
|
start: TODAY_STR + 'T12:00:00',
|
||||||
|
end: TODAY_STR + 'T15:00:00'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export function createEventId() {
|
||||||
|
return String(eventGuid++);
|
||||||
|
}
|
||||||
0
src/app/core/services/events.calender.service.ts
Normal file
0
src/app/core/services/events.calender.service.ts
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
import { MessageService } from "primeng/api";
|
||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import { Title } from "@angular/platform-browser";
|
||||||
|
import * as moment from "moment";
|
||||||
|
import { FileUpload } from "primeng/fileupload";
|
||||||
|
import jsPDF from "jspdf";
|
||||||
|
import * as FileSaver from "file-saver";
|
||||||
|
import autoTable from 'jspdf-autotable';
|
||||||
|
import { API } from "../api.service";
|
||||||
|
import { ValidationService } from "../../common/validation.service";
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class FlightContractService {
|
||||||
|
constructor(
|
||||||
|
public ApiServ: API,
|
||||||
|
public validationService: ValidationService,
|
||||||
|
public titleService: Title
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ddLoader = {
|
||||||
|
AirLine: false,
|
||||||
|
Currency: false,
|
||||||
|
origin: false,
|
||||||
|
destination: false,
|
||||||
|
ToAirport: false,
|
||||||
|
FormAirport: false,
|
||||||
|
AirCraft: false,
|
||||||
|
}
|
||||||
|
timer;
|
||||||
|
AirlineList = [];
|
||||||
|
AirportList = [];
|
||||||
|
AllAirCraftList = [];
|
||||||
|
getAirLineBySearch(val) {
|
||||||
|
if (val.length >= 2) {
|
||||||
|
this.ddLoader.AirLine = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
let request = {
|
||||||
|
"langcode": "en",
|
||||||
|
"query": val
|
||||||
|
}
|
||||||
|
this.ApiServ.AdminGoPost(`/MasterSearch/GetAllAirLine`, request).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.AirlineList = res?.Result;
|
||||||
|
this.ddLoader.AirLine = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
};
|
||||||
|
if (!val) {
|
||||||
|
this.AirlineList = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
GetAirportList(val, name) {
|
||||||
|
if (val.length >= 2) {
|
||||||
|
this.ddLoader[name] = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.ApiServ.AdminGOGet(`/Airport/GetList/en/` + val).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.AirportList = res;
|
||||||
|
this.ddLoader[name] = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
};
|
||||||
|
if (!val) {
|
||||||
|
this.AirlineList = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
getAircraftList(val) {
|
||||||
|
let repObj = {
|
||||||
|
aircraft_name: val
|
||||||
|
};
|
||||||
|
if (val.length >= 3) {
|
||||||
|
this.ddLoader.AirCraft = true;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.ApiServ.Post(`/MasterSearch/GetAllAircraftType`, repObj).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.AllAirCraftList = res.data;
|
||||||
|
this.ddLoader.AirCraft = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
GetAirportsByAirportCode(data) {
|
||||||
|
let obj = {
|
||||||
|
airport_code: data
|
||||||
|
}
|
||||||
|
this.ApiServ.AdminGoPost('/Airport/GetAirportsByAirportCode', obj).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
if (res.Result && res.Result.length > 0) {
|
||||||
|
this.AirportList = res.Result;
|
||||||
|
this.AirportList = this.AirportList.map(e => ({ 'ac': e.airport_code, 'ct': e.city_name }));
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.AirportList = [];
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
GetAirlineByAirlineCode(data) {
|
||||||
|
let obj = {
|
||||||
|
airline_code: data
|
||||||
|
}
|
||||||
|
this.ApiServ.AdminGoPost('/MasterSearch/GetAirlineByAirlineCode', obj).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.AirlineList = res.Result;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.AirlineList = [];
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
GetAircraftTypeById(data) {
|
||||||
|
let obj = {
|
||||||
|
aircraft_type_id: data
|
||||||
|
}
|
||||||
|
this.ApiServ.Post('/MasterSearch/GetAircraftTypeById', obj).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.AllAirCraftList = res.data;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.AllAirCraftList = [];
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
21
src/app/core/services/node.service.ts
Normal file
21
src/app/core/services/node.service.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
import { TreeNode } from 'primeng/api';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class NodeService {
|
||||||
|
constructor(private http: HttpClient) { }
|
||||||
|
|
||||||
|
getFiles() {
|
||||||
|
return this.http.get<any>('assets/files.json')
|
||||||
|
.toPromise()
|
||||||
|
.then(res => <TreeNode[]>res.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
getLazyFiles() {
|
||||||
|
return this.http.get<any>('assets/files-lazy.json')
|
||||||
|
.toPromise()
|
||||||
|
.then(res => <TreeNode[]>res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
787
src/app/core/services/nodeservice.ts
Normal file
787
src/app/core/services/nodeservice.ts
Normal file
@@ -0,0 +1,787 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class NodeService {
|
||||||
|
[x: string]: any;
|
||||||
|
getTreeNodesData() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
key: '0',
|
||||||
|
label: 'Documents',
|
||||||
|
data: 'Documents Folder',
|
||||||
|
icon: 'pi pi-fw pi-inbox',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '0-0',
|
||||||
|
label: 'Work',
|
||||||
|
data: 'Work Folder',
|
||||||
|
icon: 'pi pi-fw pi-cog',
|
||||||
|
children: [
|
||||||
|
{ key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
|
||||||
|
{ key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '0-1',
|
||||||
|
label: 'Home',
|
||||||
|
data: 'Home Folder',
|
||||||
|
icon: 'pi pi-fw pi-home',
|
||||||
|
children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
label: 'Events',
|
||||||
|
data: 'Events Folder',
|
||||||
|
icon: 'pi pi-fw pi-calendar',
|
||||||
|
children: [
|
||||||
|
{ key: '1-0', label: 'Meeting', icon: 'pi pi-fw pi-calendar-plus', data: 'Meeting' },
|
||||||
|
{ key: '1-1', label: 'Product Launch', icon: 'pi pi-fw pi-calendar-plus', data: 'Product Launch' },
|
||||||
|
{ key: '1-2', label: 'Report Review', icon: 'pi pi-fw pi-calendar-plus', data: 'Report Review' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
label: 'Movies',
|
||||||
|
data: 'Movies Folder',
|
||||||
|
icon: 'pi pi-fw pi-star-fill',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '2-0',
|
||||||
|
icon: 'pi pi-fw pi-star-fill',
|
||||||
|
label: 'Al Pacino',
|
||||||
|
data: 'Pacino Movies',
|
||||||
|
children: [
|
||||||
|
{ key: '2-0-0', label: 'Scarface', icon: 'pi pi-fw pi-video', data: 'Scarface Movie' },
|
||||||
|
{ key: '2-0-1', label: 'Serpico', icon: 'pi pi-fw pi-video', data: 'Serpico Movie' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2-1',
|
||||||
|
label: 'Robert De Niro',
|
||||||
|
icon: 'pi pi-fw pi-star-fill',
|
||||||
|
data: 'De Niro Movies',
|
||||||
|
children: [
|
||||||
|
{ key: '2-1-0', label: 'Goodfellas', icon: 'pi pi-fw pi-video', data: 'Goodfellas Movie' },
|
||||||
|
{ key: '2-1-1', label: 'Untouchables', icon: 'pi pi-fw pi-video', data: 'Untouchables Movie' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
getTreeTableNodesData() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
key: '0',
|
||||||
|
data: {
|
||||||
|
name: 'Applications',
|
||||||
|
view: '100kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '0-0',
|
||||||
|
data: {
|
||||||
|
name: 'React',
|
||||||
|
view: '25kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '0-0-0',
|
||||||
|
data: {
|
||||||
|
name: 'react.app',
|
||||||
|
view: '10kb',
|
||||||
|
add: 'Application'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '0-0-1',
|
||||||
|
data: {
|
||||||
|
name: 'native.app',
|
||||||
|
view: '10kb',
|
||||||
|
add: 'Application'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '0-0-2',
|
||||||
|
data: {
|
||||||
|
name: 'mobile.app',
|
||||||
|
view: '5kb',
|
||||||
|
add: 'Application'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '0-1',
|
||||||
|
data: {
|
||||||
|
name: 'editor.app',
|
||||||
|
view: '25kb',
|
||||||
|
add: 'Application'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '0-2',
|
||||||
|
data: {
|
||||||
|
name: 'settings.app',
|
||||||
|
view: '50kb',
|
||||||
|
add: 'Application'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
data: {
|
||||||
|
name: 'Cloud',
|
||||||
|
view: '20kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '1-0',
|
||||||
|
data: {
|
||||||
|
name: 'backup-1.zip',
|
||||||
|
view: '10kb',
|
||||||
|
add: 'Zip'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '1-1',
|
||||||
|
data: {
|
||||||
|
name: 'backup-2.zip',
|
||||||
|
view: '10kb',
|
||||||
|
add: 'Zip'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
data: {
|
||||||
|
name: 'Desktop',
|
||||||
|
view: '150kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '2-0',
|
||||||
|
data: {
|
||||||
|
name: 'note-meeting.txt',
|
||||||
|
view: '50kb',
|
||||||
|
add: 'Text'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2-1',
|
||||||
|
data: {
|
||||||
|
name: 'note-todo.txt',
|
||||||
|
view: '100kb',
|
||||||
|
add: 'Text'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3',
|
||||||
|
data: {
|
||||||
|
name: 'Documents',
|
||||||
|
view: '75kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '3-0',
|
||||||
|
data: {
|
||||||
|
name: 'Work',
|
||||||
|
view: '55kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '3-0-0',
|
||||||
|
data: {
|
||||||
|
name: 'Expenses.doc',
|
||||||
|
view: '30kb',
|
||||||
|
add: 'Document'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3-0-1',
|
||||||
|
data: {
|
||||||
|
name: 'Resume.doc',
|
||||||
|
view: '25kb',
|
||||||
|
add: 'Resume'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3-1',
|
||||||
|
data: {
|
||||||
|
name: 'Home',
|
||||||
|
view: '20kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '3-1-0',
|
||||||
|
data: {
|
||||||
|
name: 'Invoices',
|
||||||
|
view: '20kb',
|
||||||
|
add: 'Text'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4',
|
||||||
|
data: {
|
||||||
|
name: 'Downloads',
|
||||||
|
view: '25kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '4-0',
|
||||||
|
data: {
|
||||||
|
name: 'Spanish',
|
||||||
|
view: '10kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '4-0-0',
|
||||||
|
data: {
|
||||||
|
name: 'tutorial-a1.txt',
|
||||||
|
view: '5kb',
|
||||||
|
add: 'Text'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4-0-1',
|
||||||
|
data: {
|
||||||
|
name: 'tutorial-a2.txt',
|
||||||
|
view: '5kb',
|
||||||
|
add: 'Text'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4-1',
|
||||||
|
data: {
|
||||||
|
name: 'Travel',
|
||||||
|
view: '15kb',
|
||||||
|
add: 'Text'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '4-1-0',
|
||||||
|
data: {
|
||||||
|
name: 'Hotel.pdf',
|
||||||
|
view: '10kb',
|
||||||
|
add: 'PDF'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4-1-1',
|
||||||
|
data: {
|
||||||
|
name: 'Flight.pdf',
|
||||||
|
view: '5kb',
|
||||||
|
add: 'PDF'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '5',
|
||||||
|
data: {
|
||||||
|
name: 'Main',
|
||||||
|
view: '50kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '5-0',
|
||||||
|
data: {
|
||||||
|
name: 'bin',
|
||||||
|
view: '50kb',
|
||||||
|
add: 'Link'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '5-1',
|
||||||
|
data: {
|
||||||
|
name: 'etc',
|
||||||
|
view: '100kb',
|
||||||
|
add: 'Link'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '5-2',
|
||||||
|
data: {
|
||||||
|
name: 'var',
|
||||||
|
view: '100kb',
|
||||||
|
add: 'Link'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '6',
|
||||||
|
data: {
|
||||||
|
name: 'Other',
|
||||||
|
view: '5kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '6-0',
|
||||||
|
data: {
|
||||||
|
name: 'todo.txt',
|
||||||
|
view: '3kb',
|
||||||
|
add: 'Text'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '6-1',
|
||||||
|
data: {
|
||||||
|
name: 'logo.png',
|
||||||
|
view: '2kb',
|
||||||
|
add: 'Picture'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '7',
|
||||||
|
data: {
|
||||||
|
name: 'Pictures',
|
||||||
|
view: '150kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '7-0',
|
||||||
|
data: {
|
||||||
|
name: 'barcelona.jpg',
|
||||||
|
view: '90kb',
|
||||||
|
add: 'Picture'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '7-1',
|
||||||
|
data: {
|
||||||
|
name: 'primeng.png',
|
||||||
|
view: '30kb',
|
||||||
|
add: 'Picture'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '7-2',
|
||||||
|
data: {
|
||||||
|
name: 'prime.jpg',
|
||||||
|
view: '30kb',
|
||||||
|
add: 'Picture'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '8',
|
||||||
|
data: {
|
||||||
|
name: 'Videos',
|
||||||
|
view: '1500kb',
|
||||||
|
add: 'Folder'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '8-0',
|
||||||
|
data: {
|
||||||
|
name: 'primefaces.mkv',
|
||||||
|
view: '1000kb',
|
||||||
|
add: 'Video'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '8-1',
|
||||||
|
data: {
|
||||||
|
name: 'intro.avi',
|
||||||
|
view: '500kb',
|
||||||
|
add: 'Video'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
getLazyNodesData() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"label": "Lazy Node 0",
|
||||||
|
"data": "Node 0",
|
||||||
|
"expandedIcon": "pi pi-folder-open",
|
||||||
|
"collapsedIcon": "pi pi-folder",
|
||||||
|
"leaf": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Lazy Node 1",
|
||||||
|
"data": "Node 1",
|
||||||
|
"expandedIcon": "pi pi-folder-open",
|
||||||
|
"collapsedIcon": "pi pi-folder",
|
||||||
|
"leaf": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Lazy Node 1",
|
||||||
|
"data": "Node 2",
|
||||||
|
"expandedIcon": "pi pi-folder-open",
|
||||||
|
"collapsedIcon": "pi pi-folder",
|
||||||
|
"leaf": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
getFileSystemNodesData() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Applications",
|
||||||
|
"view":"200mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Angular",
|
||||||
|
"view":"25mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"angular.app",
|
||||||
|
"view":"10mb",
|
||||||
|
"add":"Application"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"cli.app",
|
||||||
|
"view":"10mb",
|
||||||
|
"add":"Application"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"mobile.app",
|
||||||
|
"view":"5mb",
|
||||||
|
"add":"Application"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"editor.app",
|
||||||
|
"view":"25mb",
|
||||||
|
"add":"Application"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"settings.app",
|
||||||
|
"view":"50mb",
|
||||||
|
"add":"Application"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Cloud",
|
||||||
|
"view":"20mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"backup-1.zip",
|
||||||
|
"view":"10mb",
|
||||||
|
"add":"Zip"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"backup-2.zip",
|
||||||
|
"view":"10mb",
|
||||||
|
"add":"Zip"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"name":"Desktop",
|
||||||
|
"view":"150kb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"note-meeting.txt",
|
||||||
|
"view":"50kb",
|
||||||
|
"add":"Text"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"note-todo.txt",
|
||||||
|
"view":"100kb",
|
||||||
|
"add":"Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Documents",
|
||||||
|
"view":"75kb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Work",
|
||||||
|
"view":"55kb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Expenses.doc",
|
||||||
|
"view":"30kb",
|
||||||
|
"add":"Document"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Resume.doc",
|
||||||
|
"view":"25kb",
|
||||||
|
"add":"Resume"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Home",
|
||||||
|
"view":"20kb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Invoices",
|
||||||
|
"view":"20kb",
|
||||||
|
"add":"Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"name":"Downloads",
|
||||||
|
"view":"25mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"name":"Spanish",
|
||||||
|
"view":"10mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"tutorial-a1.txt",
|
||||||
|
"view":"5mb",
|
||||||
|
"add":"Text"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"tutorial-a2.txt",
|
||||||
|
"view":"5mb",
|
||||||
|
"add":"Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Travel",
|
||||||
|
"view":"15mb",
|
||||||
|
"add":"Text"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Hotel.pdf",
|
||||||
|
"view":"10mb",
|
||||||
|
"add":"PDF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Flight.pdf",
|
||||||
|
"view":"5mb",
|
||||||
|
"add":"PDF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"name":"Main",
|
||||||
|
"view":"50mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"bin",
|
||||||
|
"view":"50kb",
|
||||||
|
"add":"Link"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"etc",
|
||||||
|
"view":"100kb",
|
||||||
|
"add":"Link"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"var",
|
||||||
|
"view":"100kb",
|
||||||
|
"add":"Link"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Other",
|
||||||
|
"view":"5mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"todo.txt",
|
||||||
|
"view":"3mb",
|
||||||
|
"add":"Text"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"logo.png",
|
||||||
|
"view":"2mb",
|
||||||
|
"add":"Picture"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Pictures",
|
||||||
|
"view":"150kb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"barcelona.jpg",
|
||||||
|
"view":"90kb",
|
||||||
|
"add":"Picture"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"primeng.png",
|
||||||
|
"view":"30kb",
|
||||||
|
"add":"Picture"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"prime.jpg",
|
||||||
|
"view":"30kb",
|
||||||
|
"add":"Picture"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"Videos",
|
||||||
|
"view":"1500mb",
|
||||||
|
"add":"Folder"
|
||||||
|
},
|
||||||
|
"children":[
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"primefaces.mkv",
|
||||||
|
"view":"1000mb",
|
||||||
|
"add":"Video"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"name":"intro.avi",
|
||||||
|
"view":"500mb",
|
||||||
|
"add":"Video"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
getTreeTableNodes() {
|
||||||
|
return Promise.resolve(this.getTreeTableNodesData());
|
||||||
|
}
|
||||||
|
|
||||||
|
getTreeNodes() {
|
||||||
|
return Promise.resolve(this.getTreeNodesData());
|
||||||
|
}
|
||||||
|
|
||||||
|
getFiles() {
|
||||||
|
return Promise.resolve(this.getTreeNodesData());
|
||||||
|
}
|
||||||
|
|
||||||
|
getLazyFiles() {
|
||||||
|
return Promise.resolve(this.getLazyNodesData());
|
||||||
|
}
|
||||||
|
|
||||||
|
getFilesystem() {
|
||||||
|
return Promise.resolve(this.getFileSystemNodesData());
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
113
src/app/core/services/product.service.ts
Normal file
113
src/app/core/services/product.service.ts
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
import { Product } from './product';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ProductService {
|
||||||
|
|
||||||
|
status: string[] = ['OUTOFSTOCK', 'INSTOCK', 'LOWSTOCK'];
|
||||||
|
|
||||||
|
productNames: string[] = [
|
||||||
|
"Bamboo Watch",
|
||||||
|
"Black Watch",
|
||||||
|
"Blue Band",
|
||||||
|
"Blue T-Shirt",
|
||||||
|
"Bracelet",
|
||||||
|
"Brown Purse",
|
||||||
|
"Chakra Bracelet",
|
||||||
|
"Galaxy Earrings",
|
||||||
|
"Game Controller",
|
||||||
|
"Gaming Set",
|
||||||
|
"Gold Phone Case",
|
||||||
|
"Green Earbuds",
|
||||||
|
"Green T-Shirt",
|
||||||
|
"Grey T-Shirt",
|
||||||
|
"Headphones",
|
||||||
|
"Light Green T-Shirt",
|
||||||
|
"Lime Band",
|
||||||
|
"Mini Speakers",
|
||||||
|
"Painted Phone Case",
|
||||||
|
"Pink Band",
|
||||||
|
"Pink Purse",
|
||||||
|
"Purple Band",
|
||||||
|
"Purple Gemstone Necklace",
|
||||||
|
"Purple T-Shirt",
|
||||||
|
"Shoes",
|
||||||
|
"Sneakers",
|
||||||
|
"Teal T-Shirt",
|
||||||
|
"Yellow Earbuds",
|
||||||
|
"Yoga Mat",
|
||||||
|
"Yoga Set",
|
||||||
|
];
|
||||||
|
|
||||||
|
constructor(private http: HttpClient) { }
|
||||||
|
|
||||||
|
getProductsSmall() {
|
||||||
|
return this.http.get<any>('assets\products.json')
|
||||||
|
.toPromise()
|
||||||
|
.then(res => <Product[]>res.data)
|
||||||
|
.then(data => { return data; });
|
||||||
|
}
|
||||||
|
|
||||||
|
getProducts() {
|
||||||
|
return this.http.get<any>('assets/products.json')
|
||||||
|
.toPromise()
|
||||||
|
.then(res => <Product[]>res.data)
|
||||||
|
.then(data => { return data; });
|
||||||
|
}
|
||||||
|
|
||||||
|
getProductsWithOrdersSmall() {
|
||||||
|
return this.http.get<any>('assets/products-orders-small.json')
|
||||||
|
.toPromise()
|
||||||
|
.then(res => <Product[]>res.data)
|
||||||
|
.then(data => { return data; });
|
||||||
|
}
|
||||||
|
|
||||||
|
generatePrduct(): Product {
|
||||||
|
const product: Product = {
|
||||||
|
id: this.generateId(),
|
||||||
|
name: this.generateName(),
|
||||||
|
description: "Product Description",
|
||||||
|
price: this.generatePrice(),
|
||||||
|
quantity: this.generateQuantity(),
|
||||||
|
category: "Product Category",
|
||||||
|
inventoryStatus: this.generateStatus(),
|
||||||
|
rating: this.generateRating()
|
||||||
|
};
|
||||||
|
|
||||||
|
// product.image = product.name.toLocaleLowerCase().split(/[ ,]+/).join('-')+".jpg";;
|
||||||
|
return product;
|
||||||
|
}
|
||||||
|
|
||||||
|
generateId() {
|
||||||
|
let text = "";
|
||||||
|
let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
|
||||||
|
for (var i = 0; i < 5; i++) {
|
||||||
|
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
generateName() {
|
||||||
|
return this.productNames[Math.floor(Math.random() * Math.floor(30))];
|
||||||
|
}
|
||||||
|
|
||||||
|
generatePrice() {
|
||||||
|
return Math.floor(Math.random() * Math.floor(299)+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
generateQuantity() {
|
||||||
|
return Math.floor(Math.random() * Math.floor(75)+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
generateStatus() {
|
||||||
|
return this.status[Math.floor(Math.random() * Math.floor(3))];
|
||||||
|
}
|
||||||
|
|
||||||
|
generateRating() {
|
||||||
|
return Math.floor(Math.random() * Math.floor(5)+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/app/core/services/product.ts
Normal file
12
src/app/core/services/product.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export interface Product {
|
||||||
|
id?:string;
|
||||||
|
code?:string;
|
||||||
|
name?:string;
|
||||||
|
description?:string;
|
||||||
|
price?:number;
|
||||||
|
quantity?:number;
|
||||||
|
inventoryStatus?:string;
|
||||||
|
category?:string;
|
||||||
|
image?:string;
|
||||||
|
rating?:number;
|
||||||
|
}
|
||||||
109
src/app/core/services/sso.service.ts
Normal file
109
src/app/core/services/sso.service.ts
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import { Router } from "@angular/router";
|
||||||
|
import { environment } from "src/environments/environment";
|
||||||
|
import { CommonService } from "./common.service";
|
||||||
|
import { of } from "rxjs";
|
||||||
|
import { LoginModel, SSOLoginModel } from "../models/common-model/Sign-in.model";
|
||||||
|
import { API } from "./api.service";
|
||||||
|
import { securityFunctions } from "../common/security";
|
||||||
|
import { CommonFunctionService } from "../common/common-function.service";
|
||||||
|
import * as moment from "moment";
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class SSOService {
|
||||||
|
sso: SSOLoginModel = new SSOLoginModel();
|
||||||
|
constructor(private http: HttpClient, private router: Router, private apiServ: API, private commonService: CommonFunctionService) { }
|
||||||
|
validateSSOLogin(key, loginUserId?) {
|
||||||
|
sessionStorage.removeItem('LoginUserData');
|
||||||
|
this.http.get("https://pro.ip-api.com/json/?fields=query,countryCode,lat,lon,city,proxy&&key=JZDsrdeBzIM0yyN").subscribe(data => {
|
||||||
|
if (data) {
|
||||||
|
let obj = {
|
||||||
|
city: data['city'],
|
||||||
|
countryCode: data['countryCode'],
|
||||||
|
lat: data['lat'],
|
||||||
|
lon: data['lon'],
|
||||||
|
proxy: data['proxy'],
|
||||||
|
iP: data['query'],
|
||||||
|
};
|
||||||
|
sessionStorage.setItem('IP', JSON.stringify(obj));
|
||||||
|
let loginModel = new LoginModel();
|
||||||
|
if (key) {
|
||||||
|
let req_obj = {
|
||||||
|
key: encodeURIComponent(key),
|
||||||
|
city: obj.city,
|
||||||
|
countryCode: obj.countryCode,
|
||||||
|
lat: obj.lat,
|
||||||
|
lon: obj.lon,
|
||||||
|
proxy: obj.proxy,
|
||||||
|
iP: obj.iP,
|
||||||
|
};
|
||||||
|
this.apiServ.AdminPost('/KeyGenerate/VendorSSOKey', req_obj).subscribe({
|
||||||
|
next: res => {
|
||||||
|
if (res && res.resp) {
|
||||||
|
let data = null;
|
||||||
|
if (loginUserId) {
|
||||||
|
if (loginUserId.includes(" ")) {
|
||||||
|
data = loginUserId.replace(/ /g, "+");
|
||||||
|
} else {
|
||||||
|
data = loginUserId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let loginId = loginUserId ? securityFunctions.decryptText(data) : null;
|
||||||
|
// set before jwt token so other api work proper
|
||||||
|
sessionStorage.setItem('JwtToken', res.respObj.JwtToken);
|
||||||
|
sessionStorage.setItem('RefreshToken', res.respObj.RefreshToken);
|
||||||
|
sessionStorage.setItem('JwtTokenExpiry', res.respObj.JwtTokenExpiry);
|
||||||
|
securityFunctions.setSessionStorage('LoginUserData', JSON.stringify(res.respObj.userLogin));
|
||||||
|
let date = new Date(moment(res.respObj.userLogin.last_login).format("YYYY MM DD hh:mm:ss") + " UTC");
|
||||||
|
let lastLogin = moment(date.toString()).format("hh:mm:ss, DD MMM YYYY");
|
||||||
|
sessionStorage.setItem('lastLogin', lastLogin);
|
||||||
|
sessionStorage.setItem('userName', res.respObj.userLogin.first_name);
|
||||||
|
this.commonService.FetchExtranetVendorMaster(res.respObj.userLogin.extranet_vendor_id, false).subscribe(data => {
|
||||||
|
if (data) {
|
||||||
|
securityFunctions.setSessionStorage('VData', JSON.stringify(data.Result[0]));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.router.navigate(['/'])
|
||||||
|
this.commonService.StartTimer();
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['/Auth/Login']);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: err => {
|
||||||
|
this.router.navigate(['/Auth/Login']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['/Auth/Login']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUserdata(userid) {
|
||||||
|
// if (userid) {
|
||||||
|
// return this.http.get(environment.adminAPIUrl + "/UserAccount/GetUserDetail/" + userid)
|
||||||
|
// } else {
|
||||||
|
// return of('continue');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
UserIpDetails;
|
||||||
|
GetIpAddress() {
|
||||||
|
this.http.get("https://pro.ip-api.com/json/?fields=query,countryCode,lat,lon,city,proxy&&key=JZDsrdeBzIM0yyN").subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.UserIpDetails = res;
|
||||||
|
let obj = {
|
||||||
|
city: res['city'],
|
||||||
|
countryCode: res['countryCode'],
|
||||||
|
lat: res['lat'],
|
||||||
|
lon: res['lon'],
|
||||||
|
proxy: res['proxy'],
|
||||||
|
iP: res['query'],
|
||||||
|
}
|
||||||
|
sessionStorage.setItem('IP', JSON.stringify(obj));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<div class="progress-loader" [hidden]="!loading">
|
||||||
|
<!-- -->
|
||||||
|
<div class="loading-spinner">
|
||||||
|
<div class="row examples">
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="snippet" data-title=".dot-pulse">
|
||||||
|
<div class="stage">
|
||||||
|
<div class="dot-pulse"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||||
|
import { LoaderService } from 'src/app/core/common/loader.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-loader',
|
||||||
|
templateUrl: './intercept-loader.component.html',
|
||||||
|
})
|
||||||
|
export class LoaderComponent implements OnInit {
|
||||||
|
|
||||||
|
loading: boolean;
|
||||||
|
|
||||||
|
constructor(private loaderService: LoaderService, private cd: ChangeDetectorRef) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.loaderService.isLoading.subscribe((v) => {
|
||||||
|
this.loading = v;
|
||||||
|
this.cd.detectChanges();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/app/core/shared/shared.module.ts
Normal file
13
src/app/core/shared/shared.module.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class SharedModule { }
|
||||||
19
src/app/layouts/base/base.component.html
Normal file
19
src/app/layouts/base/base.component.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<div class="app-main" [ngClass]="{'ng-app-main-active': ChcekSidebar.activeSide == 'IsActive'}">
|
||||||
|
<div class="app-asidebar">
|
||||||
|
<custom-sidebar></custom-sidebar>
|
||||||
|
</div>
|
||||||
|
<div [ngStyle]="{'padding-top.px': headerHeight}" style="height: 100%;">
|
||||||
|
<div class="app-mainBody">
|
||||||
|
<div class="app-header" #headerElement>
|
||||||
|
<app-header></app-header>
|
||||||
|
</div>
|
||||||
|
<div class="app-mainContent">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
<div class="app-extra-space"></div>
|
||||||
|
<!-- <div class="app-footer">
|
||||||
|
<app-footer></app-footer>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
34
src/app/layouts/base/base.component.ts
Normal file
34
src/app/layouts/base/base.component.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { Component, ElementRef, OnDestroy, ViewChild } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { ActiveSidebarService } from 'src/app/core/services/active-sidebar.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: './base.component.html',
|
||||||
|
selector: 'app-base',
|
||||||
|
})
|
||||||
|
export class BaseComponent {
|
||||||
|
constructor(public ChcekSidebar: ActiveSidebarService) {}
|
||||||
|
|
||||||
|
@ViewChild('headerElement') headerElement!: ElementRef;
|
||||||
|
headerHeight: number = 0;
|
||||||
|
resizeObserver!: ResizeObserver;
|
||||||
|
ngAfterViewInit() {
|
||||||
|
this.resizeObserver = new ResizeObserver(entries => {
|
||||||
|
for (let entry of entries) {
|
||||||
|
if (entry.target === this.headerElement.nativeElement) {
|
||||||
|
this.headerHeight = entry.contentRect.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.headerElement && this.headerElement.nativeElement) {
|
||||||
|
this.resizeObserver.observe(this.headerElement.nativeElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
if (this.resizeObserver && this.headerElement && this.headerElement.nativeElement) {
|
||||||
|
this.resizeObserver.unobserve(this.headerElement.nativeElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<!-- <div class="progress-loader" [hidden]="!loading">
|
||||||
|
<div class="loading-spinner">
|
||||||
|
<div class="row examples">
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="snippet" data-title=".dot-pulse">
|
||||||
|
<div class="stage">
|
||||||
|
<div class="dot-pulse"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
22
src/app/layouts/intercept-loader/loader/loader.component.ts
Normal file
22
src/app/layouts/intercept-loader/loader/loader.component.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||||
|
import { LoaderService } from 'src/app/core/common/loader.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-loader',
|
||||||
|
templateUrl: './loader.component.html',
|
||||||
|
})
|
||||||
|
export class LoaderComponent implements OnInit {
|
||||||
|
|
||||||
|
loading: boolean;
|
||||||
|
|
||||||
|
constructor(private loaderService: LoaderService, private cd: ChangeDetectorRef) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.loaderService.isLoading.subscribe((v) => {
|
||||||
|
this.loading = v;
|
||||||
|
this.cd.detectChanges();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
68
src/app/layouts/pages-routing.module.ts
Normal file
68
src/app/layouts/pages-routing.module.ts
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
// Angular
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
// Components
|
||||||
|
import { AuthGuard } from '../core/guard/auth.guard';
|
||||||
|
import { BaseComponent } from './base/base.component';
|
||||||
|
import { unauthorizedComponent } from './unauthorized/unauthorized.component';
|
||||||
|
// Auth
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
component: BaseComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "Unauthorized",
|
||||||
|
component: unauthorizedComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'BookingManagement',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('../modules/booking-management/booking-management.module').then(
|
||||||
|
(m) => m.BookingManagementModule
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'Services',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('../modules/services/services.module').then((m) => m.ServicesModule),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'UserConfiguration',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('../modules/user-configuration/user-configuration.module').then((m) => m.UserConfigurationModule),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'ActivityConfiguration',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('../modules/services/activity-config/activity-config.module').then((m) => m.ActivityConfigModule),
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// path: 'Error/403',
|
||||||
|
// data: {
|
||||||
|
// type: 'error-v6',
|
||||||
|
// code: 403,
|
||||||
|
// title: '403... Access forbidden',
|
||||||
|
// desc: "Looks like you don't have permission to access for requested page.<br> Please, contact administrator",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: 'Error/404',
|
||||||
|
// data: {
|
||||||
|
// type: 'error-v4',
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// { path: 'Error/:type' },
|
||||||
|
{ path: '', redirectTo: '', pathMatch: 'full' },
|
||||||
|
{ path: '**', redirectTo: 'Error/404', pathMatch: 'full' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class PagesRoutingModule { }
|
||||||
51
src/app/layouts/theme.module.ts
Normal file
51
src/app/layouts/theme.module.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
// Angular
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
// NgBootstrap
|
||||||
|
// Translation
|
||||||
|
import { BaseComponent } from './base/base.component';
|
||||||
|
import { PagesRoutingModule } from './pages-routing.module';
|
||||||
|
import { FooterComponent } from '../modules/common/footer/footer.component';
|
||||||
|
import { HeaderComponent } from '../modules/common/header/header.component';
|
||||||
|
//Angular Material
|
||||||
|
import { MatExpansionModule } from '@angular/material/expansion';
|
||||||
|
import { AuthGuard } from '../core/guard/auth.guard';
|
||||||
|
import { SideBarComponent } from '../modules/common/sidebar/sidebar.component';
|
||||||
|
import { PanelMenuModule } from 'primeng/panelmenu';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
|
import { unauthorizedComponent } from './unauthorized/unauthorized.component';
|
||||||
|
import { CustomSidebarComponent } from '../modules/common/custom-sidebar/custom-sidebar.component';
|
||||||
|
import { CustomSidebarItemComponent } from '../modules/common/custom-sidebar/custom-sidebar-item/custom-sidebar-item.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
BaseComponent,
|
||||||
|
FooterComponent,
|
||||||
|
HeaderComponent,
|
||||||
|
SideBarComponent,
|
||||||
|
unauthorizedComponent,
|
||||||
|
CustomSidebarComponent,
|
||||||
|
CustomSidebarItemComponent,
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
RouterModule,
|
||||||
|
PagesRoutingModule,
|
||||||
|
|
||||||
|
// material module
|
||||||
|
MatExpansionModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatMenuModule,
|
||||||
|
// material module
|
||||||
|
|
||||||
|
// prime ng
|
||||||
|
PanelMenuModule
|
||||||
|
],
|
||||||
|
exports: [],
|
||||||
|
providers: [],
|
||||||
|
})
|
||||||
|
export class ThemeModule { }
|
||||||
|
|
||||||
59
src/app/layouts/unauthorized/unauthorized.component.html
Normal file
59
src/app/layouts/unauthorized/unauthorized.component.html
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<div class="error-404">
|
||||||
|
<div class="errorWrap">
|
||||||
|
<div class="errorSvG"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400px" height="400px" viewBox="0 0 871 731">
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip-_403_SVG">
|
||||||
|
<rect width="871" height="731"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<g id="_403_SVG" data-name="403 SVG" clip-path="url(#clip-_403_SVG)">
|
||||||
|
<rect width="871" height="731" fill="#fff"/>
|
||||||
|
<g id="_403_SVG-2" data-name="403 SVG" transform="translate(-14.173 -11.597)">
|
||||||
|
<g id="Group_13964" data-name="Group 13964">
|
||||||
|
<g id="Group_13963" data-name="Group 13963">
|
||||||
|
<path id="Path_14692" data-name="Path 14692" d="M162.71,414.43s-2.02.84-5.46,2.47" fill="none" stroke="#204482" stroke-miterlimit="10" stroke-width="1"/>
|
||||||
|
<path id="Path_14693" data-name="Path 14693" d="M146.49,422.35c-44.3,23.8-154.05,99.36.91,201.27C336.19,747.78,507.15,486.6,507.15,486.6l182.8-113.06s272.22-20.34,119.1-210.83c0,0-50.14-63.02-200.74-86.68" fill="none" stroke="#204482" stroke-miterlimit="10" stroke-width="1" stroke-dasharray="12.062 12.062"/>
|
||||||
|
<path id="Path_14694" data-name="Path 14694" d="M602.35,75.12q-2.94-.435-5.94-.85" fill="none" stroke="#204482" stroke-miterlimit="10" stroke-width="1"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<path id="Path_14695" data-name="Path 14695" d="M674.67,565.19q9.165-9,18.33-18.01c-.38-.68-.59-1.06-.8-1.44q-23.58-43.05,1.3-85.36c1.56-2.66,3.64-2.66,5.23-.03,13.75,22.65,16.29,46.52,7.81,71.59-.14.42-.28.84-.42,1.27-.01.04.03.09-.02-.04,7.68-7.68,15.41-15.4,22.94-22.92-2-4.77-4.46-9.49-6.01-14.49-6.23-20.12-3.79-39.26,7.22-57.25,1.48-2.43,3.52-2.46,5.01-.07a67.64,67.64,0,0,1,10.41,41.01,69.766,69.766,0,0,1-3.19,16.69,7.072,7.072,0,0,0-.18.71q10.17-10.17,20.7-20.71c-1.05-2.29-2.45-4.87-3.47-7.6q-9.285-24.975,4.38-47.92c1.63-2.74,3.69-2.73,5.31-.03a53.415,53.415,0,0,1,6.11,42.83c-.05.19-.09.39-.12.58a1.455,1.455,0,0,0,.08.34c.36-.3.67-.54.95-.81,2.19-2.18,4.4-4.34,6.54-6.57a5.033,5.033,0,0,0,1.14-2.01c6.03-20.57,19.34-33.66,40.12-39.06,2.81-.73,4.3.77,3.58,3.56q-8.13,31.26-39.2,40.15a5.8,5.8,0,0,0-2.26,1.29c-2.44,2.34-4.8,4.76-7.35,7.32,2.77-.55,5.27-1.16,7.81-1.52a53.151,53.151,0,0,1,36.63,7.77c2.09,1.31,2.08,3.45-.03,4.77a53.993,53.993,0,0,1-55.34,1.38,1.641,1.641,0,0,0-1.5.07c-6.84,6.76-13.63,13.57-20.73,20.66,2.39-.66,4.38-1.29,6.4-1.77q27.735-6.555,52.19,8.11c.3.18.59.37.88.56,2.1,1.42,2.11,3.41-.03,4.78a66.117,66.117,0,0,1-24.91,9.64,67.7,67.7,0,0,1-45.98-8.19c-.65-.37-1.11-.61-1.8.08q-11.07,11.145-22.2,22.23a3.761,3.761,0,0,0-.31.42c3.79-1.06,7.52-2.32,11.33-3.14,22.03-4.78,42.65-1.17,61.84,10.63,2.53,1.56,2.52,3.61,0,5.19a82.086,82.086,0,0,1-85.37,1.37c-.38-.22-.77-.43-1.16-.64q-9.345,9.12-18.62,18.18h-3.29C674.67,567.58,674.67,566.39,674.67,565.19Z" fill="#a1c7ff"/>
|
||||||
|
<path id="Path_14696" data-name="Path 14696" d="M297.95,595.96q-10.065-7.98-20.14-15.96c.3-.72.47-1.12.64-1.52q18.885-45.315-10.35-84.74c-1.84-2.48-3.9-2.26-5.21.52-11.27,23.98-11.26,47.99-.17,72.02.19.4.37.81.55,1.22.02.03-.02.09.02-.04-8.45-6.82-16.96-13.68-25.24-20.36,1.48-4.95,3.42-9.91,4.43-15.05,4.06-20.66-.4-39.44-13.25-56.16-1.73-2.26-3.77-2.07-4.99.46a67.709,67.709,0,0,0-6,41.89,69.827,69.827,0,0,0,4.94,16.25c.13.31.23.63.25.69q-11.19-9.03-22.78-18.39c.8-2.38,1.92-5.1,2.64-7.93q6.585-25.83-9.44-47.18c-1.91-2.55-3.96-2.32-5.29.54a53.382,53.382,0,0,0-1.53,43.23q.105.285.18.57a2.071,2.071,0,0,1-.04.35,12.159,12.159,0,0,1-1.03-.71c-2.41-1.94-4.84-3.85-7.2-5.84a4.951,4.951,0,0,1-1.34-1.88c-8.18-19.82-22.8-31.42-44.04-34.58-2.88-.43-4.2,1.22-3.18,3.92q11.4,30.21,43.24,35.76a5.782,5.782,0,0,1,2.38,1.04c2.68,2.06,5.28,4.23,8.08,6.5-2.82-.25-5.37-.6-7.93-.69a53.2,53.2,0,0,0-35.6,11.61c-1.94,1.52-1.71,3.65.54,4.74a54.015,54.015,0,0,0,55.18-4.5,1.619,1.619,0,0,1,1.49-.09c7.52,6,15,12.05,22.81,18.35-2.44-.41-4.49-.82-6.55-1.08q-28.275-3.57-51.04,13.6c-.28.21-.55.43-.82.65-1.94,1.64-1.74,3.61.54,4.75a66.161,66.161,0,0,0,25.79,6.94,67.663,67.663,0,0,0,44.85-13.03c.61-.44,1.04-.73,1.79-.11q12.18,9.915,24.43,19.75a3.089,3.089,0,0,1,.35.38c-3.88-.65-7.72-1.5-11.6-1.92-22.41-2.41-42.54,3.36-60.37,17.14-2.35,1.82-2.12,3.86.55,5.16a81.257,81.257,0,0,0,49.46,7.33,80.382,80.382,0,0,0,35.57-15.03c.36-.26.73-.51,1.09-.76q10.26,8.085,20.44,16.1c1.09-.12,2.18-.23,3.27-.35C298.2,598.34,298.08,597.15,297.95,595.96Z" fill="#a1c7ff"/>
|
||||||
|
<path id="Path_14697" data-name="Path 14697" d="M482.45,107.42c20.2,0,40.41-.12,60.61.02,52.27.36,88.66,38.7,88.71,93.35.03,29.68-.18,59.37.16,89.05.08,6.7-2.02,8.52-8.09,8.19-8.79-.48-17.63-.37-26.43-.03-4.89.19-6.16-1.65-6.13-6.62.19-28.56.12-57.12.04-85.68-.09-33.87-21.46-56.12-53.85-56.15q-55.125-.045-110.26-.01c-32.65.08-54.06,22.61-54.12,56.8-.04,28.11-.13,56.22.11,84.33.05,5.58-1.58,7.54-6.95,7.33-9.23-.37-18.48-.23-27.72-.07-3.95.07-5.78-1.04-5.76-5.68.2-33.51-.51-67.03.41-100.51,1.22-44.33,37.27-82.2,79.63-83.93,23.18-.95,46.42-.17,69.63-.17A1.609,1.609,0,0,0,482.45,107.42Z" fill="#fff" stroke="#204482" stroke-miterlimit="10" stroke-width="10"/>
|
||||||
|
<path id="Path_14698" data-name="Path 14698" d="M684.59,668.34c-2.82-4.53-5.78-7.19-5.53-9.47s3.73-5.77,5.78-5.75c2.01.01,5.44,3.65,5.6,5.9C690.61,661.33,687.57,663.89,684.59,668.34Z" fill="#e91200"/>
|
||||||
|
<path id="Path_14699" data-name="Path 14699" d="M482.88,696.76h0c134.56,0,243.64-109.08,243.64-243.64V366.8a68.032,68.032,0,0,0-68.03-68.03H307.28a68.032,68.032,0,0,0-68.03,68.03v86.32C239.24,587.68,348.32,696.76,482.88,696.76Z" fill="#fff" stroke="#204482" stroke-miterlimit="10" stroke-width="10"/>
|
||||||
|
<g id="Group_13965" data-name="Group 13965">
|
||||||
|
<path id="Path_14700" data-name="Path 14700" d="M200.76,625.81a1.675,1.675,0,0,1-2.37-.05l-2.96-3.08-3.08,2.97a1.68,1.68,0,0,1-2.33-2.42l3.08-2.97-2.97-3.08a1.675,1.675,0,0,1,.05-2.37,1.694,1.694,0,0,1,1.19-.47,1.673,1.673,0,0,1,1.17.51l2.97,3.08,3.08-2.96a1.675,1.675,0,0,1,2.37.05,1.694,1.694,0,0,1,.47,1.19,1.673,1.673,0,0,1-.51,1.17l-3.08,2.96,2.96,3.08A1.69,1.69,0,0,1,200.76,625.81Z" fill="none" stroke="#204482" stroke-miterlimit="10" stroke-width="3"/>
|
||||||
|
</g>
|
||||||
|
<g id="Group_13966" data-name="Group 13966">
|
||||||
|
<path id="Path_14701" data-name="Path 14701" d="M814.34,598.97a1.675,1.675,0,0,1-2.37-.05l-2.96-3.08-3.08,2.97a1.68,1.68,0,0,1-2.33-2.42l3.08-2.97-2.97-3.08a1.675,1.675,0,0,1,.05-2.37,1.694,1.694,0,0,1,1.19-.47,1.673,1.673,0,0,1,1.17.51l2.97,3.08,3.08-2.96a1.675,1.675,0,0,1,2.37.05,1.694,1.694,0,0,1,.47,1.19,1.673,1.673,0,0,1-.51,1.17l-3.08,2.96,2.96,3.08A1.69,1.69,0,0,1,814.34,598.97Z" fill="none" stroke="#204482" stroke-miterlimit="10" stroke-width="3"/>
|
||||||
|
</g>
|
||||||
|
<circle id="Ellipse_990" data-name="Ellipse 990" cx="9.07" cy="9.07" r="9.07" transform="translate(837.64 415.71)" fill="none" stroke="#1f4582" stroke-miterlimit="10" stroke-width="4"/>
|
||||||
|
<circle id="Ellipse_991" data-name="Ellipse 991" cx="6.66" cy="6.66" r="6.66" transform="translate(195.48 162.25)" fill="none" stroke="#1f4582" stroke-miterlimit="10" stroke-width="2.938"/>
|
||||||
|
<path id="Path_14702" data-name="Path 14702" d="M44.35,379.92l11.17-4.75a.851.851,0,0,0,.18-1.46l-9.7-7.3a.848.848,0,0,0-1.35.58l-1.47,12.05A.845.845,0,0,0,44.35,379.92Z" fill="none" stroke="#204482" stroke-miterlimit="10" stroke-width="3"/>
|
||||||
|
<path id="Path_14703" data-name="Path 14703" d="M696.32,191.92l11.17-4.75a.851.851,0,0,0,.18-1.46l-9.7-7.3a.847.847,0,0,0-1.35.58l-1.47,12.05A.842.842,0,0,0,696.32,191.92Z" fill="none" stroke="#204482" stroke-miterlimit="10" stroke-width="3"/>
|
||||||
|
<circle id="Ellipse_992" data-name="Ellipse 992" cx="94.11" cy="94.11" r="94.11" transform="translate(388.77 403.65)" fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width="18"/>
|
||||||
|
<path id="Path_14704" data-name="Path 14704" d="M498.02,493.96l6.25,75.59h-42.8l5.8-75.85a31.958,31.958,0,1,1,30.75.26Z" fill="#fff" stroke="#204482" stroke-miterlimit="10" stroke-width="10"/>
|
||||||
|
<g id="Group_13967" data-name="Group 13967">
|
||||||
|
<path id="Path_14705" data-name="Path 14705" d="M570.92,76.28q-21.105-14.355-42.18-28.75c-.2-.14-.47-.23-.57-.42a1.814,1.814,0,0,1-.36-1.08c.06-.27.52-.48.84-.64a1.408,1.408,0,0,1,.62-.04q33.165-1.23,66.21-4.34c2.03-.19,4.06-.41,6.09-.59,1.02-.09,1.43.48,1.12,1.45-.11.35-.05.77-.14,1.13a2.447,2.447,0,0,1-.48,1.15,69.939,69.939,0,0,0-11.08,12.72,3.05,3.05,0,0,0-.48,1.64c.02,4.79.1,9.59.12,14.38,0,.42-.22,1.06-.52,1.19-.32.14-.85-.19-1.28-.34a1.492,1.492,0,0,1-.35-.27,16.418,16.418,0,0,0-10.44-3.57,1.447,1.447,0,0,0-1.03.51c-1.07,1.56-2.04,3.17-3.1,4.74a16.2,16.2,0,0,1-1.39,1.56A5.456,5.456,0,0,1,570.92,76.28Zm12.34-16.03a2.889,2.889,0,0,0-.47-.16,257.517,257.517,0,0,1-34.64-8.2c-4.3-1.29-8.75-2.05-13.14-3.05a1.408,1.408,0,0,0-.83.04c12.36,8.45,24.71,16.91,37.17,25.43A41.567,41.567,0,0,1,583.26,60.25ZM547.63,48.91q20.22,2.91,40.44,5.76c.45.06.81.16,1.12-.39a42.823,42.823,0,0,1,9.01-11.26c.08-.07.14-.16.36-.4-20.77,2.01-41.38,3.45-62.03,4.51C540.24,47.73,543.93,48.38,547.63,48.91Z" fill="#204482"/>
|
||||||
|
<path id="Path_14706" data-name="Path 14706" d="M525.39,47.44c.09-.19.4-.53.37-.83a1.151,1.151,0,0,0-.61-.86c-1.69-.4-3.4-.74-5.12-1a1.162,1.162,0,0,0-.91.63c-.1.29.14.99.35,1.04,1.83.44,3.68.78,5.53,1.14A3.141,3.141,0,0,0,525.39,47.44Z" fill="#204482"/>
|
||||||
|
<path id="Path_14707" data-name="Path 14707" d="M522.77,39.7c.46.52.8.9,1.13,1.28.63.71,1.26,1.43,1.91,2.13a.95.95,0,1,0,1.44-1.24c-.9-1.03-1.79-2.08-2.76-3.04a1.253,1.253,0,0,0-1.17-.15C523.03,38.83,522.94,39.37,522.77,39.7Z" fill="#204482"/>
|
||||||
|
<path id="Path_14708" data-name="Path 14708" d="M525.89,48.76a5.715,5.715,0,0,0-3.01,2.84,1.243,1.243,0,0,0,.39,1.17,1.442,1.442,0,0,0,1.21-.28,13.935,13.935,0,0,0,2.05-1.94,1.468,1.468,0,0,0,.29-1.22C526.7,49.02,526.13,48.89,525.89,48.76Z" fill="#204482"/>
|
||||||
|
<path id="Path_14709" data-name="Path 14709" d="M571.36,74.32a41.573,41.573,0,0,1,11.9-14.07,2.889,2.889,0,0,0-.47-.16,257.517,257.517,0,0,1-34.64-8.2c-4.3-1.29-8.75-2.05-13.14-3.05a1.408,1.408,0,0,0-.83.04Q552.72,61.57,571.36,74.32Z" fill="#3666b6"/>
|
||||||
|
<path id="Path_14710" data-name="Path 14710" d="M536.54,47.14c3.7.6,7.39,1.24,11.1,1.78q20.22,2.91,40.44,5.76c.45.06.81.16,1.12-.39a42.823,42.823,0,0,1,9.01-11.26c.08-.07.14-.16.36-.4C577.79,44.64,557.18,46.07,536.54,47.14Z" fill="#3666b6"/>
|
||||||
|
</g>
|
||||||
|
<path id="Path_14711" data-name="Path 14711" d="M674.84,576.63c-.01-.22-.03-.45-.04-.67-.91-13.63,3.17-17.24,15.95-13.36,1.89.57,4.37,4.13,4.24,6.15q-2.16,33.525-5.32,66.97c-.18,1.95-3.03,3.63-4.64,5.44-1.79-2.09-4.92-4.03-5.15-6.3-2.01-19.37-3.5-38.81-5.14-58.22A.275.275,0,0,1,674.84,576.63Z" fill="#e91200"/>
|
||||||
|
<path id="Path_14712" data-name="Path 14712" d="M684.32,686.71q-40.935,0-81.88-.01c-11.4-.01-13.39-3.55-7.84-13.61q41.385-75.045,82.75-150.1c5.24-9.51,9.3-9.67,14.51-.26q42.09,76.185,84.04,152.45c4.11,7.46,1.89,11.45-6.47,11.47-28.37.08-56.74.03-85.1.03C684.32,686.7,684.32,686.7,684.32,686.71Zm-9.48-110.08c-.04,0-.07.01-.11.01,1.64,19.41,3.13,38.85,5.14,58.22.24,2.27,3.36,4.21,5.15,6.3,1.61-1.81,4.46-3.49,4.64-5.44q3.12-33.435,5.32-66.97c.13-2.01-2.35-5.57-4.24-6.15-12.79-3.88-16.86-.27-15.95,13.36C674.81,576.18,674.82,576.4,674.84,576.63Zm9.75,91.71c2.98-4.45,6.02-7.01,5.85-9.32-.16-2.26-3.59-5.89-5.6-5.9-2.05-.01-5.52,3.48-5.78,5.75S681.77,663.81,684.59,668.34Z" fill="#fff"/>
|
||||||
|
<path id="Path_14713" data-name="Path 14713" d="M684.54,696.06q-47.685,0-95.38-.01c-12.53-.01-15.1-4.68-8.82-16.14q47.745-87.12,95.54-174.19,8.715-15.885,17.78.08c9.64,16.95,19.49,33.77,28.84,50.9q34.14,62.595,67.87,125.43c4.67,8.66,1.7,13.87-7.88,13.89q-48.975.105-97.96.03C684.54,696.04,684.54,696.05,684.54,696.06Zm-.22-9.35v-.02c28.37,0,56.74.05,85.1-.03,8.36-.02,10.58-4.01,6.47-11.47q-41.97-76.26-84.04-152.45c-5.2-9.42-9.26-9.26-14.51.26q-41.37,75.06-82.75,150.1c-5.55,10.06-3.56,13.6,7.84,13.61Q643.38,686.74,684.32,686.71Z" fill="#e91200"/>
|
||||||
|
<path id="Path_14714" data-name="Path 14714" d="M311.23,257.68c-2.86,9.7-6.38,18.92-8.25,28.49-4.75,24.25-1.96,47.77,7.8,70.44a27.284,27.284,0,0,1,2.29,12.9c-3.71,36.18-20.7,63.44-52.97,77.6s-63.25,9.1-90.91-13.62c-19.79-16.26-29.49-38.47-31.93-64.32a20.481,20.481,0,0,1,1.3-9.79c14.65-32.81,14.47-65.54.1-98.34a13.419,13.419,0,0,1-.61-2.18c11.43-5.54,23.11-10.2,33.75-16.7a43.083,43.083,0,0,1,24.26-6.67c21.47.3,42.96-.25,64.43-.27a20.811,20.811,0,0,1,8.68,1.76c13.46,6.35,26.79,13.01,40.16,19.58C310.08,256.92,310.77,257.41,311.23,257.68ZM225.3,244.65c-7.91,0-15.02.39-22.08-.09-11.44-.78-21.92.97-31.6,8.2-4.98,3.72-11.05,5.98-16.86,8.27-4.07,1.6-5.3,3.42-3.78,7.94,10.48,31.07,9.14,61.69-3.48,91.88a19.788,19.788,0,0,0-1.53,9.07c3.86,41.36,36.84,74.45,74.9,75.39,42.62,1.05,76.65-28.28,82.45-71.6a32.251,32.251,0,0,0-1.97-15.47c-10.54-26.47-12.62-53.42-5.42-81.08,3.55-13.63,2.86-12.26-8.63-20-17.82-12-36.76-14.73-57.04-12.76C228.35,244.58,226.41,244.6,225.3,244.65Z" fill="#e91200"/>
|
||||||
|
<path id="Path_14715" data-name="Path 14715" d="M225.3,244.65c1.11-.06,3.04-.08,4.97-.26,20.28-1.97,39.22.75,57.04,12.76,11.49,7.74,12.18,6.37,8.63,20-7.2,27.66-5.12,54.61,5.42,81.08a32.267,32.267,0,0,1,1.97,15.47c-5.8,43.32-39.83,72.65-82.45,71.6-38.06-.94-71.04-34.03-74.9-75.39a19.92,19.92,0,0,1,1.53-9.07c12.62-30.18,13.96-60.81,3.48-91.88-1.52-4.52-.29-6.34,3.78-7.94,5.81-2.29,11.88-4.55,16.86-8.27,9.68-7.23,20.16-8.97,31.6-8.2C210.28,245.04,217.39,244.65,225.3,244.65Z" fill="#fff"/>
|
||||||
|
<path id="Path_14716" data-name="Path 14716" d="M250.22,302.81c7.4,5.89,10.95,8.49,18.38,14.41-16.93,19.22-28.91,42.35-45.78,61.51-12.7-10.55-24.64-20.72-37.22-30.44,5.14-7.41,6.43-8.3,11.67-16.55,7.8,6.85,15.12,13.27,23.4,20.54C230.56,335.72,240.15,319.66,250.22,302.81Z" fill="#e91200"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg></div>
|
||||||
|
<div class="errorContent">
|
||||||
|
<h1>4Ø3</h1>
|
||||||
|
<h3>Sorry! You are not authorized to view this page.</h3>
|
||||||
|
<h5>Please contact your administrator</h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
16
src/app/layouts/unauthorized/unauthorized.component.ts
Normal file
16
src/app/layouts/unauthorized/unauthorized.component.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { CommonFunctionService } from 'src/app/core/common/common-function.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-Unauthorized',
|
||||||
|
templateUrl: './unauthorized.component.html',
|
||||||
|
})
|
||||||
|
export class unauthorizedComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(private _commonSer: CommonFunctionService) { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this._commonSer.CheckTokenExpireTime(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
0
src/app/modules/auth/auth.component.html
Normal file
0
src/app/modules/auth/auth.component.html
Normal file
14
src/app/modules/auth/auth.component.ts
Normal file
14
src/app/modules/auth/auth.component.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-auth',
|
||||||
|
templateUrl: './auth.component.html',
|
||||||
|
})
|
||||||
|
export class AuthComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
63
src/app/modules/auth/auth.module.ts
Normal file
63
src/app/modules/auth/auth.module.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import { MessageService } from 'primeng/api';
|
||||||
|
import { PasswordModule } from 'primeng/password';
|
||||||
|
import { ToastModule } from 'primeng/toast';
|
||||||
|
import { ValidationService } from 'src/app/core/common/validation.service';
|
||||||
|
import { LoginComponent } from './login/login.component';
|
||||||
|
import { InterceptLoader } from 'src/app/core/common/intercept-loader.service';
|
||||||
|
import { ForgetPasswordComponent } from './forget-password/forget-password.component';
|
||||||
|
import { VerifyEmailComponent } from './verify-email/verify-email.component';
|
||||||
|
import { NgOtpInputModule } from 'ng-otp-input';
|
||||||
|
import { SingleSignOnComponent } from './single-sign-on/single-sign-on.component';
|
||||||
|
import { SSOService } from 'src/app/core/services/sso.service';
|
||||||
|
import { ButtonModule } from 'primeng/button';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'Login',
|
||||||
|
component: LoginComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'Forget-Password',
|
||||||
|
component: ForgetPasswordComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'verify-email',
|
||||||
|
component: VerifyEmailComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'SSOLogin',
|
||||||
|
component: SingleSignOnComponent
|
||||||
|
},
|
||||||
|
{ path: '', redirectTo: 'Login', pathMatch: 'full' },
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
LoginComponent,
|
||||||
|
ForgetPasswordComponent,
|
||||||
|
VerifyEmailComponent,
|
||||||
|
SingleSignOnComponent,
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
ButtonModule,
|
||||||
|
ToastModule,
|
||||||
|
CommonModule,
|
||||||
|
PasswordModule,
|
||||||
|
NgOtpInputModule,
|
||||||
|
HttpClientModule,
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
MatCheckboxModule,
|
||||||
|
RouterModule.forChild(routes),
|
||||||
|
],
|
||||||
|
providers: [MessageService, ValidationService,
|
||||||
|
SSOService,
|
||||||
|
{ provide: HTTP_INTERCEPTORS, useClass: InterceptLoader, multi: true }]
|
||||||
|
})
|
||||||
|
export class AuthModule { }
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user