mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 21:04:33 +08:00
DEV: replaces topic-notifications-options by DMenu (#30298)
This commit introduces <NotificationsTracking /> which is a wrapper component around <DMenu /> which replaces the select-kit component <TopicNotificationsButton />. Each tracking case has its dedicated component: - topic -> `<TopicNotificationsTracking />` - group -> `<GroupNotificationsTracking />` - tag -> `<TagNotificationsTracking />` - category -> `<CategoryNotificationsTracking />` - chat thread -> `<ThreadNotificationsTracking />`
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { hash } from "@ember/helper";
|
||||
import CategoryNotificationsButton from "select-kit/components/category-notifications-button";
|
||||
import CategoryNotificationsTracking from "discourse/components/category-notifications-tracking";
|
||||
import BaseField from "./da-base-field";
|
||||
import DAFieldDescription from "./da-field-description";
|
||||
import DAFieldLabel from "./da-field-label";
|
||||
@ -11,10 +10,9 @@ export default class CategoryNotficationLevelField extends BaseField {
|
||||
<DAFieldLabel @label={{@label}} @field={{@field}} />
|
||||
|
||||
<div class="controls">
|
||||
<CategoryNotificationsButton
|
||||
@value={{@field.metadata.value}}
|
||||
<CategoryNotificationsTracking
|
||||
@levelId={{@field.metadata.value}}
|
||||
@onChange={{this.mutValue}}
|
||||
@options={{hash showFullTitle=true}}
|
||||
/>
|
||||
|
||||
<DAFieldDescription @description={{@description}} />
|
||||
|
@ -3,7 +3,7 @@ import { render } from "@ember/test-helpers";
|
||||
import { hbs } from "ember-cli-htmlbars";
|
||||
import { module, test } from "qunit";
|
||||
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import notificationsTracking from "discourse/tests/helpers/notifications-tracking-helper";
|
||||
import AutomationFabricators from "discourse/plugins/automation/admin/lib/fabricators";
|
||||
|
||||
module(
|
||||
@ -23,9 +23,7 @@ module(
|
||||
await render(
|
||||
hbs`<AutomationField @automation={{this.automation}} @field={{this.field}} />`
|
||||
);
|
||||
|
||||
await selectKit().expand();
|
||||
await selectKit().selectRowByValue(2);
|
||||
await notificationsTracking().selectLevelId(2);
|
||||
|
||||
assert.strictEqual(this.field.metadata.value, 2);
|
||||
});
|
||||
|
Reference in New Issue
Block a user