Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"chai-assert-async",
"transform-object-rest-spread",
"transform-es2015-modules-commonjs",
"transform-decorators-legacy", // must come before class-properties
"transform-class-properties",
"transform-es2015-destructuring", // https://github.com/babel/babel/issues/4074
"transform-es2015-parameters", // same
],
"presets": [
"react",
Expand Down
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"root": true,
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true,
"experimentalDecorators": true,
}
},
"settings": {
Expand Down
5 changes: 2 additions & 3 deletions lib/atom-items/issueish-pane-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {Emitter} from 'event-kit';

import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {autobind} from 'core-decorators';

import {autobind} from '../helpers';
import IssueishPaneItemController from '../controllers/issueish-pane-item-controller';
import GithubLoginModel from '../models/github-login-model';

Expand All @@ -28,6 +28,7 @@ export default class IssueishPaneItem extends Component {

constructor(props) {
super(props);
autobind(this, 'switchToIssueish', 'handleTitleChanged');

this.emitter = new Emitter();
this.title = `${this.props.owner}/${this.props.repo}#${this.props.issueishNumber}`;
Expand Down Expand Up @@ -59,12 +60,10 @@ export default class IssueishPaneItem extends Component {
);
}

@autobind
switchToIssueish(owner, repo, issueishNumber) {
this.setState({owner, repo, issueishNumber});
}

@autobind
handleTitleChanged(title) {
if (this.title !== title) {
this.title = title;
Expand Down
5 changes: 2 additions & 3 deletions lib/atom/atom-text-editor.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import {autobind} from 'core-decorators';
import {CompositeDisposable} from 'event-kit';

import RefHolder from '../models/ref-holder';
import {autobind} from '../helpers';

const editorProps = {
autoIndent: PropTypes.bool,
Expand Down Expand Up @@ -52,6 +52,7 @@ export default class AtomTextEditor extends React.PureComponent {

constructor(props, context) {
super(props, context);
autobind(this, 'didChange', 'didChangeCursorPosition');

this.subs = new CompositeDisposable();
this.suppressChange = false;
Expand Down Expand Up @@ -108,7 +109,6 @@ export default class AtomTextEditor extends React.PureComponent {
}
}

@autobind
didChange() {
if (this.suppressChange) {
return;
Expand All @@ -117,7 +117,6 @@ export default class AtomTextEditor extends React.PureComponent {
this.props.didChange(this.getModel());
}

@autobind
didChangeCursorPosition() {
this.props.didChangeCursorPosition(this.getModel());
}
Expand Down
9 changes: 6 additions & 3 deletions lib/containers/issueish-pane-item-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import {graphql, createRefetchContainer} from 'react-relay';
import PropTypes from 'prop-types';
import cx from 'classnames';
import {autobind} from 'core-decorators';

import IssueTimelineContainer from './issue-timeline-container';
import PrTimelineContainer from './pr-timeline-container';
Expand All @@ -11,6 +10,7 @@ import Octicon from '../atom/octicon';
import IssueishBadge from '../views/issueish-badge';
import GithubDotcomMarkdown from '../views/github-dotcom-markdown';
import PeriodicRefresher from '../periodic-refresher';
import {autobind} from '../helpers';

const reactionTypeToEmoji = {
THUMBS_UP: '👍',
Expand Down Expand Up @@ -62,6 +62,11 @@ export class IssueishPaneItemView extends React.Component {
refreshing: false,
}

constructor(props) {
super(props);
autobind(this, 'handleRefreshClick', 'refresh');
}

componentDidMount() {
this.refresher = new PeriodicRefresher(IssueishPaneItemView, {
interval: () => 5 * 60 * 1000,
Expand Down Expand Up @@ -141,13 +146,11 @@ export class IssueishPaneItemView extends React.Component {
);
}

@autobind
handleRefreshClick(e) {
e.preventDefault();
this.refresher.refreshNow(true);
}

@autobind
refresh() {
if (this.state.refreshing) {
return;
Expand Down
18 changes: 9 additions & 9 deletions lib/containers/pr-info-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import React from 'react';
import {graphql, createRefetchContainer} from 'react-relay';
import PropTypes from 'prop-types';
import cx from 'classnames';
import {autobind} from 'core-decorators';
import tinycolor from 'tinycolor2';

import Octicon from '../atom/octicon';
import IssueishBadge from '../views/issueish-badge';
import PeriodicRefresher from '../periodic-refresher';
import tinycolor from 'tinycolor2';

import PrStatusesContainer from './pr-statuses-container';
import {autobind} from '../helpers';

const reactionTypeToEmoji = {
THUMBS_UP: '👍',
Expand Down Expand Up @@ -57,8 +56,13 @@ export class PrInfo extends React.Component {
}).isRequired,
}

state = {
refreshing: false,
constructor(props) {
super(props);
autobind(this, 'handleRefreshClick', 'refresh', 'handleClickPrLink', 'handleUnpinClick');

this.state = {
refreshing: false,
};
}

componentDidMount() {
Expand All @@ -75,13 +79,11 @@ export class PrInfo extends React.Component {
this.refresher.destroy();
}

@autobind
handleRefreshClick(e) {
e.preventDefault();
this.refresher.refreshNow(true);
}

@autobind
refresh() {
if (this.state.refreshing) {
return;
Expand Down Expand Up @@ -172,7 +174,6 @@ export class PrInfo extends React.Component {
);
}

@autobind
handleClickPrLink(event) {
event.nativeEvent.preventDefault();
event.nativeEvent.stopPropagation();
Expand All @@ -181,7 +182,6 @@ export class PrInfo extends React.Component {
atom.workspace.open(`atom-github://issueish/https%3A%2F%2Fapi.github.com/${repo.owner.login}/${repo.name}/${pr.number}`);
}

@autobind
handleUnpinClick(event) {
event.preventDefault();
this.props.onUnpinPr && this.props.onUnpinPr();
Expand Down
7 changes: 2 additions & 5 deletions lib/containers/pr-selection-by-branch-container.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import {graphql, createFragmentContainer} from 'react-relay';
import PropTypes from 'prop-types';
import {autobind} from 'core-decorators';

import PrInfoContainer from './pr-info-container';
import PrUrlInputBox from '../views/pr-url-input-box';
import Octicon from '../atom/octicon';
import {RemotePropType, BranchSetPropType} from '../prop-types';
import {autobind} from '../helpers';

export class PrSelectionByBranch extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -44,6 +44,7 @@ export class PrSelectionByBranch extends React.Component {

constructor(props, context) {
super(props, context);
autobind(this, 'renderPrItem', 'toggleInputBoxVisibility', 'setPr', 'selectPullRequest');
this.state = {displayInputBox: false};
}

Expand Down Expand Up @@ -222,7 +223,6 @@ export class PrSelectionByBranch extends React.Component {
);
}

@autobind
renderPrItem({node}) {
return (
<li key={node.id} onClick={e => this.selectPullRequest(e, node)}>
Expand All @@ -231,17 +231,14 @@ export class PrSelectionByBranch extends React.Component {
);
}

@autobind
toggleInputBoxVisibility() {
this.setState({displayInputBox: !this.state.displayInputBox});
}

@autobind
setPr(prLink) {
this.props.onSelectPr(prLink);
}

@autobind
selectPullRequest(event, node) {
event.preventDefault();
this.setPr(node.url);
Expand Down
9 changes: 6 additions & 3 deletions lib/containers/pr-statuses-container.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import {createRefetchContainer, graphql} from 'react-relay';
import PropTypes from 'prop-types';
import {autobind} from 'core-decorators';

import {toSentence} from '../helpers';
import {toSentence, autobind} from '../helpers';
import PrStatusContextContainer from './pr-status-context-container';
import Octicon from '../atom/octicon';
import DonutChart from '../views/donut-chart';
Expand Down Expand Up @@ -83,6 +82,11 @@ export class PrStatuses extends React.Component {
static PENDING_REFRESH_TIMEOUT = 30 * 1000
static MINIMUM_REFRESH_INTERVAL = 15 * 1000

constructor(props) {
super(props);
autobind(this, 'refresh');
}

componentDidMount() {
this.refresher = new PeriodicRefresher(PrStatuses, {
interval: () => {
Expand All @@ -103,7 +107,6 @@ export class PrStatuses extends React.Component {
this.refresher.destroy();
}

@autobind
refresh() {
this.props.relay.refetch({
id: this.props.pullRequest.id,
Expand Down
7 changes: 2 additions & 5 deletions lib/controllers/commit-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import path from 'path';
import React from 'react';
import ReactDom from 'react-dom';
import PropTypes from 'prop-types';
import {autobind} from 'core-decorators';
import {CompositeDisposable} from 'event-kit';
import fs from 'fs-extra';

import CommitView from '../views/commit-view';
import {AuthorPropType} from '../prop-types';
import {autobind} from '../helpers';

export const COMMIT_GRAMMAR_SCOPE = 'text.git-commit';

Expand Down Expand Up @@ -41,6 +41,7 @@ export default class CommitController extends React.Component {

constructor(props, context) {
super(props, context);
autobind(this, 'commit', 'handleMessageChange', 'toggleExpandedCommitMessageEditor', 'grammarAdded');

this.subscriptions = new CompositeDisposable();
this.refCommitView = null;
Expand Down Expand Up @@ -121,7 +122,6 @@ export default class CommitController extends React.Component {
this.subscriptions.dispose();
}

@autobind
commit(message, coAuthors = [], amend) {
let msg;
if (this.isCommitMessageEditorExpanded()) {
Expand Down Expand Up @@ -149,7 +149,6 @@ export default class CommitController extends React.Component {
return path.join(this.props.repository.getGitDirectoryPath(), 'ATOM_COMMIT_EDITMSG');
}

@autobind
handleMessageChange(newMessage) {
if (!this.props.repository.isPresent()) {
return;
Expand All @@ -164,7 +163,6 @@ export default class CommitController extends React.Component {
return this.props.workspace.getTextEditors().filter(editor => editor.getPath() === this.getCommitMessagePath());
}

@autobind
async toggleExpandedCommitMessageEditor(messageFromBox) {
if (this.isCommitMessageEditorExpanded()) {
if (this.commitMessageEditorIsInForeground()) {
Expand Down Expand Up @@ -226,7 +224,6 @@ export default class CommitController extends React.Component {
}
}

@autobind
grammarAdded(grammar) {
if (grammar.scopeName !== COMMIT_GRAMMAR_SCOPE) { return; }

Expand Down
4 changes: 2 additions & 2 deletions lib/controllers/conflict-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {remote} from 'electron';
const {Menu, MenuItem} = remote;

import {autobind} from 'core-decorators';
import {autobind} from '../helpers';
import {OURS, BASE, THEIRS} from '../models/conflicts/source';
import Decoration from '../atom/decoration';
import Octicon from '../atom/octicon';
Expand All @@ -23,6 +23,7 @@ export default class ConflictController extends React.Component {

constructor(props, context) {
super(props, context);
autobind(this, 'showResolveMenu');

this.state = {
chosenSide: this.props.conflict.getChosenSide(),
Expand All @@ -42,7 +43,6 @@ export default class ConflictController extends React.Component {
side.isBannerModified() && side.revertBanner();
}

@autobind
showResolveMenu(event) {
event.preventDefault();

Expand Down
6 changes: 2 additions & 4 deletions lib/controllers/editor-conflict-controller.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {CompositeDisposable} from 'event-kit';
import React from 'react';
import PropTypes from 'prop-types';
import {autobind} from 'core-decorators';
import compareSets from 'compare-sets';

import Commands, {Command} from '../atom/commands';
import Conflict from '../models/conflicts/conflict';
import ConflictController from './conflict-controller';
import {OURS, THEIRS, BASE} from '../models/conflicts/source';
import {autobind} from '../helpers';

/**
* Render a `ConflictController` for each conflict marker within an open TextEditor.
Expand All @@ -27,6 +27,7 @@ export default class EditorConflictController extends React.Component {

constructor(props, context) {
super(props, context);
autobind(this, 'resolveAsCurrent', 'revertConflictModifications', 'dismissCurrent');

// this.layer = props.editor.addMarkerLayer({
// maintainHistory: true,
Expand Down Expand Up @@ -147,7 +148,6 @@ export default class EditorConflictController extends React.Component {
};
}

@autobind
resolveAsCurrent() {
this.getCurrentConflicts().forEach(match => {
if (match.sides.size === 1) {
Expand All @@ -157,7 +157,6 @@ export default class EditorConflictController extends React.Component {
});
}

@autobind
revertConflictModifications() {
this.getCurrentConflicts().forEach(match => {
match.sides.forEach(side => {
Expand All @@ -167,7 +166,6 @@ export default class EditorConflictController extends React.Component {
});
}

@autobind
dismissCurrent() {
this.dismissConflicts(this.getCurrentConflicts().map(match => match.conflict));
}
Expand Down
Loading