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

update like_spec.js #11524

Merged
merged 6 commits into from
Oct 25, 2022
Merged

update like_spec.js #11524

merged 6 commits into from
Oct 25, 2022

Conversation

ijayhub
Copy link
Contributor

@ijayhub ijayhub commented Oct 21, 2022

The code was in var an es5 way of declaring a variable changed it to let/const

Fixes #11537 (#11537)

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

The code was in var an es5 way of declaring a variable changed it to const
@welcome
Copy link

welcome bot commented Oct 21, 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 21, 2022

@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/8892709265/artifacts/406744166

@TildaDares
Copy link
Member

Hi @ijayhub, can you add a link to the issue?

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)

The code was in var an es5 way of declaring a variable changed it to const
@ijayhub
Copy link
Contributor Author

ijayhub commented Oct 21, 2022

okay

@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/8898799669/artifacts/407167901

The code was in var an es5 way of declaring a variable changed it to let
@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/8899008061/artifacts/407182791

@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #11524 (6d8d426) into main (83e0439) will increase coverage by 6.61%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11524      +/-   ##
==========================================
+ Coverage   76.71%   83.33%   +6.61%     
==========================================
  Files          93       93              
  Lines        5772     5772              
==========================================
+ Hits         4428     4810     +382     
+ Misses       1344      962     -382     
Impacted Files Coverage Δ
app/controllers/relationships_controller.rb 71.42% <0.00%> (ø)
app/controllers/users_controller.rb 80.78% <0.00%> (+0.35%) ⬆️
app/controllers/spam2_controller.rb 72.54% <0.00%> (+0.98%) ⬆️
app/controllers/user_tags_controller.rb 83.78% <0.00%> (+1.35%) ⬆️
app/controllers/admin_controller.rb 80.24% <0.00%> (+1.64%) ⬆️
app/controllers/search_controller.rb 97.67% <0.00%> (+2.32%) ⬆️
app/models/revision.rb 88.29% <0.00%> (+3.19%) ⬆️
app/models/node_tag.rb 100.00% <0.00%> (+3.70%) ⬆️
app/models/user.rb 86.23% <0.00%> (+4.34%) ⬆️
app/models/user_tag.rb 100.00% <0.00%> (+4.34%) ⬆️
... and 15 more

@ijayhub
Copy link
Contributor Author

ijayhub commented Oct 21, 2022

@TildaDares #11524

@TildaDares
Copy link
Member

Hi @ijayhub, the link you added is for this PR. I'm asking for the issue this PR was opened for. Thanks!

@ijayhub
Copy link
Contributor Author

ijayhub commented Oct 22, 2022

hello @TildaDares , I didn't fix it from an issue. It was just an improvement I made while going through the code.
Thanks

@TildaDares
Copy link
Member

Hi @ijayhub, we prefer to create issues first so that other contributors don't try to solve the same issues. It also gives the maintainers time to review the issue before you open a PR for it.

@TildaDares
Copy link
Member

For example, it looks like @Josephsanya has opened a PR for one of the files you've added in this PR #11526.

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.

Feel free to just click the Commit suggestion button. Thanks!

@@ -19,12 +19,12 @@ describe("Like Button", function () {
ajaxStub = sinon.stub($, 'ajax', function (object) {
response = object.url === '/likes/node/1/create' ? '4' : 'none'

var d = $.Deferred();
let d = $.Deferred();
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
let d = $.Deferred();
const d = $.Deferred();

@@ -65,7 +65,7 @@ describe("Like Button", function () {
ajaxStub = sinon.stub($, 'ajax', function (object) {
response = object.url === '/likes/node/1/delete' ? '4' : 'none'

var d = $.Deferred();
let d = $.Deferred();
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
let d = $.Deferred();
const d = $.Deferred();

@@ -44,7 +44,7 @@ describe("Like Button", function () {
// console.log('Failed to fake response to:', object.url);
// }

var d = $.Deferred();
let d = $.Deferred();
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
let d = $.Deferred();
const d = $.Deferred();

@Josephsanya
Copy link
Contributor

Hi @ijayhub
Here is the link to the issue
#11537

@ijayhub
Copy link
Contributor Author

ijayhub commented Oct 24, 2022 via email

@Josephsanya
Copy link
Contributor

Hey @ijayhub
You should make changes to your PR as requested and shown

fix: modified
@ijayhub
Copy link
Contributor Author

ijayhub commented Oct 24, 2022

modified

@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/8936051920/artifacts/409990024

@ijayhub
Copy link
Contributor Author

ijayhub commented Oct 24, 2022

modified

@TildaDares
Copy link
Member

Hi @ijayhub, can you make the changes I suggested above? Thank you!

@codeclimate
Copy link

codeclimate bot commented Oct 25, 2022

Code Climate has analyzed commit 6d8d426 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/8944112454/artifacts/410599312

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 @ijayhub. Thank you!

@TildaDares TildaDares merged commit affe0fc into publiclab:main Oct 25, 2022
@welcome
Copy link

welcome bot commented Oct 25, 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 📥

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.

Modify the functional scope to block scope in JavaScript using let and const in place of var
3 participants