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

JENKINS-40877 PR link on run details. #894

Merged
merged 6 commits into from
Mar 20, 2017

Conversation

imeredith
Copy link
Collaborator

@imeredith imeredith commented Mar 9, 2017

Description

Having real issues lining up the icon.

See JENKINS-40877.

Currnenly it looks like. the following because of the vertical-align, but without the vertical-align its too high. And I cant figure out how to move it either way.

screen shot 2017-03-09 at 3 02 21 pm

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.
  • Ran Acceptance Test Harness against PR changes.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

@kzantow
Copy link
Collaborator

kzantow commented Mar 9, 2017

@imeredith you should be able to use margin with vertical-align: middle and a specific line-height to get it positioned nicely

<span>
<Link to={ branchUrl }>{ displayName }</Link>
{ run.pullRequest && run.pullRequest.url &&
<a title="Display the log in new window" target="_blank" href={run.pullRequest.url}>
Copy link
Member

Choose a reason for hiding this comment

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

"Display the log"??? copy paste error?

Also, can the .url be null? What is it in the case of general SCMs like git vs github?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah hadnt actually reviewed because I was having css issues and wnated help.

And yes the url can be null. Specifically if you have PR from an old version of github-branch-source it will be null

@brody
Copy link

brody commented Mar 9, 2017

If we could fix the layout of the results part of the header, it would allow more room.. but to address the overflow, I'd go with an ellipsis before the eject to Github link icon

image

@michaelneale
Copy link
Member

@brody in terms of fix - do you mean that the timing info shoud bump to the right 1 column leaving even more space? or is it already moved in your screen shot?

The time values are not likely to be very big (I think they have the compact form now) so there is room to move them along if it didn't look bad.

@brody
Copy link

brody commented Mar 10, 2017

@michaelneale in short, yes. Branch/Commit takes up 1/4 of the width of the container, the times 1/4 of the width & the info on the right 1/2 the width. Branch will often be master which will make it perfectly balanced but will also look misweighted when theres a long branch name.

This definitely needs to be addressed down the line but the current header doesn't give us much flexibility in terms for working for both short and long branch names.

@michaelneale
Copy link
Member

@brody ok - so you don't want to move the times along one to make it 1/6th? just to be clear, but just allow 1/4 for branch/commit ? Is this how it is now?

@i386
Copy link
Contributor

i386 commented Mar 13, 2017

@brody if you want to see this addressed soon please raise a ticket.

@scherler
Copy link
Collaborator

@brody
Copy link

brody commented Mar 13, 2017

@michaelneale I'd be happy to move it along, so the columns are then 4-2-6, which would allow alooott more room than there is currently. My design was 3-3-6 but the implementation didn't quite stick to that.

@imeredith
Copy link
Collaborator Author

Spent to long on this, will get someone else to take a look. What needs doing is making the icon not disappear when the text ellipsis. And I still cant get the icon to center how i want.

@cliffmeyers
Copy link
Contributor

@imeredith I can probably take a look at this one and nail it down once I land #895.

@@ -53,15 +53,16 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

align-items: center;
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't have any effect unless you apply display: flex (or inline-flex)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I dno't really know the implications of doing that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

With the following markup:

 branchSlug = (<span className="killSpace">
 +                { displayName }
 +                <a href={this.pager.branch.branch.url} target="_blank">
 +                    <Icon { ...{ style, size: 16, icon: 'launch' } } />
 +                </a>
 +            </span>);

The following css should center that icon. As @cliffmeyers said you need some flex in your life ;)

+.RunDetailsHeader-sources span.killSpace {
 +    display: flex;
 +    align-items: center;
 +    a svg {
 +        margin-left: 8px;
 +    }
 +}

@michaelneale
Copy link
Member

functionally this looks 💯 - hopefully @cliffmeyers can shed some light on the positioning/alignment challenges and we can merge this in.

Nice one @imeredith !

@cliffmeyers
Copy link
Contributor

@imeredith The vertical alignment should now be fixed. It wasn't a problem with the alignment rules, the icon was getting 3px of extra vertical space because svg elements are inline by default, and when you wrap inline elements in anchors they always get that extra little bit of fiddly space. I also removed the align-items property because it won't apply to elements that lack the display: flex|inline-flex property.

before:
run-details-pr-link-1-misaligned

after:
run-details-pr-link-2-centered

@cliffmeyers
Copy link
Contributor

@imeredith I'm not sure if there was also an issue with some text truncation... if so, just lmk and I'll take a look at that too.

BTW, can you answer for me what kind of project I need to configure to get PR's to show up in the list? I debugged this just by dropping into the debugging and forcibly adding a pullRequest: { url: "..." } object to the run but it'd be helpful to test with real data.

@i386
Copy link
Contributor

i386 commented Mar 16, 2017

@cliffmeyers if you add https://github.com/i386/app-store-demo directly in classic you will get PRs

@michaelneale
Copy link
Member

OK @imeredith update this to master to get ATH to pass (artifact test change) - then I think this is 🐝

@michaelneale
Copy link
Member

🐝

@imeredith imeredith merged commit 7727363 into master Mar 20, 2017
@imeredith imeredith deleted the JENKINS-40877_display_github_link branch March 20, 2017 00:37
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.

7 participants