From 3a23ff98bc3d8ba2c8032e9051adf28c269e8d51 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 8 Nov 2024 18:46:05 +0000 Subject: [PATCH] DEV: Fix passing translatedTitle as argument to flat-button (#29663) Overriding computed properties with arguments is no longer supported by Ember, so we need to rename this computed property and add fallback logic manually. This fixes the styleguide 'buttons' page. Ref https://meta.discourse.org/t/styleguide-bugs/335211?u=david --- .../javascripts/discourse/app/components/flat-button.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/flat-button.js b/app/assets/javascripts/discourse/app/components/flat-button.js index e12358bdabd..9952ba5324b 100644 --- a/app/assets/javascripts/discourse/app/components/flat-button.js +++ b/app/assets/javascripts/discourse/app/components/flat-button.js @@ -9,12 +9,14 @@ import I18n from "discourse-i18n"; @tagName("button") @classNames("btn-flat") -@attributeBindings("disabled", "translatedTitle:title") +@attributeBindings("disabled", "resolvedTitle:title") export default class FlatButton extends Component { - @discourseComputed("title") - translatedTitle(title) { + @discourseComputed("title", "translatedTitle") + resolvedTitle(title, translatedTitle) { if (title) { return I18n.t(title); + } else if (translatedTitle) { + return translatedTitle; } }