Skip to content

Commit

Permalink
Merge pull request #74 from BLSQ/fix-maps
Browse files Browse the repository at this point in the history
Fix maps
  • Loading branch information
mestachs authored Jun 3, 2024
2 parents 9028a8b + cd6619d commit 83b80ed
Show file tree
Hide file tree
Showing 6 changed files with 1,300 additions and 1,128 deletions.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60",
"@turf/turf": "^5.1.6",
"@turf/turf": "^6.5.0",
"ace-builds": "^1.4.12",
"autosuggest-highlight": "^3.1.1",
"d2": "30.0.2",
Expand All @@ -27,14 +27,15 @@
"react-csv-reader": "^1.3.1",
"react-dom": "^17.0.2",
"react-leaflet": "^2.4.0",
"react-leaflet-pixi-overlay": "^1.0.12",
"react-leaflet-pixi-overlay": "^1.0.13",
"react-query": "^3.34.19",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-style-object-to-css": "^1.1.2",
"xlsx-populate": "^1.20.1"
},
"devDependencies": {
"gh-pages": "4.0.0",
"react-scripts": "4.0.1",
"source-map-explorer": "^2.5.2"
},
Expand All @@ -43,7 +44,9 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
206 changes: 121 additions & 85 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import React, { Suspense } from "react";
import "./App.css";
import { QueryClient, QueryClientProvider } from "react-query";
import { makeStyles } from "@material-ui/core/styles";
import { Typography, AppBar, Button, Paper, Toolbar, Grid } from "@material-ui/core"
import {
Typography,
AppBar,
Button,
Paper,
Toolbar,
Grid,
} from "@material-ui/core";
import {
HashRouter as Router,
Switch,
Expand All @@ -13,9 +20,9 @@ import { generateUid } from "d2/lib/uid";
import RecipesPage from "./RecipesPage";
import Dhis2 from "./support/Dhis2";
import RecipePage from "./RecipePage";
import RecipeGistPage from "./RecipeGistPage";
import AppDrawer from "./AppDrawer";


const DocPage = React.lazy(() => import("./DocPage"));

const useStyles = makeStyles((theme) => ({
Expand Down Expand Up @@ -77,98 +84,127 @@ function App() {
return (
<Router>
<QueryClientProvider client={queryClient}>
<div className={classes.root + " reportPage"}>
<AppBar position="static" color="primary" className="no-print">
<Toolbar>
<Grid
container
justify="space-between"
alignItems="center"
alignContent="center"
>
<Grid item>
<AppDrawer classes={classes} />
</Grid>
<Grid item>
<Typography variant="h6" color="inherit">
Taskr : your task runner.
</Typography>
</Grid>
<Grid item>
<Button href={"#/doc/"} color="inherit">
Documentation
</Button>
</Grid>
<div className={classes.root + " reportPage"}>
<AppBar position="static" color="primary" className="no-print">
<Toolbar>
<Grid
container
justify="space-between"
alignItems="center"
alignContent="center"
>
<Grid item>
<AppDrawer classes={classes} />
</Grid>
</Toolbar>
</AppBar>
<Paper className={classes.paper}>
<Switch>
<Route
path={`/doc`}
exact={true}
render={(props) => (
<Suspense fallback={<div>Loading...</div>}>
<DocPage match={props.match} />
</Suspense>
)}
/>
<Route
path={`/doc/:section`}
render={(props) => (
<Suspense fallback={<div>Loading...</div>}>
<DocPage match={props.match} />
</Suspense>
)}
/>
<Route
path={`/recipes`}
exact={true}
render={(props) => (
<RecipesPage
dhis2={dhis2}
freshRecipe={freshRecipe}
classes={classes}
history={props.history}
onNewRecipe={onNewRecipe}
match={props.match}
/>
)}
/>
<Route
path={`/recipes/:recipeId`}
exact={true}
render={(props) => {
return (
<RecipePage
dhis2={dhis2}
classes={classes}
freshRecipe={freshRecipe}
match={props.match}
history={props.history}
editable={true}
/>
);
}}
/>
<Route
path={`/recipes/:recipeId/run`}
render={(props) => (
<Grid item>
<Typography variant="h6" color="inherit">
Taskr : your task runner.
</Typography>
</Grid>
<Grid item>
<Button href={"#/doc/"} color="inherit">
Documentation
</Button>
</Grid>
</Grid>
</Toolbar>
</AppBar>
<Paper className={classes.paper}>
<Switch>
<Route
path={`/doc`}
exact={true}
render={(props) => (
<Suspense fallback={<div>Loading...</div>}>
<DocPage match={props.match} />
</Suspense>
)}
/>
<Route
path={`/doc/:section`}
render={(props) => (
<Suspense fallback={<div>Loading...</div>}>
<DocPage match={props.match} />
</Suspense>
)}
/>
<Route
path={`/recipes`}
exact={true}
render={(props) => (
<RecipesPage
dhis2={dhis2}
freshRecipe={freshRecipe}
classes={classes}
history={props.history}
onNewRecipe={onNewRecipe}
match={props.match}
/>
)}
/>
<Route
path={`/recipes/:recipeId`}
exact={true}
render={(props) => {
return (
<RecipePage
dhis2={dhis2}
classes={classes}
freshRecipe={freshRecipe}
match={props.match}
history={props.history}
editable={false}
editable={true}
/>
)}
/>
);
}}
/>
<Route
path={`/recipes/:recipeId/run`}
render={(props) => (
<RecipePage
dhis2={dhis2}
classes={classes}
freshRecipe={freshRecipe}
match={props.match}
history={props.history}
editable={false}
/>
)}
/>

<Route
path={`/gh/g/:repo/:gistId`}
exact={true}
render={(props) => (
<RecipeGistPage
dhis2={dhis2}
classes={classes}
freshRecipe={freshRecipe}
match={props.match}
history={props.history}
editable={true}
/>
)}
/>
<Route
path={`/gh/g/:repo/:gistId/run`}
exact={true}
render={(props) => (
<RecipeGistPage
dhis2={dhis2}
classes={classes}
freshRecipe={freshRecipe}
match={props.match}
history={props.history}
editable={false}
/>
)}
/>

<Redirect to={"/recipes"} />
</Switch>
</Paper>
</div>
<Redirect to={"/recipes"} />
</Switch>
</Paper>
</div>
</QueryClientProvider>
</Router>
);
Expand Down
Loading

0 comments on commit 83b80ed

Please sign in to comment.