diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index b8d9cef96b..b2c8bb8bd9 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -74,9 +74,7 @@ export class HassioUpdate extends LitElement { "Supervisor", this.supervisor.supervisor, "hassio/supervisor/update", - `https://github.com//home-assistant/hassio/releases/tag/${ - this.supervisor.supervisor.version_latest - }` + `https://github.com//home-assistant/hassio/releases/tag/${this.supervisor.supervisor.version_latest}` )} ${this.supervisor.host.features.includes("hassos") ? this._renderUpdateCard( diff --git a/src/data/user.ts b/src/data/user.ts index ea295dc6db..5fe1f4f259 100644 --- a/src/data/user.ts +++ b/src/data/user.ts @@ -20,6 +20,7 @@ export interface User { export interface UpdateUserParams { name?: User["name"]; + is_active?: User["is_active"]; group_ids?: User["group_ids"]; } diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 91897b3422..b8436d1b74 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -189,9 +189,11 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { ? (name, entity: any) => html` ${name}
- ${entity.entity_id} | - ${this.hass.localize(`component.${entity.platform}.title`) || - entity.platform} +
+ ${entity.entity_id} | + ${this.hass.localize(`component.${entity.platform}.title`) || + entity.platform} +
` : undefined, }, diff --git a/src/panels/config/users/dialog-user-detail.ts b/src/panels/config/users/dialog-user-detail.ts index d46a4cf24b..b854da0666 100644 --- a/src/panels/config/users/dialog-user-detail.ts +++ b/src/panels/config/users/dialog-user-detail.ts @@ -13,6 +13,7 @@ import { } from "lit-element"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; import { createCloseHeading } from "../../../components/ha-dialog"; +import "../../../components/ha-help-tooltip"; import "../../../components/ha-formfield"; import "../../../components/ha-switch"; import { adminChangePassword } from "../../../data/auth"; @@ -37,6 +38,8 @@ class DialogUserDetail extends LitElement { @internalProperty() private _isAdmin?: boolean; + @internalProperty() private _isActive?: boolean; + @internalProperty() private _error?: string; @internalProperty() private _params?: UserDetailDialogParams; @@ -48,6 +51,7 @@ class DialogUserDetail extends LitElement { this._error = undefined; this._name = params.entry.name || ""; this._isAdmin = params.entry.group_ids.includes(SYSTEM_GROUP_ID_ADMIN); + this._isActive = params.entry.is_active; await this.updateComplete; } @@ -91,15 +95,6 @@ class DialogUserDetail extends LitElement { ` : ""} - ${user.is_active - ? html` - ${this.hass.localize( - "ui.panel.config.users.editor.active" - )} - ` - : ""}
- - + - - + + + +
${!this._isAdmin ? html`
@@ -129,6 +128,27 @@ class DialogUserDetail extends LitElement { )} ` : ""} +
+ + + + + + +
@@ -192,11 +212,16 @@ class DialogUserDetail extends LitElement { this._isAdmin = ev.target.checked; } + private async _activeChanged(ev): Promise { + this._isActive = ev.target.checked; + } + private async _updateEntry() { this._submitting = true; try { await this._params!.updateEntry({ name: this._name.trim(), + is_active: this._isActive, group_ids: [ this._isAdmin ? SYSTEM_GROUP_ID_ADMIN : SYSTEM_GROUP_ID_USER, ], @@ -293,8 +318,13 @@ class DialogUserDetail extends LitElement { .state:not(:first-child) { margin-left: 8px; } - ha-switch { - margin-top: 8px; + .row { + display: flex; + padding: 8px 0; + } + ha-help-tooltip { + margin-left: 4px; + position: relative; } `, ]; diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index 55dbb018e2..db920b223f 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -46,10 +46,17 @@ export class HaConfigUsers extends LitElement { width: "25%", direction: "asc", grows: true, - template: (name) => html` - ${name || - this.hass!.localize("ui.panel.config.users.editor.unnamed_user")} - `, + template: (name, user: any) => + narrow + ? html` ${name}
+
+ ${user.username} | + ${this.hass.localize(`groups.${user.group_ids[0]}`)} +
` + : html` ${name || + this.hass!.localize( + "ui.panel.config.users.editor.unnamed_user" + )}`, }, username: { title: this.hass.localize( @@ -59,6 +66,7 @@ export class HaConfigUsers extends LitElement { filterable: true, width: "20%", direction: "asc", + hidden: narrow, template: (username) => html` ${username || this.hass!.localize("ui.panel.config.users.editor.unnamed_user")} @@ -71,13 +79,24 @@ export class HaConfigUsers extends LitElement { sortable: true, filterable: true, width: "20%", + direction: "asc", + hidden: narrow, template: (groupIds) => html` ${this.hass.localize(`groups.${groupIds[0]}`)} `, }, - }; - if (!narrow) { - columns.system_generated = { + is_active: { + title: this.hass.localize( + "ui.panel.config.users.picker.headers.is_active" + ), + type: "icon", + sortable: true, + filterable: true, + width: "80px", + template: (is_active) => + is_active ? html` ` : "", + }, + system_generated: { title: this.hass.localize( "ui.panel.config.users.picker.headers.system" ), @@ -87,8 +106,9 @@ export class HaConfigUsers extends LitElement { width: "160px", template: (generated) => generated ? html` ` : "", - }; - } + }, + }; + return columns; } ); diff --git a/src/translations/en.json b/src/translations/en.json index ce51d4fd3f..77ac8443e3 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2032,7 +2032,8 @@ "system_generated_users_not_removable": "Unable to remove system generated users.", "system_generated_users_not_editable": "Unable to update system generated users.", "unnamed_user": "Unnamed User", - "confirm_user_deletion": "Are you sure you want to delete {name}?" + "confirm_user_deletion": "Are you sure you want to delete {name}?", + "active_tooltip": "Controls if user can login" }, "add_user": { "caption": "Add user",