Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix onclick uses in poll plugin (#34160)

Jarek Radosz4373f89d7aa1
diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs
index 4d9502ec93d..25fe40a8cf8 100644
--- a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs
+++ b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs
@@ -4,7 +4,6 @@ import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
import routeAction from "discourse/helpers/route-action";
-import { i18n } from "discourse-i18n";
import PollOptionRankedChoiceDropdown from "./poll-option-ranked-choice-dropdown";
export default class PollOptionsComponent extends Component {
@@ -30,9 +29,11 @@ export default class PollOptionsComponent extends Component {
@sendRank={{this.sendRank}}
/>
{{else}}
- <DButton class="btn-default" onclick={{routeAction "showLogin"}}>{{i18n
- "poll.options.ranked_choice.login"
- }}</DButton>
+ <DButton
+ @action={{routeAction "showLogin"}}
+ @label="poll.options.ranked_choice.login"
+ class="btn-default"
+ />
{{/if}}
<span class="option-text">{{htmlSafe @option.html}}</span>
</div>
diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs
index 6112069c123..3f2b1d88da1 100644
--- a/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs
+++ b/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs
@@ -90,7 +90,7 @@ export default class PollOptionsComponent extends Component {
<span class="option-text">{{htmlSafe option.html}}</span>
</button>
{{else}}
- <button onclick={{routeAction "showLogin"}}>
+ <button {{on "click" (routeAction "showLogin")}}>
{{#if (this.isChosen option)}}
{{#if @isCheckbox}}
{{icon "far-square-check"}}