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

Refactor and internationalize IssueEventListItem #795

Open
machour opened this issue Apr 26, 2018 · 6 comments
Open

Refactor and internationalize IssueEventListItem #795

machour opened this issue Apr 26, 2018 · 6 comments

Comments

@machour
Copy link
Member

machour commented Apr 26, 2018

This component could benefit from a refactoring similar to EventsScreen, where every event type would be handled by a dedicated method.

Instead of the big switch/case in render(), we could have something like this:

render() {
    const { repository, event } = this.props;
    const handler = camelCase(`handle_${event.event}`); // lodash's camelCase

    if (typeof this[handler] === 'function') {
      return this[handler](event, repository);
    }

    return null;
}

and implement handleReviewRequested(), handleLabeled(), etc.

We would then wrap strings with utils.t() to internationalize this component.

@machour
Copy link
Member Author

machour commented Apr 27, 2018

I actually have to do this while migrating the Issue Screen to GraphQL

@machour machour assigned machour and unassigned machour Apr 29, 2018
@arashcoder
Copy link

Is this issue unassigned? If so, I'd like to work on it.

@machour
Copy link
Member Author

machour commented Jun 9, 2018

Hi @arashcoder! This work have already been done in a PR I'm working on.

@chinesedfan
Copy link
Member

@machour Not a push. Just ping to check your PR status.

@machour
Copy link
Member Author

machour commented Dec 27, 2018

Hi,

The PR that included this won't be finished as comments pagination have been done separately.

Here's the event screen with my modifications: https://github.com/machour/git-point/blob/refactor/issues-and-pulls/src/auth/screens/events.screen.js

I'd have zero problems if someone copied into his/her own PR and submitted, I'll probably won't have the time any soon.

@bobbylemm
Copy link

@machour has this task been done now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants