mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +00:00
Hide adjust stat dialog unless it has a sum
This commit is contained in:
parent
f493280f0a
commit
1e540a36dd
@ -84,6 +84,8 @@ export interface StatisticsMetaData {
|
||||
statistic_id: string;
|
||||
source: string;
|
||||
name?: string | null;
|
||||
has_sum: boolean;
|
||||
has_mean: boolean;
|
||||
}
|
||||
|
||||
export type StatisticsValidationResult =
|
||||
|
@ -117,26 +117,26 @@ class HaPanelDevStatistics extends SubscribeMixin(LitElement) {
|
||||
actions: {
|
||||
title: "",
|
||||
type: "overflow-menu",
|
||||
template: (
|
||||
_info,
|
||||
statistic: StatisticsMetaData
|
||||
) => html`<ha-icon-overflow-menu
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
.items=${[
|
||||
{
|
||||
path: mdiSlopeUphill,
|
||||
label: localize(
|
||||
"ui.panel.developer-tools.tabs.statistics.adjust_sum"
|
||||
),
|
||||
action: () =>
|
||||
showStatisticsAdjustSumDialog(this, {
|
||||
statistic: statistic,
|
||||
}),
|
||||
},
|
||||
]}
|
||||
style="color: var(--secondary-text-color)"
|
||||
></ha-icon-overflow-menu>`,
|
||||
template: (_info, statistic: StatisticsMetaData) =>
|
||||
statistic.has_sum
|
||||
? html`<ha-icon-overflow-menu
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
.items=${[
|
||||
{
|
||||
path: mdiSlopeUphill,
|
||||
label: localize(
|
||||
"ui.panel.developer-tools.tabs.statistics.adjust_sum"
|
||||
),
|
||||
action: () =>
|
||||
showStatisticsAdjustSumDialog(this, {
|
||||
statistic: statistic,
|
||||
}),
|
||||
},
|
||||
]}
|
||||
style="color: var(--secondary-text-color)"
|
||||
></ha-icon-overflow-menu>`
|
||||
: html``,
|
||||
},
|
||||
})
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user