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

Broken link in initial (blank) Query Snippets page - missing organisation slug #4140

Closed
justinclift opened this issue Sep 15, 2019 · 4 comments · Fixed by #4144
Closed

Broken link in initial (blank) Query Snippets page - missing organisation slug #4140

justinclift opened this issue Sep 15, 2019 · 4 comments · Fixed by #4144
Assignees

Comments

@justinclift
Copy link
Member

One of our users has reported the Query Snippets page has a broken link in the initial (unpopulated) placeholder content.

The Query Snippets page has a "New Query Snippet" button which works, and a text link in the list area to "Click here to add one".

The URL on the "Click here to add one" text is incorrect, missing the organisation slug.

eg: "https://myserver.org/query_snippets/new" instead of "https://myserver.org/myorganisation/query_snippets/new".

Looking at our code base, the problem seems to be our hard coded path here not adding the slug:

<a href="/query_snippets/new">Click here</a> to add one.

Hopefully this is a simple thing to fix. 😄

@gabrieldutra gabrieldutra self-assigned this Sep 15, 2019
@gabrieldutra
Copy link
Member

I've already started looking into this, I believe it's not a slug issue (it also happens in netlify's preview and I think the organization slug would be in the base url). This is a specific case for the logic I've introduced here. It works by avoiding the controller to be changed when changing the url, the issue is when you open the url /query_snippets/new directly. I'll push a fix for it later today as well as explaining it better 🙂.

@arikfr
Copy link
Member

arikfr commented Sep 15, 2019

@gabrieldutra won't #4143 work? The other option I had in mind is just to use the onClick handler like we do with the button.

@gabrieldutra
Copy link
Member

@gabrieldutra won't #4143 work? The other option I had in mind is just to use the onClick handler like we do with the button.

🤔 it's possible that what I tried was a different issue:

query-snippets-issue

You can only click once in that, after that the link just stops working. It also happens if you open /query_snippets/new directly.

The onClick handler would probably work, though I was going in #4144 direction since we don't lose the ability to open in new tab (for query snippets it doesn't affect much, so not a big issue).

@arikfr
Copy link
Member

arikfr commented Sep 15, 2019

Yeah, #4143 won't fix this one. Let's go with the onClick approach to reduce changes for something that isn't that important. Will you pdate #4144?

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