mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix empty slug breaking url (#8974)
This commit is contained in:
committed by
Maxime Beauchemin
parent
ff9bc74c86
commit
7e6719050b
@@ -431,11 +431,13 @@ class Header extends React.PureComponent {
|
||||
metadata: JSON.parse(updates.jsonMetadata),
|
||||
});
|
||||
this.props.dashboardTitleChanged(updates.title);
|
||||
history.pushState(
|
||||
{ event: 'dashboard_properties_changed' },
|
||||
'',
|
||||
`/superset/dashboard/${updates.slug}/`,
|
||||
);
|
||||
if (updates.slug) {
|
||||
history.pushState(
|
||||
{ event: 'dashboard_properties_changed' },
|
||||
'',
|
||||
`/superset/dashboard/${updates.slug}/`,
|
||||
);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -52,10 +52,10 @@ class PropertiesModal extends React.PureComponent {
|
||||
this.state = {
|
||||
errors: [],
|
||||
values: {
|
||||
dashboard_title: this.props.dashboardTitle,
|
||||
slug: this.props.dashboardInfo.slug,
|
||||
owners: this.props.owners || [],
|
||||
json_metadata: JSON.stringify(this.props.dashboardInfo.metadata),
|
||||
dashboard_title: props.dashboardTitle,
|
||||
slug: props.dashboardInfo.slug,
|
||||
owners: props.owners || [],
|
||||
json_metadata: JSON.stringify(props.dashboardInfo.metadata),
|
||||
},
|
||||
isOwnersLoaded: false,
|
||||
userOptions: null,
|
||||
@@ -189,7 +189,7 @@ class PropertiesModal extends React.PureComponent {
|
||||
name="slug"
|
||||
type="text"
|
||||
bsSize="sm"
|
||||
value={values.slug}
|
||||
value={values.slug || ''}
|
||||
onChange={this.onChange}
|
||||
/>
|
||||
<p className="help-block">
|
||||
|
||||
Reference in New Issue
Block a user