-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
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
Pinging @elastic/code |
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.
Adding comments/questions for reviewers to respond to.
x-pack/legacy/plugins/code/public/components/commits/commit.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/code/public/components/commits/commit.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/code/public/components/commits/commit.tsx
Outdated
Show resolved
Hide resolved
💔 Build Failed |
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.
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 theorg
andname
fromrepoUri
- 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
x-pack/legacy/plugins/code/public/components/commits/commit.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/code/public/components/commits/commit.tsx
Outdated
Show resolved
Hide resolved
For i18n items, we don't need to deal with those json files any more, the kibana UI team will handle that. |
@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 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. |
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.
LGTM overall. I don't want the last minute discussion to block the progress, particularly having the follow up commit search page.
💔 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', |
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.
@mw-ding one more question: who writes/reviews this copy?
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.
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.
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, 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.
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.
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
💔 Build Failed |
💔 Build Failed |
retest |
💔 Build Failed |
Uses Date.UTC to get a non-relative date/time.
💔 Build Failed |
retest |
@elasticmachine merge upstream |
💚 Build Succeeded |
@daveyholler can you help to take a look at this one? |
💚 Build Succeeded |
💚 Build Succeeded |
* 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.
* 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.
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
commits
folderCommit
component to use more EUI components and less custom CSSCommit
component according to the new designsChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers