Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
REFACTOR after linting #2 part
Browse files Browse the repository at this point in the history
  • Loading branch information
damianprzygodzki committed Feb 16, 2017
1 parent fc4f8d4 commit adb3057
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 36 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"parser": "babel-eslint",
"rules": {
"esline:recommended": 2,
"quotes": [2, "single"],
"jsx-quotes": [2, "prefer-double"],
"strict": [2, "never"],
Expand Down
13 changes: 9 additions & 4 deletions src/components/app/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class LoginForm extends Component {
<img src={logo} className="header-logo mt-2 mb-2" />
</div>
{roleSelect ? <div>
<div className={"form-control-label"}><small>Select role</small></div>
<div className="form-control-label"><small>Select role</small></div>
<RawList
rank="primary"
list={roles}
Expand All @@ -126,7 +126,7 @@ class LoginForm extends Component {
</div>
}
<div>
<div className={"form-control-label"}><small>Login</small></div>
<div className="form-control-label"><small>Login</small></div>
<input
type="text"
onChange={this.handleOnChange}
Expand All @@ -139,7 +139,7 @@ class LoginForm extends Component {
ref={c => this.login = c} />
</div>
<div>
<div className={"form-control-label"}><small>Password</small></div>
<div className="form-control-label"><small>Password</small></div>
<input
type="password"
onChange={this.handleOnChange}
Expand All @@ -156,7 +156,12 @@ class LoginForm extends Component {
</div>
}
<div className="mt-2">
<button className="btn btn-sm btn-block btn-meta-success" onClick={this.handleLogin}>{roleSelect? 'Send' : 'Login'}</button>
<button
className="btn btn-sm btn-block btn-meta-success"
onClick={this.handleLogin}
>
{roleSelect? 'Send' : 'Login'}
</button>
</div>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/Breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Breadcrumb extends Component {

return (<div key={index}>
{!!index && <span className="divider">/</span>}
<div className={"header-btn tooltip-parent"}>
<div className="header-btn tooltip-parent">
<div
title={!!index && menu.children.captionBreadcrumb ? menu.children.captionBreadcrumb : ''}
className={'header-item-container pointer ' +
Expand All @@ -53,7 +53,7 @@ class Breadcrumb extends Component {
onMouseEnter={!!index ? '' : (e) => this.toggleTooltip(true)}
onMouseLeave={(e) => this.toggleTooltip(false)}
>
<span className={"header-item icon-sm"}>
<span className="header-item icon-sm">
{!!index ? menu.children.captionBreadcrumb : <i className="meta-icon-menu" />}
</span>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ class Header extends Component {
{
prompt.open &&
<Prompt
title={"Delete"}
text={"Are you sure?"}
title="Delete"
text="Are you sure?"
buttons={{submit: 'Delete', cancel: 'Cancel'}}
onCancelClick={this.handlePromptCancelClick}
onSubmitClick={() => this.handlePromptSubmitClick(windowType, dataId)}
Expand Down Expand Up @@ -328,7 +328,7 @@ class Header extends Component {
onMouseEnter={(e) => this.toggleTooltip(keymap.GLOBAL_CONTEXT.OPEN_INBOX_MENU)}
onMouseLeave={(e) => this.toggleTooltip('')}
>
<span className={"header-item header-item-badge icon-lg"}>
<span className="header-item header-item-badge icon-lg">
<i className="meta-icon-notifications" />
{inbox.unreadCount > 0 && <span className="notification-number">{inbox.unreadCount}</span>}
</span>
Expand Down
6 changes: 3 additions & 3 deletions src/components/shortcuts/DocumentListContextShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class DocumentListContextShortcuts extends Component {
render() {
return (
<Shortcuts
name={"DOCUMENT_LIST_CONTEXT"}
name="DOCUMENT_LIST_CONTEXT"
handler = { this.handleShortcuts }
targetNodeSelector = { "body" }
targetNodeSelector="body"
isolate = { true }
preventDefault = { true }
stopPropagation = { true }
Expand All @@ -48,4 +48,4 @@ class DocumentListContextShortcuts extends Component {
}
}

export default DocumentListContextShortcuts;
export default DocumentListContextShortcuts;
4 changes: 2 additions & 2 deletions src/components/shortcuts/DocumentStatusContextShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class DocumentStatusContextShortcuts extends Component {
render() {
return (
<Shortcuts
name={"DOCUMENT_STATUS_CONTEXT"}
name="DOCUMENT_STATUS_CONTEXT"
handler = { this.handleShortcuts }
targetNodeSelector = { "body" }
targetNodeSelector = "body"
isolate = { true }
preventDefault = { true }
stopPropagation = { true }
Expand Down
4 changes: 2 additions & 2 deletions src/components/shortcuts/GlobalContextShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class GlobalContextShortcuts extends Component {
render() {
return (
<Shortcuts
name = { "GLOBAL_CONTEXT" }
name = "GLOBAL_CONTEXT"
handler = { this.handleShortcuts }
targetNodeSelector = { "body" }
targetNodeSelector = "body"
isolate = { true }
preventDefault = { true }
stopPropagation = { true }
Expand Down
4 changes: 2 additions & 2 deletions src/components/shortcuts/PaginationContextShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class PaginationContextShortcuts extends Component {
render() {
return (
<Shortcuts
name={"PAGINATION_CONTEXT"}
name="PAGINATION_CONTEXT"
handler = { this.handleShortcuts }
targetNodeSelector = { "body" }
targetNodeSelector = "body"
isolate = { true }
preventDefault = { true }
stopPropagation = { true }
Expand Down
6 changes: 3 additions & 3 deletions src/components/shortcuts/QuickActionsContextShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class DocumentListContextShortcuts extends Component {
render() {
return (
<Shortcuts
name={"QUICK_ACTIONS"}
name="QUICK_ACTIONS"
handler = { this.handleShortcuts }
targetNodeSelector = { "body" }
targetNodeSelector = "body"
isolate = { true }
preventDefault = { true }
stopPropagation = { true }
Expand All @@ -30,4 +30,4 @@ class DocumentListContextShortcuts extends Component {
}
}

export default DocumentListContextShortcuts;
export default DocumentListContextShortcuts;
4 changes: 2 additions & 2 deletions src/components/shortcuts/TableContextShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class TableContextShortcuts extends Component {
render() {
return (
<Shortcuts
name={"TABLE_CONTEXT"}
name="TABLE_CONTEXT"
handler = { this.handleShortcuts }
targetNodeSelector = { "body" }
targetNodeSelector = "body"
isolate = { true }
preventDefault = { true }
stopPropagation = { true }
Expand Down
4 changes: 2 additions & 2 deletions src/components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ class Table extends Component {
}
{promptOpen &&
<Prompt
title={"Delete"}
text={"Are you sure?"}
title="Delete"
text="Are you sure?"
buttons={{submit: 'Delete', cancel: 'Cancel'}}
onCancelClick={this.handlePromptCancelClick}
onSubmitClick={() => this.handlePromptSubmitClick(selected)}
Expand Down
3 changes: 1 addition & 2 deletions src/components/table/TableItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ class TableItem extends Component {
indentation.push(
<div
key={i}
className={"indent-item-mid "
}
className="indent-item-mid"
>
{i === indent.length - 1 && <div className="indent-mid"/>}
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/table/TablePagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class TablePagination extends Component {

{pagination}

<li className={"page-item "}>
<li className="page-item ">
<a className="page-link" onClick={() => {handleChangePage('up'); deselect()} }>
<span>&raquo;</span>
</a>
Expand Down
5 changes: 2 additions & 3 deletions src/components/tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Tabs extends Component {
return (
<div
key={'pane' + item.key}
className={"tab-pane active"}
className="tab-pane active"
>
{itemWithProps}
</div>
Expand All @@ -78,7 +78,6 @@ class Tabs extends Component {

render() {
const {children, tabIndex, fullScreen} = this.props;
// const {fullScreen} = this.state;
return (
<div className={
'mb-1 ' +
Expand All @@ -88,7 +87,7 @@ class Tabs extends Component {
{this.renderPills(children)}
</ul>
<div
className={"tab-content"}
className="tab-content"
tabIndex={tabIndex}
ref={c => this.tabContent = c}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/widget/RawWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class RawWidget extends Component {
onChange={(e) => this.handlePatch(widgetField, e.target.checked, id)}
tabIndex="-1"
/>
<div className={"input-checkbox-tick"}/>
<div className="input-checkbox-tick" />
</label>
)
case 'Switch':
Expand All @@ -483,7 +483,7 @@ class RawWidget extends Component {
tabIndex="-1"
onChange={(e) => this.handlePatch(widgetField, e.target.checked, id)}
/>
<div className={"input-slider"} />
<div className="input-slider" />
</label>
)
case 'Label':
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Dashboard extends Component {
const {breadcrumb} = this.props;
return (
<Container
siteName = {"Dashboard"}
siteName = "Dashboard"
noMargin = {true}
>
<div className="container-fluid dashboard-wrapper">
Expand Down
2 changes: 1 addition & 1 deletion src/containers/InboxAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class InboxAll extends Component {

return (
<Container
siteName = {"Inbox"}
siteName = "Inbox"
>
<Inbox
all={true}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/NavigationTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class NavigationTree extends Component {
return (
<Container
breadcrumb={breadcrumb.slice(0,1)}
siteName = {"Sitemap"}
siteName = "Sitemap"
>
{modal.visible &&
<Modal
Expand Down

0 comments on commit adb3057

Please sign in to comment.