Skip to content

Commit

Permalink
Merge pull request #26 from harmonydata/staging
Browse files Browse the repository at this point in the history
Releasing Staging
  • Loading branch information
ronnyTodgers authored Jun 23, 2024
2 parents 1622698 + e742f66 commit 868808d
Show file tree
Hide file tree
Showing 12 changed files with 934 additions and 406 deletions.
10 changes: 10 additions & 0 deletions functions/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def api(req: https_fn.Request) -> https_fn.Response:
d = doc.to_dict()
d["fbid"] = doc.id
data.append(d)
case "/shares":
match req.method:
case "POST":
payload = req.json
update_time, share_ref = db.collection("imports").add(payload)
return https_fn.Response(json.dumps({"share_id": share_ref}), mimetype="application/json")
case "GET":
share_id = req.args.get('id')
doc = db.collection("imports").document(share_id).get()
return https_fn.Response(json.dumps(doc), mimetype="application/json")
case "/harmonisations":
docs = db.collection("harmonisations").stream()
for doc in docs:
Expand Down
1 change: 1 addition & 0 deletions harmonisations
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions mismatches
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1,057 changes: 660 additions & 397 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@mui/icons-material": ">=5.14.19",
"@mui/material": "^5.14.20",
"firebase": "^10.7.1",
"js-base64": "^3.7.7",
"liqe": "^3.8.0",
"material-ui-popup-state": "^5.0.9",
"mui-nested-menu": "^3.2.1",
Expand All @@ -21,7 +22,7 @@
"react-dom": "^18.3.1",
"react-drag-drop-files": "^2.3.10",
"react-ga4": "^2.1.0",
"react-pdf": "^7.6.0",
"react-pdf": "^9.0.0",
"react-router-dom": "^5.3.4",
"react-toastify": "^9.1.3",
"react-transition-group": "^4.4.5",
Expand All @@ -35,13 +36,15 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"react-scripts": "^5.0.1"
"react-scripts": "^5.0.1",
"webpack-cli": "^5.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"build:HarmonyExport": "webpack --config webpack.config.component.js"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
Binary file added public/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions public/js/harmony-export.js

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ function App() {
setMode(prefersDarkMode ? "dark" : "light");
}, [prefersDarkMode]);

useEffect(() => {
const handleBeforeUnload = (event) => {
// stash the current fileInfos to sessionStorage so they can be retreived in the case of handling an import link
sessionStorage["harmonyStashed"] = JSON.stringify(fileInfos);
};
window.addEventListener("beforeunload", handleBeforeUnload);
return () => {
window.removeEventListener("beforeunload", handleBeforeUnload);
};
}, [fileInfos]);

useEffect(() => {
if (sessionStorage["harmonyStashed"])
setFileInfos(JSON.parse(sessionStorage["harmonyStashed"]));
}, []);

useEffect(() => {
//default to intraInstrument ON in the case of just one instument in the model
if (
Expand Down Expand Up @@ -439,6 +455,15 @@ function App() {
ReactGA={ReactGA}
/>
</Route>
<Route path="/import/:importId">
<Upload
appFileInfos={fileInfos}
setAppFileInfos={setFileInfos}
setApiData={setApiData}
existingInstruments={existingInstruments}
ReactGA={ReactGA}
/>
</Route>
<Route path="*">
<Upload
appFileInfos={fileInfos}
Expand Down
101 changes: 101 additions & 0 deletions src/components/HarmonyExport.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 868808d

Please sign in to comment.