Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sprint-3 Release] : Inji web Spring Release with Code Refactoring #51

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6f91827
[DSD-5029] Updated install scripts
abhishek8shankar Apr 15, 2024
46a63cf
[DSD-5029] Updated install scripts
abhishek8shankar Apr 15, 2024
f7d3c1a
[DSD-5029] Update install scripts
abhishek8shankar Apr 16, 2024
ee97652
[DSD-5029] Updated scripts
abhishek8shankar Apr 16, 2024
350a1ef
Updated install.sh
abhishek8shankar Apr 16, 2024
f3ade46
[DSD-5029] Update install.sh
abhishek8shankar Apr 24, 2024
94ee0e8
[DSD-5029] Update install.sh
abhishek8shankar Apr 24, 2024
16dbd9d
[DSD-5029] Update install.sh
abhishek8shankar Apr 25, 2024
bd0fffc
[DSD-5029] Update install.sh
abhishek8shankar Apr 25, 2024
fd0d162
[DSD-5029] Update install.sh
abhishek8shankar Apr 25, 2024
c744bb2
[DSD-5029] Update install.sh
abhishek8shankar Apr 25, 2024
16cdc76
[DSD-5029] Update values.yaml
abhishek8shankar Apr 25, 2024
62500c0
[DSD-5029] Update copy_cm.sh
abhishek8shankar Apr 25, 2024
873040a
Merge pull request #30 from abhishek8shankar/develop
ckm007 Apr 25, 2024
2ee6bde
[INJIWEB-242][INJIWEB-202][INJIWEB-247]: refactor js -> ts conversion…
vijay151096 Apr 25, 2024
c0824db
[INJIWEB-247]: update the URL Configuration
vijay151096 Apr 25, 2024
bf674db
Merge pull request #38 from tw-mosip/inji-url-refactoring
vijay151096 Apr 25, 2024
a1b97d8
[INJIWEB-396]: UI Corrections using Tailwindcss (#43)
vijay151096 Apr 26, 2024
d14798c
[INJIWEB-257]: injiweb theme customization (#44)
vijay151096 Apr 27, 2024
51c4b0b
InjiWeb refactoring for PDF Download (#45)
vijay151096 Apr 29, 2024
358630f
Injiweb ts migration with unit testing setup with jest (#48)
vijay151096 Apr 29, 2024
c563e43
add unit testing and update the language selector (#49)
vijay151096 Apr 30, 2024
c19fbbd
[INJIWEB-396]: Tailwind Theming Configuration with Font Customization…
vijay151096 May 1, 2024
118aa1b
Update credential_issuer for the Authorization Redirection
vijay151096 May 1, 2024
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
5 changes: 3 additions & 2 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: inji-web build upon a push

on:
release:
types: [published]
types: [ published ]
pull_request:
types: [opened, reopened, synchronize]
types: [ opened, reopened, synchronize ]
push:
branches:
- '!release-branch'
Expand All @@ -13,6 +13,7 @@ on:
- 1.*
- develop
- MOSIP*
- injiweb*

jobs:
build-dockers-inji-web:
Expand Down
4 changes: 2 additions & 2 deletions helm/inji-web/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: inji-web
name: injiweb
description: A Helm chart for MOSIP injiweb UI module
type: application
version: 1.0.0
version: 0.0.1-develop
appVersion: ""
dependencies:
- name: common
Expand Down
6 changes: 3 additions & 3 deletions helm/inji-web/copy_cm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

function copying_cm() {
COPY_UTIL=./copy_cm_func.sh
DST_NS=esignet
DST_NS=injiweb

$COPY_UTIL configmap global default $DST_NS
$COPY_UTIL configmap artifactory-share artifactory $DST_NS
$COPY_UTIL configmap config-server-share config-server $DST_NS
$COPY_UTIL configmap softhsm-esignet-share softhsm $DST_NS
#$COPY_UTIL configmap softhsm-esignet-share softhsm $DST_NS
return 0
}

Expand All @@ -19,4 +19,4 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
set -o errtrace # trace ERR through 'time command' and other functions
set -o pipefail # trace ERR through pipes
copying_cm # calling function
copying_cm # calling function
6 changes: 3 additions & 3 deletions helm/inji-web/delete.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash
# Uninstalls injiweb-ui helm charts
# Uninstalls injiweb helm charts
## Usage: ./delete.sh [kubeconfig]

if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

function Deleting_injiweb-ui() {
NS=esignet
NS=injiweb
while true; do
read -p "Are you sure you want to delete all esignet helm charts?(Y/n) " yn
if [ $yn = "Y" ]
then
helm -n $NS delete injiweb-ui
helm -n $NS delete injiweb
break
else
break
Expand Down
42 changes: 35 additions & 7 deletions helm/inji-web/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,38 @@ if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

NS=esignet
CHART_VERSION=1.0.0
NS=injiweb
CHART_VERSION=0.0.1-develop

DEFAULT_MOSIP_INJIWEB_HOST=$( kubectl get cm global -n config-server -o jsonpath={.data.mosip-injiweb-host} )
# Check if MOSIP_INJIWEB_HOST is present under configmap/global of configserver
if echo "$DEFAULT_MOSIP_INJIWEB_HOST" | grep -q "MOSIP_INJIWEB_HOST"; then
echo "MOSIP_INJIWEB_HOST is already present in configmap/global of configserver"
MOSIP_INJIWEB_HOST=DEFAULT_MOSIP_INJIWEB_HOST
else
read -p "Please provide injiwebhost (eg: injiweb.sandbox.xyz.net ) : " MOSIP_INJIWEB_HOST

if [ -z "MOSIP_INJIWEB_HOST" ]; then
echo "INJIWEB Host not provided; EXITING;"
exit 0;
fi
fi

CHK_MOSIP_INJIWEB_HOST=$( nslookup "$MOSIP_INJIWEB_HOST" )
if [ $? -gt 0 ]; then
echo "Injiweb Host does not exists; EXITING;"
exit 0;
fi

echo "MOSIP_INJIWEB_HOST is not present in configmap/global of configserver"
# Add injiweb host to global
kubectl patch configmap global -n config-server --type merge -p "{\"data\": {\"mosip-injiweb-host\": \"$MOSIP_INIEB_HOST\"}}"
# Add the host
kubectl set env deployment/config-server SPRING_CLOUD_CONFIG_SERVER_OVERRIDES_MOSIP_ESIGNET_INJIWEB_HOST=$MOSIP_INJIWEB_HOST -n config-server
# Restart the configserver deployment
kubectl -n config-server get deploy -o name | xargs -n1 -t kubectl -n config-server rollout restart

sleep 400s

echo Create $NS namespace
kubectl create ns $NS
Expand All @@ -20,18 +50,16 @@ function installing_inji-web() {
helm repo update

echo Copy configmaps
# ./copy_cm.sh
./copy_cm.sh

ESIGNET_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-esignet-host})
INJI_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-injiweb-host})
echo Installing INJIWEB
helm -n $NS install inji-web mosip/inji-web \
helm -n $NS install injiweb mosip/inji-web \
-f values.yaml \
--set esignet_redirect_url=$ESIGNET_HOST \
--set istio.hosts\[0\]=$INJI_HOST \
--version $CHART_VERSION

# kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status
kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status

echo Installed inji-web
return 0
Expand Down
2 changes: 1 addition & 1 deletion helm/inji-web/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then
fi

function Restarting_oidc-ui() {
NS=esignet
NS=injiweb
kubectl -n $NS rollout restart deploy oidc-ui

kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status
Expand Down
5 changes: 2 additions & 3 deletions helm/inji-web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ extraEnvVarsCM:
- global
- config-server-share
- artifactory-share
- softhsm-esignet-share
- oidc-ui
#- softhsm-esignet-share

## Secret with extra environment variables
##
Expand Down Expand Up @@ -433,5 +432,5 @@ istio:
portName: http
port: 80
hosts:
- inji.sandbox.xyz.net
- injiweb.sandbox.xyz.net
prefix: /
6 changes: 0 additions & 6 deletions inji-web/.babelrc

This file was deleted.

2 changes: 2 additions & 0 deletions inji-web/.env
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#REACT_APP_MIMOTO_URL=http://localhost:3010
#REACT_APP_AUTHORIZATION_REDIRECT_URL = http://localhost:3001/redirect
REACT_APP_APPLICATION_THEME=orange_theme
4 changes: 0 additions & 4 deletions inji-web/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion inji-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3004

# The main command to start Nginx when the container runs
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
71 changes: 71 additions & 0 deletions inji-web/adr/0.0.1-injiweb-refactoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Inji Web Design Decisions.

**Date:** 2024-04-17

## 1. Migration from JS To TS

### context :
Why TS ?

1. TS gives us more control on data that is passed within the application
2. TypeScript code tends to be more readable compared to JavaScript, primarily due to its static typing feature.
3. Its more developer friendly

### decision :
We will be moving to TS from JS


## 2. Folder Structure Maintenance for Tests

### context :
Its better we move all the test files outside the src, so that source is more cleaner with the implementation and mocks are packed separately.

### decision :
We will be maintaining the same folder structure as src folder under __ tests __ folder to package all the test files together.

## 3. State Management Library

### context :
Since the application involves intermediary state changes, Its better we decide a state management library to cater our needs.

### option 1 : Redux

1. Redux is a light weight js library, which is independent on the language / library we are using.
2. Its very easy to use and main
3. But Its maintains the global state /context

### option 2 : XState

1. XState library is very helpful in maintaining /managing the complex states.
2. XState works using finite state machines.
3. plugins / editors are available to create and debug the flows.
4. But Its more dependent on the state machine, and more tied up with the controller / state machine

### decision
Since INJI Web is a light weight project with small use case, We will go with Redux, and having xstate for INJIWEB will be hard to maintain.

## 4. UI Management Libraries ( TailwindCSS Over Material UI)

### context :
Since the application involves UI pages and components, Its better we decide a UI management library to cater our needs.

### option 1 : Material UI
1. Material UI is a JavaScript framework
2. Material UI Provides Pre Constructed JS Components and little customization to match our wireframe.
3. But Material UI has to load the entire Framework to render the Page, which increase the loadup time of the application.
4. Application will be scalable, but not Customisable.

### option 2 : Tailwind CSS
1. TailwindCSS is a CSS library that applies the styles and downloads only the styles that is required for the application to load.
2. Tailwind css over more customization to cater our needed, its easy to manage and scale.
3. Tailwind css is easy to maintain and very light weight.

### Decision :
We will go with TailwindCSS over Material UI for the following reasons
1. Tailwind CSS is light weight
2. It improves the loadup time, as it Downloads only the styles that are needed.
3. Its provides more customisability, where system integrators can use it to cater their needs and design

## People
Owners: Vijayakumar, S
Reviewers / team: Vijayakumar S , challa, Shiva Kumar, Sasikumar Ganesan
18 changes: 0 additions & 18 deletions inji-web/jest-setup/frameworkSetup.js

This file was deleted.

2 changes: 0 additions & 2 deletions inji-web/jest-setup/setupTests.js

This file was deleted.

18 changes: 0 additions & 18 deletions inji-web/jest.config.cjs

This file was deleted.

Loading
Loading