mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Simplify bootstrap mode visuals (#18626)
This commit is contained in:
parent
de9ed8792a
commit
868ab26fb3
@ -5,6 +5,7 @@ import discourseComputed from "discourse-common/utils/decorators";
|
|||||||
import { NotificationLevels } from "discourse/lib/notification-levels";
|
import { NotificationLevels } from "discourse/lib/notification-levels";
|
||||||
import { getOwner } from "discourse-common/lib/get-owner";
|
import { getOwner } from "discourse-common/lib/get-owner";
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
|
import showModal from "discourse/lib/show-modal";
|
||||||
|
|
||||||
export default Component.extend(FilterModeMixin, {
|
export default Component.extend(FilterModeMixin, {
|
||||||
router: service(),
|
router: service(),
|
||||||
@ -162,5 +163,9 @@ export default Component.extend(FilterModeMixin, {
|
|||||||
this.createTopic();
|
this.createTopic();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
inviteUsers() {
|
||||||
|
showModal("create-invite");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
<div class="row bootstrap-mode-notice">
|
<div class="row bootstrap-mode-notice">
|
||||||
<div class="alert alert-info alert-bootstrap-mode">
|
<div class="alert alert-info alert-bootstrap-mode">
|
||||||
<div class="col-text">
|
{{this.message}}
|
||||||
{{this.message}}
|
|
||||||
</div>
|
|
||||||
<div class="col-button">
|
|
||||||
<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}}
|
|
||||||
<div class="alert--link"><a class="bootstrap-wizard-link" href="/wizard">{{i18n "bootstrap_wizard_link_title"}}</a></div>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,6 +39,19 @@
|
|||||||
category=this.category
|
category=this.category
|
||||||
tag=this.tag}} />
|
tag=this.tag}} />
|
||||||
|
|
||||||
|
{{#if (and (or this.site.siteSettings.invite_only this.site.siteSettings.bootstrap_mode_enabled) this.currentUser.admin)}}
|
||||||
|
<DButton @icon="user-plus" @action={{action "inviteUsers"}} @class="btn-primary" @title="bootstrap_invite_button_title" />
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (and this.site.siteSettings.wizard_required this.currentUser.admin)}}
|
||||||
|
{{#unless this.site.mobileView}}
|
||||||
|
<LinkTo @route="wizard.index" class="btn-primary bootstrap-wizard-link">
|
||||||
|
{{d-icon "pencil-alt"}}
|
||||||
|
{{i18n "bootstrap_wizard_link_title"}}
|
||||||
|
</LinkTo>
|
||||||
|
{{/unless}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<CreateTopicButton @canCreateTopic={{this.canCreateTopic}} @action={{action "clickCreateTopicButton"}} @disabled={{this.createTopicButtonDisabled}} @label={{this.createTopicLabel}} @btnClass={{this.createTopicClass}} @canCreateTopicOnTag={{this.canCreateTopicOnTag}} />
|
<CreateTopicButton @canCreateTopic={{this.canCreateTopic}} @action={{action "clickCreateTopicButton"}} @disabled={{this.createTopicButtonDisabled}} @label={{this.createTopicLabel}} @btnClass={{this.createTopicClass}} @canCreateTopicOnTag={{this.canCreateTopicOnTag}} />
|
||||||
|
|
||||||
<PluginOutlet @name="after-create-topic-button" @connectorTagName="div" @tagName="" @args={{hash
|
<PluginOutlet @name="after-create-topic-button" @connectorTagName="div" @tagName="" @args={{hash
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
|
import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
|
||||||
import { test } from "qunit";
|
import { test } from "qunit";
|
||||||
import { click, currentURL, settled, visit } from "@ember/test-helpers";
|
import { settled, visit } from "@ember/test-helpers";
|
||||||
import { set } from "@ember/object";
|
import { set } from "@ember/object";
|
||||||
|
|
||||||
acceptance("Bootstrap Mode Notice", function (needs) {
|
acceptance("Bootstrap Mode Notice", function (needs) {
|
||||||
@ -17,24 +17,6 @@ acceptance("Bootstrap Mode Notice", function (needs) {
|
|||||||
exists(".bootstrap-mode-notice"),
|
exists(".bootstrap-mode-notice"),
|
||||||
"has the bootstrap mode notice"
|
"has the bootstrap mode notice"
|
||||||
);
|
);
|
||||||
assert.ok(
|
|
||||||
exists(".bootstrap-invite-button"),
|
|
||||||
"bootstrap notice has invite button"
|
|
||||||
);
|
|
||||||
assert.ok(
|
|
||||||
exists(".bootstrap-wizard-link"),
|
|
||||||
"bootstrap notice has wizard link"
|
|
||||||
);
|
|
||||||
|
|
||||||
await click(".bootstrap-invite-button");
|
|
||||||
assert.ok(exists(".create-invite-modal"), "opens create invite modal");
|
|
||||||
|
|
||||||
await click(".bootstrap-wizard-link");
|
|
||||||
assert.strictEqual(
|
|
||||||
currentURL(),
|
|
||||||
"/wizard/steps/hello-world",
|
|
||||||
"it transitions to the wizard page"
|
|
||||||
);
|
|
||||||
|
|
||||||
await visit("/");
|
await visit("/");
|
||||||
set(this.siteSettings, "bootstrap_mode_enabled", false);
|
set(this.siteSettings, "bootstrap_mode_enabled", false);
|
||||||
|
Loading…
Reference in New Issue
Block a user