Closed dondi closed 1 year ago
I moved the function call of $.ajax from setup-load-and-import-handles.js into the grnsight-api.js file
Functionality of local host is not maintained
Question: when moving the $ajax function call, I have to move everything that calls $ajax ?
The done
function is what the loadGrn
function does with the result of the network call, so what I would do here is:
loadGrn
where it isdone
function stays in loadGrn
as the callback to perform after loadNetwork finishesWrote two functions inside grnsight-api.js :
Then I called these functions inside setup-load-and-import-handlers.js
Looks almost ready for a pull request; we can pre-empt some comments that would have gone into the code review by making just a few more changes:
loadAjax
and getJson
are somewhat generic and do not communicate the specific functionality that is taking placeMade few more changes to the functions:
Almost ready for PR; just need to move fullUrl
calculation into the API functions, thus making the arguments into these functions be the true “input” that determines the behavior of the network request
=> Functionality not maintained. => Question: Possible errors when moving function?
@Sarronnn yes, double-check the original versions. A key consideration when rearranging code is to ensure that you use the same code consistently with the initial
Something I can see right away is that in getWorkbookFromForm
, the code you transplanted for computing fullUrl
is not the same. Line 142 makes reference to queryURL
but that variable is not in the original version (it is present in the second function, but not the first)
That’s just one thing that leaps out to me; there may be more
Also, keeping your Developer Tools console open while running the web app will help; it will show you any error messages encountered when executing the code
=> What I did here is, I supplied uploadRoute as one of the arguments instead of having fullUrl as an argument.
Then, I placed the const fullUrl inside the getWorkbookFromForm function.
Error when doing this.
=> Possible solutions I tried:
404 means the URL didn’t correspond to anything that the server recognized; look at the Network tab to examine the request. Compare it to the one that master/beta sends out and see if there are differences. They should be identical
(well identical except for the hostname)
Conflicts and branch mixup have been resolved; after one last run of testing, @Sarronnn can commit, push, and issue a pull request for code review
@Sarronnn the epic pull request has been merged. Go ahead and merge beta
into your branch, and retrace the changes you made, as we discussed earlier this week
This is done and added to release notes.
There are some lingering
$.getJSON
and$.ajax
function calls in the web app, all from the original GRNsight logic that did not need the database. Ideally, these should get folded into the grnsight-api.js module as well so that all such network calls are in one place