Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/bugfix_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Bugfix Request

#### JIRA ID
<!-- Provide a detailed description of the feature -->

#### Module
<!-- Provide a detailed description of the feature -->

#### Description
<!-- Provide a detailed description of the feature -->

### Root Cause
<!-- Describe the root cause of the bug. -->

#### Related Issues
<!-- Link any related GitHub issues here -->
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/feature_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Feature Request

#### JIRA ID
<!-- Provide a detailed description of the feature -->

#### Module
<!-- Provide a detailed description of the feature -->

#### Description
<!-- Provide a detailed description of the feature -->

#### Related Issues
<!-- Link any related GitHub issues here -->
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/release_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Release Request

#### JIRA ID
<!-- Provide a detailed description of the feature -->

#### Module
<!-- Provide a detailed description of the feature -->

#### Description
<!-- Provide a detailed description of the feature -->

#### List of Features
<!-- Link any related GitHub issues here -->

#### List of Issues
<!-- Link any related GitHub issues here -->
25 changes: 25 additions & 0 deletions .github/hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

# Get the current branch name
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)

# Define the pattern
PATTERN="^(FEATURE|BUGFIX|RELEASE)\/(HCMPRE|DPG|SN)-[0-9]{1,5}$"

# Check if the branch name matches the pattern
if [[ ! "$BRANCH_NAME" =~ $PATTERN ]]; then
echo "Branch name '$BRANCH_NAME' does not follow the correct pattern:"
echo " - FEATURE/HCMPRE-<TICKET_NO>"
echo " - FEATURE/DPG-<TICKET_NO>"
echo " - FEATURE/SN-<TICKET_NO>"
echo " - BUGFIX/HCMPRE-<TICKET_NO>"
echo " - BUGFIX/DPG-<TICKET_NO>"
echo " - BUGFIX/SN-<TICKET_NO>"
echo " - RELEASE/HCMPRE-<TICKET_NO>"
echo " - RELEASE/DPG-<TICKET_NO>"
echo "Where <TICKET_NO> is a number between 0 and 99999."
exit 1
fi

# If the pattern matches, allow the push
exit 0
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Choose the appropriate template for your PR:

- [Feature PR](./PULL_REQUEST_TEMPLATE/feature_template.md)
- [Bugfix PR](./PULL_REQUEST_TEMPLATE/bugfix_template.md)
- [Release PR](./PULL_REQUEST_TEMPLATE/release_template.md)
27 changes: 27 additions & 0 deletions .github/workflows/branch-name-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Branch Name Validation

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
validate-branch-name:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Validate branch name
run: |
branch_name=$(echo "${GITHUB_REF#refs/heads/}")
pattern="^(FEATURE|BUGFIX|RELEASE)\/(HCMPRE|DPG|SN)-[0-9]{1,5}$"
if [[ ! "$branch_name" =~ $pattern ]]; then
echo "Branch name '$branch_name' does not follow the correct pattern: FEATURE/HCMPRE-<TICKET_NO>, FEATURE/DPG-<TICKET_NO>, FEATURE/SN-<TICKET_NO>, BUGFIX/SN-<TICKET_NO>, BUGFIX/HCMPRE-<TICKET_NO>, or BUGFIX/DPG-<TICKET_NO> where x is a number between 0 and 99999"
exit 1
fi
65 changes: 65 additions & 0 deletions .github/workflows/buildAllUpgradedPackages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Digit build upgraded packages workflow
on:
push:
branches:
- VersionUpgrade-test6
paths:
- 'micro-ui/web/micro-ui-internals/**'
pull_request:
branches:
- VersionUpgrade-test6
workflow_dispatch:
jobs:
docker_image-build:
outputs:
run_job_digit_ui: ${{ steps.check_files.outputs.run_job_digit_ui }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Docker
uses: docker/setup-buildx-action@v1
- name: check modified files
id: check_files
run: |
echo "=============== list modified files ==============="
git diff --name-only HEAD^ HEAD

echo "========== check paths of modified files =========="
git diff --name-only HEAD^ HEAD > files.txt
run_job_digit_ui=false
while IFS= read -r file
do
if [[ $file == micro-ui/* ]]; then
echo "This modified file is under the 'digit_ui' folder."
run_job_digit_ui=true
fi
done < files.txt

# Set the output based on whether the job should run
echo "::set-output name=run_job_digit_ui::$run_job_digit_ui"
echo "ACTION_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "COMMIT_ID=${GITHUB_SHA: -8}" >> $GITHUB_ENV # Extract last 8 characters of SHA
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV




- name: Login to egovio docker Container Registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
# Authenticate with Docker Hub
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

- name: Build and Push Docker image for digit-ui
if: ${{ steps.check_files.outputs.run_job_digit_ui == 'true' }}
run: |
cd ../../../
docker build -t digit-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }} -f micro-ui/web/docker/Dockerfile .
docker tag digit-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }} egovio/digit-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }}
docker push egovio/digit-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }}
working-directory: micro-ui/web/docker
11 changes: 3 additions & 8 deletions .github/workflows/publishAllPackages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ name: Node.js Publish UI Packages

on:
push:
branches: [ 'develop','campaign' ]
branches: [ 'develop' ]
paths:
- 'micro-ui/web/micro-ui-internals/**'

pull_request:
branches:
- 'dev-hcm'
# Push events to branches matching refs/heads/mona/octocat

jobs:
build:
Expand All @@ -20,6 +15,6 @@ jobs:
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: cd micro-ui/web/micro-ui-internals/ && bash ./publish-develop.sh
- run: cd micro-ui/web/micro-ui-internals/ && bash ./publish-workbench.sh
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
accelerators/frontend/micro-ui-internals/node_modules/*
.idea
index.lock
utilities/
utilities/project-factory/
5 changes: 1 addition & 4 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
* @egovernments/core-ui-reviewers

##Frontend
micro-ui/web @nabeelmd-eGov
* @egovernments/core-ui-reviewers
12 changes: 8 additions & 4 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ config:
dockerfile: micro-ui/web/workbench/Dockerfile
image-name: workbench-ui

- name: builds/Digit-Frontend/microplan-ui
- name: builds/Digit-Frontend/sandbox-ui
build:
- work-dir: micro-ui/
dockerfile: micro-ui/web/microplan/Dockerfile
image-name: microplan-ui
dockerfile: micro-ui/web/sandbox/Dockerfile
image-name: sandbox-ui

- name: builds/Digit-Frontend/storybook-svg
build:
- work-dir: micro-ui/web/micro-ui-internals/packages/svg-components/
Expand All @@ -55,3 +55,7 @@ config:
dockerfile: micro-ui/web/core/Dockerfile
image-name: core-ui

- name: builds/Digit-Frontend/utilities/egov-bff
build:
- work-dir: utilities/egov-bff
image-name: egov-bff
1 change: 1 addition & 0 deletions micro-ui/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jagankumar-egov @sathishp-eGov
12 changes: 8 additions & 4 deletions micro-ui/web/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"presets": [
"@babel/preset-env","@babel/preset-react"
]
}
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-optional-chaining"
]
}
17 changes: 8 additions & 9 deletions micro-ui/web/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# FROM egovio/alpine-node-builder-14:yarn AS build
FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build
FROM node:20-alpine AS build
RUN apk update && apk upgrade
RUN apk add --no-cache git>2.30.0
ARG WORK_DIR
WORKDIR /app
ENV NODE_OPTIONS "--max-old-space-size=8168"

COPY ${WORK_DIR} .
RUN ls -lah
# Copy the entire micro-ui directory into the container.
COPY micro-ui .

#RUN node web/envs.js
RUN cd web/ \
&& ./install-deps.sh \
# Navigate to the web directory to install dependencies and build.
RUN cd web \
&& ./install-deps.sh \
&& yarn install \
&& yarn build:webpack
&& yarn build:webpack

FROM nginx:mainline-alpine
#FROM ghcr.io/egovernments/nginx:mainline-alpine
Expand All @@ -22,4 +21,4 @@ ENV WORK_DIR=/var/web/digit-ui
RUN mkdir -p ${WORK_DIR}

COPY --from=build /app/web/build ${WORK_DIR}/
COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf
2 changes: 1 addition & 1 deletion micro-ui/web/docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server
listen 80;
underscores_in_headers on;

location /digit-ui
location /digit-ui/
{
root /var/web;
index index.html index.htm;
Expand Down
8 changes: 8 additions & 0 deletions micro-ui/web/micro-ui-internals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ To run this project, you will need to add the following environment variables to

[sample .env file](https://github.com/egovernments/Digit-Core/blob/workbench/frontend/micro-ui/web/micro-ui-internals/example/.env-unifieddev)

## Environment Variables

To create your own globalConfig, copy and refer the below file.
```bash
frontend/micro-ui/web/micro-ui-internals/sampleGlobalConfig.js
```


## Tech Stack

**Libraries:**
Expand Down
7 changes: 7 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env sandbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=Citizen
REACT_APP_EMPLOYEE_TOKEN=
REACT_APP_CITIZEN_TOKEN=
REACT_APP_PROXY_API=https://digit-lts.digit.org
REACT_APP_PROXY_ASSETS=https://digit-lts.digit.org
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/sandbox/globalConfigSandboxLTS.js
7 changes: 7 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env-fsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=
REACT_APP_EMPLOYEE_TOKEN=
REACT_APP_CITIZEN_TOKEN=
REACT_APP_PROXY_API=https://unified-dev.digit.org
REACT_APP_PROXY_ASSETS=https://unified-dev.digit.org
REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigsFSM.js
7 changes: 7 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env-health-qa
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://health-qa.digit.org
REACT_APP_PROXY_ASSETS=https://health-qa.digit.org
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsWorkbenchHCM.js
8 changes: 8 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env-mgramseva-uat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://mgramseva-uat.psegs.in
REACT_APP_PROXY_ASSETS=https://mgramseva-uat.psegs.in
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsMgramsewa.js
REACT_APP_CONTEXT=works
7 changes: 7 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env-mz-prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://salama.digit.org
REACT_APP_PROXY_ASSETS=https://salama.digit.org
REACT_APP_GLOBAL=https://moz-health-prd.s3.af-south-1.amazonaws.com/globalConfig.js
7 changes: 7 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env-mz-uat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://moz-health-uat.digit.org
REACT_APP_PROXY_ASSETS=https://moz-health-uat.digit.org
REACT_APP_GLOBAL=https://moz-health-uat.s3.ap-south-1.amazonaws.com/globalConfig.js
7 changes: 7 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env-qa
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://qa.digit.org
REACT_APP_PROXY_ASSETS=https://qa.digit.org
REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js
4 changes: 3 additions & 1 deletion micro-ui/web/micro-ui-internals/example/.env-staging
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://staging.digit.org
REACT_APP_PROXY_ASSETS=https://staging.digit.org
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsDemo.js
REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js
MICROPLAN=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsMicroplan.js
REACT_APP_CONTEXT=works
8 changes: 8 additions & 0 deletions micro-ui/web/micro-ui-internals/example/.env-upyog
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://upyog.niua.org
REACT_APP_PROXY_ASSETS=https://upyog.niua.org
REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/in-egov-assets/globalConfigs.js
REACT_APP_CONTEXT=digit-ui
Loading