Skip to content

armgit / core

Public Imported from GitHub
0

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

Disabled autocomplete on user and account page (#1566)

Wouter Voorberg400dc2422c2c
diff --git a/ui/app/manager/src/pages/page-account.ts b/ui/app/manager/src/pages/page-account.ts
index b8d96d19d..4ae49ca99 100644
--- a/ui/app/manager/src/pages/page-account.ts
+++ b/ui/app/manager/src/pages/page-account.ts
@@ -236,21 +236,21 @@ export class PageAccount extends Page<AppStateKeyed> {
<div class="column">
<!-- user details -->
<h5>${i18next.t("details")}</h5>
- <or-mwc-input id="username" class="validate"
+ <or-mwc-input id="new-username" class="validate"
.label="${i18next.t("username")}"
.type="${InputType.TEXT}"
?required="${!registrationEmailAsUsername}"
.disabled="${true}"
minLength="3" maxLength="255" pattern="[A-Za-z0-9\\-_]+"
.validationMessage="${i18next.t("invalidUsername")}"
- .value="${user?.username}"
+ .value="${user?.username}" autocomplete="false"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
user.username = e.detail.value;
onchange?.(user, true, this._isInvalid());
}}"
></or-mwc-input>
<!-- if identity provider is set to use email as username, make it required -->
- <or-mwc-input id="email" class="validate"
+ <or-mwc-input id="new-email" class="validate"
.label="${i18next.t("email")}"
.type="${InputType.EMAIL}"
?required="${registrationEmailAsUsername}"
@@ -258,30 +258,30 @@ export class PageAccount extends Page<AppStateKeyed> {
.disabled="${!user || (!!user?.id && registrationEmailAsUsername)}"
pattern="^[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w]{2,4}$"
.validationMessage="${i18next.t("invalidEmail")}"
- .value="${user?.email}"
+ .value="${user?.email}" autocomplete="false"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
user.email = e.detail.value;
onchange?.(user, true, this._isInvalid());
}}"
></or-mwc-input>
- <or-mwc-input id="firstName" class="validate"
+ <or-mwc-input id="new-firstName" class="validate"
.label="${i18next.t("firstName")}"
.type="${InputType.TEXT}"
?readonly="${readonly}"
.disabled="${!user}"
- minLength="5"
+ minLength="5" autocomplete="false"
.value="${user?.firstName}"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
user.firstName = e.detail.value;
onchange?.(user, true, this._isInvalid());
}}"
></or-mwc-input>
- <or-mwc-input id="surname" class="validate"
+ <or-mwc-input id="new-surname" class="validate"
.label="${i18next.t("surname")}"
.type="${InputType.TEXT}"
?readonly="${readonly}"
.disabled="${!user}"
- minLength="1"
+ minLength="1" autocomplete="false"
.value="${user?.lastName}"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
user.lastName = e.detail.value;
@@ -291,24 +291,24 @@ export class PageAccount extends Page<AppStateKeyed> {
</div>
<div class="column">
<h5>${i18next.t("password")}</h5>
- <or-mwc-input id="password" class="validate"
+ <or-mwc-input id="new-password" class="validate"
.label="${i18next.t("password")}"
.type="${InputType.PASSWORD}"
?readonly="${readonly}"
.disabled="${!user}"
- min="1"
+ min="1" autocomplete="false"
@or-mwc-input-changed="${(_e: OrInputChangedEvent) => {
const changed = this._onPasswordChanged(user);
onchange?.(user, changed, this._isInvalid());
}}"
></or-mwc-input>
- <or-mwc-input id="repeatPassword"
+ <or-mwc-input id="new-repeatPassword"
.label="${i18next.t("repeatPassword")}"
.type="${InputType.PASSWORD}"
helperPersistent
?readonly="${readonly}"
.disabled="${!user}"
- min="1"
+ min="1" autocomplete="false"
@or-mwc-input-changed="${(_e: OrInputChangedEvent) => {
const changed = this._onPasswordChanged(user);
onchange?.(user, changed, this._isInvalid());
diff --git a/ui/app/manager/src/pages/page-users.ts b/ui/app/manager/src/pages/page-users.ts
index 64b2446d1..297d0e955 100644
--- a/ui/app/manager/src/pages/page-users.ts
+++ b/ui/app/manager/src/pages/page-users.ts
@@ -850,25 +850,25 @@ export class PageUsers extends Page<AppStateKeyed> {
<div class="column">
<h5>${i18next.t("details")}</h5>
<!-- user details -->
- <or-mwc-input id="username-${suffix}" ?readonly="${!!user.id || readonly}" .disabled="${!!user.id || (!isServiceUser && this._registrationEmailAsUsername)}"
+ <or-mwc-input id="new-username-${suffix}" ?readonly="${!!user.id || readonly}" .disabled="${!!user.id || (!isServiceUser && this._registrationEmailAsUsername)}"
class = "validate"
.label="${i18next.t("username")}"
.type="${InputType.TEXT}" minLength="3" maxLength="255"
?required="${isServiceUser || !this._registrationEmailAsUsername}"
pattern="[A-Za-z0-9\\-_]+"
- .value="${user.username}"
+ .value="${user.username}" autocomplete="false"
.validationMessage="${i18next.t("invalidUsername")}"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
user.username = e.detail.value;
this.onUserChanged(suffix)
}}"></or-mwc-input>
<!-- if identity provider is set to use email as username, make it required -->
- <or-mwc-input ?readonly="${(!!user.id && this._registrationEmailAsUsername) || readonly}"
+ <or-mwc-input id="new-email" ?readonly="${(!!user.id && this._registrationEmailAsUsername) || readonly}"
.disabled="${!!user.id && this._registrationEmailAsUsername}"
class="${isServiceUser ? "hidden" : "validate"}"
.label="${i18next.t("email")}"
.type="${InputType.EMAIL}"
- .value="${user.email}"
+ .value="${user.email}" autocomplete="false"
?required="${!isServiceUser && this._registrationEmailAsUsername}"
pattern="^[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w]{2,4}$"
.validationMessage="${i18next.t("invalidEmail")}"
@@ -880,20 +880,20 @@ export class PageUsers extends Page<AppStateKeyed> {
this.onUserChanged(suffix);
this.requestUpdate(); // in case of username update, we trigger a state change
}}"></or-mwc-input>
- <or-mwc-input ?readonly="${readonly}"
+ <or-mwc-input id="new-firstName" ?readonly="${readonly}"
class="${isServiceUser ? "hidden" : "validate"}"
.label="${i18next.t("firstName")}"
.type="${InputType.TEXT}" minLength="1"
- .value="${user.firstName}"
+ .value="${user.firstName}" autocomplete="false"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
user.firstName = e.detail.value;
this.onUserChanged(suffix)
}}"></or-mwc-input>
- <or-mwc-input ?readonly="${readonly}"
+ <or-mwc-input id="new-surname" ?readonly="${readonly}"
class="${isServiceUser ? "hidden" : "validate"}"
.label="${i18next.t("surname")}"
.type="${InputType.TEXT}" minLength="1"
- .value="${user.lastName}"
+ .value="${user.lastName}" autocomplete="false"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
user.lastName = e.detail.value;
this.onUserChanged(suffix)
@@ -903,7 +903,7 @@ export class PageUsers extends Page<AppStateKeyed> {
<h5>${i18next.t("password")}</h5>
${isServiceUser ? html`
${when(user.secret, () => html`
- <or-mwc-input id="password-${suffix}" readonly
+ <or-mwc-input id="new-password-${suffix}" readonly
class = "validate"
.label="${i18next.t("secret")}"
.value="${user.secret}"
@@ -919,20 +919,20 @@ export class PageUsers extends Page<AppStateKeyed> {
<span>${i18next.t("generateSecretInfo")}</span>
`)}
` : html`
- <or-mwc-input id="password-${suffix}"
+ <or-mwc-input id="new-password-${suffix}"
?readonly="${readonly}"
class = "validate"
.label="${i18next.t("password")}"
- .type="${InputType.PASSWORD}" min="1"
+ .type="${InputType.PASSWORD}" min="1" autocomplete="false"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
this._onPasswordChanged(user, suffix);
this.onUserChanged(suffix);
}}"
></or-mwc-input>
- <or-mwc-input id="repeatPassword-${suffix}"
+ <or-mwc-input id="new-repeatPassword-${suffix}"
helperPersistent ?readonly="${readonly}"
.label="${i18next.t("repeatPassword")}"
- .type="${InputType.PASSWORD}" min="1"
+ .type="${InputType.PASSWORD}" min="1" autocomplete="false"
style="${this._passwordPolicy ? 'margin-bottom: 0' : undefined}"
@or-mwc-input-changed="${(e: OrInputChangedEvent) => {
this._onPasswordChanged(user, suffix);