Skip to content

Commit

Permalink
fix(#157): add global sort options to UI editor
Browse files Browse the repository at this point in the history
  • Loading branch information
MindFreeze committed Mar 2, 2024
1 parent 2116cfd commit 439b965
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ export class SankeyChartEditor extends LitElement implements LovelaceCardEditor
{ name: 'min_state', selector: { number: { mode: 'box', min: 0., step: 'any' } } },
{ name: 'static_scale', selector: { number: { mode: 'box' } } },
{ name: 'round', selector: { number: { mode: 'box', unit_of_measurement: localize('editor.decimals') } } },
{ name: 'throttle', selector: { number: { mode: 'box', unit_of_measurement: 'ms' } } },
{
name: 'unit_prefix',
selector: {
Expand All @@ -196,6 +195,29 @@ export class SankeyChartEditor extends LitElement implements LovelaceCardEditor
},
},
},
{
name: 'sort_by',
selector: {
select: {
mode: 'dropdown',
options: [{ value: '' }, { value: 'state', label: localize('editor.sort_by.state') }],
},
},
},
{
name: 'sort_dir',
selector: {
select: {
mode: 'dropdown',
options: [
{ value: '' },
{ value: 'desc', label: localize('editor.sort_dir.desc') },
{ value: 'asc', label: localize('editor.sort_dir.asc') },
],
},
},
},
{ name: 'throttle', selector: { number: { mode: 'box', unit_of_measurement: 'ms' } } },
],
},
];
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"color_limit": "State limit for color change",
"color_above": "Color above limit",
"color_below": "Color below limit",
"sort_by": "Sort by",
"sort_dir": "Sort direction",
"section": {
"min_width": "Min width",
"sort_by": "Sort by",
Expand Down

0 comments on commit 439b965

Please sign in to comment.