187 files

This commit is contained in:
Home Assistant Version Control
2026-10-09 11:57:31 +00:00
parent 28fa34d78a
commit 1e1b12d52b
187 changed files with 40899 additions and 32654 deletions
@@ -471,14 +471,15 @@ export function createIncentiveCard(P) {
admins *and* TaskMate parents get the Apply buttons. Defining one is
structural config, so the manage controls (pencil, add/edit/delete) are
admin-only — matching the `_parent` / `_admin` service gates. A child on
a shared tablet sees the list with no buttons. */
a shared tablet sees the list with no buttons. show_parent_actions: false
(#1032) gives a parent who stays signed in on that tablet the same view. */
_canApply() {
return window.__taskmate_is_parent(this.hass);
return this.config?.show_parent_actions !== false && window.__taskmate_is_parent(this.hass);
}
_canManage() {
return !!this.hass?.user?.is_admin;
return this.config?.show_parent_actions !== false && !!this.hass?.user?.is_admin;
}
_toggleEditMode() {
@@ -1065,6 +1066,7 @@ export function createIncentiveCard(P) {
return [
{ name: 'entity', selector: { entity: { domain: 'sensor' } } },
{ name: 'title', selector: { text: {} } },
{ name: 'show_parent_actions', selector: { boolean: {} } },
{
name: 'card_design',
selector: {
@@ -1083,6 +1085,7 @@ export function createIncentiveCard(P) {
const labels = {
entity: this._t('common.editor.overview_entity'),
title: this._t('common.editor.card_title'),
show_parent_actions: this._t('common.editor.show_parent_actions'),
card_design: this._t('common.design.field_label'),
};
return labels[entry.name] ?? entry.name;
@@ -1091,6 +1094,7 @@ export function createIncentiveCard(P) {
_computeHelper = (entry) => {
const helpers = {
entity: this._t('common.editor.overview_entity_helper'),
show_parent_actions: this._t('common.editor.show_parent_actions_helper'),
};
return helpers[entry.name] ?? '';
};
@@ -1100,6 +1104,7 @@ export function createIncentiveCard(P) {
const data = {
entity: this.config.entity || '',
title: this.config.title || '',
show_parent_actions: this.config.show_parent_actions !== false,
card_design: this.config.card_design || 'global',
};
return html`