OrderAndCh4oS / Graph-Editor

Create graph models online
https://grapheditor.orderandchaoscreative.com
3 stars 3 forks source link

Clicking "Model Editor" should always create a new model page #17

Open OrderAndCh4oS opened 5 years ago

OrderAndCh4oS commented 5 years ago

There is no way to open a new model while editing on the Model Editor page. When a user clicks the Model Editor link it should always open a new empty editor. Before navigating away from the editor view a user should be prompted to save their work.

mattb555 commented 5 years ago

I'll take a crack at this one

OrderAndCh4oS commented 5 years ago

@mattb555 Great, thank you. If you need help getting set up just let me know. It needs to have the API running to be able to fetch the data.

mattb555 commented 5 years ago

I'm having some issues with setting up the API. I cloned the backend repo and ran docker-compose. Here is what I think is the relevant error message:

graph_editor | /usr/app/node_modules/ts-node/src/index.ts:261 graph_editor | return new TSError(diagnosticText, diagnosticCodes) graph_editor | ^ graph_editor | TSError: ⨯ Unable to compile TypeScript: graph_editor | src/controller/base-controller.ts(29,46): error TS2339: Property 'id' does not exist on type 'User'. graph_editor | src/controller/base-controller.ts(44,76): error TS2339: Property 'id' does not exist on type 'User'. graph_editor | graph_editor | at createTSError (/usr/app/node_modules/ts-node/src/index.ts:261:12) graph_editor | at getOutput (/usr/app/node_modules/ts-node/src/index.ts:367:40) graph_editor | at Object.compile (/usr/app/node_modules/ts-node/src/index.ts:558:11) graph_editor | at Module.m._compile (/usr/app/node_modules/ts-node/src/index.ts:439:43) graph_editor | at Module._extensions..js (internal/modules/cjs/loader.js:789:10) graph_editor | at Object.require.extensions.(anonymous function) [as .ts] (/usr/app/node_modules/ts-node/src/index.ts:442:12) graph_editor | at Module.load (internal/modules/cjs/loader.js:653:32) graph_editor | at tryModuleLoad (internal/modules/cjs/loader.js:593:12) graph_editor | at Function.Module._load (internal/modules/cjs/loader.js:585:3) graph_editor | at Module.require (internal/modules/cjs/loader.js:692:17) graph_editor | at require (internal/modules/cjs/helpers.js:25:18) graph_editor | at Object. (/usr/app/src/controller/user-controller.ts:7:1) graph_editor | at Module._compile (internal/modules/cjs/loader.js:778:30) graph_editor | at Module.m._compile (/usr/app/node_modules/ts-node/src/index.ts:439:23) graph_editor | at Module._extensions..js (internal/modules/cjs/loader.js:789:10) graph_editor | at Object.require.extensions.(anonymous function) [as .ts] (/usr/app/node_modules/ts-node/src/index.ts:442:12) graph_editor | at Module.load (internal/modules/cjs/loader.js:653:32) graph_editor | at tryModuleLoad (internal/modules/cjs/loader.js:593:12) graph_editor | at Function.Module._load (internal/modules/cjs/loader.js:585:3) graph_editor | at Module.require (internal/modules/cjs/loader.js:692:17) graph_editor | at require (internal/modules/cjs/helpers.js:25:18) graph_editor | at Object. (/usr/app/src/routes.ts:3:1) graph_editor | [nodemon] app crashed - waiting for file changes before starting.

OrderAndCh4oS commented 5 years ago

@mattb555 Please pull down the latest version. I toggled on GitHub Dependabot recently and merged some of its pull requests to try and clear the dependency vulnerabilities. Long story short Typescript got updated and I've had to fix a few bugs.

OrderAndCh4oS commented 5 years ago

@mattb555 Please hold off on this, I have some deeper issues to solve with this API. Last time I ran it, it was just docker-compose up and it was away. Somethings up since the last round of npm updates. I'll dig deeper. Sorry for any time you've wasted on getting this set up.

mattb555 commented 5 years ago

Oh don't worry about it. Whenever you think you've got it fixed I'll take a whack at the front end. I'm able to load the webpage now in any case.

OrderAndCh4oS commented 5 years ago

@mattb555 Great, yeah that's the main thing. Once I figure out what's up with Sequelize (it's hanging after making an SQL query and not returning for some reason) and have fixed it I'll let you know.

OrderAndCh4oS commented 5 years ago

@mattb555

Can you try running this in the root of the API project: docker-compose exec web bash to access the docker container.

Then go to the orm directory with: cd src/orm

Lastly run: ts-node create-database.ts

You should see the SQL queries printed to the terminal. Once they stop just hit ctrl + c.

This will create the database and insert some initial data.

After that, you should be ok to register a user and create some models.

mattb555 commented 5 years ago

Seems to have worked!

mattb555 commented 5 years ago

So just a status update on my end, clicking "Model Editor" brings up a blank slate now. I haven't gotten around to a "Check if changes: Save Me" type prompt yet because there was an error where making new Nodes wouldn't work because they don't have a default color. I made a hot fix for that and now that I can make my own graphs, the prompt is my next step.

OrderAndCh4oS commented 5 years ago

Perfect sounds like great work. Any improvements and bug fixes are definitely welcome.