Plots2: Answer Preview is not working

Created on 29 Sep 2018  ·  19Comments  ·  Source: publiclab/plots2

Please describe the problem (or idea)

If I want to Comment/answer of the question, In question page there is two option I can comment or I can give answer and comment Preview working fine but Answer preview is not working, if click on preview then it's showing comments preview not an answer's preview

issue

Link to the comment/answer form - https://github.com/publiclab/plots2/blob/master/app/views/comments/_form.html.erb

Both new comment and new answer uses the same form. In research notes, there is only a single empty form so preview button works fine. But, when we come to questions, preview button doesn't work for answer's comment form and answer's form. When we press preview for any form, it shows/toggle preview for the first empty form of the page.

Link to toggle_preview function - https://github.com/publiclab/plots2/blob/master/app/assets/javascripts/editor.js#L103-L134

Thanks!

JavaScript bug fto-candidate help wanted

Most helpful comment

Hi, my name is Ivana and I'm Outreachy participant. Can I work on this issue?

All 19 comments

Nice catch @avsingh999. Can you please add this and other gci-candidate issue you have made to #3276 and the google code-in dashboard. Thanks!!

This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @SidharthBansal to get it labelled. Or, if this is not your first time, try to solve it yourself!

Would it be appropriate to add to this issue that Preview is also not working on wikis or notes, or should that be a separate issue?

Hi, I'd like to work on this .. I'm a Gci candidate... @publiclab/mentors

Can i get links to the code files....

@SidharthBansal Could you help me here.. I think I may be able to solve both #3534 and #4122

Answer and Comment both are using comments/form .. So if we make an answers/form will that help us solve the error... ?

@oorjitchowdhary this is fto issue, so you are ineligible for this.
You can try other issues.

Okay no problem.. I tried working on this as this wasn't a beginner task on gci

Sorry for the late reply.

On Sun, Dec 9, 2018 at 2:11 AM Oorjit Chowdhary notifications@github.com
wrote:

Okay no problem.. I tried working on this as this wasn't a beginner task
on gci


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/3534#issuecomment-445488391,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUACQ2b20DC8vx1Uqt90sczqxvGX99Lqks5u3CQWgaJpZM4XAd3e
.

No worries.. You guys are already working so hard... 👏

Hi, my name is Ivana and I'm Outreachy participant. Can I work on this issue?

Hi @Ivilili, welcome to Public Lab. Go ahead with the issue :+1:

Hi @publiclab/mentors @gauravano I have few questions about this issue. I've noticed that preview and other features in Answer are attached to Comment area.
How should I approach this? Should I create new form for answer, because now comment and answer are together in comments/form?
Or maybe even integrate answers with comments?

Hi @Ivilili, I went through the issue myself and it's a bit complex. The preview button calls the function toggle_preview which is located here- https://github.com/publiclab/plots2/blob/master/app/assets/javascripts/editor.js#L103-L134

And, if one observes carefully then will observe that pressing preview button opens the preview of first available empty form. So, something wrong here - https://github.com/publiclab/plots2/blob/master/app/assets/javascripts/editor.js#L103-L134 only. It may take time to fix this one. So, do you like to have another issue?

I have created https://github.com/publiclab/plots2/issues/5056 for you. You can claim that. And, thanks for trying this.

Thank you @gauravano, I will start with new one immediately. It's hard to give up on this one...

You can come back to this one anytime after recording your first contribution. Thanks!

Hi, I am closing this because we have gotten rid of the answers editor and just have comments now, which was working fine. We can open specific issues for the other surrounding issues with the buttons. going to re-open it for GCI with a different prompt

Was this page helpful?
0 / 5 - 0 ratings