Skip to content

Commit

Permalink
update title
Browse files Browse the repository at this point in the history
  • Loading branch information
namnguyen20999 committed Jun 19, 2024
1 parent dcb2dcc commit cc67c5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
11 changes: 6 additions & 5 deletions frontend/taipy-gui/src/components/Taipy/Metric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface MetricProps extends TaipyBaseProps, TaipyHoverProps {
template_Light_?: string;
}

const emptyLayout = {} as Record<string, Record<string, unknown>>;
const emptyLayout = {} as Partial<Layout>;
const defaultStyle = {position: "relative", display: "inline-block"};

const Metric = (props: MetricProps) => {
Expand Down Expand Up @@ -145,10 +145,11 @@ const Metric = (props: MetricProps) => {
layout.template = template;
}

return {
title: props.title || layout.title,
...layout
} as Partial<Layout>
if (props.title) {
layout.title = props.title;

Check warning on line 149 in frontend/taipy-gui/src/components/Taipy/Metric.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 150 in frontend/taipy-gui/src/components/Taipy/Metric.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

return layout as Partial<Layout>;
}, [
props.title,
props.template,
Expand Down
5 changes: 0 additions & 5 deletions taipy/gui/viselements.json
Original file line number Diff line number Diff line change
Expand Up @@ -1198,11 +1198,6 @@
"name": "template[light]",
"type": "dict",
"doc": "The Plotly <a href=\"https://plotly.com/javascript/layout-template/\">layout template</a> applied over the base template when theme is not dark."
},
{
"name": "hover_text",
"type": "dynamic(str)",
"doc": "The information that is displayed when the user hovers over this element."
}
]
}
Expand Down

0 comments on commit cc67c5b

Please sign in to comment.