Skip to content

Commit

Permalink
Merge branch 'issue-353' of github.com:ioBroker/ioBroker.vis-2 into i…
Browse files Browse the repository at this point in the history
…ssue-353
  • Loading branch information
foxriver76 committed Feb 5, 2024
2 parents bd25973 + 0c41c99 commit da6c167
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ E.g., if it was used in a menu and the menu is red, the circle would be red.
### **WORK IN PROGRESS**
* (foxriver76) fixed multiple problems with nested groups
* (foxriver76) allow to select widgets in group via click (previously only dropdown worked)
* (foxriver76) fixed issue, that Basic Image 8 is not configurable for 0 value

### 2.9.28 (2024-02-03)
* (foxriver76) correctly determine the vis instance in all cases
Expand Down
2 changes: 1 addition & 1 deletion src/public/widgets/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"en": "Write here css style, like: 'color:red;background:white'",
"de": "Hier muss CSS Stil stehen, wie 'color:red;background:white'",
"ru": "CSS Стиль, например: 'color:red;background:white'"},
"count": {"en": "Values number to", "de": "Wertsanzahl bis", "ru": "Количество значений до"},
"count": {"en": "Values number to", "de": "Werteanzahl bis", "ru": "Количество значений до"},
"test_list": {"en": "Test value", "de": "Testwert", "ru": "Тестовое значение"},
"urlValue": {"en": "Call URL on click", "de": "Rufe URL bei click", "ru": "Вызвать URL при нажатии"},
"group_ccontrol": {"en": "Advanced control", "de": "Extrasteuerung", "ru": "Продвинутое управление"},
Expand Down
4 changes: 2 additions & 2 deletions src/src/Vis/Widgets/Basic/BasicImage8.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class BasicImage8 extends VisRxWidget<RxData> {
{
name: 'count',
type: 'number',
default: 1,
default: 0,
onChange: async (_field: unknown, data: Record<string, any>, changeData: (data: Record<string, any>) => void) => {
const { count } = data;

Expand All @@ -46,7 +46,7 @@ export default class BasicImage8 extends VisRxWidget<RxData> {
}, {
name: 'images',
label: 'Image',
indexFrom: 1,
indexFrom: 0,
indexTo: 'count',
fields: [
{
Expand Down
4 changes: 3 additions & 1 deletion src/src/Vis/visWidgetsCatalog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ export const parseAttributes = (widgetParams, widgetIndex, commonGroups, commonF
commonGroups = commonGroups || { common: 1 };
commonFields = commonFields || {};
const fields = deepClone(widgetParams);
let groupIndex = fields.findIndex(group => group.indexFrom);
let groupIndex = fields.findIndex(group => typeof group.indexFrom === 'number');

while (groupIndex > -1) {
const group = fields[groupIndex];
group.singleName = group.name;
Expand All @@ -518,6 +519,7 @@ export const parseAttributes = (widgetParams, widgetIndex, commonGroups, commonF
delete group.indexFrom;
delete group.indexTo;
const indexedGroups = [];

for (let i = from; i <= to; i++) {
const indexedGroup = {
...deepClone(group),
Expand Down

0 comments on commit da6c167

Please sign in to comment.