Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into pgr_updates
  • Loading branch information
hridya-egov committed Aug 13, 2024
2 parents 805a6e1 + 45cfa94 commit dfe83a6
Show file tree
Hide file tree
Showing 50 changed files with 1,951 additions and 33 deletions.
8 changes: 7 additions & 1 deletion build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ config:
- work-dir: micro-ui/
dockerfile: micro-ui/web/workbench/Dockerfile
image-name: workbench-ui


- name: builds/Digit-Frontend/sandbox-ui
build:
- work-dir: micro-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 Down
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"
]
}
4 changes: 2 additions & 2 deletions micro-ui/web/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"dependencies": {
"@egovernments/digit-ui-components": "0.0.2-beta.18",
"@egovernments/digit-ui-libraries": "1.8.2-beta.6",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.7",
"@egovernments/digit-ui-module-core": "1.8.2-beta.12",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-core": "1.8.2-beta.13",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
"@egovernments/digit-ui-module-open-payment":"0.0.1",
"@egovernments/digit-ui-module-hrms": "1.8.1-beta.1",
Expand Down
8 changes: 7 additions & 1 deletion micro-ui/web/core/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ module.exports = {
{
test: /\.(js)$/,
exclude: /node_modules/,
use: ["babel-loader"],
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: ["@babel/plugin-proposal-optional-chaining"]
}
},
},
{
test: /\.css$/i,
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
5 changes: 3 additions & 2 deletions micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
},
"devDependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.6",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.7",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-pgr": "1.8.1-beta.1",
"@egovernments/digit-ui-module-dss": "1.8.1",
"@egovernments/digit-ui-module-core": "1.8.2-beta.12",
"@egovernments/digit-ui-module-core": "1.8.2-beta.13",
"@egovernments/digit-ui-module-common": "1.8.0",
"@egovernments/digit-ui-module-hrms": "1.8.0",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
"@egovernments/digit-ui-module-open-payment":"0.0.1",
"@egovernments/digit-ui-module-engagement": "1.5.20",
"@egovernments/digit-ui-components": "0.0.2-beta.18",
"@egovernments/digit-ui-react-components": "1.8.2-beta.12",
"@egovernments/digit-ui-module-sandbox": "0.0.1",
"http-proxy-middleware": "^1.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
3 changes: 3 additions & 0 deletions micro-ui/web/micro-ui-internals/example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { initUtilitiesComponents } from "@egovernments/digit-ui-module-utilitie
import {initWorkbenchComponents} from "@egovernments/digit-ui-module-workbench";
import {initPGRComponents} from "@egovernments/digit-ui-module-pgr";
import {initOpenPaymentComponents} from "@egovernments/digit-ui-module-open-payment";
import {initSandboxComponents} from "@egovernments/digit-ui-module-sandbox";

import "@egovernments/digit-ui-css/example/index.css";

Expand All @@ -26,6 +27,7 @@ const enabledModules = [
"Utilities","PGR",
//added to check fsm
// "FSM"
"Sandbox",
"OpenPayment"
];

Expand Down Expand Up @@ -75,6 +77,7 @@ const initDigitUI = () => {
initWorkbenchComponents();
initPGRComponents();
initOpenPaymentComponents();
initSandboxComponents();

const moduleReducers = (initData) => ({
pgr: PGRReducers(initData),
Expand Down
2 changes: 2 additions & 0 deletions micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"dev:openpayment": "cd packages/modules/open-payment && yarn start",
"devD:openpayment": "cd packages/modules/open-payment && yarn start",
"devD:engagement": "cd packages/modules/engagement && yarn start",
"dev:sandbox": "cd packages/modules/sandbox && yarn start",
"build": "run-p build:**",
"build:libraries": "cd packages/libraries && yarn build",
"build:components": "cd packages/react-components && yarn build",
Expand All @@ -49,6 +50,7 @@
"build:workbench": "cd packages/modules/workbench && yarn build",
"build:pgr": "cd packages/modules/pgr && yarn build",
"build:openpayment": "cd packages/modules/open-payment && yarn build",
"build:sandbox": "cd packages/modules/sandbox && yarn build",
"deploy:jenkins": "./scripts/jenkins.sh",
"clean": "rm -rf node_modules"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-core",
"version": "1.8.2-beta.12",
"version": "1.8.2-beta.13",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const ChangeLanguage = (prop) => {
<Dropdown
className={"language-dropdown"}
option={languages}
selected={languages.find((language) => language.value === selectedLanguage)}
selected={languages?.find((language) => language?.value === selectedLanguage)}
optionKey={"label"}
select={handleChangeLanguage}
freeze={true}
customSelector={<label className="cp">{languages.find((language) => language.value === selected).label}</label>}
customSelector={<label className="cp">{languages?.find((language) => language?.value === selected)?.label}</label>}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## [0.0.1] - 2024-06-13

### New Changes

- Added base code sandbox
23 changes: 23 additions & 0 deletions micro-ui/web/micro-ui-internals/packages/modules/sandbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- TODO: update this -->

# digit-ui-module-sandbox



## Install

```bash
npm install --save @egovernments/digit-ui-module-sandbox
```

## Limitation

```bash
This Package is more specific to DIGIT-UI's can be used across mission's
It is the base css for all Digit UI's
```
##Module generation
- Generated the module using digit-ui-codegen
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@egovernments/digit-ui-module-sandbox",
"version": "0.0.1",
"description": "Sandbox",
"main": "dist/index.js",
"module": "dist/index.modern.js",
"source": "src/Module.js",
"files": [
"dist"
],
"scripts": {
"start": "microbundle-crl watch --no-compress --format modern,cjs",
"build": "microbundle-crl --compress --no-sourcemap --format cjs",
"prepublish": "yarn build"
},
"peerDependencies": {
"react": "17.0.2",
"react-router-dom": "5.3.0"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.2-beta.3",
"@egovernments/digit-ui-components": "0.0.2-beta.1",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
"react-hook-form": "6.15.8",
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.3.0"
},
"author": "Jagankumar <[email protected]>",
"license": "MIT"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Loader } from "@egovernments/digit-ui-react-components";
import React from "react";
import { useRouteMatch } from "react-router-dom";
import { default as EmployeeApp } from "./pages/employee";
import SandboxCard from "./components/SandboxCard";
import { overrideHooks, updateCustomConfigs } from "./utils";

export const SandboxModule = ({ stateCode, userType, tenants }) => {
const { path, url } = useRouteMatch();
const tenantId = Digit.ULBService.getCurrentTenantId();
const moduleCode = ["common", "workflow", "Sandbox", "sandbox"];
const language = Digit.StoreData.getCurrentLanguage();
const { isLoading, data: store } = Digit.Services.useStore({
stateCode,
moduleCode,
language,
});

if (isLoading) {
return <Loader />;
}
return <EmployeeApp path={path} stateCode={stateCode} userType={userType} tenants={tenants} />;
};

const componentsToRegister = {
SandboxModule,
SandboxCard,
};

export const initSandboxComponents = () => {
overrideHooks();
updateCustomConfigs();
Object.entries(componentsToRegister).forEach(([key, value]) => {
Digit.ComponentRegistryService.setComponent(key, value);
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { EmployeeModuleCard, PropertyHouse } from "@egovernments/digit-ui-react-components";
import React from "react";
import { useTranslation } from "react-i18next";

const SandboxCard = () => {
const { t } = useTranslation();

const propsForModuleCard = {
Icon: <PropertyHouse />,
moduleName: t("Sandbox"),
kpis: [],
links: [
{
label: t("Tenant Management"),
link: `/${window?.contextPath}/employee/sandbox/tenant-management/search`,
},
{
label: t("Application Management"),
link: `/${window?.contextPath}/employee/sandbox/application-management`,
}
],
};

return <EmployeeModuleCard {...propsForModuleCard} />;
};

export default SandboxCard;
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";

const SandboxTestComponent = (props) => {
const [data, updateData] = useState({});
const { t } = useTranslation();
useEffect(() => {
updateData(props?.formData || {});
}, [props, props?.formData]);
return (
<div>
<h3>View Entered Data(SandboxTestComponent)</h3>
<div className="pucar-component-style">
{Object.keys(data).map((key) => {
return (
data?.[key] && (
<div>
{key} : {JSON.stringify(data?.[key])}
</div>
)
);
})}
</div>
</div>
);
};

export default SandboxTestComponent;
Loading

0 comments on commit dfe83a6

Please sign in to comment.