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

Test code review: replace switch statements with object literals #4

Closed
txau opened this issue May 24, 2016 · 1 comment
Closed

Test code review: replace switch statements with object literals #4

txau opened this issue May 24, 2016 · 1 comment
Assignees
Labels

Comments

@txau
Copy link
Collaborator

txau commented May 24, 2016

@daneryl @konzz

Testing how we can use issues for code review. So far I'm not happy with the inline comments (blame). Github's interface for this sucks big time. Comments get lost, there is no way of tracking what conversations are active etc. The official suggestion is to use pull requests, which I think is a total overkill unless you are conducting a full code review.

Code style suggestion, replace switch statements with object literals: https://toddmotto.com/deprecating-the-switch-statement-for-object-literals.

https://github.com/huridocs/UwaziDocs/blob/9fcc2009263a36f4885b0e0bcc7bd70dfef2c973/app/react/Templates/components/FilterSuggestions.js

getTypeIcon(type) {
    let icon;
    switch (type) {
    case 'checkbox':
      icon = 'fa fa-check-square-o';
      break;
    case 'select':
      icon = 'fa fa-sort';
      break;
    case 'list':
      icon = 'fa fa-list';
      break;
    case 'date':
      icon = 'fa fa-calendar';
      break;
    default:
      icon = 'fa fa-font';
    }

    return icon;
  }
@txau txau assigned daneryl and konzz and unassigned daneryl May 24, 2016
@txau txau added the Sprint label Jun 3, 2016
@konzz konzz closed this as completed Jun 4, 2016
@konzz
Copy link
Member

konzz commented Jun 4, 2016

Fixed with #81

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

No branches or pull requests

3 participants