diff --git a/app/assets/javascripts/discourse/app/components/modal/grant-badge.js b/app/assets/javascripts/discourse/app/components/modal/grant-badge.gjs similarity index 59% rename from app/assets/javascripts/discourse/app/components/modal/grant-badge.js rename to app/assets/javascripts/discourse/app/components/modal/grant-badge.gjs index fca5bc76774..215f3308b16 100644 --- a/app/assets/javascripts/discourse/app/components/modal/grant-badge.js +++ b/app/assets/javascripts/discourse/app/components/modal/grant-badge.gjs @@ -1,6 +1,11 @@ import Component from "@glimmer/component"; import { tracked } from "@glimmer/tracking"; +import { fn, hash } from "@ember/helper"; import { action } from "@ember/object"; +import didInsert from "@ember/render-modifiers/modifiers/did-insert"; +import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner"; +import DButton from "discourse/components/d-button"; +import DModal from "discourse/components/d-modal"; import { extractError } from "discourse/lib/ajax-error"; import { grantableBadges, @@ -10,6 +15,7 @@ import Badge from "discourse/models/badge"; import UserBadge from "discourse/models/user-badge"; import getURL from "discourse-common/lib/get-url"; import { i18n } from "discourse-i18n"; +import ComboBox from "select-kit/components/combo-box"; export default class GrantBadgeModal extends Component { @tracked loading = true; @@ -54,6 +60,7 @@ export default class GrantBadgeModal extends Component { this.loading = false; } } + @action async performGrantBadge() { try { @@ -79,4 +86,41 @@ export default class GrantBadgeModal extends Component { this.saving = false; } } + + + + <:body> + + {{#if this.noAvailableBadges}} + {{i18n "admin.badges.no_badges"}} + {{else}} + + + + {{/if}} + + + <:footer> + + + + } diff --git a/app/assets/javascripts/discourse/app/components/modal/grant-badge.hbs b/app/assets/javascripts/discourse/app/components/modal/grant-badge.hbs deleted file mode 100644 index 19f5d62fa37..00000000000 --- a/app/assets/javascripts/discourse/app/components/modal/grant-badge.hbs +++ /dev/null @@ -1,34 +0,0 @@ - - <:body> - - {{#if this.noAvailableBadges}} - {{i18n "admin.badges.no_badges"}} - {{else}} - - - - {{/if}} - - - <:footer> - - - \ No newline at end of file
{{i18n "admin.badges.no_badges"}}
+ +
- -