mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-21 23:19:22 +08:00
`discourse-common` was created in the past to share logic between the 'wizard' app and the main 'discourse' app. Since then, the wizard has been consolidated into the main app, so the separation of `discourse-common` is no longer useful. This commit moves `discourse-common/helpers/*` into `discourse/helpers/*`, removes `discourse-common` from the Ember resolver config, and adds shims for the imports.
34 lines
822 B
Text
Vendored
34 lines
822 B
Text
Vendored
import Component from "@glimmer/component";
|
|
import { action } from "@ember/object";
|
|
import { service } from "@ember/service";
|
|
import { htmlSafe } from "@ember/template";
|
|
import DButton from "discourse/components/d-button";
|
|
import icon from "discourse/helpers/d-icon";
|
|
|
|
export default class AdminNotice extends Component {
|
|
@service currentUser;
|
|
|
|
@action
|
|
dismiss() {
|
|
this.args.dismissCallback(this.args.problem);
|
|
}
|
|
|
|
get canDismiss() {
|
|
return this.currentUser.admin;
|
|
}
|
|
|
|
<template>
|
|
<div class="notice">
|
|
<div class="message">
|
|
{{if @icon (icon @icon)}}
|
|
{{htmlSafe @problem.message}}
|
|
</div>
|
|
{{#if this.canDismiss}}
|
|
<DButton
|
|
@action={{this.dismiss}}
|
|
@label="admin.dashboard.dismiss_notice"
|
|
/>
|
|
{{/if}}
|
|
</div>
|
|
</template>
|
|
}
|