Skip to content

Instantly share code, notes, and snippets.

View teimurjan's full-sized avatar
:electron:

Teimur Gasanov teimurjan

:electron:
View GitHub Profile

Если нет props, то объявлять propTypes не нужно

static propTypes = {};

Вынести в методы класса, иначе будут создаваться новые функции при каждом вызове render

searchField: props => <SearchField {...props} placeholder={this.props.intl('search')}/>
function priceFormatter(cell, row){
  return '<i class="glyphicon glyphicon-usd"></i> ' + cell;
}
@teimurjan
teimurjan / sametrica-code-review-19-10-2017.md
Last active October 19, 2017 04:58
Test Seeders Builders, Zhyldyz Alikeeva
  • All builders should be independent and reusable.
  • No titles should be used for creating foreign key/m-2-m relations, only objects.
  • Create common functions for creating complex structures(form with page and section, question with option etc.)
@teimurjan
teimurjan / sametrica-code-review-03-10-2017.md
Last active October 3, 2017 04:57
Form Edit, Teimur Gasanov

Form Edit

  • Exract EditTab to a container in order to not sending props from the parent.
  • Make components stateless
  • Refactor tabs
  • Extract spinner to a wrapper
  • Make files/variables names more clear
  • Extract language to the FornEdit global state

Edit tab

  • Remove unnecessary handlers
  • Extract switch to a factory
@teimurjan
teimurjan / sametrica-code-review-28-09-2017.md
Last active September 28, 2017 05:01
FeatureContext.php file, Igor Lee

FeatureContext.php

Feature name to seed name map

Extract as Trait or Factory in a separate file.

Translations map

In order to minify errors after changing texts on frontend we should get translations directly from the frontend's en.json, fr.json files. It can be achieved by reading these files from a FeatureContext.php file method like getTranslationWithCode(locale).

Simplify FeatureContext.php

Make FeatureContext.php contains just features methods like "Before", "BeforeStep" etc. So the steps methods like "I click", "I see" should be added as traits. These traits can be separated to groups: Base("I click", "I see"), Group("I publish", "I assign"), Specific("I see something in specific modal")

Do some "Given" steps programmaticaly