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

comment id unique #5531

Closed
wants to merge 1 commit into from
Closed

Conversation

CleverFool77
Copy link
Member

Fixes #4771 (<=== Add issue number here)

  • 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

Thanks!

@plotsbot
Copy link
Collaborator

plotsbot commented Apr 19, 2019

2 Messages
📖 @CleverFool77 Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 This pull request doesn’t link to a issue number. Please refer to the issue it fixes (if any) in the body of your PR, in the format: Fixes #123.

Generated by 🚫 Danger

@@ -1,5 +1,5 @@
<div class="comment-form-wrapper" style="background-color:#f8f8f8; border: 1px solid #e7e7e7;padding: 18px;">
<form class="comment-form" id="comment-form" data-remote="true" class="well" <% if !local_assigns[:is_answer].blank? %> action= "/answers/create/<%= @node.nid %>" <% elsif !local_assigns[:aid].blank? %> action= "/comment/answer_create/<%= aid %>" <% else %> action="/comment/create/<%= @node.nid %><%= "?type=question" if local_assigns[:type]=="question" %>" <% end %> <% if local_assigns[:aid].blank? %>method="post"<% end %>>
<form class="comment-form" id="comment-form-<%= Time.now.to_s.gsub(" ", "") %><%= rand(10000) %>" data-remote="true" class="well" <% if !local_assigns[:is_answer].blank? %> action= "/answers/create/<%= @node.nid %>" <% elsif !local_assigns[:aid].blank? %> action= "/comment/answer_create/<%= aid %>" <% else %> action="/comment/create/<%= @node.nid %><%= "?type=question" if local_assigns[:type]=="question" %>" <% end %> <% if local_assigns[:aid].blank? %>method="post"<% end %>>
Copy link
Member

Choose a reason for hiding this comment

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

Hi @CleverFool77 !!! This is great, you have just the right idea. However, I think two possibilities may be good; one, to not change the id, but to use a new class (in case some other function depends on the old format of id), AND to consider using the comment cid if it exists. Here, are we able to use aid? @ViditChitkara what do you think?

Thank you!!!

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think we need to check if some other js function(drag drop or editor) depends on the comment IDs.

Copy link
Member

Choose a reason for hiding this comment

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

I think the cid might not exist for a new comment form. Maybe that's the reason why cid has not been considered? @CleverFool77

Copy link
Member

Choose a reason for hiding this comment

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

Also, the tests for the reply to comment features are not yet written so we may need to manually test if the reply to comment feature is not affected, image upload is working, propose title, etc. which appear at the bottom of the comment textbox are working.
Will be writing the tests asap. @CleverFool77 if you want, we'd love your help in writing tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @jywarren I went through all the js functions for comments. And I found that there is no use of comment-form id. Instead mostly places in js have used classes.
Regarding other ids, I will look into it.
And as @ViditChitkara mentioned. Earlier, I was considering to use cid first but then as I went though the code base I realised the comment-form doesn't have cid. And That's why I went for current method.
And Sure, It would be great to help in writing test for comment section.

@CleverFool77 CleverFool77 force-pushed the commnet-id branch 3 times, most recently from 29ddf05 to 5f62c60 Compare April 19, 2019 17:19
@jywarren
Copy link
Member

jywarren commented May 8, 2019

Hi! Just checking if this is ready to merge? Thanks!!

@CleverFool77
Copy link
Member Author

Hi @jywarren Apologies for being pretty inactive these days.
I had exams and they extended a span of time.
Now that They have finally ended today. So I'll be back to work.
I'll be updating all my PRs and resolving conflicts soon.
Thanks for the patience.

@jywarren
Copy link
Member

jywarren commented May 8, 2019 via email

@CleverFool77
Copy link
Member Author

The Pr has been updated and conflict has been resolved.
Thanks !!

@jywarren
Copy link
Member

jywarren commented May 8, 2019

Hi, @CleverFool77 -- thanks, this is awesome! I wanted to know if you'd be willing to try to write a simple system test to demonstrate the issue this solves. There are resources and some completed example tests in #5316

One way to do this is to "record" the test using https://github.com/polarblau/capycorder/ in your browser. It works /ok/. That will help protect this critical system, which keeps breaking (thank you so much for fixing it!)

@CleverFool77
Copy link
Member Author

CleverFool77 commented Sep 4, 2019

Hi @jywarren I went through some old PRs. and tried working on left behind PRs. In this one, you mean to write system test. Should I write the system test of recording using capycorder you said ? or is this possible to write in screenshot test too. Can we press inspect element in screenshot test too ?

@jywarren
Copy link
Member

jywarren commented Sep 4, 2019 via email

@jywarren
Copy link
Member

Hi @CleverFool77 this bug came up again and I was wondering if we should resolve the conflicts here and test it out, and see if we can get someone else to add a system test? Thanks!

@SidharthBansal
Copy link
Member

@Uzay-G @VladimirMikulic again there are some tests which you can write.

@SidharthBansal
Copy link
Member

SidharthBansal commented Jan 17, 2020

It is not necessary to get everything done in GCI. You can continue to work on issues and prs after GCI. However you will not get points for them(after GCI phase ends). I will request students to be in touch with the organizations so that studends can continue to learn. Points matter far less than learning. I hope you all want more learning after GCI too.

@SidharthBansal
Copy link
Member

Students will get points till GCI ends. After GCI no points but infinite learning

@SidharthBansal
Copy link
Member

@CleverFool77 kindly rebase and resolve conflicts

@SidharthBansal
Copy link
Member

As the person is inactive for more than a month, I am closing the PR. In case you want to push changes please feel free to open a new PR OR reopen this PR and add additional changes to it.
Thanks for contributing on Public Lab

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

Successfully merging this pull request may close these issues.

non-unique id in comment form - possibly related to comment bugs
5 participants