import Component from "@glimmer/component"; import { concat } from "@ember/helper"; import { action } from "@ember/object"; import { eq } from "truth-helpers"; import ConditionalLoadingSection from "discourse/components/conditional-loading-section"; import DButton from "discourse/components/d-button"; import concatClass from "discourse/helpers/concat-class"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import icon from "discourse-common/helpers/d-icon"; import i18n from "discourse-common/helpers/i18n"; import AdminNotice from "admin/components/admin-notice"; export default class DashboardProblems extends Component { @action async dismissProblem(problem) { try { await ajax(`/admin/admin_notices/${problem.id}`, { type: "DELETE" }); this.args.problems.removeObject(problem); } catch (error) { popupAjaxError(error); } } get problems() { return this.args.problems.sortBy("priority"); } }