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

Used string interpolation in notes_controller #11489

Merged
merged 7 commits into from
Oct 16, 2022

Conversation

IdayatSanni
Copy link
Contributor

Fixes #11446

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

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

@welcome
Copy link

welcome bot commented Oct 15, 2022

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 Oct 15, 2022

@codecov
Copy link

codecov bot commented Oct 15, 2022

Codecov Report

Merging #11489 (ec9da4b) into main (9fa50a8) will not change coverage.
The diff coverage is 66.66%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #11489   +/-   ##
=======================================
  Coverage   83.33%   83.33%           
=======================================
  Files          93       93           
  Lines        5772     5772           
=======================================
  Hits         4810     4810           
  Misses        962      962           
Impacted Files Coverage Δ
app/controllers/notes_controller.rb 85.76% <66.66%> (ø)

@IdayatSanni
Copy link
Contributor Author

@TildaDares hi, I just created this request but it is saying I have some issues. how do I fix it?

@@ -470,11 +470,13 @@ def new_note
end

def new_preview_note
Node.new_preview_note(uid: current_user.uid,
Node.new_preview_note(
+ uid: current_user.uid,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ uid: current_user.uid,
uid: current_user.uid,

Copy link
Member

Choose a reason for hiding this comment

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

Same with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello, am I understanding that the problem here is that I have to delete one space and bring it forward?

Copy link
Member

Choose a reason for hiding this comment

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

@IdayatSanni The issue is that you added the plus sign in the code.

Copy link
Member

@TildaDares TildaDares left a comment

Choose a reason for hiding this comment

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

@IdayatSanni There was a missing quotation mark.

@@ -273,7 +273,7 @@ def update
if request.xhr?
render plain: "#{@node.path(format)}?_=#{Time.now.to_i}"
else
redirect_to URI.parse(@node.path(format)).path + '?_=' + Time.now.to_i.to_s
redirect_to "#{URI.parse(@node.path(format)).path}?_=#{Time.now.to_i}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
redirect_to "#{URI.parse(@node.path(format)).path}?_=#{Time.now.to_i}
redirect_to "#{URI.parse(@node.path(format)).path}?_=#{Time.now.to_i}"

@IdayatSanni
Copy link
Contributor Author

Hello, thank you for the review. I will work on it

@IdayatSanni
Copy link
Contributor Author

Hello @TildaDares I have made corrections but it is still showing issues. What exactly am I doing wrong please?

location: params[:location])
Node.new_preview_note(
+ uid: current_user.uid,
title: params[:title],
Copy link

Choose a reason for hiding this comment

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

unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion parameter, under AllCops)

Node.new_preview_note(
+ uid: current_user.uid,
title: params[:title],
body: params[:body],
Copy link

Choose a reason for hiding this comment

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

unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion parameter, under AllCops)

+ uid: current_user.uid,
title: params[:title],
body: params[:body],
main_image: params[:main_image],
Copy link

Choose a reason for hiding this comment

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

unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion parameter, under AllCops)

title: params[:title],
body: params[:body],
main_image: params[:main_image],
location: params[:location]
Copy link

Choose a reason for hiding this comment

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

unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion parameter, under AllCops)

@codeclimate
Copy link

codeclimate bot commented Oct 16, 2022

Code Climate has analyzed commit ec9da4b and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions
Copy link

This pull request generated screenshots of many common pages in the running app. You should be able to download and view them here:
https://github.com/publiclab/plots2/suites/8798116355/artifacts/399993614

Copy link
Member

@TildaDares TildaDares left a comment

Choose a reason for hiding this comment

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

Amazing work @IdayatSanni. Thank you!!

@TildaDares TildaDares merged commit a5d2483 into publiclab:main Oct 16, 2022
@welcome
Copy link

welcome bot commented Oct 16, 2022

Congrats on merging your first pull request! 🙌🎉⚡️
Your code will likely be published to PublicLab.org in the next few days, but first it will be published to https://stable.publiclab.org/ (it will take some minutes for this to load, and until then you may see logs from the build process). Please test out your work on this testing server and report back with a comment that all has gone well!
Do join our weekly check-in to share your this week goal and the awesome work you did 😃. Please find the link to our latest check-in here 📝
Now that you've completed this, you can help someone else take their first step!
Reach out to someone else working on theirs on Public Lab's code welcome page (where you'll now be featured as a recent contributor!). Thanks!

Help others take their first step

Now that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌

https://code.publiclab.org

Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕

People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉

Read about how to help support another newcomer here, or find other ways to offer mutual support here.

You can also join our Gitter channel to connect with other contributors 📥

@TildaDares
Copy link
Member

Congratulations on merging your PR @IdayatSanni 🎉

@IdayatSanni
Copy link
Contributor Author

Thank you @TildaDares! I appreciate the guidance.

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

Successfully merging this pull request may close these issues.

Rubocop - Use string interpolation (notes_controller)
2 participants