mirror of
https://github.com/apache/superset.git
synced 2026-06-06 16:19:18 +00:00
[explore-v2] control panel fixes (#1529)
* make fieldset conditions more clear * make label required * use render* pattern * use slugify util for turning labels into ids * use field rather than html * don't need panel-title class here
This commit is contained in:
@@ -142,3 +142,13 @@ export function formatSelectOptions(options) {
|
||||
[opt, opt]
|
||||
);
|
||||
}
|
||||
|
||||
export function slugify(string) {
|
||||
// slugify('My Neat Label! '); returns 'my-neat-label'
|
||||
return string
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.replace(/[\s\W-]+/g, '-') // replace spaces, non-word chars, w/ a single dash (-)
|
||||
.replace(/-$/, ''); // remove last floating dash
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user