Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy the correct link from the contribution page and insert it on the Recent Spectra Section for the contributor's name that currently has a broken link #810

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

Georjane
Copy link
Collaborator

@Georjane Georjane commented Dec 20, 2021

Fixes #(update with issue number)

Make sure these boxes are checked before your pull request is ready to be reviewed and merged. Thanks!

  • tests pass -- rake test
  • code is in uniquely-named feature branch, and has been rebased on top of latest master (especially if you've been asked to make additional changes)
  • pull request are descriptively named
  • if possible, multiple commits squashed if they're smaller changes
  • reviewed/confirmed/tested by another contributor or maintainer

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/wiki/contributing-to-public-lab-software

Thanks!

@welcome
Copy link

welcome bot commented Dec 20, 2021

Thanks for opening this pull request! This space is protected by our Code of Conduct - and we're here to help.
Dangerbot will test out your code and reply in a bit with some pointers and requests.
Also please refer here for installation help 💿
There may be some errors, but don't worry! We'll work through them with you! 👍🎉😄


One thing that can help to get started is to make sure you've included a link back to the original issue you're solving, in the
format fixes #0000 (for example). And to make sure the PR title describes what you're trying to do! (often it can be the same as
the issue title) Thanks! 🙌


Then, you can say hello in our chatroom & share a link to this PR to get a review! 👋 ✅

@gitpod-io
Copy link

gitpod-io bot commented Dec 20, 2021

@jywarren
Copy link
Member

This looks great. I assume you tested it manually but do you see any opportunity for a test? If not, shall we merge this? Thanks!!!

@Georjane
Copy link
Collaborator Author

This looks great. I assume you tested it manually but do you see any opportunity for a test? If not, shall we merge this? Thanks!!!

Sure Jeff, I can definitely try to write a test for this. Thanks

Copy link
Collaborator

@Tlazypanda Tlazypanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Georjane for writing test you can checkout the system test in spectral-workbench and plots2 repo for reference.
https://github.com/publiclab/spectral-workbench/blob/main/test/system/upload_test.rb
https://github.com/publiclab/plots2/blob/main/test/system/dashboard_test.rb

The idea would be to navigate to the recent spectral page link and then find the element on this page, click on it and check for redirect

@Georjane
Copy link
Collaborator Author

Hey @Georjane for writing test you can checkout the system test in spectral-workbench and plots2 repo for reference. https://github.com/publiclab/spectral-workbench/blob/main/test/system/upload_test.rb https://github.com/publiclab/plots2/blob/main/test/system/dashboard_test.rb

The idea would be to navigate to the recent spectral page link and then find the element on this page, click on it and check for redirect

Thanks very much @Tlazypanda This is very helpful

@Tlazypanda Tlazypanda closed this Jan 7, 2022
@Tlazypanda Tlazypanda reopened this Jan 7, 2022
@Tlazypanda
Copy link
Collaborator

Hey @Georjane can you please clear the merge conflicts through the command line so the tests can be run and then we can debug this?

Also sharing this link for reference on how to remove merge conflicts through the command line if needed - https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line

@Georjane
Copy link
Collaborator Author

Georjane commented Jan 19, 2022

Hi @jywarren @Tlazypanda @TildaDares 👋🏽
I think I fixed the link for the spectrum author and I added the tests. But I have a question while the format that was in the code profile_path(@user) was not working while /profile/user_id works. See the two codes below.

working code

<a class="author-profile" data-transition="slide" href="/profile/<%=h spectrum.author %>"><%= spectrum.author %></a>

code not working

<a class="author-profile" data-transition="slide" href="<%= profile_path(spectrum.author) %>"><%= spectrum.author %></a>
Thank you

@TildaDares
Copy link
Member

TildaDares commented Jan 19, 2022

@Georjane Since the route for profile was not created with a resourceful route (resources :profile), helper methods like _url and path are not available for use. You can read more about it in the Rails docs.

You can also use route helpers with routes like

get '/profile/:id', to: 'users#show'

by using as https://guides.rubyonrails.org/routing.html#naming-routes

I hope that helps.

@Georjane
Copy link
Collaborator Author

Georjane commented Jan 19, 2022

@Georjane Since the route for profile was not created with a resourceful route (resources :profile), helper methods like _url and path are not available for use. You can read more about it in the Rails docs.

You can also use route helpers with routes like

get '/profile/:id', to: 'users#show'

by using as https://guides.rubyonrails.org/routing.html#naming-routes
I hope that helps.

woow this is very helpful @TildaDares Thank you very much.
This means get '/profile/:id', to: 'users#show', as: :profile will create a routeprofile_path and this will solve the problem of the author broken link right?

@Georjane
Copy link
Collaborator Author

@TildaDares I tried creating a fto for this issue, please can you check it out here, #869
thank you! 🙏🏽

@jywarren
Copy link
Member

Oh cool - so does that mean after #869 is solved, we should be able to rebase this and it should work? Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants