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

'click to unfollow' is not working in /tag section #4406

Closed
Rishabh-Kumar-Bothra opened this issue Dec 26, 2018 · 19 comments
Closed

'click to unfollow' is not working in /tag section #4406

Rishabh-Kumar-Bothra opened this issue Dec 26, 2018 · 19 comments
Labels
fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet hacktoberfest help wanted requires help by anyone willing to contribute JavaScript Ruby

Comments

@Rishabh-Kumar-Bothra
Copy link
Contributor

Rishabh-Kumar-Bothra commented Dec 26, 2018

Please describe the problem (or idea)

What happened just before the problem occurred? Or what problem could this idea solve?

image

here we are not able to unfollow the tags direct which we are following and it is redirected to this page,
but we should be able to unfollow directly from /tags

image

Please show us where to look

https://publiclab.org/tags

What's your PublicLab.org username?

geekychaser

This can help us diagnose the issue:

Browser, version, and operating system

Many bugs are related to these -- please help us track it down and reproduce what you're seeing!


Thank you!

Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

@Rishabh-Kumar-Bothra
Copy link
Contributor Author

@jywarren @SidharthBansal can i give it a try?

@oorjitchowdhary
Copy link
Member

Hi @geekychaser .. I don't find any unfollow button on the page. I think the following button was meant to function like this...
However, I think we can change this. So instead of the following button we show unfollow and its function would be to remove that subscription

This seems good.

@Rishabh-Kumar-Bothra
Copy link
Contributor Author

@oorjitchowdhary on hovering over the following its show click here to unfollow.
image

so on clicking it button should turn to follow again rather than redirecting to other page where we need to unfollow again

@oorjitchowdhary
Copy link
Member

I just went through the issue on PL. You're right.
The following button should be firstly renamed to unfollow.
Then we see, if the button is clicked you're redirected to /unsubscribe/tag/tag_name. I think this where the problem is.
If you click unfollow on the /tags page or /subscriptions, you're redirected to some URL like subscriptions?_=1545829506

@oorjitchowdhary
Copy link
Member

so on clicking it button should turn to follow again rather than redirecting to other page where we need to unfollow again

When you've successfully unsubscribed to a tag. You go to /tags again and then you'd have to refresh it once again to see it the button change to follow.

I think this page is missing AJAX. Sorry if I'm wrong

@Rishabh-Kumar-Bothra
Copy link
Contributor Author

yes exactly this is the issue, and then you there again need to click on this button to this button to unfollow
image

@grvsachdeva grvsachdeva added help wanted requires help by anyone willing to contribute JavaScript Ruby labels Dec 28, 2018
@grvsachdeva
Copy link
Member

Hi @geekychaser @oorjitchowdhary do you guys like to work on this issue together?

@jywarren
Copy link
Member

jywarren commented Oct 5, 2019

I think we need to set the data-method to delete in the a tag here!

@SidharthBansal
Copy link
Member

@gauravano I think both of them have abandoned this task.

@snpd25
Copy link
Contributor

snpd25 commented Oct 8, 2019

Hey @SidharthBansal , if no one is working on this issue, can I give it a try?

@SidharthBansal
Copy link
Member

SidharthBansal commented Oct 10, 2019 via email

@renugasaraswathy
Copy link
Contributor

Hi @gauravano @geekychasser, I would like to work on this issue. Could you assign it to me? Thanks.

@grvsachdeva
Copy link
Member

grvsachdeva commented Oct 5, 2020

Hi @renugasaraswathy, please go ahead. Thanks!

@KarishmaVanwari
Copy link
Contributor

Hey @geekychasser @grvsachdeva , can I take up this issue, if it's open?

@cesswairimu
Copy link
Collaborator

cesswairimu commented Feb 11, 2022

Hi @KarishmaVanwari, The page has gone through some revamps and has fixed most of the issues discussed above. This is how it is currently:
Screenshot from 2022-02-11 07-50-01 The unfollow button still redirects to subscriptions page and we would love your help on this. Thanks

@cesswairimu
Copy link
Collaborator

💡Format this Issue Into a First Timers Issue

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 it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled🏷. Or, if this is not your first time, try to solve it yourself🧑‍💻!


todo:

This is the method that is called on unfollow.

def delete
# assume tag, for now
if params[:type] == "tag"
id = Tag.find_by(name: params[:name]).tid
end
if id.nil?
flash[:error] = "You are not subscribed to '#{params[:name]}'"
redirect_to "/subscriptions" + "?_=" + Time.now.to_i.to_s
else
if !set_following(false, params[:type], id) # should return false if result is that following == false
respond_with do |format|
format.html do
if request.xhr?
render json: true
else
flash[:notice] = "You have stopped following '#{params[:name]}'."
redirect_to "/subscriptions" + "?_=" + Time.now.to_i.to_s
end
end
end
else
flash[:error] = "Something went wrong!" # silly
redirect_to "/subscriptions" + "?_=" + Time.now.to_i.to_s
end
end
end

Replacing the redirects to redirect_to request.referrer should resolve this

@cesswairimu cesswairimu added fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet hacktoberfest and removed hackoctoberfest labels Sep 30, 2022
@ghubrakesh
Copy link

Hello @cesswairimu, I would Like to take up this issue.

@cesswairimu
Copy link
Collaborator

hello @ghubrakesh, we would like your help...please go ahead, Thanks

@cesswairimu
Copy link
Collaborator

Converted this to an fto #11490. Closing this. Thanks all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet hacktoberfest help wanted requires help by anyone willing to contribute JavaScript Ruby
Projects
None yet
10 participants