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

✨ Enhancement: DocsHelp component option to hide Edit This on GitHub #1099

Open
DarhkVoyd opened this issue Nov 9, 2024 · 17 comments · May be fixed by #1114
Open

✨ Enhancement: DocsHelp component option to hide Edit This on GitHub #1099

DarhkVoyd opened this issue Nov 9, 2024 · 17 comments · May be fixed by #1114
Assignees
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature. good first issue Good for newcomers Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Status: In Progress This issue is being worked on, and has someone assigned.

Comments

@DarhkVoyd
Copy link
Member

Is your feature request related to a problem? Please describe

The pages using DocsHelp component, have a link "Edit this page on GitHub". In case of /tools it goes to https://github.com/json-schema-org/website/blob/main/pages/%2Ftools/index.page.tsx, which seems to just be the layout of the page, not the content itself. As discussed most of the time people would want to add or edit entries for their own tool.

Describe the solution you'd like

We can add an option to feedback component (DocsHelp) to disable/hide the Edit this page on GitHub or an option to pass a custom link, in this case the tooling data.

Describe alternatives you've considered

No response

Additional context

No response

Are you working on this?

No

@DarhkVoyd DarhkVoyd added ✨ Enhancement Indicates that the issue suggests an improvement or new feature. Status: Triage This is the initial status for an issue that requires triage. labels Nov 9, 2024
@DarhkVoyd DarhkVoyd added good first issue Good for newcomers Status: Available No one has claimed responsibility for resolving this issue. Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. and removed Status: Triage This is the initial status for an issue that requires triage. labels Nov 9, 2024
@techmannih
Copy link
Contributor

@DarhkVoyd May I work on this issue

@DarhkVoyd
Copy link
Member Author

@techmannih Thank you for your enthusiasm and for all the work you’re doing! I noticed you’re already working on a few issues. Would it be okay to prioritize completing the pending PRs and wrapping up any remaining issues you’ve started before we assign this new one to you?

@arpitkuriyal
Copy link
Contributor

@DarhkVoyd can you please assign this to me?

@DarhkVoyd
Copy link
Member Author

DarhkVoyd commented Nov 11, 2024

@arpitkuriyal Yes, please go ahead.

@DarhkVoyd DarhkVoyd added Status: In Progress This issue is being worked on, and has someone assigned. and removed Status: Available No one has claimed responsibility for resolving this issue. labels Nov 11, 2024
@arpitkuriyal
Copy link
Contributor

@DarhkVoyd i have make a prop to hide the "edit this page in the github" . Can you tell me in which pages i should hide it and on which pages i should show it?
In part where the prop is passed with false value the page will look like this
Screenshot 2024-11-13 at 6 27 15 PM
is it fine?

@DarhkVoyd
Copy link
Member Author

@arpitkuriyal Good work on your progress. Let's not hide the entire section instead just hiding the button would be better. The default behavior for the DocsHelp component should be to show the button, that way we will only have to manually handle cases when we want to hide it. For now, we only want to hide the button on the /tools page.

@arpitkuriyal
Copy link
Contributor

@DarhkVoyd Okay okay I got it

@arpitkuriyal arpitkuriyal linked a pull request Nov 14, 2024 that will close this issue
@gregsdennis
Copy link
Member

Is there not an option to specify the link in the button? It seems to me like the button is quite nice to have, and it would be better if we can just get it to point to the right file in GitHub depending on which page you're on.

@arpitkuriyal
Copy link
Contributor

@gregsdennis Yes, there's a prop that allows specifying a custom redirect link in the DocsHelp component. However, based on the issue's requirements, it doesn't need to be included on the tooling page . please let me know if you have more suggestions.

@gregsdennis
Copy link
Member

I'm suggesting the issue's requirements might be the wrong thing to do. This is merely a proposal. The issue is for discussion. Issues aren't just to-dos.

@benjagm, please weigh in here.

@gregsdennis
Copy link
Member

@DarhkVoyd the opening comment says "as discussed" but doesn't link to where anything was discussed.

@arpitkuriyal
Copy link
Contributor

@gregsdennis sorry but i am just a beginner learning things i see this is a good first issue so i picked it. i didn't see that it is discuss or not or just a proposal to be discussed.

@benjagm
Copy link
Collaborator

benjagm commented Nov 14, 2024

@DarhkVoyd the opening comment says "as discussed" but doesn't link to where anything was discussed.

Discussed here in slack.

@DarhkVoyd
Copy link
Member Author

@gregsdennis The current behavior of the “Edit this page on GitHub” button is to navigate to the file that contains the page’s content. This is specified by a prop, which accepts the file type to construct the GitHub path. For instance, “_index” (referring to “_index.md”) or by default, it points to “index.page.tsx” for that path. However, for the “/tools” page, all the content is from a data file rather than a markdown file, so by default, it points to “index.page.tsx,” which primarily consists of the layout and logic. Currently, there’s no logic in place to use a custom link.

@arpitkuriyal
Copy link
Contributor

@DarhkVoyd so now can i write test case for code that i added?

@gregsdennis
Copy link
Member

Thanks, Benja.

@DarhkVoyd I understood the problem. What I was missing was the context that provided the solution. Just looking at this issue, it seems like a decision was just made without discussion. Let's be sure to provide as much context as possible in the future, okay?

@DarhkVoyd
Copy link
Member Author

Understood, I’ll make sure to include more context moving forward. Thanks for the feedback!

This was referenced Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature. good first issue Good for newcomers Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Status: In Progress This issue is being worked on, and has someone assigned.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants