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

[Dashboard][Slug] Spaces and hyphens are being ignored. #3803

Closed
NaukhaizAhmad opened this issue Nov 8, 2017 · 6 comments · Fixed by #3876
Closed

[Dashboard][Slug] Spaces and hyphens are being ignored. #3803

NaukhaizAhmad opened this issue Nov 8, 2017 · 6 comments · Fixed by #3876

Comments

@NaukhaizAhmad
Copy link

NaukhaizAhmad commented Nov 8, 2017

Superset version

0.20.3

Expected results

  • Spaces should be replaced by hyphens or underscores.
  • Hyphens shouldn't be ignored.

Actual results

Spaces and hyphens are being ignored.

Steps to reproduce

open the dashboard configuration GUI
add slug with spaces and hyphens
save the dashboard configurations.
Re-open the dashboard configurations again to review the previously saved state
the Spaces and hyphens would be missing from the slug.

P.S. All special characters are also being ignored (except underscore _).
slug-2

@xrmx
Copy link
Contributor

xrmx commented Nov 8, 2017

That's exactly the purpose of the slug https://en.wikipedia.org/wiki/Semantic_URL#Slug

@rumbin
Copy link
Contributor

rumbin commented Nov 8, 2017

Well, I don't fully agree with @xrmx. In the link provided it is clearly stated whitespace characters [are] replaced by a dash or an underscore to avoid being encoded. So the hyphens/dashes being dropped and the white spaces not being replaced by dashes or underscores may be regarded as unexpected behavior.

@xrmx
Copy link
Contributor

xrmx commented Nov 8, 2017

Yeah the implementation of this slug is buggy (\W+ in the re.sub matches -) but unless anyone cares enough to open a PR that's not really an issue.

@TryHarder01
Copy link

It sounds like the "expected results" aren't exactly on point.

The expected result is that spaces are replaced, but dashes and hyphens stays.

@rumbin
Copy link
Contributor

rumbin commented Nov 8, 2017

The awesome-slugify package seems to do the job quite simply.

@NaukhaizAhmad
Copy link
Author

I second @rumbin comments about the link shared by @xrmx .
1- Spaces has to be replaced with dashes or underscores.
2- Dropping the hyphens/dashes is not the intended behavior.

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

Successfully merging a pull request may close this issue.

4 participants