Skip to content

Commit

Permalink
Scheduler-UI-NEXT from develop to master Code push regarding CI Build…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: nkokkiligadda87 <[email protected]>
Co-authored-by: Parth Kothari <[email protected]>
Co-authored-by: Bhallamudi Pratibha <[email protected]>
  • Loading branch information
5 people authored Jul 1, 2024
1 parent 68f7335 commit d7c01a8
Show file tree
Hide file tree
Showing 21 changed files with 614 additions and 834 deletions.
30 changes: 30 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}": [
Expand Down
192 changes: 192 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- @Author : Sunil K Sundaram @Date : 21-May-17 @Email : [email protected] -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.iemr.scheduler-ui-next</groupId>
<artifactId>SCHEDULER-UI-NEXT</artifactId>
<version>1.0</version>
<name>SCHEDULER-UI-NEXT</name>
<description>Piramal - scheduler: Module ui</description>
<packaging>war</packaging>
<profiles>
<profile>
<id>dev</id>
<properties>
<old-api-url>10.208.122.38</old-api-url>
<new-api-url>10.208.122.38</new-api-url>
<environment>dev</environment>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>uat</id>
<properties>
<old-api-url>10.208.122.38</old-api-url>
<new-api-url>deviemr.piramalswasthya.org</new-api-url>
<environment>uat</environment>
</properties>
</profile>
<profile>
<id>local</id>
<properties>
<old-api-url>10.208.122.38</old-api-url>
<new-api-url>localhost</new-api-url>
<environment>local</environment>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<old-api-url>10.208.122.38</old-api-url>
<new-api-url>10.208.122.32</new-api-url>
<environment>test</environment>
</properties>
</profile>
<profile>
<id>ci</id>
<properties>
<environment>ci</environment>
</properties>
</profile>
</profiles>

<!-- we could create individual properties similar to variables -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<final-name>scheduler-ui-next-v1.0</final-name>
<hostname-dev>10.208.122.32</hostname-dev>
<port-dev>9990</port-dev>
<hostname-local>localhost</hostname-local>
<port-local>9990</port-local>
<hostname-test>10.208.122.38</hostname-test>
<port-test>9990</port-test>
<hostname-uat>deviemr.piramalswasthya.org</hostname-uat>
<port-uat>9990</port-uat>
<server-id>wildfly-${environment}</server-id>
<server-hostname>{hostname-${environment}}</server-hostname>
<server-port>{port-${environment}}</server-port>
</properties>

<!-- install the necessary node_modules & compile in prod mode -->
<build>
<finalName>scheduler-ui-next-v1.0</finalName>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<filesets>
<fileset>
<directory>dist</directory>
<!-- if any that needs to be included or excluded -->
<!-- using name in both would be a crime - pls avoid! -->
<!-- <includes><include>**/*.tmp</include><include>**/*.log</include></includes><excludes><exclude>**/important.log</exclude><exclude>**/another-important.log</exclude></excludes> -->
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>npm-install</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
<argument>--legacy-peer-deps</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>ng-build</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>run</argument>
<argument>build-${environment}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>default-copy-resources</id>
<phase>prepare-package</phase>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/dist</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>dist</directory>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/packaging/</directory>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>properties-updated</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>replacing/updating urls ${project.basedir} 2</echo>
<replaceregexp match="${old-api-url}"
replace="${new-api-url}" flags="ig">
<fileset dir="${project.basedir}/dist"
includes="main.*.bundle.js" />
</replaceregexp>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
52 changes: 52 additions & 0 deletions scripts/ci-prebuild.js
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<nav class="navbar navbar-expand-lg navbar-iemr">
<nav
class="navbar navbar-expand-lg navbar-iemr"
aria-labelledby="mainnavheading"
>
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
Expand All @@ -7,18 +10,6 @@
<img src="assets/images/logo.png" alt="Logo" />
</a>
</div>
<!-- <button
type="button"
class="navbar-toggler ms-auto"
data-toggle="collapse"
data-target="#top-navbar, #main-navbar"
aria-expanded="false"
>
<span class="sr-only">{{ currentLanguageSet?.togglenavigation }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> -->
</div>
<button
class="navbar-toggler ms-auto"
Expand Down Expand Up @@ -120,25 +111,6 @@
<span class="logoutIcon"></span>
</a>
</li>
<!-- <li class="alignDropDown">
<select
class="form-control drop-arrow border-radius-20 height-30 width120px pull-right"
name="app_language"
[(ngModel)]="app_language"
(change)="changeLanguage(app_language)"
>
<option
*ngFor="let language of languageArray"
[value]="language.languageName"
>
{{ language.languageName }}
</option>
</select>
</li> -->

<!-- <li class="alignWord">
<span>{{ currentLanguageSet?.SelectLanguage }} :</span>
</li> -->
</ul>
</div>
<!-- /.navbar-collapse -->
Expand All @@ -147,7 +119,7 @@
</nav>

<div *ngIf="showRoles" class="container-fluid">
<nav class="navbar navbar-expand-lg">
<nav class="navbar navbar-expand-lg" aria-labelledby="secondarynavheading">
<div class="collapse navbar-collapse" id="main-navbar">
<ul
class="nav navbar-nav ml-auto"
Expand Down
Loading

0 comments on commit d7c01a8

Please sign in to comment.