Closed garrettluu closed 4 years ago
Finally added displaying forks! Not sure how much I should style this since the UI and layout are probably gonna change soon.
Tested forking with the backend and it seems to work and create new blobs, but I would also like to track the forks of the parent in an array in the blob (this is a backend task @mohammedsahl).
If we start with this blob
{
"id": "example1",
"forkedFrom": "",
"forks": []
}
and we fork it to generate this blob
{
"id": "example2",
"forkedFrom": "example1",
"forks": []
}
the forks
array of example1
should contain example2
as an element:
"forks": ["example2"]
Currently, the forks
array seems to always be empty or null.
Currently, the
forks
array seems to always be empty or null.
Okay so this seems to be an issue(?) with async DB updates. If you GET
example1
after forking it should have forks : ["example2"]
Edit: It appears that forks: [...]
is not part of the res
body when GET
ing a single blob, I'll add that right away
Tested with real data from backend and everything seems to work! 😀
We should also update the docs about how the forking logic works just to clarify.
The current process is:
./src/components/MainMenu.js
Module not found: Can't resolve './ForkModal' in '/home/ianjennings/Development-Unix/babel-sandbox/src/components'
I don't see this file in my local copy, do you need to commit it?
Closes #28, addresses #27
This PR adds UI elements to fork and save a config. I ran into several issues as I was doing this, stemming from the problem of not being able to get the
id
of the current config (since that isn't stored in the state anywhere). So I propose a new process for forking:id
somewhere in the application statenewBlob
identical to the currentblob
but with a differentid
newBlob.id
toblob.forks[]
and makenewBlob.forkedFrom
point toblob.id
(this is done in backend)~TODO~ done!
REPLState
to allow for saving and forkingid
in application state, or change the url after saving and getid
usingextractID