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(commit): view commits #258
Conversation
b3afdab
to
6d5b82a
Compare
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.
Wow this is great! Just a super minor change from my first pass through.
containerStyle={styles.listItemContainer} | ||
title={commit.message} | ||
titleNumberOfLines={1} | ||
subtitle={commit.sha.substring(0, 7) + ' - ' + commit.author.name || ''} // eslint-disable-line prefer-template |
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.
Probably may as well use a template here if we have to disable the eslint rule anyways.
This is coming together nicelyyyy, can't wait to have it included 😍 |
6d5b82a
to
a7dec31
Compare
const { navigation, getCommitDetailsByDispatch } = this.props; | ||
const commit = navigation.state.params.commit; | ||
|
||
getCommitDetailsByDispatch(commit); |
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.
@housseindjirdeh @andrewda I call this getCommitDetailsByDispatch
function in the componentDidMount()
. But I have the feeling that the isPendingCommit
and isPendingDiff
are not to false when the render()
function is called.... (And I get an error when I try to render the diff).
Do you know why this happen? I'm stuck since few hours :(
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.
Hmmm so looking through what you have it seems like your actions are changing isPendingCommit
and isPendingDiff
from true --> false and vice-versa just fine. Have you used logging (redux-logger or reactotron) to make sure the actions were being fired correctly? Also what error message are you seeing?
Will be happy to pull this down tomorrow and see if I can reproduce what you're experiencing 🙌
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.
I'm using reactotron, and the action isn't fired....
The error message is:
undefined
is not an object (evaluatingcommit.commit.message
) - commit.screen.js:124
If you try today, you have to find a push event in the EventScreen and tap on master
.
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.
Just found a problem, I have:
props: {
navigation: Object,
commit: Object,
diff: string,
isPendingCommit: boolean,
isPendingDiff: boolean,
getCommitDetailsByDispatch: Function,
language: string,
};
The diff
props is affected as {} instead of '' (empty string)!
It's linked to state.repository.diff
(in the mapStateToProps
function) which is, initially, an empty string.
My question is now: Why this diff
props isn't an empty string at the initialization of my screen?
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.
So sorry for not getting on this sooner to help you with debugging 😞 Will make sure to do it within this week, apologies again mate!
import { ListItem } from 'react-native-elements'; | ||
import { colors, fonts } from 'config'; | ||
|
||
type Props = { |
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.
I think this should not go here since we're not using @flow
. Thoughts @Antoine38660 @housseindjirdeh ?
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.
Nope quite a few components are using flow types :) I think it's definitely nice to have and hopefully we can increase type coverage throughout the app.
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.
But, we don't have @flow
on top...so flow should not be checking anything. Or am I just missing something here?
|
||
export const CommitListItem = ({ commit, navigation }: Props) => | ||
<TouchableHighlight | ||
onPress={() => |
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.
Can you please move this arrow function out of this prop? Maybe you can create a function outside of the component and call it here instead.
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.
Nice I'm fine either way honestly, but I do see the benefit of having methods separate 👍
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.
Having an arrow function inside a prop may become a perf issue.
src/repository/repository.action.js
Outdated
|
||
export const getCommitDetails = commit => { | ||
// eslint-disable-next-line no-unused-vars | ||
return (dispatch, getState) => { |
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.
You can omit getState
here.
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.
Thanks @alejandronanez for your review 😃
@Antoine38660 I tried to look, there is an error when clicking on the branch in the event push event: |
@lex111 I just tried with your last commit on gitpoint: Do you remember on which commit you clicked? Maybe it's a non-tested commit content 😄 |
@Antoine38660 I now tried to open commits for two events and I got the same error. And if you open push events not for the GitPoint repository, can this be the case? |
Atm my events list is flooded by GitPoint events 😅 Thanks for reporting this error. Did you tried to view a commits list from a Repo view? |
* 2 new routes and screens => CommitList and Commit (WIP) * PushEvent are clickable in the EventScreen
* Commit Screen * Commit diff is now retrieved`and displayed
No more // eslint-disable-next-line no-unused-vars
bbd74ce
to
3c48cad
Compare
@Antoine38660 I looked at the new changes, commits from the feed screen are opened. If more than one commit was pushed, will the last commit be displayed? Can make mapping commits, like on GitHub? |
<View style={styles.header}> | ||
<Text> | ||
{translate('repository.commit.byConnector', language, { | ||
contributor: committer, |
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.
Can we make a clickable committer? To open a profile.
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.
Good idea! I add it to the checklist 😃👍
@lex111 If there are more than one commit pushed, you'll be redirected to a "commit list screen" instead of "Commit screen". |
Strange then, I have opened the last commit. |
@lex111 you were right, I was doing a bad condition : https://github.com/Antoine38660/git-point/blob/feature/commits/src/auth/screens/events.screen.js#L471 (It was I fixed that in my last commit. |
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.
Just wanted to check in and see if you wanted to get this in as part of the next release? @Antoine38660 If not, no worries at all!
Noticed that I don't see commits list item in the repository screen:
Forgive me if this is something that's still being worked on however 🙌
ActivityIndicator, | ||
TouchableHighlight, | ||
} from 'react-native'; | ||
import { ListItem, Button } from 'react-native-elements'; |
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.
I'm sorry, I was fixing merge conflicts here and included this Button
as part of the conflict fix. Shouldn't be here since we're leveraging @machour's <Button
component. My apologies 😞
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.
Np mate, thanks for the conflict fix 😄
Looks like some "merge from master" broke my code. I'll update it with a correct rebase, then the commit list item should reappear ! Edit: I really want to merge this one, but recent changes broke some parts of this branch.. Moreover I think it'll not be ready for monday 😞 |
@Antoine38660 No worries. Apologies are partially my fault, I should have helped you get this off the ground sooner. But not a problem, we'll be doing more frequent releases after Monday so this shouldn't be out soon after :) |
I hope I fixed all the issues introduced by some refactor of our code during last weeks :) Can you test and let me know your point of view about this feature (and design)?! |
|
Friendly ping @Antoine38660, just wanted to see if you were stuck or anything at all we can do to help <3 |
I would like finish once and for all this PR! But I'm facing a lack of time at the moment because of my school courses and school project... I'll be on holidays at the beginning of November so I'll kill this one! 😃 Thanks @lex111 for your comment and bugs you found ❤️ ❤️ |
@Antoine38660 not at all! I only asked because I was worried if you were just stuck on something. Please take as long as you need my friend. Please don't let this take up your holiday time too :O Holidays are for relaxation time 🌴 Please don't feel rushed to get on this at anytime 🙏 |
One more friendly ping @Antoine38660. Do you think you've added most of the final functionality in your recent commits? If so, I can pull this down, finish off what's left and have this merged in :) |
@Antoine38660 if it's okay with you, I propose we close this PR as a lot of internals changed since it was opened. We will scavenge the UI bits from this PR. |
Yes @machour it's ok and it isn't a problem for me. |
@Antoine38660 no worries at all dude! Hope you'll find some time during your next summer vacations, there's still sooo much to do 😄 Closing this PR. |
* feat(commits): migrate #258 changes * feat(commits): fix i18n * fix(issue): fix issue description styles * feat(commit): Show author and committer, both clickable * chore(i18n): update translation files
Fix #5