Skip to content

Commit

Permalink
updated tqm code
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunarora-eGov committed Apr 1, 2024
1 parent 3dd11af commit b0737c6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 77 deletions.
2 changes: 1 addition & 1 deletion micro-ui/web/packages/core/src/components/Search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => {
{data?.display ? (
<div style={{ marginTop: "20x", width: "1025px", marginLeft: "25px", backgroundColor: "white", height: "60px" }}>
{t(data.display)
.split("\\n")
?.split("\\n")
.map((text, index) => (
<p key={index} style={{ textAlign: "center" }}>
{text}
Expand Down
6 changes: 3 additions & 3 deletions micro-ui/web/packages/tqm/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">

<head>
<title>Workbench Page</title>
<title>TQM Page</title>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigsWorkbench.js"></script>
<script type="systemjs-importmap">
{
"imports": {
"react": "https://cdn.jsdelivr.net/npm/[email protected].1/umd/react.production.min.js",
"react-dom": "https://cdn.jsdelivr.net/npm/[email protected].1/umd/react-dom.production.min.js"
"react": "https://cdn.jsdelivr.net/npm/[email protected].2/umd/react.production.min.js",
"react-dom": "https://cdn.jsdelivr.net/npm/[email protected].2/umd/react-dom.production.min.js"
}
}
</script>
Expand Down
3 changes: 1 addition & 2 deletions micro-ui/web/packages/tqm/src/TQMWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import EmployeeApp from "./pages/employee";
const App = ({ queryClient, title }) => {
initTQMComponents();
//make way to do this job in container while registering remotes

return (
<Router>
<QueryClientProvider client={queryClient}>
<EmployeeApp path={"/workbench-ui/employee/tqm"} />
<EmployeeApp path={`/${window.contextPath}/employee/tqm`} />
</QueryClientProvider>
</Router>
);
Expand Down
97 changes: 27 additions & 70 deletions micro-ui/web/packages/tqm/src/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,38 @@

// import React from "react";
// import ReactDOM from "react-dom";
// import { createBrowserHistory } from "history";
// import { QueryClient, QueryClientProvider } from "react-query";
// import App from "./TQMWrapper";

// //registering remote apps
// const queryClient = new QueryClient({
// defaultOptions: {
// queries: {
// staleTime: 15 * 60 * 1000,
// cacheTime: 50 * 60 * 1000,
// retry: false,
// retryDelay: (attemptIndex) => Infinity,
// /*
// enable this to have auto retry incase of failure
// retryDelay: attemptIndex => Math.min(1000 * 3 ** attemptIndex, 60000)
// */
// },
// },
// });

// const mount = (el, { history, login }) => {
// ReactDOM.render(
// <QueryClientProvider client={queryClient}>
// <App />
// </QueryClientProvider>,
// el
// );
// };

// if (process.env.NODE_ENV === "development") {
// debugger
// const rootNode = document.querySelector("#tqm-module-root");

// if (rootNode) {
// mount(rootNode, {
// history: createBrowserHistory(),
// login: () => {},
// });
// }
// }

// export { mount };
debugger;
import React from "react";
import ReactDOM from "react-dom";
import { Router } from "react-router-dom";
import { createBrowserHistory } from "history";
import { initLibraries } from "@digit-ui/digit-ui-libraries-mfe";
import { initTQMComponents } from "./Module";
import { QueryClient, QueryClientProvider } from "react-query";
import { QueryClient } from "react-query";
import App from "./TQMWrapper";

const initDigitUI = () => {
window.contextPath = "core-digit-ui"
window.Digit.Customizations = {};
window?.Digit.ComponentRegistryService.setupRegistry({
// PaymentModule,
// ...paymentConfigs,
// PaymentLinks,
});

// initHRMSComponents();
const enabledModules = ["TQM"];

const moduleReducers = (initData) => initData;

const stateCode = window?.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") || "pg";
// initTokens(stateCode);

// return (<DigitUI stateCode={stateCode} enabledModules={enabledModules} defaultLanding="employee" moduleReducers={moduleReducers} />);
};

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

// initTQMComponents();

const queryClient = new QueryClient({
defaultOptions: {
Expand All @@ -73,16 +49,15 @@ const queryClient = new QueryClient({
},
});
const mount = (el, { history, login }) => {
initDigitUI()
ReactDOM.render(
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>,
<App queryClient={queryClient}/>,
// <div>TQM MODULE</div>,
el
);
};

if (process.env.NODE_ENV === "development") {
debugger
const rootNode = document.querySelector("#tqm-module-root");

if (rootNode) {
Expand All @@ -93,24 +68,6 @@ if (process.env.NODE_ENV === "development") {
}
}

const initDigitUI = () => {
window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") || "digit-ui";
window.Digit.Customizations = {};
window?.Digit.ComponentRegistryService.setupRegistry({
// PaymentModule,
// ...paymentConfigs,
// PaymentLinks,
});

// initHRMSComponents();
const enabledModules = ["PT", "TQM"];

const moduleReducers = (initData) => initData;

const stateCode = window?.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") || "pb";
// initTokens(stateCode);

// return (<DigitUI stateCode={stateCode} enabledModules={enabledModules} defaultLanding="employee" moduleReducers={moduleReducers} />);
};

export { mount };
2 changes: 1 addition & 1 deletion micro-ui/web/packages/tqm/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require("path");

module.exports = {
entry: "./src/SingleSpaEntry.js",
entry: "./src/index.js",
resolve: {
extensions: [ ".js", ".jsx"],
modules: [path.resolve(__dirname, "src"), "node_modules"],
Expand Down

0 comments on commit b0737c6

Please sign in to comment.