discourse/app/assets/javascripts/admin/addon/routes/admin-user-fields-new.js
Ted Johansson b36747163b
FEATURE: Allow hiding user fields on signup form (#34672)
We want to allow configuring fields that are both optional and editable to not show up in the signup form.

- Fields that are optional but not editable need to be on the signup form, or they can never be filled in.
- Fields that are not optional need to be on the signup form, or you can never sign up.
2025-09-15 10:42:07 +08:00

21 lines
498 B
JavaScript
Vendored

import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
import { i18n } from "discourse-i18n";
const DEFAULT_VALUES = {
field_type: "text",
requirement: "optional",
show_on_signup: true,
};
export default class AdminUserFieldsNewRoute extends DiscourseRoute {
@service store;
async model() {
return this.store.createRecord("user-field", { ...DEFAULT_VALUES });
}
titleToken() {
return i18n("admin.user_fields.new_header");
}
}