mirror of
https://github.com/discourse/discourse.git
synced 2026-08-19 01:14:56 -05:00
DEV: makes chat modals use the new <DModal /> component (#22495)
This commit also standardize the naming pattern of modals: `<Chat::Modal::FooBar />` and changes css class accordingly. Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
co-authored by
David Taylor
parent
ed2dae6d1a
commit
9830c40386
@@ -1,5 +1,5 @@
|
||||
<DButton
|
||||
@class="btn-flat d-modal-cancel"
|
||||
@action={{action this.close}}
|
||||
@action={{@close}}
|
||||
@translatedLabel={{i18n "cancel"}}
|
||||
/>
|
||||
@@ -1,4 +0,0 @@
|
||||
import Component from "@ember/component";
|
||||
export default Component.extend({
|
||||
tagName: "",
|
||||
});
|
||||
+16
@@ -490,4 +490,20 @@ module("Integration | Component | select-kit/single-select", function (hooks) {
|
||||
|
||||
assert.dom(".single-select.is-expanded").exists();
|
||||
});
|
||||
|
||||
test("options.formName", async function (assert) {
|
||||
setDefaultState(this);
|
||||
await render(hbs`
|
||||
<SingleSelect
|
||||
@value={{this.value}}
|
||||
@content={{this.content}}
|
||||
@options={{hash formName="foo"}}
|
||||
/>
|
||||
`);
|
||||
|
||||
assert
|
||||
.dom('input[name="foo"]')
|
||||
.hasAttribute("type", "hidden")
|
||||
.hasAttribute("value", "1");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -311,6 +311,7 @@ export default Component.extend(
|
||||
hiddenValues: null,
|
||||
disabled: false,
|
||||
expandedOnInsert: false,
|
||||
formName: null,
|
||||
},
|
||||
|
||||
autoFilterable: computed("content.[]", "selectKit.filter", function () {
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
data-name={{this.name}}
|
||||
class="select-kit-selected-name selected-name choice"
|
||||
>
|
||||
{{#if this.selectKit.options.formName}}
|
||||
<input
|
||||
type="hidden"
|
||||
name={{this.selectKit.options.formName}}
|
||||
value={{this.value}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.item.icon}}
|
||||
{{d-icon this.item.icon}}
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user