UX: Replace site-settings link with "Admin" link in sidebar (#17665)

The main landing page for admins/mods should be the admin Dashboard, not the site settings. Having a "Settings" link can be confused with user settings.

This commit also displays the button for moderators, who are also allowed access to parts of the admin dashboard)
This commit is contained in:
David Taylor 2022-07-26 14:46:33 +01:00 committed by GitHub
parent 5a0480efd7
commit fccbe5c604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -5,9 +5,9 @@
{{i18n "about.simple_title"}}
</LinkTo>
{{#if this.currentUser.admin}}
<LinkTo @route="adminSiteSettings" title={{i18n "admin.site_settings.title"}} class="sidebar-footer-link sidebar-footer-link-site-settings">
{{i18n "admin.site_settings.title"}}
{{#if this.currentUser.staff}}
<LinkTo @route="admin" title={{i18n "admin_title"}} class="sidebar-footer-link sidebar-footer-link-admin">
{{i18n "admin_title"}}
</LinkTo>
{{/if}}
</div>

View File

@ -62,19 +62,19 @@ acceptance("Sidebar - User with sidebar enabled", function (needs) {
);
});
test("navigating to site setting route using sidebar", async function (assert) {
test("navigating to admin route using sidebar", async function (assert) {
await visit("/");
await click(".sidebar-footer-link-site-settings");
await click(".sidebar-footer-link-admin");
assert.strictEqual(currentRouteName(), "adminSiteSettingsCategory");
assert.strictEqual(currentRouteName(), "admin.dashboard.general");
});
test("site setting link is not shown in sidebar for non-admin user", async function (assert) {
updateCurrentUser({ admin: false });
test("admin link is not shown in sidebar for non-admin user", async function (assert) {
updateCurrentUser({ admin: false, moderator: false });
await visit("/");
assert.notOk(exists(".sidebar-footer-link-site-settings"));
assert.notOk(exists(".sidebar-footer-link-admin"));
});
test("undocking and docking sidebar", async function (assert) {