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

Fix missing dataset title on client-side card listing #1834

Merged
merged 1 commit into from Aug 17, 2018
Merged

Fix missing dataset title on client-side card listing #1834

merged 1 commit into from Aug 17, 2018

Conversation

noirbizarre
Copy link
Contributor

@noirbizarre noirbizarre commented Aug 17, 2018

This PR fixes the missing dataset title on editorial home datasets.

Explanation

full_title is Dataset object computed property (it's title + acronym if present).
Everywhere but here this is a list of Dataset object instances which is given as parameter.

To fix this, this PR allows to cast js Listobjects with an optionnal model option in constructor.

Before

screenshot-data xps-2018 08 17-19-01-59

After

screenshot-data xps-2018 08 17-18-56-38

@noirbizarre noirbizarre added this to the 1.6.0 milestone Aug 17, 2018
@noirbizarre noirbizarre self-assigned this Aug 17, 2018
@noirbizarre noirbizarre requested a review from a team August 17, 2018 17:02
@@ -268,7 +269,7 @@ export class List extends Base {
}

on_fetched(data) {
this.items = data.obj;
this.items = this.model ? data.obj.map(o => new this.model({data: o})) : data.obj;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like some black magic code having a wider scope than the PR desc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Details on how and why added in the description

@noirbizarre noirbizarre merged commit 3e5e9e7 into opendatateam:master Aug 17, 2018
@noirbizarre noirbizarre deleted the fix-datasets-cards-list branch August 17, 2018 18:18
@noirbizarre noirbizarre mentioned this pull request Aug 24, 2018
@noirbizarre noirbizarre modified the milestones: 1.6.0, 1.5.3 Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants