CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 89
Missing shows data. #226
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
Missing shows data. #226
Conversation
.onCall(1).returns(Promise.resolve(2)); | ||
|
||
PartnerShow.__Rewire__('gravity', gravity); | ||
PartnerShow.__Rewire__('total', total); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stubbing of total
works, but when I call it (in schema/partner_show.js
) it doesn’t appear to return the promises I expect it to and the tests fail with null
values.
Any idea what I’m doing wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dzucconi I’d really like some input on this one, currently its tests are failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:Taking a look:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib/loaders/total.js
Outdated
export const total = ({ path, options }) => { | ||
const key = toKey(path, assign({}, options, { | ||
size: 1, | ||
size: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change depends on https://github.com/artsy/gravity/pull/9992 being deployed.
press_release: markdown(), | ||
start_at: date, | ||
end_at: date, | ||
exhibition_period: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Eigen we called this ausstellungsdauer, but I’ve noticed that that was not something that was shared across clients, e.g. Force calls it ‘running dates’.
I went with the translation of ‘ausstellungsdauer’, but I’m open to a naming contest.
/cc @orta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Exhibition period' makes more sense than 'running dates' IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, just found this discussion - yeah, I think realistically exhibition period is a much better name.
Related to the exhibition period addition, and dates in general, we should think about timezones. I filed #227 for that purpose. |
} | ||
|
||
return `${startMoment.format(startFormat)} - ${endMoment.format(endFormat)}`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moment has some methods that might make some of this logic easier to read:
if (start.isSame(end, 'year')) { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I've been shying away from including predetermined date formatting in the schema in favor of exposing a moment formatting interface directly. Though I can see this can't really be handled that way. I'd like to avoid the nonsense we have in Force though where there are many subtly different date string formatting methods on models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I've been shying away from including predetermined date formatting in the schema
Yeah, I do get that, but we just keep re-implementing these things. So I’m thinking that maybe it’s time for that shift in moving view models into the ☁️ ?
I'd like to avoid the nonsense we have in Force though where there are many subtly different date string formatting methods on models.
I’m not familiar with the Force code-base, but did have a hard time figuring out all the date methods when doing some cursory reading for this work.
I agree that I’d also like to avoid that, so don’t hold back when reviewing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah; I'm with it after thinking about it. I think historically this has been a problem because of a lack of consistency site-wide when designs have been specified but there's now a move to actually consolidate. See the image of the spec posted below. It'll be nice to not have to worry about it for sure.
@dzucconi Will you PR those fixes you made into this branch? |
alloy#1 you got it |
artist_id: { | ||
type: GraphQLString, | ||
description: 'The slug or ID of an artist in the show.', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dzucconi I was unsure how to make numeral
work with this field that takes an optional argument. Is this a requirement for getting this merged or is it something that can be added when needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it probably needs to be edited to accept that, but it's fine—you'll just have to process it to add commas or whatever else you wanna do on your client in the meantime.
period.should.equal('January 12th - 19th'); | ||
const period = exhibitionPeriod(moment().format('YYYY-01-01'), moment().format('YYYY-01-19')) | ||
period.should.equal('Jan 1 – 19'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@briansw FYI here are the test cases.
@dzucconi Added last missing data for our shows view, should be ready for review/merge 👍 |
Looks good! Thanks for bearing with 👍 👍 |
Thanks for the assistance, @dzucconi ! |
args: { | ||
max_days: { | ||
type: GraphQLInt, | ||
description: 'Before this many days no update will be generated', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Before this many days no update will be generated" doesn't make too much sense, perhaps "the maximum amount of days to show a relative day string, instead of the full time range"?
This is for artsy/emission#11