Refactor and internationalize `IssueEventListItem`
See original GitHub issueThis 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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Code refactoring | IntelliJ IDEA Documentation - JetBrains
IntelliJ IDEA refactoring source code features description: change signature, copy, extract constant, extract variable, inline, move, pull, rename, ...
Read more >Refactoring source code in Visual Studio Code
Visual Studio Code supports refactoring operations (refactorings) such as Extract Method and Extract Variable to improve your code base from within your editor....
Read more >A Field Study of Refactoring Challenges and Benefits
This paper presents a field study of refactoring benefits and challenges at Microsoft through three complementary study methods: a survey, semi-structured ...
Read more >AWS Migration Hub Refactor Spaces is now integrated with ...
AWS Migration Hub Refactor Spaces automates the creation of application refactor environments so that customers do not need to build the AWS ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I actually have to do this while migrating the Issue Screen to GraphQL
@machour has this task been done now?