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

[Code] Commit component rework #46097

Merged
merged 18 commits into from
Sep 30, 2019
Merged

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Sep 19, 2019

Summary

This is the first chunk of work for the Commit Search feature (elastic/code#1587, elastic/code#1230); I'm at a good stopping point and I wanted to open this up for feedback.

What it does

  • Moves commit-related components into a commits folder
  • Breaks commit-related components into separate files
  • Refactors the existing Commit component to use more EUI components and less custom CSS
  • Updates the Commit component according to the new designs

Kibana

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

There were already >5 components in this file; this splits them into
smaller, distinct components/files and an index.
Rather than keeping them inline.
This is embedded within the Commit component, for now.

Obviates CommitLink for now, but we'll address that in the PR.
* Parses and displays the commit title/description
* Parses and displays the author and date
* Adds new translations
@rylnd rylnd added v8.0.0 Team:Code release_note:skip Skip the PR/issue when compiling release notes v7.5.0 labels Sep 19, 2019
@rylnd rylnd requested a review from a team as a code owner September 19, 2019 00:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/code

Copy link
Contributor Author

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Adding comments/questions for reviewers to respond to.

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@mw-ding mw-ding left a comment

Choose a reason for hiding this comment

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

Mostly are good. 2 comments here regarding the links

  • For the org/repo link, I don't think it's necessary for the commit message item in the source view page, because they are already in the repo. You can add it later when implementing the commit history page. This is the helper function to parse out the org and name from repoUri
  • The above comment might also be true for the commit sha links on the right. We may want to disable the link but just show as text in the source view page.

What do you think? @rylnd @daveyholler

@mw-ding
Copy link
Contributor

mw-ding commented Sep 19, 2019

For i18n items, we don't need to deal with those json files any more, the kibana UI team will handle that.

@rylnd
Copy link
Contributor Author

rylnd commented Sep 24, 2019

  • The above comment might also be true for the commit sha links on the right. We may want to disable the link but just show as text in the source view page.

@mw-ding in my mind, clicking on the sha will bring you to that commit's page, with all the file changes involved. While it doesn't currently do that, (and instead takes you to the history view rooted at that commit, right?) I can see that being useful behavior regardless of which page you're on. Or are you thinking that the route shift as it currently stands is too subtle?

@mw-ding
Copy link
Contributor

mw-ding commented Sep 24, 2019

  • The above comment might also be true for the commit sha links on the right. We may want to disable the link but just show as text in the source view page.

@mw-ding in my mind, clicking on the sha will bring you to that commit's page, with all the file changes involved. While it doesn't currently do that, (and instead takes you to the history view rooted at that commit, right?) I can see that being useful behavior regardless of which page you're on. Or are you thinking that the route shift as it currently stands is too subtle?

Oh, I am not referring to the View All button, but the hash commit on each commit message item on the source view page.

this one:
image

What I am saying here is should we consider providing an option in the component to only show commit hash as pure text for the sake of source view page.

Copy link
Contributor

@mw-ding mw-ding left a comment

Choose a reason for hiding this comment

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

LGTM overall. I don't want the last minute discussion to block the progress, particularly having the follow up commit search page.

@elasticmachine
Copy link
Contributor

💔 Build Failed

I was reading the wrong field in figma. Whoops!
If we're already viewing the commit in the context of the repo, the link
here isn't as helpful. For our first use, the commit history, that is
the case.
We should build a helper for this, but these are strewn about the
codebase.
}

const copyLabel = i18n.translate('xpack.code.commits.copyCommitAriaLabel', {
defaultMessage: 'Copy the full commit ID',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mw-ding one more question: who writes/reviews this copy?

Copy link
Contributor

@mw-ding mw-ding Sep 25, 2019

Choose a reason for hiding this comment

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

Do you mean the default English version here or the japanese and chinese ones? The first one should be ourselves. The latter ones my understanding is the kibana ui team will handle this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was referring to the default english. I saw the guidelines and nothing looked out of line, but I wasn't sure if there was more process involved and wanted to call it out.

Copy link
Contributor

Choose a reason for hiding this comment

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

mengwei is right, we need to be responsible for the English version.

also, in Code team, we do Chinese translation (at least for the first round) by ourselves

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@rylnd
Copy link
Contributor Author

rylnd commented Sep 26, 2019

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

Uses Date.UTC to get a non-relative date/time.
@elasticmachine
Copy link
Contributor

💔 Build Failed

@rylnd
Copy link
Contributor Author

rylnd commented Sep 26, 2019

retest

@rylnd
Copy link
Contributor Author

rylnd commented Sep 26, 2019

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@mw-ding
Copy link
Contributor

mw-ding commented Sep 26, 2019

@daveyholler can you help to take a look at this one?

@daveyholler
Copy link
Contributor

@mw-ding @rylnd Looking now

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@rylnd rylnd merged commit c6c1d8e into elastic:master Sep 30, 2019
@rylnd rylnd deleted the search-commit-history branch September 30, 2019 15:37
rylnd added a commit to rylnd/kibana that referenced this pull request Sep 30, 2019
* Remove unnecessary whitespace

* Split CommitHistory into multiple files

There were already >5 components in this file; this splits them into
smaller, distinct components/files and an index.

* Extract props to interfaces

Rather than keeping them inline.

* Add basic implementation of new commit actions

This is embedded within the Commit component, for now.

Obviates CommitLink for now, but we'll address that in the PR.

* Update the remainder of the Commit layout

* Parses and displays the commit title/description
* Parses and displays the author and date
* Adds new translations

* Update translation keys to match naming standards

See
https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/GUIDELINE.md
for details.

* Extract commit message parsing to helper util

* Move CommitLink to commit folder

* Fix font-sizes of commit text

I was reading the wrong field in figma. Whoops!

* Add RepoLink component controlled by a boolean

If we're already viewing the commit in the context of the repo, the link
here isn't as helpful. For our first use, the commit history, that is
the case.

* Simpler construction of app paths

We should build a helper for this, but these are strewn about the
codebase.

* Update snapshots following text size changes

* Truncate summary text

* Fix type error on test component

* Make date-dependent test timezone-agnostic

Uses Date.UTC to get a non-relative date/time.
rylnd added a commit that referenced this pull request Sep 30, 2019
* Remove unnecessary whitespace

* Split CommitHistory into multiple files

There were already >5 components in this file; this splits them into
smaller, distinct components/files and an index.

* Extract props to interfaces

Rather than keeping them inline.

* Add basic implementation of new commit actions

This is embedded within the Commit component, for now.

Obviates CommitLink for now, but we'll address that in the PR.

* Update the remainder of the Commit layout

* Parses and displays the commit title/description
* Parses and displays the author and date
* Adds new translations

* Update translation keys to match naming standards

See
https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/GUIDELINE.md
for details.

* Extract commit message parsing to helper util

* Move CommitLink to commit folder

* Fix font-sizes of commit text

I was reading the wrong field in figma. Whoops!

* Add RepoLink component controlled by a boolean

If we're already viewing the commit in the context of the repo, the link
here isn't as helpful. For our first use, the commit history, that is
the case.

* Simpler construction of app paths

We should build a helper for this, but these are strewn about the
codebase.

* Update snapshots following text size changes

* Truncate summary text

* Fix type error on test component

* Make date-dependent test timezone-agnostic

Uses Date.UTC to get a non-relative date/time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants