Skip to content

Commit

Permalink
Merge pull request #1414 from digitalgreenorg/passowrd_enhancement
Browse files Browse the repository at this point in the history
routes fixed
  • Loading branch information
shruthi-monika authored Sep 12, 2024
2 parents b6a2a38 + 310e3ce commit f6aa627
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
13 changes: 12 additions & 1 deletion src/features/default/src/Layout/Datahub.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const EditDataset = lazy(() =>
const DashboardNew = lazy(() => import("../Views/Dashboard/DashboardNew"));
const StreamlitFrame = lazy(() => import("../Views/Pages/Dashboard/streamlit"));
const TempFile = lazy(() => import("../Views/GuestUser/TempFarmerFile"));
const DaFile = lazy(() => import("../Views/GuestUser/TempDaRegistryFile"));
const Support = lazy(() => import("../Components/Support_New/Support"));
const SupportView = lazy(() => import("../Components/Support_New/SupportView"));
const AskSupport = lazy(() => import("../Components/Support_New/SupportForm"));
Expand Down Expand Up @@ -311,7 +312,17 @@ function Datahub(props) {
<Route
exact
path="/datahub/dashboards/:name"
component={TempFile}
render={(props) => {
const { name } = props.match.params;

if (name === "farmer_registry_dashboard") {
return <TempFile />;
} else if (name === "da_registry_dashboard") {
return <DaFile />;
} else {
return <NotFound />;
}
}}
/>
{isParticipantsEnabled && (
<Route
Expand Down
7 changes: 7 additions & 0 deletions src/features/default/src/Views/Dashboard/DashboardNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ function DashboardNew() {
: isLoggedInUserParticipant()
? `/participant/dashboards/${item}`
: "/home";
} else if (item === "da_registry_dashboard") {
path =
isLoggedInUserAdmin() || isLoggedInUserCoSteward()
? `/datahub/dashboards/da_registry_dashboard`
: isLoggedInUserParticipant()
? `/participant/dashboards/da_registry_dashboard`
: "/home";
} else {
path =
isLoggedInUserAdmin() || isLoggedInUserCoSteward()
Expand Down
13 changes: 13 additions & 0 deletions src/features/default/src/Views/GuestUser/TempDaRegistryFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { FarmStackContext } from "common/components/context/DefaultContext/FarmstackProvider";
import React, { useContext, useEffect, useRef } from "react";
import Dashboard from "../../../../../Da_Registry/index";

const TempDaRegistryFile = () => {
const { callToast, callLoader } = useContext(FarmStackContext);

return (
<><Dashboard /></>
);
};

export default TempDaRegistryFile;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Box, CssBaseline } from "@mui/material";
import { FarmStackContext } from "common/components/context/DefaultContext/FarmstackProvider";
import UrlConstant from "common/constants/UrlConstants";
import Dashboard from "../../../../../../../Da_Registry/index"

import React, { useContext, useEffect, useState } from "react";
import { useParams } from "react-router-dom";
Expand Down Expand Up @@ -30,9 +29,8 @@ const StreamlitFrame = () => {

return (
<>
<Dashboard />
{/* <CssBaseline /> */}
{/* <Box
<CssBaseline />
<Box
sx={{
width: "100vw",
height: "100vh",
Expand All @@ -51,8 +49,8 @@ const StreamlitFrame = () => {
height="100%"
frameBorder="0"
allowFullScreen
></iframe> */}
{/* </Box> */}
></iframe>
</Box>
</>
);
};
Expand Down

0 comments on commit f6aa627

Please sign in to comment.