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

Display repo and maintainers as byline #821

Merged
merged 10 commits into from
Nov 26, 2019
Merged

Display repo and maintainers as byline #821

merged 10 commits into from
Nov 26, 2019

Conversation

trvrb
Copy link
Member

@trvrb trvrb commented Nov 12, 2019

This PR aims to do two things:

  1. Surface repository / build URL. It's nice to point people to GitHub readmes that have details behind how the analysis was generated.
  2. Better highlight maintainers. In the continued effort to give everyone credit, probably better to move maintainers to the top of the page rather than the very bottom.

This looks like this for the Zika Tutorial build:

zika

This is what this looks like for the Ebola DRC build:

ebola

(There are some more mocks in Slack here: https://bedfordlab.slack.com/archives/C116R9PR7/p1564668779044000)

This would require groups to use custom GitHub profile photos if they want their logo shared.

This uses metadata.repository, but could easily be changed to metadata.buildUrl or something else (nextstrain/augur#408 (comment)).

I'd imagine this working with existing community functionality in that if metadata.repository is not specified and charon getAvailable has shared buildUrl with auspice, then metadata.repository would use the URL passed in from community. metadata.repository would override passed in community buildUrl if both exist.

This byline includes both repository and maintainers where available in metadata. This replaces the use of maintainers in footer.
@trvrb trvrb changed the title Display repo Display repo and maintainers as byline Nov 12, 2019
@tsibley
Copy link
Member

tsibley commented Nov 12, 2019

The UI here looks great ✨, and I ❤️ that we're better highlighting build maintainers with a byline.

@jameshadfield
Copy link
Member

I'm 100% behind this. For completeness, see also this PR from July: #761

image

@trvrb
Copy link
Member Author

trvrb commented Nov 12, 2019

Thanks Tom and thanks James! I've just requested a review from you @jameshadfield. I suspect some of my JS use here could be improved.

@trvrb trvrb marked this pull request as ready for review November 13, 2019 00:17
@jameshadfield
Copy link
Member

Thanks @trvrb. I'd like to split this into two separate sections:

  1. UI. This looks pretty good to me so far, but it should be tested on an example where there are many maintainers (i.e. which flow into multiple lines) and how it looks on smaller screens. As long as there are no big problems here, then i'm happy with it.

  2. Implementation. I'll take a look at this as we'll have to cover cases where a "build url" is provided both from the dataset JSON & the getAvailable API call. In this case, the former should take precedence.

I'll play with both of these this week. Note that this is not blocking augur development or release in any way.

@tsibley
Copy link
Member

tsibley commented Nov 13, 2019

I'll take a look at this as we'll have to cover cases where a "build url" is provided both from the dataset JSON & the getAvailable API call. In this case, the former should take precedence.

I think it'd be nice to remove buildUrl from /charon/getAvailable and converge the Auspice client on reading it only from the dataset JSON. The server-side can then just opportunistically fill in a missing build_url / repository in the datasets it fetches from community repos.

Auspice (2.*) allows the `getAvailable` API request to define `buildUrl`s for datasets. These were displayed in the sidebar, above the choose-dataset dropdowns. 

This commit removes the sidebar display of this, as it's been super-seeded by the byline.

The commit also sets the `metadata.buildUrl` to be that defined in the `getAvailable` API response _if_ it has not been set via the dataset JSON, as the latter is to be considered the "canonical" way of defining this value.
Refactors the byline into its own React Component. In general, I think this helps reduce interpretability of the code. No changes in UI. Minimal changes to implementation, related to making this a functional component which are simpler than react classes (and react is generally moving away from classes).
Feels much cleaner to me, but this is highly subjective!
The "should i render" boolean approach is replaced with returning a react component when it's determined that something should be rendered, else returning `null` as a fallthrough at the end of the function (null is better than `<span/>`). 

The `renderLink` function is replaced by a component, which gets passed props rather than an object.

Looks like lots of changes but not that many really!
@jameshadfield
Copy link
Member

@trvrb i've made a few changes & think this is pretty good to go once we decide on the key name for the dataset JSON (currently build_url). Please see the commit titles/messages for what was done. Happy to explain any of them in more detail.

I've changed the font size & weight as it looked much heavier on my setup than yours, but this needs testing (feel free to get rid of this commit if you want).

Screen Shot 2019-11-20 at 7 36 44 PM
Screen Shot 2019-11-20 at 7 37 09 PM

I think it'd be nice to remove buildUrl from /charon/getAvailable and converge the Auspice client on reading it only from the dataset JSON.

This is specified in the v2 auspice API here: https://nextstrain.github.io/auspice/server/api#charon-getavailable. It won't be used if a build_url is supplied in the dataset JSON. Can be removed in auspice v3 if people wish.

The originally intention was to have the overall weight (including size, color and font weight) of byline to be about halfway between title and info. I see that the weight 700 wasn't working. This looks a little better to my eye while still incorporating direction implemented by @jameshadfield.
@trvrb
Copy link
Member Author

trvrb commented Nov 20, 2019

Thanks James! Changes look great. I agree byline works better as a separate React component. The only suggestion I had was to split the difference with aesthetic changes. I just pushed a small change there. I'm happy merging, but I do think we should wait on decision on build_url name.

@jameshadfield
Copy link
Member

I do think we should wait on decision on build_url name

Agreed. No huge hurry here as there are no JSONs which have it yet! 😉

I just pushed a small change there.

Great! We already request weight 500 fonts so no extra overhead here.

@trvrb trvrb merged commit 32b2688 into master Nov 26, 2019
@trvrb trvrb deleted the display-repo branch November 26, 2019 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants