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

Conversation

@noirbizarre
Copy link
Member

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 opendatateam/etalab Aug 17, 2018
@taniki
taniki approved these changes Aug 17, 2018
@@ -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;

This comment has been minimized.

Copy link
@taniki

taniki Aug 17, 2018

Member

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

This comment has been minimized.

Copy link
@noirbizarre

noirbizarre Aug 17, 2018

Author Member

Details on how and why added in the description

@noirbizarre noirbizarre force-pushed the noirbizarre:fix-datasets-cards-list branch from 651d524 to a4714ac Aug 17, 2018
@noirbizarre noirbizarre force-pushed the noirbizarre:fix-datasets-cards-list branch from a4714ac to f391ee5 Aug 17, 2018
@noirbizarre noirbizarre merged commit 3e5e9e7 into opendatateam:master Aug 17, 2018
3 checks passed
3 checks passed
ci/circleci: assets Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: python Your tests passed on CircleCI!
Details
@noirbizarre noirbizarre deleted the noirbizarre:fix-datasets-cards-list branch Aug 17, 2018
@noirbizarre noirbizarre referenced 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
2 participants
You can’t perform that action at this time.