grandma-collaboration / skyportal_grandma_dev

Little Git Repo to keep track of the work done by the A4 ESILV TEAM
2 stars 0 forks source link

Lydie Pont - Adding New Features #13

Closed lydie10 closed 1 year ago

lydie10 commented 1 year ago

Hi @Theodlz ! 👋

I have been following the Adding New Features tutorial, and so far I have read the Basic React concepts: Elements and Components and Redux basics sections in addition to the ReactJS and Redux tutorials.

I'm now reading through the Adding a new end-to-end SkyPortal feature section, and I have been wondering : do I have to actually create all the files mentioned in this part ? If so, is it in my own fork ? Or do I have to add them in the skyportal repository clone that was created at the beginning of the Setup ?

This question is sort of also related to the tasks that we will have to do next, as I don't know if there is a way to see whether or not our changes are doing the right thing (on the SkyPortal version that we installed), before submitting them in here.

Thank you for your answer ! 😊

Theodlz commented 1 year ago

So. What you should do is always clone your fork instead of directly skyportal main. Then you create a branch on your fork, checkout to that branch and you can make your changes there.

Theodlz commented 1 year ago

Otherwise, you can add multiple "remotes" to the repo you cloned. That allows your to switch between branches of different origins. For example, I cloned my fork so the remote called "origin" is my fork. But then I can add a new remote called 'michael' that points to michael's fork, or a remote called 'skyportal' that points to skyportal main. That way, I can checkout to branches from different forks.

But you should always start by cloning your fork. Thats just safer, so you dont end up pushing to skyportal main by accident.

Theodlz commented 1 year ago

Best thing would be to follow a quick tutorial on git. Its super useful for this project, and if you work as a dev someday, its litteraly mandatory.

lydie10 commented 1 year ago

Thank you :) I already did clone my fork and so now I will create a branch to make my changes in there.

Sorry the last part of my question was not clear, once I have made changes in my branch, how do I test these changes ? I'm a bit confused as at the beginning of the setup it is written :

git clone https://github.com/skyportal/skyportal.git
cd skyportal/
virtualenv skyportal_env
source skyportal_env/bin/activate

So what I understood is that the skyportal main was cloned and then when I do make run and make log in the virtual environment it will look into this clone. Im not sure it will take into account the new testComments files and changes in existing files in my fork/branch. Do I need to repeat the Launch steps in my fork in order to try out the new testComments feature ?

lydie10 commented 1 year ago

and I’ll definitely look for a git tutorial to better understand how it all works

Theodlz commented 1 year ago

I'm a bit confused by your question here. You follow step one but your replace the skyportal main url by the url of your fork when you run git clone. Then you do `git checkout .

Then you can make your changes and run the app. The app you'll be running is naturally the one with the modified files (i mean you are running the app you have locally right, with the changes you just made).

If it works, and you are happy with the changes, you git add them, commit and push.

lydie10 commented 1 year ago

Hi ! Thanks for your explanations, it was very helpful :)

I'm now trying to implement the new test comment feature. I added the code given in the tutorial but when I launch the app and direct my browser to localhost:5000/test_comments, I get the following errors when landing on the page :

Failed to load resource: the server responded with a status of 400 (Bad Request) api/test_comments:1

Invalid API endpoint Notifications.jsx?9cbd:98

Then, when I click on the submit button to add a comment :

Failed to load resource: the server responded with a status of 405 (Method Not Allowed) api/test_comments:1

HTTP 405: Method Not Allowed

I checked the skyportal/handlers/api/test_comments.py file and I didn’t notice any difference from the original code, so I don't know if there is something missing in an other file ?

lydie10 commented 1 year ago

Hello 😉 I finally completed this tutorial thanks to the new version you posted @Theodlz I first started to follow the new documentation in the docs.zip but there was an error with author_id in skyportal/handlers/api/test_comment.py so I used the code in doc/adding_features.md instead.

Theodlz commented 1 year ago

Hi @lydie10 , I updated it. The tutorial shouldn't have any errors now. Could you have a look at it and confirm?