Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-28 11:50:28 +01:00
DEV: Refactor staff condition in category-chooser for simplicity
Dieser Commit ist enthalten in:
Ursprung
61c4574908
Commit
9656303c63
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
|
@ -88,7 +88,7 @@ export default {
|
||||||
categoriesByScope(options = {}) {
|
categoriesByScope(options = {}) {
|
||||||
let categories = this._super(options);
|
let categories = this._super(options);
|
||||||
const currentUser = this.currentUser;
|
const currentUser = this.currentUser;
|
||||||
if (!(currentUser && (currentUser.admin || currentUser.staff))) {
|
if (!currentUser?.staff) {
|
||||||
categories = categories.filter((category) => {
|
categories = categories.filter((category) => {
|
||||||
return !category.custom_fields?.create_topic_wizard;
|
return !category.custom_fields?.create_topic_wizard;
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,7 +4,7 @@ import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||||
import { test } from "qunit";
|
import { test } from "qunit";
|
||||||
|
|
||||||
acceptance("Category Chooser Initializer for regular users", function (needs) {
|
acceptance("Category Chooser Initializer for regular users", function (needs) {
|
||||||
needs.user({ staff: false, admin: false, moderator: false });
|
needs.user({ admin: false, moderator: false });
|
||||||
needs.settings({
|
needs.settings({
|
||||||
allow_uncategorized_topics: false,
|
allow_uncategorized_topics: false,
|
||||||
});
|
});
|
||||||
|
|
Laden …
In neuem Issue referenzieren