diff --git a/src/locales/index.ts b/src/locales/index.ts index ff6197e0b..8a05351b7 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -1,3 +1,4 @@ +// tslint:disable const en = require('./en.json'); const mn = require('./mn.json'); diff --git a/src/modules/auth/routes.tsx b/src/modules/auth/routes.tsx index 573a7acea..34a4f0ab1 100755 --- a/src/modules/auth/routes.tsx +++ b/src/modules/auth/routes.tsx @@ -4,39 +4,29 @@ import { Route } from 'react-router-dom'; import { AuthLayout } from '../layout/components'; import { ForgotPassword, ResetPassword, SignIn } from './containers'; -const routes = () => ( - - { - return } />; - }} - /> +const routes = () => { + const home = () => } />; + const signIn = () => } />; + const forgotPassword = () => } />; - { - return } />; - }} - /> + const resetPassword = ({ location }) => { + const parsed = queryString.parse(location.search); + return ( + } /> + ); + }; - { - return } />; - }} - /> + return ( + + - { - const parsed = queryString.parse(location.search); - return ( - } /> - ); - }} - /> - -); + + + + + + + ); +}; export default routes; diff --git a/src/modules/common/components/Chooser.tsx b/src/modules/common/components/Chooser.tsx index a54b68cc7..c14f81786 100644 --- a/src/modules/common/components/Chooser.tsx +++ b/src/modules/common/components/Chooser.tsx @@ -46,7 +46,6 @@ class CommonChooser extends React.Component { }; this.onSelect = this.onSelect.bind(this); - this.handleChange = this.handleChange.bind(this); this.search = this.search.bind(this); this.loadMore = this.loadMore.bind(this); } @@ -105,7 +104,7 @@ class CommonChooser extends React.Component { } return ( -
  • this.handleChange(icon, data)}> +
  • {this.props.renderName(data)}
  • @@ -125,7 +124,7 @@ class CommonChooser extends React.Component { } render() { - const { renderForm, datas, title, data } = this.props; + const { renderForm, datas, title, data, closeModal } = this.props; const selectedDatas = this.state.datas; const addTrigger = ( @@ -141,7 +140,7 @@ class CommonChooser extends React.Component { this.search(e)} + onChange={this.search} />
      {datas.map(dataItem => this.renderRow(dataItem, 'add'))} @@ -177,11 +176,7 @@ class CommonChooser extends React.Component { content={renderForm} />
      - diff --git a/src/modules/common/components/FilterByParams.tsx b/src/modules/common/components/FilterByParams.tsx index 023923969..e1309a2dc 100644 --- a/src/modules/common/components/FilterByParams.tsx +++ b/src/modules/common/components/FilterByParams.tsx @@ -48,6 +48,12 @@ class FilterByParams extends React.Component { } } + onClick(paramKey: string, fieldId: string) { + const { history } = this.props; + + router.setParams(history, { [paramKey]: fieldId }); + } + renderItems() { const { history, fields, counts, paramKey, icon, searchable } = this.props; const { key } = this.state; @@ -75,9 +81,7 @@ class FilterByParams extends React.Component { ? 'active' : '' } - onClick={() => { - router.setParams(history, { [paramKey]: field._id }); - }} + onClick={this.onClick.bind(this, paramKey, field._id)} > {icon ? ( diff --git a/src/modules/common/components/ModifiableSelect.tsx b/src/modules/common/components/ModifiableSelect.tsx index 781f961e8..173f37ae8 100644 --- a/src/modules/common/components/ModifiableSelect.tsx +++ b/src/modules/common/components/ModifiableSelect.tsx @@ -5,7 +5,7 @@ import { __, Alert } from '../utils'; type OptionProps = { option: any; - onSelect: (option: any[], e: any) => void; + onSelect: (option: any[]) => void; }; class Option extends React.Component { @@ -19,11 +19,11 @@ class Option extends React.Component { }; return ( -
      onSelect(option, e)}> +
      {option.label} onRemove(option.value)} + onClick={onRemove(option.value)} icon="cancel-1" />
      @@ -80,7 +80,11 @@ class ModifiableSelect extends React.Component { return {selectedOption}; } - handleSave() { + handleSave(e) { + if (e.key !== 'Enter') { + return; + } + const { options, selectedOption } = this.state; const { onChange } = this.props; const value = (document.getElementById( @@ -157,11 +161,7 @@ class ModifiableSelect extends React.Component { { - if (e.key === 'Enter') { - this.handleSave(); - } - }} + onKeyPress={this.handleSave} />
      ); diff --git a/src/modules/common/components/Uploader.tsx b/src/modules/common/components/Uploader.tsx index f55788b5a..7241df117 100644 --- a/src/modules/common/components/Uploader.tsx +++ b/src/modules/common/components/Uploader.tsx @@ -95,7 +95,7 @@ class Uploader extends React.Component { alt="attachment" src="/images/attach.svg" style={attachmentPreviewStyle} - onClick={e => this.removeAttachment(e)} + onClick={this.removeAttachment} /> ))} {loading && } diff --git a/src/modules/common/components/editor/Editor.tsx b/src/modules/common/components/editor/Editor.tsx index 8256c8331..6839675d9 100755 --- a/src/modules/common/components/editor/Editor.tsx +++ b/src/modules/common/components/editor/Editor.tsx @@ -191,7 +191,9 @@ export class ErxesEditor extends React.Component { this.toggleInlineStyle = this.toggleInlineStyle.bind(this); } - focus() {} + focus() { + return; + } onTab(e) { const { onChange, editorState } = this.props; diff --git a/src/modules/common/components/filter/Filter.tsx b/src/modules/common/components/filter/Filter.tsx index 01f43c6b1..18161a4ef 100644 --- a/src/modules/common/components/filter/Filter.tsx +++ b/src/modules/common/components/filter/Filter.tsx @@ -28,7 +28,7 @@ function Filter({ queryParams = {}, history }: IProps) { } return ( - onClickClose([paramKey])}> + {bool ? paramKey : queryParams[paramKey]} ); @@ -53,7 +53,7 @@ function Filter({ queryParams = {}, history }: IProps) { const ChipText = createChipText(graphqlQuery, id); return ( - onClickClose([paramKey])}> + ); @@ -67,7 +67,7 @@ function Filter({ queryParams = {}, history }: IProps) { return ( onClickClose(['startDate', 'endDate'])} + onClickClose={onClickClose.bind(null, ['startDate', 'endDate'])} > {queryParams.startDate} - {queryParams.endDate} diff --git a/src/modules/common/components/filterableList/FilterableList.tsx b/src/modules/common/components/filterableList/FilterableList.tsx index 15631997d..cb3df9f67 100755 --- a/src/modules/common/components/filterableList/FilterableList.tsx +++ b/src/modules/common/components/filterableList/FilterableList.tsx @@ -88,9 +88,7 @@ class FilterableList extends React.Component {
    • { - this.toggleItem(item._id); - }} + onClick={this.toggleItem.bind(this, item._id)} > {item.iconClass ? ( { } } + setArea({ area }) { + this.area = area; + } + render() { const { maxHeight, ...props } = this.props; return (