Skip to content

feat: Issue Events #438

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

Merged
merged 32 commits into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1c6cee1
feat(issue_events): Show events on issues
brandly Oct 5, 2017
332ea33
style(issue_events): Added styles to "added label" event
brandly Oct 5, 2017
db7db99
style(issue_events): Add icon & improve styling of added labels
brandly Oct 6, 2017
20ea5dd
style(issue_events): Improve <ReviewRequested /> styles
brandly Oct 6, 2017
77fe340
feat(issue_events): Remove mentioned/subscribed events from UI
brandly Oct 6, 2017
ed535e4
feat(issue_events): Define <Closed /> events
brandly Oct 6, 2017
484b4e5
refactor(issue_events): Extract <EventIcon /> and <Date />
brandly Oct 6, 2017
cb772e1
feat(issue_events): Add `unlabled` prop to <Labeled />
brandly Oct 6, 2017
743d9ad
feat(issue_events): Define <Merged /> event
brandly Oct 6, 2017
174731d
feat(issue_events): Filter out `closed` events preceded by `merged`
brandly Oct 6, 2017
0f3d37c
feat(issue_events): Define <HeadRef /> events
brandly Oct 6, 2017
9321669
feat(issue_events): Define <Assigned /> events
brandly Oct 6, 2017
ab19588
feat(issue_events): Define <Reopened /> & <Renamed /> events
brandly Oct 6, 2017
b0321b6
refactor(issue_events): Render <Text /> from <ActorLink />
brandly Oct 6, 2017
63af0ba
style(issue_events): Trim issue names to ensure spacing
brandly Oct 6, 2017
4a38709
feat(issue_events): Define <Locked /> event
brandly Oct 6, 2017
27ba458
feat(issue_events): Define <Milestoned /> event
brandly Oct 6, 2017
0278d06
refactor(issue_events): Clean up authUser from LabeledComponent
brandly Oct 6, 2017
539a44c
feat(issue_events): Define <MarkedAsDuplicate /> event
brandly Oct 7, 2017
49f3324
refactor(issue_events): Define generic <Event /> component
brandly Oct 7, 2017
adad844
docs(readme): Add @brandly as a contributor
brandly Oct 7, 2017
c63ff80
feat(issue_events): Define <LabelGroup /> for list of label changes
brandly Oct 7, 2017
3221bcf
refactor(issue_events): Use spread operator for textChildren
brandly Oct 7, 2017
1d592ed
Merge branch 'master' into patch-1
andrewda Oct 7, 2017
652c104
style(issue_events): Add blank line after external imports
brandly Oct 7, 2017
e402d59
feat(issue_events): <InlineLabel /> has rounded corners
brandly Oct 8, 2017
192977f
refactor(issue_events): Move <InlineLabel /> into own file
brandly Oct 8, 2017
5f80edd
feat(issue_events): Press username in events to view profile
brandly Oct 8, 2017
ba61126
refactor(events): Inline most <Event />s into <IssueEventListItem />
brandly Oct 10, 2017
fb5a018
refactor(events): Eliminate <Date /> since its only used once
brandly Oct 10, 2017
0bb5415
refactor(events): Extract formatEventsToRender into event-helpers
brandly Oct 11, 2017
7322576
Merge branch 'master' into patch-1
Oct 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,15 @@
]
},
{
"login": "brandly",
"name": "Matthew Brandly",
"avatar_url": "https://avatars3.githubusercontent.com/u/820696?v=4",
Copy link
Member

Choose a reason for hiding this comment

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

🎉

"profile": "http://words.brandly.me/about/",
"contributions": [
"code"
]
},
{
"login": "Jpfonseca",
"name": "João Fonseca",
"avatar_url": "https://avatars2.githubusercontent.com/u/11836470?v=4",
Expand Down
11 changes: 11 additions & 0 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,14 @@ export const fetchNotificationsCount = accessToken =>

export const fetchRepoNotificationsCount = (owner, repoName, accessToken) =>
v3.count(`/repos/${owner}/${repoName}/notifications?per_page=1`, accessToken);

export const fetchIssueEvents = (
owner: string,
repoName: string,
issueNum: number,
accessToken: string
Copy link
Member

Choose a reason for hiding this comment

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

Types make function declaration clearer. But in other functions we never write them.

) =>
v3.getJson(
`/repos/${owner}/${repoName}/issues/${issueNum}/events`,
accessToken
);
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export * from './diff-blocks.component';
export * from './entity-info.component';
export * from './issue-description.component';
export * from './issue-list-item.component';
export * from './issue-event-list-item.component';
export * from './label-button.component';
export * from './inline-label.component';
export * from './label-list-item.component';
export * from './github-htmlview.component';
export * from './markdown-webview.component';
Expand Down
46 changes: 46 additions & 0 deletions src/components/inline-label.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React, { Component } from 'react';
import { StyleSheet, Text } from 'react-native';

import { normalize } from 'config';
import { getFontColorByBackground } from 'utils';

const styles = StyleSheet.create({
inlineLabel: {
fontSize: normalize(10),
fontWeight: 'bold',
padding: 3,
paddingLeft: 5,
paddingRight: 5,
margin: 2,
borderWidth: 1,
overflow: 'hidden',
borderRadius: 2,
minWidth: 50,
textAlign: 'center',
},
});

export class InlineLabel extends Component {
props: {
label: Object,
};

render() {
const { color, name } = this.props.label;

return (
<Text
style={[
styles.inlineLabel,
{
backgroundColor: `#${color}`,
color: getFontColorByBackground(color),
borderColor: `#${color}`,
},
]}
>
{name}
</Text>
);
}
}
Loading