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

Copy of master #186

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
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
5 changes: 0 additions & 5 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,3 @@ config:
- work-dir: frontend/micro-ui/
dockerfile: frontend/micro-ui/web/docker/Dockerfile
image-name: digit-ui
- name: "builds/iFix/reference-adapter/ifms-adapter"
build:
- work-dir: "reference-adapter/ifms-adapter"
image-name: "ifms-adapter"
dockerfile: "build/maven/Dockerfile"
1 change: 1 addition & 0 deletions frontend/micro-ui/web/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN ls -lah

#RUN node web/envs.js
RUN cd web/ \
&& chmod 777 install-deps.sh \
&& ./install-deps.sh \
&& yarn install \
&& yarn build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { createProxyMiddleware } = require("http-proxy-middleware");

const createProxy = createProxyMiddleware({
//target: process.env.REACT_APP_PROXY_API || "https://uat.digit.org",
// target: process.env.REACT_APP_PROXY_API || "https://uat.digit.org",
// target: process.env.REACT_APP_PROXY_API || "https://qa.digit.org",
target: process.env.REACT_APP_PROXY_API || "https://works-dev.digit.org",
target: process.env.REACT_APP_PROXY_API || "https://ifix-uat.psegs.in",
changeOrigin: true,
secure:false
});
const assetsProxy = createProxyMiddleware({
target: process.env.REACT_APP_PROXY_ASSETS || "https://works-dev.digit.org",
target: process.env.REACT_APP_PROXY_API || "https://ifix-uat.psegs.in",
changeOrigin: true,
secure:false
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useQuery } from "react-query";
import { DSSService } from "../../services/elements/DSS";

const useGetDepartments = (tenantId, config = {}) => {
let data = {
"requestHeader": {
"version": "2.0.0"
},
"criteria": {
tenantId
}
}

return useQuery(["DSS_HIERARCHY_DEPT", tenantId], () => DSSService.getDepartments(data), config);

};

export default useGetDepartments;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useQuery } from "react-query";
import { DSSService } from "../../services/elements/DSS";

const useGetHierarchy = (tenantId, departmentId, config={}) => {
let data = {
"requestHeader": {
"version": "2.0.0"
},
"criteria": {
tenantId,
departmentId
}
}
return useQuery(["DSS_HIERARCHY_LIST", tenantId, departmentId], () => DSSService.getHierarchyData(data), config);
};

export default useGetHierarchy;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useQuery } from "react-query";
import { DSSService } from "../../services/elements/DSS";

const useGetHierarchyMetaData = (tenantId, departmentId, config={}) => {
let data = {
"requestHeader": {
"version": "2.0.0"
},
"criteria": {
tenantId,
departmentId
}
}
// return DSSService.getDepartments(data);
return useQuery(["DSS_HIERARCHY_METADATA", tenantId, departmentId], () => DSSService.getHierarchyMetaData(data), config);
};

export default useGetHierarchyMetaData;
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ import useDashboardConfig from "./dss/useDashboardConfig";
import useDSSDashboard from "./dss/useDSSDashboard";
import useGetChart from "./dss/useGetChart";
import useDssMdms from "./dss/useMDMS";
import useGetHierarchy from "./dss/useGetHierarchy";
import useGetHierarchyMetaData from "./dss/useGetHierarchyMetaData";
import useGetDepartments from "./dss/useGetDepartments";


import useHRMSCount from "./hrms/useHRMSCount";
Expand Down Expand Up @@ -105,6 +108,9 @@ const dss = {
useDashboardConfig,
useDSSDashboard,
useGetChart,
useGetHierarchy,
useGetHierarchyMetaData,
useGetDepartments
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ const Urls = {
dss: {
dashboardConfig: "/dashboard-analytics/dashboard/getDashboardConfig",
getCharts: "/dashboard-analytics/dashboard/getChartV2",
search_ifix_dept_master_data: "/adapter-master-data/department/v1/_search",
search_ifix_hierarchy_level: "/ifix-department-entity/departmentEntity/hierarchyLevel/v1/_search",
search_ifix_dept_entity: "/ifix-department-entity/departmentEntity/v1/_search",
},

mcollect: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,31 @@ export const DSSService = {
auth: true,
data,
}),
getDepartments: (data) =>
Request({
url: (window?.globalConfigs.getConfig('HIERARCHY_API_BASE_URL') || "").toString() + Urls.dss.search_ifix_dept_master_data,
useCache: false,
userService: false,
method: "POST",
auth: true,
data,
}),
getHierarchyMetaData: (data) =>
Request({
url: (window?.globalConfigs.getConfig('HIERARCHY_API_BASE_URL') || "").toString() + Urls.dss.search_ifix_hierarchy_level,
useCache: false,
userService: false,
method: "POST",
auth: true,
data
}),
getHierarchyData: (data) =>
Request({
url: (window?.globalConfigs.getConfig('HIERARCHY_API_BASE_URL') || "").toString() + Urls.dss.search_ifix_dept_entity,
useCache: false,
userService: false,
method: "POST",
auth: true,
data,
}),
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const amountFormatter = (value, denomination, t) => {

switch (denomination) {
case "Lac":
return `₹ ${currencyFormatter.format((value / 100000).toFixed(2) || 0)} ${t("ES_DSS_LAC")}`;
return `₹ ${currencyFormatter.format(parseFloat((value / 100000).toFixed(2)) || 0)} ${t("ES_DSS_LAC")}`;
case "Cr":
return `₹ ${currencyFormatter.format((value / 10000000).toFixed(2) || 0)} ${t("ES_DSS_CR")}`;
return `₹ ${currencyFormatter.format(parseFloat((value / 10000000).toFixed(2)) || 0)} ${t("ES_DSS_CR")}`;
case "Unit":
return `₹ ${currencyFormatter.format(value?.toFixed(2) || 0)}`;
return `₹ ${currencyFormatter.format(parseFloat(value?.toFixed(2)) || 0)}`;
default:
return "";
}
Expand All @@ -28,7 +28,9 @@ export const formatter = (value, symbol, unit, commaSeparated = true, t) => {
return parseInt(value);
}
const Nformatter = new Intl.NumberFormat("en-IN");
return Nformatter.format(Math.round(value));
// Commenting round because it doesn't give exact value, should display decimal upto 2 places
// return Nformatter.format(Math.round(value));
return Nformatter.format(value);
case "percentage":
const Pformatter = new Intl.NumberFormat("en-IN", { maximumSignificantDigits: 3 });
return `${Pformatter.format(value.toFixed(2))} %`;
Expand Down Expand Up @@ -104,4 +106,19 @@ export const getCitiesAvailable = (e, selectedDDRs) => {
} else {
return false;
}
};
};

// Check ifix dashboard from dashboard config
export const isIFixDashboard = (config) => {
return config?.[0]?.name.includes("DSS_IFIX_DASHBOARD") ? true : false;
}

/**
* This is for demo only needs to be remove, funciton which checks the ifix key is exists then it returns the value
*/
export const getIfixMapedName = (key) => {
if (key)
return JSON.parse(localStorage.getItem("Digit.dss.iFixCodeNameMap") || {})[key] || key;
else
return null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const AppModules = ({ stateCode, userType, modules, appTenants }) => {

const user = Digit.UserService.getUser();

if (!user || !user?.access_token || !user?.info) {
return <Redirect to={{ pathname: `/${window?.contextPath}/employee/user/login`, state: { from: location.pathname + location.search } }} />;
}
// if (!user || !user?.access_token || !user?.info) {
// return <Redirect to={{ pathname: `/${window?.contextPath}/employee/user/login`, state: { from: location.pathname + location.search } }} />;
// }

const appRoutes = modules.map(({ code, tenants }, index) => {
const Module = Digit.ComponentRegistryService.getComponent(`${code}Module`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const TopBar = ({
return (
<div className="topbar">
{mobileView ? <Hamburger handleClick={toggleSidebar} color="#9E9E9E" /> : null}
<img className="city" src={loggedin ? cityDetails?.logoId : stateInfo?.statelogo} />
{ !window.location.href.includes("employee/dss/dashboard/ifix") && <img className="city" src={loggedin ? cityDetails?.logoId : stateInfo?.statelogo} />}
<span style={{ display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }}>
{loggedin &&
(cityDetails?.city?.ulbGrade ? (
Expand All @@ -112,15 +112,19 @@ const TopBar = ({
) : (
<img className="state" src={logoUrl} />
))}
{!loggedin && (
{!loggedin && !window.location.href.includes("employee/dss/dashboard/ifix") ? (
<p className="ulb" style={mobileView ? { fontSize: "14px", display: "inline-block" } : {}}>
{t(`MYCITY_${stateInfo?.code?.toUpperCase()}_LABEL`)} {t(`MYCITY_STATECODE_LABEL`)}
</p>
) : (
<p className="ulb" style={mobileView ? { fontSize: "14px", display: "inline-block" } : { fontSize: "20px"}}>
{t(`DSS_IFIX_DASHBOARD_TOP_BAR`)}
</p>
)}
{!mobileView && (
<div className={mobileView ? "right" : "flex-right right w-80 column-gap-15"} style={!loggedin ? { width: "80%" } : {}}>
<div className="left">
{!window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && (
{!window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && !window.location.href.includes("employee/dss/dashboard/ifix") && (
<ChangeCity dropdown={true} t={t} />
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ const TopBarSideBar = ({
userOptions={userOptions}
handleUserDropdownSelection={handleUserDropdownSelection}
logoUrl={logoUrl}
showLanguageChange={showLanguageChange}
// Commenting language selector for now
// showLanguageChange={showLanguageChange}
showLanguageChange={false}
/>
{showDialog && (
<LogoutDialog onSelect={handleOnSubmit} onCancel={handleOnCancel} onDismiss={handleOnCancel}></LogoutDialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ const EmployeeApp = ({
</div>
</div>
</Route>
<Route>
{/* <Route>
<Redirect to={`${path}/user/language-selection`} />
</Route>
</Route> */}
</Switch>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ const Routes = ({ path, stateCode }) => {
const isMobile = window.Digit.Utils.browser.isMobile();
return (
<div className="chart-wrapper" style={isMobile ? {marginTop:"unset"} : {}}>
<DssBreadCrumb location={location} />
{/* Disabling breadcrumb for dss */}
{/* <DssBreadCrumb location={location} /> */}
<Switch>
<PrivateRoute path={`${path}/landing/:moduleCode`} component={() => <Home stateCode={stateCode} />} />
<PrivateRoute path={`${path}/dashboard/:moduleCode`} component={() => <DashBoard stateCode={stateCode} />} />
// Changed from private route to normal route to remove redirection for iFix-dashboard
{/* <PrivateRoute path={`${path}/dashboard/:moduleCode`} component={() => <DashBoard stateCode={stateCode} />} /> */}
<Route path={`${path}/dashboard/:moduleCode`} component={() => <DashBoard stateCode={stateCode} />} />
<PrivateRoute path={`${path}/drilldown`} component={() => <DrillDown stateCode={stateCode} />} />
<Route key={"national-faq"} path={`${path}/national-faqs`}>
<FAQsSection/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ const CustomAreaChart = ({ xDataKey = "name", yDataKey = getValue, data, setChar
data={chartData}
margin={{
top: 15,
right: 5,
right: 10,
left: 20,
bottom: 5,
}}
Expand All @@ -289,6 +289,7 @@ const CustomAreaChart = ({ xDataKey = "name", yDataKey = getValue, data, setChar
<XAxis dataKey="name" />
<YAxis
tickFormatter={yAxistickFormatter}
width={70}
/*
Removed this custom yaxis label for all line charts
label={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination }
return response?.responseData?.data?.map((rows, id) => {
const lyData = lastYearResponse?.responseData?.data?.find((lyRow) => lyRow?.headerName === rows?.headerName);
return rows?.plots?.reduce((acc, row, currentIndex) => {
let cellValue = row?.value !== null ? row?.value : row?.label || "";
let cellValue = row?.value !== null ? row?.value : Digit.Utils.dss.getIfixMapedName(row?.label) || "";
if (row?.strValue && row?.symbol === "string" && !row?.label) {
cellValue = row?.strValue;
}
Expand Down Expand Up @@ -128,7 +128,7 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination }
const result = tableData?.map((row) => {
return Object.keys(row).reduce((acc, key) => {
if (key === "key") return acc;
acc[key] = typeof row?.[key] === "object" ? row?.[key]?.value : row?.[key];
acc[key] = typeof row?.[key] === "object" ? row?.[key]?.value : Digit.Utils.dss.getIfixMapedName(row?.[key]);
return acc;
}, {});
});
Expand Down Expand Up @@ -355,9 +355,9 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination }
case "Unit":
return val;
case "Lac":
return Number((val / 100000).toFixed(2));
return Number(parseFloat((val / 100000).toFixed(2)) || 0);
case "Cr":
return Number((val / 10000000).toFixed(2));
return Number(parseFloat((val / 10000000).toFixed(2)) || 0);
default:
return val;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const GenericChart = ({
i18nKey: t("ES_COMMON_DOWNLOAD_IMAGE"),
icon: <DownloadIcon />,
},
// Disabling share icon
/*
{
code: "shareImage",
i18nKey: t("ES_DSS_SHARE_IMAGE"),
Expand All @@ -54,6 +56,7 @@ const GenericChart = ({
target: "whatsapp",
icon: <WhatsappIcon />,
},
*/
];

function download(data) {
Expand Down
Loading