Skip to content

Commit

Permalink
fix layout issues in sensor group dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsfaber committed Mar 6, 2024
1 parent 461e232 commit f94be68
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,21 @@ export class CreateSensorGroupDialog extends SubscribeMixin(LitElement) {
render() {
if (!this._params) return html``;
return html`
<ha-dialog open @closed=${this.closeDialog} @close-dialog=${this.closeDialog} .heading=${this.renderHeader()}>
<ha-dialog open .heading=${true} @closed=${this.closeDialog} @close-dialog=${this.closeDialog}>
<ha-dialog-header slot="heading">
<ha-icon-button slot="navigationIcon" dialogAction="close" .path=${mdiClose}>
</ha-icon-button>
<span slot="title">
${this.data.group_id
? localize(
'panels.sensors.dialogs.edit_group.title',
this.hass.language,
'{name}',
this.sensorGroups[this.data.group_id!].name
)
: localize('panels.sensors.dialogs.create_group.title', this.hass.language)}
</span>
</ha-dialog-header>
<div class="wrapper">
<settings-row dialog>
<span slot="heading">
Expand Down Expand Up @@ -122,27 +136,6 @@ export class CreateSensorGroupDialog extends SubscribeMixin(LitElement) {
`;
}

renderHeader() {
return html`
<span class="header_title">
${this.data.group_id
? localize(
'panels.sensors.dialogs.edit_group.title',
this.hass.language,
'{name}',
this.sensorGroups[this.data.group_id!].name
)
: localize('panels.sensors.dialogs.create_group.title', this.hass.language)}
</span>
<ha-icon-button
.label=${this.hass.localize('ui.dialogs.generic.close')}
.path=${mdiClose}
dialogAction="close"
class="header_button"
></ha-icon-button>
`;
}

renderSensorOptions() {
const sensors = Object.keys(this.sensors)
.filter(e => !isDefined(this.sensors[e].group) || this.sensors[e].group === this.data.group_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ export class ManageSensorGroupsDialog extends SubscribeMixin(LitElement) {
render() {
if (!this._params) return html``;
return html`
<ha-dialog open .heading=${this.renderHeader()} @closed=${this.closeDialog} @close-dialog=${this.closeDialog}>
<ha-dialog open .heading=${true} @closed=${this.closeDialog} @close-dialog=${this.closeDialog}>
<ha-dialog-header slot="heading">
<ha-icon-button slot="navigationIcon" dialogAction="close" .path=${mdiClose}>
</ha-icon-button>
<span slot="title">${localize('panels.sensors.dialogs.manage_groups.title', this.hass.language)}</span>
</ha-dialog-header>
<div class="wrapper">
<div class="description">
${localize('panels.sensors.dialogs.manage_groups.description', this.hass.language)}
Expand All @@ -68,19 +73,6 @@ export class ManageSensorGroupsDialog extends SubscribeMixin(LitElement) {
`;
}

renderHeader() {
return html`
<span class="header_title">${localize('panels.sensors.dialogs.manage_groups.title', this.hass.language)}</span>
<ha-icon-button
.label=${this.hass.localize('ui.dialogs.generic.close')}
.path=${mdiClose}
dialogAction="close"
class="header_button"
>
</ha-icon-button>
`;
}

renderGroup(item: SensorGroup) {
return html`
<ha-card
Expand Down

0 comments on commit f94be68

Please sign in to comment.