From d7c01a8e09aa006ea3ea80c8c9c6c7df4897dbc4 Mon Sep 17 00:00:00 2001 From: bhpratibha <165631570+bhpratibha@users.noreply.github.com> Date: Mon, 1 Jul 2024 20:57:36 +0530 Subject: [PATCH] Scheduler-UI-NEXT from develop to master Code push regarding CI Build Configurations and some fixes (#39) * Fixes with Lint * Resolved Merged conflicts * Changes in table & webcam * Resolved vulnerability and implemented EQEQEQ * routing screen functionality fix * fixes of scheduler reports * Fix bugs for functionality in sch * Changes in report pop-up's * CSS changes * timesheet ts changes * Changes in fullcalender with timings * chnage in timesheet and chief complaint * modified codeql.yml file * change in codeql.yml in tools for scanning * change in codeql with matrix * rebase pull requests * Fork Test Codeql (#37) * change in pacakage.lock.json final in fork branch * change in recapture method in camera comp --------- Co-authored-by: Parth Kothari * ci build configurations changes * ci environmentfile changes * fixed PR comments * fixed PR comments * Sonar-Lint Fix for scheduler * Sonar lint fix for key press event --------- Co-authored-by: Parth Kothari Co-authored-by: nkokkiligadda87 Co-authored-by: Parth Kothari <109517053+KpParth@users.noreply.github.com> Co-authored-by: Bhallamudi Pratibha --- angular.json | 30 +++ package.json | 6 +- pom.xml | 192 +++++++++++++++++ scripts/ci-prebuild.js | 52 +++++ .../app-header/app-header.component.html | 38 +--- .../app-header/app-header.component.ts | 36 ---- .../camera-dialog.component.html | 204 ------------------ .../core/services/spinner.service.ts | 33 --- .../appointment-view.component.html | 2 +- .../chief-complaint-report.component.ts | 121 +++-------- .../consultation-report.component.ts | 155 +++++-------- .../daily-report/daily-report.component.ts | 153 +++++-------- .../monthly-report.component.ts | 184 ++++++++-------- .../total-consultation-report.component.ts | 184 ++++++++-------- .../timesheet/timesheet.component.html | 19 -- .../timesheet/timesheet.component.ts | 13 +- src/app/app.module.ts | 2 - src/environments/environment.ci.ts.template | 7 +- src/environments/environment.ts | 2 - src/packaging/version.properties | 2 + src/styles.css | 13 -- 21 files changed, 614 insertions(+), 834 deletions(-) create mode 100644 pom.xml create mode 100644 scripts/ci-prebuild.js create mode 100644 src/packaging/version.properties diff --git a/angular.json b/angular.json index 6aca074..335eb25 100644 --- a/angular.json +++ b/angular.json @@ -64,6 +64,36 @@ "extractLicenses": false, "sourceMap": true, "namedChunks": true + }, + "ci": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "5mb", + "maximumError": "6mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "1mb", + "maximumError": "2mb" + } + ], + "outputHashing": "all", + "optimization": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.ci.ts" + } + ] + }, + "test":{ + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.test.ts" + } + ] } }, "defaultConfiguration": "production" diff --git a/package.json b/package.json index 29ad3bd..18fd68a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,11 @@ "test": "ng test", "lint": "ng lint", "lint:fix": "ng lint --fix", - "prepare": "husky install" + "prepare": "husky install", + "build-dev": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=development --aot", + "build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=production --aot", + "build-ci": "chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot", + "build-test": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=test --aot" }, "lint-staged": { "src/**/*.{ts,html}": [ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..911d14a --- /dev/null +++ b/pom.xml @@ -0,0 +1,192 @@ + + + + 4.0.0 + com.iemr.scheduler-ui-next + SCHEDULER-UI-NEXT + 1.0 + SCHEDULER-UI-NEXT + Piramal - scheduler: Module ui + war + + + dev + + 10.208.122.38 + 10.208.122.38 + dev + + + true + + + + uat + + 10.208.122.38 + deviemr.piramalswasthya.org + uat + + + + local + + 10.208.122.38 + localhost + local + + + + test + + 10.208.122.38 + 10.208.122.32 + test + + + + ci + + ci + + + + + + + UTF-8 + scheduler-ui-next-v1.0 + 10.208.122.32 + 9990 + localhost + 9990 + 10.208.122.38 + 9990 + deviemr.piramalswasthya.org + 9990 + wildfly-${environment} + {hostname-${environment}} + {port-${environment}} + + + + + scheduler-ui-next-v1.0 + + + maven-clean-plugin + 3.3.2 + + + + dist + + + + false + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + npm-install + compile + + exec + + + npm + + install + --legacy-peer-deps + + + + + ng-build + compile + + exec + + + npm + + run + build-${environment} + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + default-copy-resources + prepare-package + + true + ${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/ + + + ${project.basedir}/dist + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.4.0 + + false + + + + dist + + + true + src/packaging/ + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + properties-updated + prepare-package + + run + + + + replacing/updating urls ${project.basedir} 2 + + + + + + + + + + + diff --git a/scripts/ci-prebuild.js b/scripts/ci-prebuild.js new file mode 100644 index 0000000..4cc0495 --- /dev/null +++ b/scripts/ci-prebuild.js @@ -0,0 +1,52 @@ +#!/usr/bin/env node + +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + +const fs = require('fs'); +const path = require('path'); + +const ejs = require('ejs'); + +const environmentFilesDirectory = path.join(__dirname, '../src/environments'); +const targetEnvironmentTemplateFileName = 'environment.ci.ts.template'; +const targetEnvironmentFileName = 'environment.ci.ts'; + +// Load template file +const environmentTemplate = fs.readFileSync( + path.join(environmentFilesDirectory, targetEnvironmentTemplateFileName), + {encoding: 'utf-8'} +); + +const defaultEnvValues = { + COMMON_API_BASE: '', + COMMON_API_OPEN_SYNC: '', + TM_API_BASE: '', + SCHEDULER_API_BASE: '', +}; + +// Generate output data +const output = ejs.render(environmentTemplate, Object.assign({}, defaultEnvValues, process.env)); +// Write environment file +fs.writeFileSync(path.join(environmentFilesDirectory, targetEnvironmentFileName), output); + +process.exit(0); diff --git a/src/app/app-modules/core/components/app-header/app-header.component.html b/src/app/app-modules/core/components/app-header/app-header.component.html index e99ef2b..165aeb7 100644 --- a/src/app/app-modules/core/components/app-header/app-header.component.html +++ b/src/app/app-modules/core/components/app-header/app-header.component.html @@ -1,4 +1,7 @@ -