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

feat: show commit list #917

Merged
merged 3 commits into from
Apr 30, 2020
Merged

feat: show commit list #917

merged 3 commits into from
Apr 30, 2020

Conversation

lorenzo-cavazzi
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi commented Apr 24, 2020

Adds all the necessary logic to handle projects commits.

It includes a ProjectCoordinator component to handle storing project data to the global Redux store (#623). This created extra difficulties since we can't easily migrate all the ProjectModel logic at once. To simplify the temporary co-existence, I created a higher order function withProjectMapped to map project data from the global store to single components whenever needed.

The first commit closes #852 by adding a new "Commits" section in the project overview tab, while the second commit re-uses the CommitsView component in the merge request section.
The third commit injects all the commits-related logic in the environments components. We may want to clean up a little bit Notebooks.container.js when branches will be managed by ProjectCoordinator.

Preview: https://lorenzotest.dev.renku.ch
How to test: browse to any project, go to the new "Commits" section on the "Overview" page. Please check also the "Merge request" section and check a notebook in the "File" tab, starting also a new environment from there. This should cover all the relevant changes.

Screenshot_20200424_194059

@lorenzo-cavazzi lorenzo-cavazzi requested a review from a team as a code owner April 24, 2020 17:45
@rokroskar
Copy link
Member

Is there an issue/epic for this?

@lorenzo-cavazzi
Copy link
Member Author

@rokroskar yes, it's #852 . I accidentally wrote twice #623 in the issue description (fixed) but it was in the linked issues

Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

Looks great and works very well. And thanks for fixing the small spacing issues in the Merge Request text. 🎉

The list of commits gets truncated at 100. Could you add a link to the bottom of the list:

More than {maxNumberOfCommits}. To see the full project history, view in GitLab.

image

Copy link
Contributor

@vfried vfried left a comment

Choose a reason for hiding this comment

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

It looks really good!

I also have a small details i would change, could you remove the line on top of the beginning of commits?

Here it would be on top of April.... I think with pt-0 inside the card you can make it happen
image

I would also align the three buttons to the right on the header and add a tooltip to the commits count.

@lorenzo-cavazzi
Copy link
Member Author

lorenzo-cavazzi commented Apr 28, 2020

@ciyer good point! We may want to handle pagination better in the future, but in the meanwhile that message would make this limitation clear.
I added the info inside a <InfoAlert> Component, let me know if you prefer the plain text.

Here is a comparison (first is the current implementation). The final implementation has 100 instead of 10.

Screenshot_20200428_190617

Screenshot_20200428_190647

@lorenzo-cavazzi
Copy link
Member Author

@vfried thanks for the suggestions!

I think the current spacing on the top is in line with the other tabs (see Description and Stats). Furthermore, making the top padding 0 would make the top border look thicker (it's visible in your image).

Im not sure about moving the buttons to the right. I see that it would make the page more similar to the Cards in the Files tab, but it would be awkward to have the number and the refresh button far from the Commits text they qualify.

@ciyer
Copy link
Contributor

ciyer commented Apr 28, 2020

@ciyer good point! We may want to handle pagination better in the future, but in the meanwhile that message would make this limitation clear.
I added the info inside a <InfoAlert> Component, let me know if you prefer the plain text.

Here is a comparison (first is the current implementation). The final implementation has 100 instead of 10.

Screenshot_20200428_190617

Screenshot_20200428_190647

Nice! I prefer the second one, the plain text option. The InfoAlert looks a bit too aggressive to my eyes.

@lorenzo-cavazzi
Copy link
Member Author

@ciyer done
I updated https://lorenzotest.dev.renku.ch

@lorenzo-cavazzi lorenzo-cavazzi added this to the sprint-2020-03-27 milestone Apr 29, 2020
ciyer
ciyer previously approved these changes Apr 29, 2020
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

Looks great! Can't wait to have this feature on Renkulab. I pushed two small commits:

  • Fix a warning about duplicate React component keys
  • Add padding to the commit list in the merge request view so it looks the same as in the project commit view.

<SingleCommit
key={commit.id ? commit.id : commit.readableDate}
key={commit.id ? commit.id : `${i}-${commit.readableDate}`}
Copy link
Member Author

Choose a reason for hiding this comment

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

the same readableDate shouldn't appear twice. If that happens, it may be a bug in how the date is computed

Copy link
Member Author

Choose a reason for hiding this comment

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

Using committed_date instead of authored_date seems to be the right thing to do to avoid out of order dates. It's also in line with what GitLab shows

lorenzo-cavazzi added a commit that referenced this pull request Apr 29, 2020
Adds all the necessary logic to handle project's commits:
* Add a new tab in project overview to show commits
* Create ProjectCoordinator with basic metadata
* Create higher order function to easily map project data from global store to React components

fix #852
@lorenzo-cavazzi
Copy link
Member Author

  • Switched authored_date for committed_date to keep dates consistency with GitLab and avoid duplicates
  • Squashed commits and added a reference to the PR to keep the history clean

@lorenzo-cavazzi lorenzo-cavazzi requested a review from ciyer April 29, 2020 13:39
ciyer
ciyer previously approved these changes Apr 29, 2020
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

👍

@vfried
Copy link
Contributor

vfried commented Apr 30, 2020

Im not sure about moving the buttons to the right. I see that it would make the page more similar to the Cards in the Files tab, but it would be awkward to have the number and the refresh button far from the Commits text they qualify.

The new changes look really good, I agree with you with the buttons and the top padding thing is a small detail. I see inside stats is a similar thing so it's ok if you leave it as it is.

vfried
vfried previously approved these changes Apr 30, 2020
Adds all the necessary logic to handle project's commits:
* Add a new tab in project overview to show commits
* Create ProjectCoordinator with basic metadata
* Create higher order function to easily map project data from global store to React components

fix #852
@lorenzo-cavazzi
Copy link
Member Author

I had to rebase, could someone please re-approve?

@lorenzo-cavazzi lorenzo-cavazzi requested review from vfried and ciyer April 30, 2020 08:10
@lorenzo-cavazzi lorenzo-cavazzi merged commit e9ca00c into master Apr 30, 2020
@lorenzo-cavazzi lorenzo-cavazzi deleted the 852-commits branch April 30, 2020 08:31
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.

Show commit messages in renkulab
4 participants