FEATURE: open create invite modal from the bootstrap notice banner (#17960)
This commit is contained in:
parent
97a20d6d82
commit
42c64abe15
|
@ -1,9 +1,11 @@
|
||||||
import GlimmerComponent from "@glimmer/component";
|
import Component from "@glimmer/component";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
|
import { action } from "@ember/object";
|
||||||
|
import showModal from "discourse/lib/show-modal";
|
||||||
|
|
||||||
export default class BootstrapModeNotice extends GlimmerComponent {
|
export default class BootstrapModeNotice extends Component {
|
||||||
@service siteSettings;
|
@service siteSettings;
|
||||||
@service site;
|
@service site;
|
||||||
|
|
||||||
|
@ -19,4 +21,9 @@ export default class BootstrapModeNotice extends GlimmerComponent {
|
||||||
|
|
||||||
return htmlSafe(I18n.t(msg, { count: bootstrapModeMinUsers }));
|
return htmlSafe(I18n.t(msg, { count: bootstrapModeMinUsers }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
inviteUsers() {
|
||||||
|
showModal("create-invite");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{{this.message}}
|
{{this.message}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-button">
|
<div class="col-button">
|
||||||
<div class="alert--button"><DButton @icon="user-plus" @href="/my/invited" @class="btn-primary bootstrap-invite-button" @label="bootstrap_invite_button_title" /></div>
|
<div class="alert--button"><DButton @icon="user-plus" @action={{this.inviteUsers}} @class="btn-primary bootstrap-invite-button" @label="bootstrap_invite_button_title" /></div>
|
||||||
{{#if this.site.wizard_required}}
|
{{#if this.site.wizard_required}}
|
||||||
<div class="alert--link"><a class="bootstrap-wizard-link" href="/wizard">{{i18n "bootstrap_wizard_link_title"}}</a></div>
|
<div class="alert--link"><a class="bootstrap-wizard-link" href="/wizard">{{i18n "bootstrap_wizard_link_title"}}</a></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -26,13 +26,8 @@ acceptance("Bootstrap Mode Notice", function (needs) {
|
||||||
);
|
);
|
||||||
|
|
||||||
await click(".bootstrap-invite-button");
|
await click(".bootstrap-invite-button");
|
||||||
assert.strictEqual(
|
assert.ok(exists(".create-invite-modal"), "opens create invite modal");
|
||||||
currentURL(),
|
|
||||||
"/u/eviltrout/invited/pending",
|
|
||||||
"it transitions to the invite page"
|
|
||||||
);
|
|
||||||
|
|
||||||
await visit("/");
|
|
||||||
await click(".bootstrap-wizard-link");
|
await click(".bootstrap-wizard-link");
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
currentURL(),
|
currentURL(),
|
||||||
|
|
Loading…
Reference in New Issue