Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix for failing 'create user' page, when unique email is configured. Now updating username along with email. (#1503)

Martin Peeters73c487e38aaf
diff --git a/ui/app/manager/src/pages/page-users.ts b/ui/app/manager/src/pages/page-users.ts
index ed6f46f92..d61881f0d 100644
--- a/ui/app/manager/src/pages/page-users.ts
+++ b/ui/app/manager/src/pages/page-users.ts
@@ -864,8 +864,12 @@ export class PageUsers extends Page<AppStateKeyed> {
pattern="^[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w]{2,4}$"
.validationMessage="${i18next.t("invalidEmail")}"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
+ if(this._registrationEmailAsUsername) {
+ user.username = e.detail.value;
+ }
user.email = e.detail.value;
- this.onUserChanged(suffix)
+ this.onUserChanged(suffix);
+ this.requestUpdate(); // in case of username update, we trigger a state change
}}"></or-mwc-input>
<or-mwc-input ?readonly="${readonly}"
class="${isServiceUser ? "hidden" : "validate"}"