mirror of https://github.com/apache/superset.git
fix(other): column name in created content on profile page (#17029)
* fix: fix name in created content on profile page * add more fix on mutater
This commit is contained in:
parent
14b7f6cdba
commit
f2d41dc416
|
@ -33,14 +33,14 @@ class CreatedContent extends React.PureComponent<CreatedContentProps> {
|
||||||
const mutator = (data: Slice[]) =>
|
const mutator = (data: Slice[]) =>
|
||||||
data.map(slice => ({
|
data.map(slice => ({
|
||||||
slice: <a href={slice.url}>{slice.title}</a>,
|
slice: <a href={slice.url}>{slice.title}</a>,
|
||||||
favorited: moment.utc(slice.dttm).fromNow(),
|
created: moment.utc(slice.dttm).fromNow(),
|
||||||
_favorited: slice.dttm,
|
_created: slice.dttm,
|
||||||
}));
|
}));
|
||||||
return (
|
return (
|
||||||
<TableLoader
|
<TableLoader
|
||||||
dataEndpoint={`/superset/created_slices/${this.props.user.userId}/`}
|
dataEndpoint={`/superset/created_slices/${this.props.user.userId}/`}
|
||||||
className="table-condensed"
|
className="table-condensed"
|
||||||
columns={['slice', 'favorited']}
|
columns={['slice', 'created']}
|
||||||
mutator={mutator}
|
mutator={mutator}
|
||||||
noDataText={t('No charts')}
|
noDataText={t('No charts')}
|
||||||
sortable
|
sortable
|
||||||
|
@ -52,8 +52,8 @@ class CreatedContent extends React.PureComponent<CreatedContentProps> {
|
||||||
const mutator = (data: Dashboard[]) =>
|
const mutator = (data: Dashboard[]) =>
|
||||||
data.map(dash => ({
|
data.map(dash => ({
|
||||||
dashboard: <a href={dash.url}>{dash.title}</a>,
|
dashboard: <a href={dash.url}>{dash.title}</a>,
|
||||||
favorited: moment.utc(dash.dttm).fromNow(),
|
created: moment.utc(dash.dttm).fromNow(),
|
||||||
_favorited: dash.dttm,
|
_created: dash.dttm,
|
||||||
}));
|
}));
|
||||||
return (
|
return (
|
||||||
<TableLoader
|
<TableLoader
|
||||||
|
@ -61,7 +61,7 @@ class CreatedContent extends React.PureComponent<CreatedContentProps> {
|
||||||
mutator={mutator}
|
mutator={mutator}
|
||||||
dataEndpoint={`/superset/created_dashboards/${this.props.user.userId}/`}
|
dataEndpoint={`/superset/created_dashboards/${this.props.user.userId}/`}
|
||||||
noDataText={t('No dashboards')}
|
noDataText={t('No dashboards')}
|
||||||
columns={['dashboard', 'favorited']}
|
columns={['dashboard', 'created']}
|
||||||
sortable
|
sortable
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue