Fix CascadeStudio integration #99

Merged
Irev-Dev merged 11 commits from kurt/issue-95 into main 2020-11-16 19:33:35 +01:00
Irev-Dev commented 2020-11-16 10:54:29 +01:00 (Migrated from github.com)

Resolves #19

I'm sure there are bugs but at lease it's working now. Sorry that this PR is so big. Up to you if you want to look through it or not @Yash-R.

Theres a preview here

Basically there's some UI for the tool bar to work and logic for saving the code in the editor/IDE,
image

and than there are many hacks to get a code in the sudmodule to work. Not really sustainable from a maintenance perspective but good enough for a proof of concept. I'm think I'm just about ready to reach out to the folks at cascade Studio and see if they want to collaborate at all.

Resolves #19 I'm sure there are bugs but at lease it's working now. Sorry that this PR is so big. Up to you if you want to look through it or not @Yash-R. Theres a [preview here](https://5fb245a705534b00070e2c64--cadhubxyz.netlify.app/) Basically there's some UI for the tool bar to work and logic for saving the code in the editor/IDE, ![image](https://user-images.githubusercontent.com/29681384/99238406-cbb28800-284d-11eb-8ceb-d3f078386368.png) and than there are many hacks to get a code in the sudmodule to work. Not really sustainable from a maintenance perspective but good enough for a proof of concept. I'm think I'm just about ready to reach out to the folks at cascade Studio and see if they want to collaborate at all.
Yash-R (Migrated from github.com) reviewed 2020-11-16 10:54:29 +01:00
Irev-Dev (Migrated from github.com) reviewed 2020-11-16 10:56:33 +01:00
@@ -11,1 +11,3 @@
"move-ts-defs": "cp ./node_modules/opencascade.js/dist/opencascade.d.ts ./web/public && cp ./node_modules/three/src/Three.d.ts ./web/public && cp ./web/src/cascade/js/StandardLibraryIntellisense.ts ./web/public"
"move-ts-defs": "cp ./web/src/cascade/js/StandardLibraryIntellisense.ts ./web/public",
"move-cad-worker": "rm -r web/public/CADWorker || true && mkdir web/public/CADWorker && mkdir web/public/CADWorker/node_modules && cp -r ./web/src/cascade/js/CADWorker ./web/public && cp -r ./web/src/cascade/node_modules ./web/public/CADWorker && cp -r ./web/src/cascade/fonts ./web/public/CADWorker",
"move-statics": "yarn move-ts-defs && yarn move-cad-worker"
Irev-Dev (Migrated from github.com) commented 2020-11-16 10:56:32 +01:00

This is just copying a bunch of js worker files from the git submodule and putting them in the public folder (so they can be accessed from the browser),
which reminds me I need to update the read me to add a yarn move-cad-worker step to the instructions.

This is just copying a bunch of js worker files from the git submodule and putting them in the public folder (so they can be accessed from the browser), which reminds me I need to update the read me to add a `yarn move-cad-worker` step to the instructions.
Irev-Dev (Migrated from github.com) reviewed 2020-11-16 10:57:13 +01:00
Irev-Dev (Migrated from github.com) commented 2020-11-16 10:57:13 +01:00

clean up

clean up
Irev-Dev (Migrated from github.com) reviewed 2020-11-16 10:59:26 +01:00
@@ -0,0 +10,4 @@
const [code, setCode] = useState(part.code)
const { currentUser } = useAuth()
const canEdit = currentUser?.sub === part?.user?.id
useEffect(() => {
Irev-Dev (Migrated from github.com) commented 2020-11-16 10:59:25 +01:00

Add a description to this useEffect, something along the lines of.

Cascade studio attatches to a div outside the react app, and so we are "opening" and "closing" it for the ide part of the app by displaying none or block. Which is why this useEffect returns a clean up function that hides the div again.

Add a description to this useEffect, something along the lines of. Cascade studio attatches to a div outside the react app, and so we are "opening" and "closing" it for the ide part of the app by displaying none or block. Which is why this useEffect returns a clean up function that hides the div again.
Irev-Dev (Migrated from github.com) reviewed 2020-11-16 11:00:25 +01:00
Irev-Dev (Migrated from github.com) commented 2020-11-16 11:00:25 +01:00

delete this nav element. I added hidden class but intended to remove it entirely.

delete this nav element. I added hidden class but intended to remove it entirely.
Irev-Dev (Migrated from github.com) reviewed 2020-11-16 11:00:47 +01:00
Irev-Dev (Migrated from github.com) commented 2020-11-16 11:00:47 +01:00

Likewise has a hidden class. This div should be removed.

Likewise has a hidden class. This div should be removed.
Irev-Dev (Migrated from github.com) reviewed 2020-11-16 11:01:05 +01:00
Irev-Dev (Migrated from github.com) commented 2020-11-16 11:01:05 +01:00

remove commented code.

remove commented code.
Irev-Dev (Migrated from github.com) reviewed 2020-11-16 11:01:50 +01:00
Irev-Dev (Migrated from github.com) commented 2020-11-16 11:01:50 +01:00

Clean up this file, what a mess

Clean up this file, what a mess
Yash-R commented 2020-11-16 13:57:23 +01:00 (Migrated from github.com)

Oh Great, i'm sure you will collaborate with them @Irev-Dev

Oh Great, i'm sure you will collaborate with them @Irev-Dev
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#99