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

add review, approval info and linkify #831

Merged
merged 7 commits into from
Jan 29, 2019

Conversation

rebornix
Copy link
Member

@rebornix rebornix commented Jan 21, 2019

Add more timeline event info

Merge Event
image

Review Event Author Association
image

Linkify
image

image

@rebornix rebornix changed the title add review and approval info add review, approval info and linkify Jan 21, 2019
@kieferrm kieferrm mentioned this pull request Jan 21, 2019
20 tasks
createdAt: graphQLPullRequest.createdAt,
updatedAt: graphQLPullRequest.updatedAt,
head: {
label: graphQLPullRequest.headRef.name,
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible for headRef or baseRef to be undefined, if they've been deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

It can be null based on the schema, I'd love to use the generated typings with strict null checks ;)

labels: []
};
}

export function parseGraphQLTimelineEvents(events: any[]): TimelineEvent[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to replace this any with the types from graphql.ts

@@ -563,6 +608,9 @@ class ReviewNode {
userLogin.href = this._review.user.url;
userLogin.textContent = this._review.user.login;

const authorAssociation: HTMLSpanElement = document.createElement('span');
authorAssociation.textContent = `(${this._review.authorAssociation.toLocaleLowerCase()})`;
Copy link
Contributor

Choose a reason for hiding this comment

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

authorAssociation seems to be undefined when using the REST API. Also, when the authorAssociation is none, I think we shouldn't render it

}

export function convertRESTTimelineEvents(events: any[]): TimelineEvent[] {
export function convertRESTTimelineEvents(events: any[]): Common.TimelineEvent[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

if possible let's also replace any with a real type here, avatar_url isn't being converted to avatarUrl

@Tyriar
Copy link
Member

Tyriar commented Feb 6, 2019

Do you get the HTML directly from GitHub or do some conversions? Microsoft/vscode#xyz should also work

@rebornix
Copy link
Member Author

rebornix commented Feb 7, 2019

@Tyriar we didn't do anything more if it's from github.com

@RMacfarlane RMacfarlane deleted the rebornix/more-timelineevents-rendering branch February 16, 2019 00:25
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.

3 participants