Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Renamed editor tasks to use xTask naming
Browse files Browse the repository at this point in the history
no issue

- helps indicate that you're dealing with an ember-concurrency task object rather than a function/action so you know to use `perform` and that you have access to derived state
  • Loading branch information
kevinansfield committed Jun 21, 2021
1 parent e2985d3 commit 0f24cb9
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 88 deletions.
2 changes: 1 addition & 1 deletion app/components/gh-post-settings-menu-labs.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
{{#if (eq this.subview "email-settings")}}
<GhPostSettingsMenu::Email
@post={{this.post}}
@savePostTask={{this.savePost}}
@savePostTask={{this.savePostTask}}
@toggleEmailPreviewModal={{this.toggleEmailPreviewModal}}
@close={{action "closeSubview"}}
/>
Expand Down
42 changes: 21 additions & 21 deletions app/components/gh-post-settings-menu-labs.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -133,7 +133,7 @@ export default Component.extend({
* triggered by user manually changing slug
*/
updateSlug(newSlug) {
return this.updateSlug
return this.updateSlugTask
.perform(newSlug)
.catch((error) => {
this.showError(error);
Expand All @@ -151,7 +151,7 @@ export default Component.extend({
post.validate({property: 'publishedAtBlog'});
} else {
post.set('publishedAtBlogDate', dateString);
return this.savePost.perform();
return this.savePostTask.perform();
}
},

Expand All @@ -164,7 +164,7 @@ export default Component.extend({
post.validate({property: 'publishedAtBlog'});
} else {
post.set('publishedAtBlogTime', time);
return this.savePost.perform();
return this.savePostTask.perform();
}
},

Expand All @@ -178,7 +178,7 @@ export default Component.extend({

post.set('customExcerpt', excerpt);

return post.validate({property: 'customExcerpt'}).then(() => this.savePost.perform());
return post.validate({property: 'customExcerpt'}).then(() => this.savePostTask.perform());
},

setHeaderInjection(code) {
Expand All @@ -191,7 +191,7 @@ export default Component.extend({

post.set('codeinjectionHead', code);

return post.validate({property: 'codeinjectionHead'}).then(() => this.savePost.perform());
return post.validate({property: 'codeinjectionHead'}).then(() => this.savePostTask.perform());
},

setFooterInjection(code) {
Expand All @@ -204,7 +204,7 @@ export default Component.extend({

post.set('codeinjectionFoot', code);

return post.validate({property: 'codeinjectionFoot'}).then(() => this.savePost.perform());
return post.validate({property: 'codeinjectionFoot'}).then(() => this.savePostTask.perform());
},

setMetaTitle(metaTitle) {
Expand All @@ -226,7 +226,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -249,7 +249,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -272,7 +272,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -295,7 +295,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -318,7 +318,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -341,7 +341,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -364,7 +364,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -375,7 +375,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -388,7 +388,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -401,7 +401,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -414,7 +414,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -427,7 +427,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -440,7 +440,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -462,7 +462,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
post.rollbackAttributes();
});
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-post-settings-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
{{#if (eq this.subview "email-settings")}}
<GhPostSettingsMenu::Email
@post={{this.post}}
@savePostTask={{this.savePost}}
@savePostTask={{this.savePostTask}}
@toggleEmailPreviewModal={{this.toggleEmailPreviewModal}}
@close={{action "closeSubview"}}
/>
Expand Down
42 changes: 21 additions & 21 deletions app/components/gh-post-settings-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -131,7 +131,7 @@ export default Component.extend({
* triggered by user manually changing slug
*/
updateSlug(newSlug) {
return this.updateSlug
return this.updateSlugTask
.perform(newSlug)
.catch((error) => {
this.showError(error);
Expand All @@ -149,7 +149,7 @@ export default Component.extend({
post.validate({property: 'publishedAtBlog'});
} else {
post.set('publishedAtBlogDate', dateString);
return this.savePost.perform();
return this.savePostTask.perform();
}
},

Expand All @@ -162,7 +162,7 @@ export default Component.extend({
post.validate({property: 'publishedAtBlog'});
} else {
post.set('publishedAtBlogTime', time);
return this.savePost.perform();
return this.savePostTask.perform();
}
},

Expand All @@ -176,7 +176,7 @@ export default Component.extend({

post.set('customExcerpt', excerpt);

return post.validate({property: 'customExcerpt'}).then(() => this.savePost.perform());
return post.validate({property: 'customExcerpt'}).then(() => this.savePostTask.perform());
},

setHeaderInjection(code) {
Expand All @@ -189,7 +189,7 @@ export default Component.extend({

post.set('codeinjectionHead', code);

return post.validate({property: 'codeinjectionHead'}).then(() => this.savePost.perform());
return post.validate({property: 'codeinjectionHead'}).then(() => this.savePostTask.perform());
},

setFooterInjection(code) {
Expand All @@ -202,7 +202,7 @@ export default Component.extend({

post.set('codeinjectionFoot', code);

return post.validate({property: 'codeinjectionFoot'}).then(() => this.savePost.perform());
return post.validate({property: 'codeinjectionFoot'}).then(() => this.savePostTask.perform());
},

setMetaTitle(metaTitle) {
Expand All @@ -224,7 +224,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -247,7 +247,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -270,7 +270,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -293,7 +293,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -316,7 +316,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -339,7 +339,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -362,7 +362,7 @@ export default Component.extend({
return;
}

return this.savePost.perform();
return this.savePostTask.perform();
});
},

Expand All @@ -373,7 +373,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -386,7 +386,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -399,7 +399,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -412,7 +412,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -425,7 +425,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -438,7 +438,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
this.post.rollbackAttributes();
});
Expand All @@ -460,7 +460,7 @@ export default Component.extend({
return;
}

this.savePost.perform().catch((error) => {
this.savePostTask.perform().catch((error) => {
this.showError(error);
post.rollbackAttributes();
});
Expand Down

0 comments on commit 0f24cb9

Please sign in to comment.