REFACTOR: Remove deprecated `action="something"` attributes

In newer versions of Ember, `this.sendAction` is deprecated:

https://deprecations.emberjs.com/v3.x/#toc_ember-component-send-action

This patch removes most of our current uses (via `d-button`) but also
some other rogue `this.sendAction` calls too.
This commit is contained in:
Robin Ward 2020-09-29 12:22:50 -04:00
parent da0dea1e94
commit 3d6d3e6cb1
6 changed files with 12 additions and 5 deletions

View File

@ -94,6 +94,8 @@ export default Component.extend({
if (action) {
if (typeof action === "string") {
// Note: This is deprecated in new Embers and needs to be removed in the future.
// There is already a warning in the console.
this.sendAction("action", this.actionParam);
} else if (typeof action === "object" && action.value) {
action.value(this.actionParam);

View File

@ -74,7 +74,7 @@ export default Component.extend({
},
deleteTag() {
this.sendAction("deleteAction", this.tagInfo);
this.deleteAction(this.tagInfo);
},
unlinkSynonym(tag) {

View File

@ -1,7 +1,7 @@
{{#if visible}}
<div class="row">
<div id="banner" class={{overlay}}>
{{d-button icon="times" action="dismiss" class="btn btn-flat close" title="banner.close"}}
{{d-button icon="times" action=(action "dismiss") class="btn btn-flat close" title="banner.close"}}
<div id="banner-content">
{{html-safe content}}
{{#if currentUser.staff}}

View File

@ -11,7 +11,7 @@
</span>
{{d-button
icon="times"
action="dismiss"
action=(action "dismiss")
class="btn btn-flat close" title="banner.close"
}}
</div>

View File

@ -9,7 +9,7 @@
</span>
{{d-button
icon="times"
action="dismiss"
action=(action "dismiss")
class="btn btn-flat close"
title="banner.close"
}}

View File

@ -34,6 +34,11 @@
</div>
{{/if}}
{{d-button action="close" class="btn btn-flat close" icon="times" aria-label="share.close" title="share.close"}}
{{d-button action=(action "close")
class="btn btn-flat close"
icon="times"
aria-label="share.close"
title="share.close"
}}
</div>
</div>