Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0d9801a
Swati|Praveena: Inital config changes
May 25, 2021
3fc3342
Merge pull request #1 from Bahmni-Covid19/212_ConfiguringHIU
swatigogia2020 Jun 1, 2021
063e825
Update ci.yml
swatigogia2020 Jun 2, 2021
03aad92
Update ci.yml
swatigogia2020 Jun 2, 2021
52018e1
Update index.html
swatigogia2020 Jun 2, 2021
949d0c5
329|Sameera|Nazeer|Fixes displaying the incorrect health information
Nazeer-debug Sep 3, 2021
3e8794c
Merge pull request #2 from Bahmni-Covid19/329-incorrect-details
swatigogia2020 Sep 5, 2021
a2c2220
Making change in docker file for QA02
swatigogia2020 Sep 5, 2021
dc0426e
undoing the last commit
swatigogia2020 Sep 5, 2021
583afe9
Updating ci.yml, to deploy on qa02 env
swatigogia2020 Sep 5, 2021
566fd18
reverting back the changes on ci.yml
swatigogia2020 Sep 5, 2021
406a86d
Update ci.yml
swatigogia2020 Sep 22, 2021
288dd5c
Update ci.yml
swatigogia2020 Sep 22, 2021
89458f1
_n0man | added code to verify token expiry for private routes
N0-man Oct 25, 2021
7eb97b3
abinaya | noman : WIP add. tests for PrivateRoute
abinaya-u Oct 26, 2021
4d98fad
_n0man, abi | added test for PrivateRoute
N0-man Oct 26, 2021
1ae0d37
Merge pull request #3 from Bahmni-Covid19/406-dbauth-jwt-fix
abinaya-u Oct 29, 2021
172e5e6
abinaya | _n0man : fix. recursive redirection issue in login page
N0-man Oct 26, 2021
ec66e71
Merge pull request #4 from Bahmni-Covid19/406-dbauth-jwt-fix
abinaya-u Oct 29, 2021
52c9c5b
_n0man, abi | fixed formatting
N0-man Oct 29, 2021
eb78baf
423|Sameera|Umair| Change UI. sbx disappears on entering healthId number
Nov 17, 2021
4f52d45
Merge pull request #5 from Bahmni-Covid19/423-removing-sbx
swatigogia2020 Nov 18, 2021
dea84aa
Update ci.yml
swatigogia2020 Nov 18, 2021
a85b597
Update ci.yml
swatigogia2020 Nov 23, 2021
b7cf1f4
327|Sameera|Umair|Arjun| Adds. TimeZone offset to the dockerFile nd w…
Nov 25, 2021
9553087
327|Sameera| Updated Readme and removed unused functions
Nov 26, 2021
1b3e3ff
327| Fixed. Test failures regarding TIMEZONE_OFFSET
Nov 26, 2021
4eca757
327|Sameera| Refactors. changed TimeOffset to -05:00 in tests
Nov 29, 2021
533c1f8
Merge pull request #6 from Bahmni-Covid19/327-TimeZone-IST
SanoferSameera Nov 29, 2021
b7c062a
Update ci.yml
SanoferSameera Nov 29, 2021
716b3e6
Update ci.yml
swatigogia2020 Dec 1, 2021
af6a244
Update ci.yml
swatigogia2020 Dec 6, 2021
b056300
Update ci.yml
swatigogia2020 Dec 7, 2021
73d11cd
Update ci.yml
swatigogia2020 Dec 10, 2021
03a0e0a
Update ci.yml
swatigogia2020 Dec 10, 2021
45fb74a
Update README.md
swatigogia2020 Dec 14, 2021
186cbc2
Update README.md
swatigogia2020 Dec 14, 2021
336add4
Create LICENSE
swatigogia2020 Dec 19, 2021
8579ee5
Swati | renaming Jataayu Id to patient identifier
Feb 3, 2022
ebdb9f0
Update ci.yml
swatigogia2020 Feb 3, 2022
1a37cba
Update ci.yml
swatigogia2020 Feb 4, 2022
fbbe259
Update ci.yml
SanoferSameera Mar 16, 2022
1e42953
BAH-1444 | HIU-UI refactoring to not Take host id as build arg (#7)
SanoferSameera Mar 22, 2022
ab23d9c
BAH-1439 | Refactor. updated workflow for hiu-ui image
SanoferSameera Apr 11, 2022
a63a0c0
Merge pull request #8 from BahmniIndiaDistro/BAH-1439
SanoferSameera May 11, 2022
4f13e3e
Abdm infra (#9)
swatigogia2020 Jun 10, 2022
a7d79da
BAH-2149 | Adds nodeSelection templates to helm chart.
goyaldivij Aug 9, 2022
1b2bc13
BAH-2149 | Adds nodeSelection templates to helm chart
goyaldivij Aug 9, 2022
3c8c499
Merge pull request #10 from BahmniIndiaDistro/BAH-2149
mohan-13 Aug 9, 2022
048ec61
specified serve version in dockerFile
SanoferSameera Aug 10, 2022
97c6a8b
BAH-2135: Updated. Base_name config for redirection
Aug 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .appversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
plugins: ['react'],
rules: {
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'import/no-extraneous-dependencies': ['error', {'devDependencies': ['**/*.test.js', '**/*.test.jsx','**/*.spec.js', '**/*.spec.jsx']}],
'react/jsx-props-no-spreading': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'import/no-extraneous-dependencies': [
Expand Down
64 changes: 57 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,73 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
HELM_CHART_PATH: package/helm/
steps:
- uses: actions/checkout@v1
- name: Set env
run: echo "RELEASE_VERSION=$(echo $GITHUB_SHA | head -c7)" >> $GITHUB_ENV
run: |
APP_VERSION=$(cat .appversion)
echo "ARTIFACT_VERSION=$(echo $APP_VERSION-${{github.run_number}})" >> $GITHUB_ENV
- name: NCG Docker Registry
env:
DOCKER_REGISTRY_URL: docker.io
NCG_PASSWORD: ${{ secrets.DOCKER_NCG_PASSWORD }}
NCG_USERNAME: ${{ secrets.DOCKER_NCG_USERNAME }}
NCG_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
NCG_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker login -u $NCG_USERNAME -p $NCG_PASSWORD $DOCKER_REGISTRY_URL
- name: Build docker image for NCG
env:
CONTAINER_REPO_NAME: hiu-ui
NCG_USERNAME: ${{ secrets.DOCKER_NCG_USERNAME }}
run: docker build --build-arg BACKEND_BASE_URL=https://ncg-dev.projecteka.in/ --build-arg BASE_NAME=/hiu --build-arg BACKEND_API_PATH=hiu-api --build-arg DICOM_SERVER_PATH=/dicom-web --build-arg VIEWER_PAGE=/viewer/ --build-arg TITLE=NCG -t $NCG_USERNAME/$CONTAINER_REPO_NAME:$RELEASE_VERSION .
NCG_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker build -f package/docker/Dockerfile -t $NCG_USERNAME/$CONTAINER_REPO_NAME:$ARTIFACT_VERSION .
- name: Push Docker image to NCG Registry
env:
CONTAINER_REPO_NAME: hiu-ui
NCG_USERNAME: ${{ secrets.DOCKER_NCG_USERNAME }}
run: docker push $NCG_USERNAME/$CONTAINER_REPO_NAME:$RELEASE_VERSION
NCG_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker push $NCG_USERNAME/$CONTAINER_REPO_NAME:$ARTIFACT_VERSION
- name: Tag Docker Container with latest tag
env:
CONTAINER_REPO_NAME: hiu-ui
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker tag $DOCKER_USERNAME/$CONTAINER_REPO_NAME:$ARTIFACT_VERSION $DOCKER_USERNAME/$CONTAINER_REPO_NAME:latest
- name: Push Latest Docker Container to Registry
env:
CONTAINER_REPO_NAME: hiu-ui
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker push $DOCKER_USERNAME/$CONTAINER_REPO_NAME:latest
- name: Helm - Update Version and Image Tag
run: |
yq --inplace '.image.tag = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/values.yaml
yq --inplace '.version = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/Chart.yaml

- name: Helm Lint
run: helm lint $HELM_CHART_PATH

- name: Helm Package
run: helm package $HELM_CHART_PATH

- name: Helm - Checkout Charts Repository
uses: actions/checkout@v2
with:
repository: Bahmniindiadistro/helm-charts
ref: gh-pages
path: helm-charts
persist-credentials: false

- name: Helm - Copy chart
run: mkdir -p helm-charts/hiu-ui/ && cp hiu-ui-${{ env.ARTIFACT_VERSION }}.tgz helm-charts/hiu-ui/

- name: Helm - reIndex
working-directory: helm-charts/
run: helm repo index --merge index.yaml --url https://bahmniindiadistro.github.io/helm-charts/ .

- name: Helm - Publish Chart
working-directory: helm-charts/
run: |
git config user.name ${{ secrets.BAHMNI_USERNAME}}
git config user.email ${{ secrets.BAHMNI_EMAIL}}
git add .
git commit -m "Release of hiu-ui-${{ env.ARTIFACT_VERSION }}"
git push 'https://${{ secrets.BAHMNI_USERNAME}}:${{ secrets.BAHMNI_PAT}}@github.com/bahmniindiadistro/helm-charts.git' gh-pages


10 changes: 5 additions & 5 deletions .github/workflows/uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
- name: NHA Docker Registry
env:
DOCKER_REGISTRY_URL: docker.io
NHA_PASSWORD: ${{ secrets.DOCKER_NHA_PASSWORD }}
NHA_USERNAME: ${{ secrets.DOCKER_NHA_USERNAME }}
NHA_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
NHA_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker login -u $NHA_USERNAME -p $NHA_PASSWORD $DOCKER_REGISTRY_URL
- name: Build docker image for NHA
env:
CONTAINER_REPO_NAME: hiu-ui
NHA_USERNAME: ${{ secrets.DOCKER_NHA_USERNAME }}
run: docker build --build-arg BACKEND_BASE_URL=http://uat.ndhm.gov.in/ --build-arg BASE_NAME=/hiu --build-arg BACKEND_API_PATH=api-hiu --build-arg DICOM_SERVER_PATH=/dicom-web --build-arg VIEWER_PAGE=/viewer/ --build-arg TITLE=NHA -t $NHA_USERNAME/$CONTAINER_REPO_NAME:$RELEASE_VERSION .
NHA_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker build -t $NHA_USERNAME/$CONTAINER_REPO_NAME:$RELEASE_VERSION .
- name: Push Docker image to NHA Registry
env:
CONTAINER_REPO_NAME: hiu-ui
NHA_USERNAME: ${{ secrets.DOCKER_NHA_USERNAME }}
NHA_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker push $NHA_USERNAME/$CONTAINER_REPO_NAME:$RELEASE_VERSION
26 changes: 0 additions & 26 deletions Dockerfile

This file was deleted.

7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 Thoughtworks Technologies India Private limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
48 changes: 38 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
## Available Scripts
This is a forked repo from project-eka, includes few ui-enchancements and session management.

## To run locally:

update src path in index.html as `/bundle.js`

### 1. using docker

To build a image, you can run:

### `docker build -t hiu-ui .`

To run the container,

you can update docker-compose.development.yml environment variable if needed, you can run:

### `docker-compose -f docker-compose.development.yml up hiu-ui`

Note: BACKEND_BASE_URL, BASE_NAME are mandatory in docker-compose.development.yml

###2. using npm

In the project directory, you can run:

Expand Down Expand Up @@ -36,20 +56,28 @@ devServer: {
Launches the test runner in the interactive watch mode.


## Plugging in the reference HIU-UI to HIU-Server
## Plugging in the reference HIU-UI to Local-HIU-Server

create a file ".env" in the root directory. with the following contents
update src/Config.js. with the following contents

```
BACKEND_BASE_URL = 'http://localhost:8003'
BASE_NAME = '/hiu'
BACKEND_API_PATH= '/'
DICOM_VIEWER_PAGE= '/viewer/'
DICOM_SERVER_PATH= '/dicom-web'
REACT_APP_SITE_TITLE= 'NCG'
BACKEND_BASE_URL: 'http://localhost:8003',
BASE_NAME: '/hiu',
BACKEND_API_PATH: '/',
DICOM_VIEWER_PAGE: '/viewer/',
DICOM_SERVER_PATH: '/dicom-web',
TITLE: 'NCG'
```
The above should be self explanatory, essentially it says that the HIU-Service is running on http://localhost:8003

Add the following to the Config file for the specific timezone. The following is for IST TimeZone UTC+5:30

```aidl
TIMEZONE_OFFSET: '+05:30'
```

Note: If you haven't specify TimeZone, it will be UTC by default

If you are testing with the reference HIU-Service, and thats running locally on a different port, most likely Chrome will not allow you to make Http calls because of CORS restrictions. To do this, there are many ways - for example, use a proxy like HAProxy and put your HIU-UI and HIU-Server behind the proxy and route the calls appropriately.

For development purpose, you can start chrome with disabled web security.
Expand All @@ -60,4 +88,4 @@ open -na Google\ Chrome --args --disable-web-security --user-data-dir=$HOME/loca
Note the above will start a new process of Chrome. Use this only for local testing and do not use this for accessing any public websites, and terminate this specific process as soon as you are done.


The latest versions of Safari also allows you disable Cross-Origin Restrictions. Enable the developer menu from Preferences >> Advanced, and select "Disable Cross-Origin Restrictions" from the develop menu. Again be careful of browsing external and public websites, and uncheck the above option "Disable Cross-Orgin .. " as soon as you are done.
The latest versions of Safari also allows you disable Cross-Origin Restrictions. Enable the developer menu from Preferences >> Advanced, and select "Disable Cross-Origin Restrictions" from the develop menu. Again be careful of browsing external and public websites, and uncheck the above option "Disable Cross-Orgin .. " as soon as you are done.
15 changes: 15 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'
services:
hiu-ui:
image: "hiu-ui:latest"
environment:
BACKEND_BASE_URL: "<backend base url>"
BASE_NAME: '/hiu'
BACKEND_API_PATH: "/hiu-api"
DICOM_SERVER_PATH: '/'
VIEWER_PAGE: "/viewer/"
TITLE: 'NCG'
TIMEZONE_OFFSET: "+05:30"
ports:
- "8000:5000"

17 changes: 17 additions & 0 deletions entryPoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

file="/dist/bundle.js"
set -xe
: "${BACKEND_BASE_URL?BACKEND_BASE_URL is not defined}"
: "${BASE_NAME?BASE_NAME is not defined}"

sed -i 's|TITLE:[^,]*|TITLE: '\"$TITLE\"'|g' $file
sed -i 's|BACKEND_BASE_URL:[^,]*|BACKEND_BASE_URL: '\"$BACKEND_BASE_URL\"'|g' $file
sed -i 's|BACKEND_API_PATH:[^,]*|BACKEND_API_PATH: '\"$BACKEND_API_PATH\"'|g' $file
sed -i 's|BASE_NAME:[^,]*|BASE_NAME: '\"$BASE_NAME\"'|g' $file
sed -i 's|DICOM_VIEWER_PAGE:[^,]*|DICOM_VIEWER_PAGE: '\"$DICOM_VIEWER_PAGE\"'|g' $file
sed -i 's|DICOM_SERVER_PATH:[^,]*|DICOM_SERVER_PATH: '\"$DICOM_SERVER_PATH\"'|g' $file
sed -i 's|TIMEZONE_OFFSET:[^,]*|TIMEZONE_OFFSET: '\"$TIMEZONE_OFFSET\"'|g' $file


exec "$@"
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

<body>
<div id="app"></div>
<script type="text/javascript" src="/bundle.js"></script>
<script type="text/javascript" src="/hiuser/bundle.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { MuiPickersUtilsProvider } from "@material-ui/pickers";
import { teal } from "@material-ui/core/colors";
// main app
import App from "./src/App";
import Config from "./src/Config";

const theme = createMuiTheme({
palette: {
Expand All @@ -28,7 +29,7 @@ const theme = createMuiTheme({
}
});

document.querySelector('title').innerHTML=REACT_APP_SITE_TITLE;
document.querySelector('title').innerHTML= Config.TITLE;

ReactDOM.render(
<Provider store={store}>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --passWithNoTests",
"test:update:snapshot": "npm test -- -u",
"test:watch": "jest --watch",
"build": "rm -rf dist && MODE=PROD webpack --config ./webpack/webpack.prod.config.js",
"build": "rm -rf dist && MODE=PROD webpack --config ./webpack/webpack.common.js",
"dev": "./node_modules/.bin/webpack-dev-server --config ./webpack/webpack.dev.config.js",
"start": "http-server dist",
"lint": "eslint src",
Expand Down
16 changes: 16 additions & 0 deletions package/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:8 as build-deps
WORKDIR /app
COPY . ./
RUN npm install
RUN npm run build

# stage: 2 ?~@~T the production environment
FROM node:13.12.0-alpine
RUN npm install -g serve@13.0.4
COPY --from=build-deps /app/dist/ dist/
EXPOSE 5000

COPY entryPoint.sh /
RUN chmod +x entryPoint.sh
ENTRYPOINT ["/entryPoint.sh"]
CMD ["serve", "dist/", "-l", "5000"]
23 changes: 23 additions & 0 deletions package/helm/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
5 changes: 5 additions & 0 deletions package/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: hiu-ui
description: Helm chart for hiu-ui
type: application
version: 1.0.0
12 changes: 12 additions & 0 deletions package/helm/templates/configMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-config
data:
BACKEND_BASE_URL: "{{ .Values.config.BACKEND_BASE_URL }}"
BASE_NAME: "{{ .Values.config.BASE_NAME }}"
BACKEND_API_PATH: "{{ .Values.config.BACKEND_API_PATH }}"
DICOM_SERVER_PATH: "{{ .Values.config.DICOM_SERVER_PATH }}"
VIEWER_PAGE: "{{ .Values.config.VIEWER_PAGE }}"
TITLE: "{{ .Values.config.TITLE }}"
TIMEZONE_OFFSET: "{{ .Values.config.TIMEZONE_OFFSET }}"
Loading