Skip to content

Commit 1ad5547

Browse files
committed
Rename "reportMutationErrors" to "reportRelayError" globally 🙈
1 parent 1f5c9e7 commit 1ad5547

20 files changed

+73
-73
lines changed

Diff for: lib/containers/issueish-detail-container.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default class IssueishDetailContainer extends React.Component {
4848
switchToIssueish: PropTypes.func.isRequired,
4949
onTitleChange: PropTypes.func.isRequired,
5050
destroy: PropTypes.func.isRequired,
51-
reportMutationErrors: PropTypes.func.isRequired,
51+
reportRelayError: PropTypes.func.isRequired,
5252

5353
// Item context
5454
itemType: ItemTypePropType.isRequired,
@@ -258,7 +258,7 @@ export default class IssueishDetailContainer extends React.Component {
258258
onTabSelected={this.props.onTabSelected}
259259
onOpenFilesTab={this.props.onOpenFilesTab}
260260
endpoint={this.props.endpoint}
261-
reportMutationErrors={this.props.reportMutationErrors}
261+
reportRelayError={this.props.reportRelayError}
262262

263263
workspace={this.props.workspace}
264264
commands={this.props.commands}

Diff for: lib/containers/reviews-container.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class ReviewsContainer extends React.Component {
4242
tooltips: PropTypes.object.isRequired,
4343

4444
// Action methods
45-
reportMutationErrors: PropTypes.func.isRequired,
45+
reportRelayError: PropTypes.func.isRequired,
4646
}
4747

4848
render() {

Diff for: lib/controllers/emoji-reactions-controller.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class BareEmojiReactionsController extends React.Component {
1919
tooltips: PropTypes.object.isRequired,
2020

2121
// Action methods
22-
reportMutationErrors: PropTypes.func.isRequired,
22+
reportRelayError: PropTypes.func.isRequired,
2323
}
2424

2525
render() {
@@ -36,15 +36,15 @@ export class BareEmojiReactionsController extends React.Component {
3636
try {
3737
await addReactionMutation(this.props.relay.environment, this.props.reactable.id, content);
3838
} catch (err) {
39-
this.props.reportMutationErrors('Unable to add reaction emoji', err);
39+
this.props.reportRelayError('Unable to add reaction emoji', err);
4040
}
4141
};
4242

4343
removeReaction = async content => {
4444
try {
4545
await removeReactionMutation(this.props.relay.environment, this.props.reactable.id, content);
4646
} catch (err) {
47-
this.props.reportMutationErrors('Unable to remove reaction emoji', err);
47+
this.props.reportRelayError('Unable to remove reaction emoji', err);
4848
}
4949
};
5050
}

Diff for: lib/controllers/issueish-detail-controller.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class BareIssueishDetailController extends React.Component {
6161
onTitleChange: PropTypes.func.isRequired,
6262
switchToIssueish: PropTypes.func.isRequired,
6363
destroy: PropTypes.func.isRequired,
64-
reportMutationErrors: PropTypes.func.isRequired,
64+
reportRelayError: PropTypes.func.isRequired,
6565

6666
// Item context
6767
itemType: ItemTypePropType.isRequired,
@@ -147,7 +147,7 @@ export class BareIssueishDetailController extends React.Component {
147147
openReviews={this.openReviews}
148148
switchToIssueish={this.props.switchToIssueish}
149149
destroy={this.props.destroy}
150-
reportMutationErrors={this.props.reportMutationErrors}
150+
reportRelayError={this.props.reportRelayError}
151151

152152
itemType={this.props.itemType}
153153
refEditor={this.props.refEditor}
@@ -170,7 +170,7 @@ export class BareIssueishDetailController extends React.Component {
170170
issue={repository.issue}
171171
switchToIssueish={this.props.switchToIssueish}
172172
tooltips={this.props.tooltips}
173-
reportMutationErrors={this.props.reportMutationErrors}
173+
reportRelayError={this.props.reportRelayError}
174174
/>
175175
);
176176
}

Diff for: lib/controllers/reviews-controller.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class BareReviewsController extends React.Component {
6666
tooltips: PropTypes.object.isRequired,
6767

6868
// Action methods
69-
reportMutationErrors: PropTypes.func.isRequired,
69+
reportRelayError: PropTypes.func.isRequired,
7070
}
7171

7272
constructor(props) {
@@ -262,7 +262,7 @@ export class BareReviewsController extends React.Component {
262262
addEvent('resolve-comment-thread', {package: 'github'});
263263
} catch (err) {
264264
this.showThreadID(thread.id);
265-
this.props.reportMutationErrors('Unable to resolve the comment thread', err);
265+
this.props.reportRelayError('Unable to resolve the comment thread', err);
266266
}
267267
}
268268
}
@@ -278,7 +278,7 @@ export class BareReviewsController extends React.Component {
278278
this.highlightThread(thread.id);
279279
addEvent('unresolve-comment-thread', {package: 'github'});
280280
} catch (err) {
281-
this.props.reportMutationErrors('Unable to unresolve the comment thread', err);
281+
this.props.reportRelayError('Unable to unresolve the comment thread', err);
282282
}
283283
}
284284
}
@@ -337,7 +337,7 @@ export class BareReviewsController extends React.Component {
337337
}
338338
}
339339

340-
this.props.reportMutationErrors('Unable to submit your comment', error);
340+
this.props.reportRelayError('Unable to submit your comment', error);
341341
} finally {
342342
this.setState({postingToThreadID: null});
343343
}

Diff for: lib/controllers/root-controller.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ export default class RootController extends React.Component {
441441
tooltips={this.props.tooltips}
442442
config={this.props.config}
443443

444-
reportMutationErrors={this.reportMutationErrors}
444+
reportRelayError={this.reportRelayError}
445445
/>
446446
)}
447447
</PaneItem>
@@ -462,7 +462,7 @@ export default class RootController extends React.Component {
462462
tooltips={this.props.tooltips}
463463
config={this.props.config}
464464
commands={this.props.commandRegistry}
465-
reportMutationErrors={this.reportMutationErrors}
465+
reportRelayError={this.reportRelayError}
466466
/>
467467
)}
468468
</PaneItem>
@@ -925,7 +925,7 @@ export default class RootController extends React.Component {
925925
return await Promise.all(editorPromises);
926926
}
927927

928-
reportMutationErrors = (friendlyMessage, err) => {
928+
reportRelayError = (friendlyMessage, err) => {
929929
const opts = {dismissable: true};
930930

931931
if (err.errors) {

Diff for: lib/items/issueish-detail-item.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class IssueishDetailItem extends Component {
4242
config: PropTypes.object.isRequired,
4343

4444
// Action methods
45-
reportMutationErrors: PropTypes.func.isRequired,
45+
reportRelayError: PropTypes.func.isRequired,
4646
}
4747

4848
static defaultProps = {
@@ -124,7 +124,7 @@ export default class IssueishDetailItem extends Component {
124124
destroy={this.destroy}
125125
itemType={this.constructor}
126126
refEditor={this.refEditor}
127-
reportMutationErrors={this.props.reportMutationErrors}
127+
reportRelayError={this.props.reportRelayError}
128128
/>
129129
);
130130
}

Diff for: lib/items/reviews-item.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class ReviewsItem extends React.Component {
2727
tooltips: PropTypes.object.isRequired,
2828

2929
// Action methods
30-
reportMutationErrors: PropTypes.func.isRequired,
30+
reportRelayError: PropTypes.func.isRequired,
3131
}
3232

3333
static uriPattern = 'atom-github://reviews/{host}/{owner}/{repo}/{number}?workdir={workdir}'

Diff for: lib/views/issue-detail-view.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class BareIssueDetailView extends React.Component {
5555
tooltips: PropTypes.object.isRequired,
5656

5757
// Action methods
58-
reportMutationErrors: PropTypes.func.isRequired,
58+
reportRelayError: PropTypes.func.isRequired,
5959
}
6060

6161
state = {
@@ -87,7 +87,7 @@ export class BareIssueDetailView extends React.Component {
8787
<EmojiReactionsController
8888
reactable={issue}
8989
tooltips={this.props.tooltips}
90-
reportMutationErrors={this.props.reportMutationErrors}
90+
reportRelayError={this.props.reportRelayError}
9191
/>
9292
<IssueTimelineController
9393
issue={issue}

Diff for: lib/views/pr-detail-view.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class BarePullRequestDetailView extends React.Component {
8585
openReviews: PropTypes.func.isRequired,
8686
switchToIssueish: PropTypes.func.isRequired,
8787
destroy: PropTypes.func.isRequired,
88-
reportMutationErrors: PropTypes.func.isRequired,
88+
reportRelayError: PropTypes.func.isRequired,
8989

9090
// Item context
9191
itemType: ItemTypePropType.isRequired,
@@ -169,7 +169,7 @@ export class BarePullRequestDetailView extends React.Component {
169169
<EmojiReactionsController
170170
reactable={pullRequest}
171171
tooltips={this.props.tooltips}
172-
reportMutationErrors={this.props.reportMutationErrors}
172+
reportRelayError={this.props.reportRelayError}
173173
/>
174174
<PullRequestTimelineController
175175
onBranch={onBranch}

Diff for: lib/views/reviews-view.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class ReviewsView extends React.Component {
9595
resolveThread: PropTypes.func.isRequired,
9696
unresolveThread: PropTypes.func.isRequired,
9797
addSingleComment: PropTypes.func.isRequired,
98-
reportMutationErrors: PropTypes.func.isRequired,
98+
reportRelayError: PropTypes.func.isRequired,
9999
}
100100

101101
constructor(props) {
@@ -287,7 +287,7 @@ export default class ReviewsView extends React.Component {
287287
<EmojiReactionsController
288288
reactable={review}
289289
tooltips={this.props.tooltips}
290-
reportMutationErrors={this.props.reportMutationErrors}
290+
reportRelayError={this.props.reportRelayError}
291291
/>
292292
</main>
293293
</div>
@@ -581,7 +581,7 @@ export default class ReviewsView extends React.Component {
581581
<EmojiReactionsController
582582
reactable={comment}
583583
tooltips={this.props.tooltips}
584-
reportMutationErrors={this.props.reportMutationErrors}
584+
reportRelayError={this.props.reportRelayError}
585585
/>
586586
</div>
587587
</div>

Diff for: test/containers/reviews-container.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('ReviewsContainer', function() {
6565
config: atomEnv.config,
6666
commands: atomEnv.commands,
6767
tooltips: atomEnv.tooltips,
68-
reportMutationErrors: () => {},
68+
reportRelayError: () => {},
6969

7070
...override,
7171
};

Diff for: test/controllers/emoji-reactions-controller.test.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('EmojiReactionsController', function() {
3232
},
3333
reactable: issueBuilder(reactableQuery).build(),
3434
tooltips: atomEnv.tooltips,
35-
reportMutationErrors: () => {},
35+
reportRelayError: () => {},
3636
...override,
3737
};
3838

@@ -48,7 +48,7 @@ describe('EmojiReactionsController', function() {
4848

4949
describe('adding a reaction', function() {
5050
it('fires the add reaction mutation', async function() {
51-
const reportMutationErrors = sinon.spy();
51+
const reportRelayError = sinon.spy();
5252

5353
expectRelayQuery({
5454
name: addReactionQuery.operation.name,
@@ -64,15 +64,15 @@ describe('EmojiReactionsController', function() {
6464
const reactable = issueBuilder(reactableQuery).id('issue0').build();
6565
relayEnv.getStore().getSource().set('issue0', {...createRecord('issue0', 'Issue'), ...reactable});
6666

67-
const wrapper = shallow(buildApp({reactable, reportMutationErrors}));
67+
const wrapper = shallow(buildApp({reactable, reportRelayError}));
6868

6969
await wrapper.find(EmojiReactionsView).prop('addReaction')('ROCKET');
7070

71-
assert.isFalse(reportMutationErrors.called);
71+
assert.isFalse(reportRelayError.called);
7272
});
7373

7474
it('reports errors encountered', async function() {
75-
const reportMutationErrors = sinon.spy();
75+
const reportRelayError = sinon.spy();
7676

7777
expectRelayQuery({
7878
name: addReactionQuery.operation.name,
@@ -86,11 +86,11 @@ describe('EmojiReactionsController', function() {
8686
const reactable = issueBuilder(reactableQuery).id('issue1').build();
8787
relayEnv.getStore().getSource().set('issue1', {...createRecord('issue1', 'Issue'), ...reactable});
8888

89-
const wrapper = shallow(buildApp({reactable, reportMutationErrors}));
89+
const wrapper = shallow(buildApp({reactable, reportRelayError}));
9090

9191
await wrapper.find(EmojiReactionsView).prop('addReaction')('EYES');
9292

93-
assert.isTrue(reportMutationErrors.calledWith(
93+
assert.isTrue(reportRelayError.calledWith(
9494
'Unable to add reaction emoji',
9595
sinon.match({errors: [{message: 'oh no'}]})),
9696
);
@@ -99,7 +99,7 @@ describe('EmojiReactionsController', function() {
9999

100100
describe('removing a reaction', function() {
101101
it('fires the remove reaction mutation', async function() {
102-
const reportMutationErrors = sinon.spy();
102+
const reportRelayError = sinon.spy();
103103

104104
expectRelayQuery({
105105
name: removeReactionQuery.operation.name,
@@ -115,15 +115,15 @@ describe('EmojiReactionsController', function() {
115115
const reactable = issueBuilder(reactableQuery).id('issue0').build();
116116
relayEnv.getStore().getSource().set('issue0', {...createRecord('issue0', 'Issue'), ...reactable});
117117

118-
const wrapper = shallow(buildApp({reactable, reportMutationErrors}));
118+
const wrapper = shallow(buildApp({reactable, reportRelayError}));
119119

120120
await wrapper.find(EmojiReactionsView).prop('removeReaction')('THUMBS_DOWN');
121121

122-
assert.isFalse(reportMutationErrors.called);
122+
assert.isFalse(reportRelayError.called);
123123
});
124124

125125
it('reports errors encountered', async function() {
126-
const reportMutationErrors = sinon.spy();
126+
const reportRelayError = sinon.spy();
127127

128128
expectRelayQuery({
129129
name: removeReactionQuery.operation.name,
@@ -137,11 +137,11 @@ describe('EmojiReactionsController', function() {
137137
const reactable = issueBuilder(reactableQuery).id('issue1').build();
138138
relayEnv.getStore().getSource().set('issue1', {...createRecord('issue1', 'Issue'), ...reactable});
139139

140-
const wrapper = shallow(buildApp({reactable, reportMutationErrors}));
140+
const wrapper = shallow(buildApp({reactable, reportRelayError}));
141141

142142
await wrapper.find(EmojiReactionsView).prop('removeReaction')('CONFUSED');
143143

144-
assert.isTrue(reportMutationErrors.calledWith(
144+
assert.isTrue(reportRelayError.calledWith(
145145
'Unable to remove reaction emoji',
146146
sinon.match({errors: [{message: 'wtf'}]})),
147147
);

Diff for: test/controllers/issueish-detail-controller.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('IssueishDetailController', function() {
6464
onTitleChange: () => {},
6565
switchToIssueish: () => {},
6666
destroy: () => {},
67-
reportMutationErrors: () => {},
67+
reportRelayError: () => {},
6868

6969
itemType: IssueishDetailItem,
7070
refEditor: new RefHolder(),

0 commit comments

Comments
 (0)