Skip to content

Commit

Permalink
Fix flaky unit test - remove 'Markup' object in data (#5313)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored and Grace Guo committed Jul 2, 2018
1 parent 885d779 commit 16d2633
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions superset/assets/src/dashboard/actions/sliceEntities.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export function fetchAllSlices(userId) {
description: slice.description,
description_markdown: slice.description_markeddown,
viz_type: slice.viz_type,
modified: slice.modified
? slice.modified.replace(/<[^>]*>/g, '')
: '',
modified: slice.modified,
};
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ function AddSliceDragPreview({ dragItem, slices, isDragging, currentOffset }) {
transform: `translate(${currentOffset.x}px, ${currentOffset.y}px)`,
}}
sliceName={slice.slice_name}
lastModified={
slice.modified ? slice.modified.replace(/<[^>]*>/g, '') : ''
}
lastModified={slice.modified}
visType={slice.viz_type}
datasourceLink={slice.datasource_link}
/>
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/src/dashboard/reducers/getInitialState.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function(bootstrapData) {
datasource: slice.form_data.datasource,
description: slice.description,
description_markeddown: slice.description_markeddown,
modified: slice.modified ? slice.modified.replace(/<[^>]*>/g, '') : '',
modified: slice.modified,
changed_on: new Date(slice.changed_on).getTime(),
};

Expand Down
3 changes: 1 addition & 2 deletions superset/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ def changed_on_(self):

@renders('modified')
def modified(self):
s = humanize.naturaltime(datetime.now() - self.changed_on)
return Markup('<span class="no-wrap">{}</span>'.format(s))
return humanize.naturaltime(datetime.now() - self.changed_on)

@property
def icons(self):
Expand Down

0 comments on commit 16d2633

Please sign in to comment.