FIX: Do not display enabled inputs when username/name are locked

This commit is contained in:
David Taylor 2020-07-10 10:49:32 +01:00
parent c72bc27888
commit 4b0d86d8d3
No known key found for this signature in database
GPG Key ID: 46904C18B1D3F434
1 changed files with 10 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import getURL from "discourse-common/lib/get-url";
import I18n from "I18n";
import { A } from "@ember/array";
import { isEmpty } from "@ember/utils";
import { notEmpty, and } from "@ember/object/computed";
import { notEmpty } from "@ember/object/computed";
import Controller, { inject as controller } from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import ModalFunctionality from "discourse/mixins/modal-functionality";
@ -74,8 +74,15 @@ export default Controller.extend(
return false;
},
usernameDisabled: and("authOptions", "!authOptions.can_edit_username"),
nameDisabled: and("authOptions", "!authOptions.can_edit_name"),
@discourseComputed("authOptions", "authOptions.can_edit_username")
usernameDisabled(authOptions, canEditUsername) {
return authOptions && !canEditUsername;
},
@discourseComputed("authOptions", "authOptions.can_edit_name")
nameDisabled(authOptions, canEditName) {
return authOptions && !canEditName;
},
@discourseComputed
fullnameRequired() {