Skip to content

Commit

Permalink
Added mono-ui and workbench for 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmoy-96 committed Mar 21, 2024
1 parent 2c94a47 commit 621cfee
Show file tree
Hide file tree
Showing 2,599 changed files with 140,143 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="staging.digit.org"
android:host="qa.digit.org"
android:pathPattern=".*"
android:pathPrefix="/" /> <!-- if you want only a specific directory from your website to be opened in the app through external links -->
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public void downloadBase64File(String base64Data, String filename) throws IOExce
os = new FileOutputStream(dwldsPath, false);
os.write(pdfAsBytes);
}catch (Exception e){
Log.v("Error while creating temp report.");
}finally {
os.flush();
os.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const searchSetCommon = getCommonContainer({
visible: process.env.REACT_APP_NAME === "Citizen" ? true : false,
}),
fromdate: getDateField({
label: { labelName: "DOB", labelKey: "BND_FROM_DATE" },
label: { labelName: "DOB", labelKey: "BND_BIRTH_FROM_DATE" },
placeholder: {
labelName: "FromDate of Search",
labelKey: "BND_BIRTH_DOB_PLACEHOLDER",
Expand All @@ -284,7 +284,7 @@ export const searchSetCommon = getCommonContainer({
visible: process.env.REACT_APP_NAME === "Employee" ? true : false,
}),
todate: getDateField({
label: { labelName: "DOB", labelKey: "BND_TO_DATE" },
label: { labelName: "DOB", labelKey: "BND_BIRTH_TO_DATE" },
placeholder: {
labelName: "ToDate of Search",
labelKey: "BND_BIRTH_DOB_PLACEHOLDER",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export const searchSetCommon = getCommonContainer({
visible: process.env.REACT_APP_NAME === "Citizen" ? true : false,
}),
fromdate: getDateField({
label: { labelName: "DOD", labelKey: "BND_FROM_DATE" },
label: { labelName: "DOD", labelKey: "BND_DEATH_FROM_DATE" },
placeholder: {
labelName: "FromDate of Search",
labelKey: "BND_DEATH_DOB_PLACEHOLDER",
Expand All @@ -279,7 +279,7 @@ export const searchSetCommon = getCommonContainer({
visible: process.env.REACT_APP_NAME === "Employee" ? true : false,
}),
todate: getDateField({
label: { labelName: "DOD", labelKey: "BND_TO_DATE" },
label: { labelName: "DOD", labelKey: "BND_DEATH_TO_DATE" },
placeholder: {
labelName: "ToDate of Search",
labelKey: "BND_DEATH_DOB_PLACEHOLDER",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,24 @@ export const getCurrentFinancialYear = () => {
var fiscalYr = "";
if (curMonth > 3) {
var nextYr1 = (today.getFullYear() + 1).toString();
fiscalYr = today.getFullYear().toString() + "-" + nextYr1;
fiscalYr = today.getFullYear().toString() + "-" + nextYr1.slice(-2);
} else {
var nextYr2 = today.getFullYear().toString();
fiscalYr = (today.getFullYear() - 1).toString() + "-" + nextYr2;
fiscalYr = (today.getFullYear() - 1).toString() + "-" + nextYr2.slice(-2);
}
return fiscalYr;
};

export const getCurrentFinancialYearForFireNoc = () => {
var today = new Date();
var curMonth = today.getMonth();
var fiscalYr = "";
if (curMonth > 3) {
var nextYr1 = (today.getFullYear() + 1).toString();
fiscalYr = today.getFullYear().toString() + "-" + nextYr1.slice(-2);
} else {
var nextYr2 = today.getFullYear().toString();
fiscalYr = (today.getFullYear() - 1).toString() + "-" + nextYr2.slice(-2);
}
return fiscalYr;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ const mapStateToProps = (state, ownProps) => {
export default connect(
mapStateToProps,
null
)(AutoSuggestDropdown);
)(AutoSuggestDropdown);
32 changes: 32 additions & 0 deletions frontend/workbench-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.env
.eslintcache

# yarn $
.yarn
yarn.lock
.yarnrc.yml

# dependencies
node_modules
.yarn
/.pnp
.pnp.js

# testing
/coverage

# production
/web/build
dist
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions frontend/workbench-ui/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jagankumar-egov @sathishp-eGov
3 changes: 3 additions & 0 deletions frontend/workbench-ui/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library 'ci-libs'

buildPipeline(configFile: './build/build-config.yml')
140 changes: 140 additions & 0 deletions frontend/workbench-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@

# workbench ui

A React App built on top of DIGIT UI Core.

# DIGIT

DIGIT eGovernance Platform Services

DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://core.digit.org/ for more details.

DIGIT platform is microservices based API platform enabling quick rebundling of services as per specific needs. This is a repo that lays down the core platform on top of which other mission services depend.


# DIGIT UI


This repository contains source code for web implementation of the new Digit UI modules with dependencies and libraries.

Workbench module is used to Manage the master data (MDMS V2 Service) used across the DIGIT Services / Applications

It is also used to manage the Localisation data present in the system (Localisation service)


## Run Locally

Clone the project

```bash
git clone https://github.com/egovernments/DIGIT-Frontend.git
```

Go to the Sub directory to run UI
```bash
cd into micro-ui/web/micro-ui-internals
```

Install dependencies

```bash
yarn install
```

Add .env file
```bash
micro-ui/web/micro-ui-internals/example/.env
```

Start the server

```bash
yarn start
```


## Environment Variables

To run this project, you will need to add the following environment variables to your .env file

`REACT_APP_PROXY_API` :: `{{server url}}`

`REACT_APP_GLOBAL` :: `{{server url}}`

`REACT_APP_PROXY_ASSETS` :: `{{server url}}`

`REACT_APP_USER_TYPE` :: `{{EMPLOYEE||CITIZEN}}`

`SKIP_PREFLIGHT_CHECK` :: `true`

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

## Tech Stack

**Libraries:**

[React](https://react.dev/)

[React Hook Form](https://www.react-hook-form.com/)

[React Query](https://tanstack.com/query/v3/)

[Tailwind CSS](https://tailwindcss.com/)

[Webpack](https://webpack.js.org/)

## License

[MIT](https://choosealicense.com/licenses/mit/)


## Author

- [@jagankumar-egov](https://www.github.com/jagankumar-egov)


## Documentation

[Documentation](https://https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui)


## Support

For support, add the issues in https://github.com/egovernments/DIGIT-core/issues.


## Modules

1. Core
2. Workbench
3. HRMS
4. Dashboard
5. Engagement
6. Payment

## Starting with Digit-UI App (Impelmentation Teams) - MICRO-UI


Go to the Sub directory to run UI

```bash
cd into micro-ui/web
```

```bash
yarn install
```

Add .env file
```bash
micro-ui/web/.env
```

Start the server

```bash
yarn start
```


![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png)
4 changes: 4 additions & 0 deletions frontend/workbench-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "workbench-ui",
"version": "1.0.0"
}
5 changes: 5 additions & 0 deletions frontend/workbench-ui/web/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env","@babel/preset-react"
]
}
3 changes: 3 additions & 0 deletions frontend/workbench-ui/web/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_STATE_LEVEL_TENANT_ID=pb
REACT_APP_PROXY_URL=https://works-dev.digit.org
72 changes: 72 additions & 0 deletions frontend/workbench-ui/web/core/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React from "react";
import { initLibraries } from "@egovernments/digit-ui-libraries";
import {
paymentConfigs,
PaymentLinks,
PaymentModule,
} from "@egovernments/digit-ui-module-common";
import { DigitUI } from "@egovernments/digit-ui-module-core";
import { initDSSComponents } from "@egovernments/digit-ui-module-dss";
import { initEngagementComponents } from "@egovernments/digit-ui-module-engagement";
import { initHRMSComponents } from "@egovernments/digit-ui-module-hrms";
import { initUtilitiesComponents } from "@egovernments/digit-ui-module-utilities";
import { UICustomizations } from "./Customisations/UICustomizations";
import { initWorkbenchComponents } from "@egovernments/digit-ui-module-workbench";

window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH");

const enabledModules = [
"DSS",
"NDSS",
"Utilities",
"HRMS",
"Engagement",
"Workbench",
];

const moduleReducers = (initData) => ({
initData,
});

const initDigitUI = () => {
window.Digit.ComponentRegistryService.setupRegistry({
PaymentModule,
...paymentConfigs,
PaymentLinks,
});

initDSSComponents();
initHRMSComponents();
initEngagementComponents();
initUtilitiesComponents();
initWorkbenchComponents();

window.Digit.Customizations = {
PGR: {},
commonUiConfig: UICustomizations,
};
};

initLibraries().then(() => {
initDigitUI();
});

function App() {
window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH");
const stateCode =
window.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") ||
process.env.REACT_APP_STATE_LEVEL_TENANT_ID;
if (!stateCode) {
return <h1>stateCode is not defined</h1>;
}
return (
<DigitUI
stateCode={stateCode}
enabledModules={enabledModules}
moduleReducers={moduleReducers}
// defaultLanding="employee"
/>
);
}

export default App;
29 changes: 29 additions & 0 deletions frontend/workbench-ui/web/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM egovio/alpine-node-builder-14:yarn AS build
#FROM ghcr.io/egovernments/alpine-node-builder-14:yarn 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=4792"

COPY ${WORK_DIR} .
RUN ls -lah

#RUN node web/envs.js
RUN cd web/ \
&& node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))' \
&& node -e 'console.log("core only")' \
&& cd core/ \
&& ./install-deps.sh \
&& cd ../ \
&& yarn install \
&& yarn build:webpack

FROM nginx:mainline-alpine
#FROM ghcr.io/egovernments/nginx:mainline-alpine
ENV WORK_DIR=/var/web/core-ui

RUN mkdir -p ${WORK_DIR}

COPY --from=build /app/web/build ${WORK_DIR}/
COPY --from=build /app/web/core/nginx.conf /etc/nginx/conf.d/default.conf
Loading

0 comments on commit 621cfee

Please sign in to comment.