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

AO3-5890 - Add link to individual prompt and prompt user for prompt meme posts #4804

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

digiAlchem
Copy link
Contributor

@digiAlchem digiAlchem commented May 1, 2024

Pull Request Checklist

Issue

This is a partial fix for AO3-5890.

I can see that the issue has been assigned to somebody, but it has not seen any updates since July 2021 — unsure what to do in this scenario, as this PR is looking to fix a specific problem that I would like to see resolved (namely, the inability to link to a specific prompt) but I also don't want to step on any toes in the process.

(Apologies about the discrepency between PR user and commit user — they're both me, but I accidentally pushed the commit with the incorrect Github user!)

Purpose

Adds a permalink to a prompt inside of a prompt meme, allowing easier sharing of inidividual prompts, and also adds a link to a psued's page (if the prompt is not anonymous) in the same way a work blurb does.

Testing Instructions

  • Visit a prompt meme's list of requests (/collections/collection/requests)
  • See that prompt titles are clickable links which take the user to the individual prompt page
  • See that non-anonymous prompts show a link to the user's pseud dashboard

References

No other relevant issues.

Credit

spectralMachina (he/him)

@sarken
Copy link
Collaborator

sarken commented May 2, 2024

Hi, spectralMachina!

I'm checking in with the person assigned to the issue to find out if they're still interested in working on it. If not, you'll be welcome to claim it and finish it up!

(It looks like you have a Jira account from a previous contribution, so if you run into this situation in the future, you're also welcome to comment on the issue and ask the assignee directly. We find the best way to handle the situation is to ask them to reply within a period of a week and let them know that if we don't hear back from them, we'll assume they're busy and someone else can take over.)

As long as I was here, I gave the code here a quick spin on my dev environment and noticed that if I followed any of the prompt links from a Gift Exchange's Requests Summary (/collections/gift_exchange/requests), I received an error saying, "Sorry, you don't have permission to access the page you were trying to reach." This is probably due to the before_action :allowed_to_view, only: [:show] filter in the prompts controller.

before_action :allowed_to_view, only: [:show]

def allowed_to_view
unless @challenge.user_allowed_to_see_prompt?(current_user, @prompt)
access_denied(redirect: @collection)
end
end

def user_allowed_to_see_prompt?(user, prompt)
self.collection.user_is_maintainer?(user) || prompt.pseud.user == user
end

If you already knew that and were planning to tackle it once you got some guidance on whether it was okay to keep working on the issue, my apologies! I'll let you know if I hear back from the current assignee, but I believe you can also use your Jira account to watch the issue -- that way, you should get any comments or updates to it automatically.

@digiAlchem
Copy link
Contributor Author

@sarken Thank you so much for looking into that for me! I really appreciate it 💜

Ah, that's my bad - I hadn't quite followed the logic all the way through to realise that prompt memes and gift exchanges use the same controller! In my head, the functionality I'm adding here (linking to an individual prompt) would only be relevant for a prompt meme, as with a gift exchange a user would be directly assigned a prompt - meaning that the link to the prompt should only show up if we're inside a prompt meme and not a gift exchange. Would that be the right way of going about this?

(I'll keep an eye on the Jira issue and go from there! Should I comment any further questions/updates on this PR or on the issue itself?)

@sarken
Copy link
Collaborator

sarken commented May 2, 2024

In my head, the functionality I'm adding here (linking to an individual prompt) would only be relevant for a prompt meme, as with a gift exchange a user would be directly assigned a prompt - meaning that the link to the prompt should only show up if we're inside a prompt meme and not a gift exchange. Would that be the right way of going about this?

We'd like the link available for both prompt memes and gift exchanges. Both types of challenges should also have "All Requests in Sign-up" links added to non-anonymous prompts. (The issue has more information about where that link should be placed, as well as some important details about the sign-up pages.)

The reason we want these changes for both types of challenges is a lot of moderators make their gift exchange's Requests Summary public with the expectation folks will treat them like prompts in a prompt meme -- that means people will want to bookmark prompts or sign-ups they're interested in, share their own prompts or sign-ups, or link back to specific prompts they're filling, just like people want to do with prompt meme challenges.

Should I comment any further questions/updates on this PR or on the issue itself?

The issue is probably the best place at this stage! Five years from now, when we're wondering something like "Why do we even have this link on gift exchanges?" or "Was not including the link for anonymous prompts intentional?", the Jira issue is the first place we'll check.

@digiAlchem
Copy link
Contributor Author

Excellent, thank you very much for the clarifications! I'll wait and see if the issue comes my way, and then I'll make any further comments on Jira should anything else arise from there 👍

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.

4 participants