Conversation
|
Whoops. Forgot to run linter. Fixing. |
|
@ryanknutson feel free to review if you're interested in the python/js stuff! |
mission_control/static/js/bd-api.js
Outdated
| function saveFirst() { | ||
| $.post('/mission-control/block-diagrams/', data, function(response){ | ||
| bdId = response.id; | ||
| console.log('Created bd ' + bdId + ' on the server server'); |
mission_control/static/js/bd-api.js
Outdated
| console.log('Created bd ' + bdId + ' on the server server'); | ||
| }) | ||
| .fail(function(){ | ||
| console.log("Failure when creating saved bd on server."); |
There was a problem hiding this comment.
I'd suggest console.error. There are some other cases in this file as well. Also, if you put a parameter for the function, you can get the error message that might be helpful.
There was a problem hiding this comment.
Good idea.
We get lots of info back on an error. I went with printing xhr.responseText to the console?
mission_control/static/js/bd-api.js
Outdated
| var allBlocksHidden = true; | ||
| for (hiddenBlock of blocksToHide) { | ||
| if (!hideBlock(hiddenBlock)) | ||
| allBlocksHidden = false; |
mission_control/static/js/bd-api.js
Outdated
| }); | ||
| } | ||
|
|
||
| function saveAgain() { |
There was a problem hiding this comment.
I'd prefer create and update for the function names, but it's up to you.
There was a problem hiding this comment.
Ha, yes. Real CRUD works are better. Changing.
|
|
||
| function saveFirst() { | ||
| $.post('/mission-control/block-diagrams/', data, function(response){ | ||
| bdId = response.id; |
There was a problem hiding this comment.
I think you'd want to set this id from loadDesign as well. Otherwise, you won't have it unless the user saved a new block diagram.
There was a problem hiding this comment.
Agreed. But I think I'd like to do that in my next PR when I fix up the loadDesign function for #56.
…rcode-web into feature/Save_bds
This makes mission control save the block diagrams to rovercode.com instead of to the rover.
Can't really check that the CSRF tokens are working in the development environment. Just have to see if they work on beta.rovercode.com?
Reorganized the js files a bit.