mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 19:13:26 +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.
35 lines
822 B
Plaintext
35 lines
822 B
Plaintext
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>
|
|
}
|