Skip to content

Commit

Permalink
Merge branch 'master' into no-vis-1
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Jan 23, 2025
2 parents a7a5176 + 43d312f commit 8dc3e78
Show file tree
Hide file tree
Showing 11 changed files with 699 additions and 535 deletions.
606 changes: 408 additions & 198 deletions packages/iobroker.vis-2/src-vis/public/widgets/basic/js/table.js

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions packages/iobroker.vis-2/src-vis/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1190,17 +1190,17 @@ class Editor extends Runtime<EditorProps, EditorState> {
return;
}
this.setState({ selectedGroup: groupId });
this.setSelectedWidgets([]);
void this.setSelectedWidgets([]);
};

undo = async (): Promise<void> => {
this.setSelectedWidgets([]);
void this.setSelectedWidgets([]);
await this.changeProject(this.state.history[this.state.historyCursor - 1], true);
await this.setStateAsync({ historyCursor: this.state.historyCursor - 1 });
};

redo = async (): Promise<void> => {
this.setSelectedWidgets([]);
void this.setSelectedWidgets([]);
await this.changeProject(this.state.history[this.state.historyCursor + 1], true);
await this.setStateAsync({ historyCursor: this.state.historyCursor + 1 });
};
Expand Down Expand Up @@ -1669,13 +1669,15 @@ class Editor extends Runtime<EditorProps, EditorState> {
const project = deepClone(store.getState().visProject);
const widget = project[this.state.selectedView].widgets[id];
if (widget?.marketplace) {
const marketplace = deepClone(
const marketplace: MarketplaceWidgetRevision | null = deepClone(
store
.getState()
.visProject.___settings.marketplace.find(item => item.widget_id === widget.marketplace.widget_id),
);
await this.deleteWidgetsAction();
await this.addMarketplaceWidget(marketplace.id, null, null, id, widget.data, widget.style);
if (marketplace) {
await this.addMarketplaceWidget(marketplace.id, null, null, id, widget.data, widget.style);
}
}
};

Expand Down Expand Up @@ -2152,13 +2154,12 @@ class Editor extends Runtime<EditorProps, EditorState> {
name: view,
widgets: [],
};
Object.keys(store.getState().visProject[view].widgets).forEach((widget: AnyWidgetId) => {
const pWidgets = store.getState().visProject[view].widgets;
Object.keys(pWidgets).forEach((widget: AnyWidgetId) => {
if (
this.state.updateWidgetsDialog &&
store.getState().visProject[view].widgets[widget].marketplace?.widget_id ===
this.state.updateWidgetsDialog.widget_id &&
store.getState().visProject[view].widgets[widget].marketplace?.version !==
this.state.updateWidgetsDialog.version
pWidgets[widget].marketplace?.widget_id === this.state.updateWidgetsDialog.widget_id &&
pWidgets[widget].marketplace?.version !== this.state.updateWidgetsDialog.version
) {
viewWidgets.widgets.push(widget);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';

import { Icon } from '@iobroker/adapter-react-v5';
import type { RxRenderWidgetProps, VisBaseWidgetProps } from '@iobroker/types-vis-2';
import type { RxRenderWidgetProps, VisBaseWidgetProps, WidgetData } from '@iobroker/types-vis-2';
import VisRxWidget from '@/Vis/visRxWidget';

export interface RxDataBasicImageGeneric {
export interface RxDataBasicImageGeneric extends WidgetData {
stretch: boolean;
refreshInterval: number;
refreshOnWakeUp: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import React, { type CSSProperties } from 'react';

import { I18n } from '@iobroker/adapter-react-v5';

import type { RxRenderWidgetProps, RxWidgetInfo, RxWidgetInfoGroup } from '@iobroker/types-vis-2';
import type { RxRenderWidgetProps, RxWidgetInfo, RxWidgetInfoGroup, WidgetData } from '@iobroker/types-vis-2';
import VisRxWidget from '../../visRxWidget';

interface RxData {
interface RxData extends WidgetData {
oid: string;
count: number;
[key: `contains_view_${number}`]: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ import { FormControl, FormLabel, Slider, Stack, LinearProgress } from '@mui/mate

import { Icon, type LegacyConnection } from '@iobroker/adapter-react-v5';

import VisRxWidget, { type VisRxData, type VisRxWidgetState } from '../../visRxWidget';
import VisRxWidget, { type VisRxWidgetState } from '../../visRxWidget';
import type {
RxRenderWidgetProps,
RxWidgetInfo,
RxWidgetInfoAttributesField,
VisBaseWidgetProps,
WidgetData,
Writeable,
} from '@iobroker/types-vis-2';

interface RxData extends VisRxData {
interface RxData extends WidgetData {
type: 'single' | 'range';
oid: string;
click_id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import React from 'react';

import { I18n } from '@iobroker/adapter-react-v5';
import type { RxRenderWidgetProps, RxWidgetInfo } from '@iobroker/types-vis-2';
import type { RxRenderWidgetProps, RxWidgetInfo, WidgetData } from '@iobroker/types-vis-2';
import VisRxWidget from '../../visRxWidget';
import InstallSwipe from './InstallSwipe';

interface RxData {
interface RxData extends WidgetData {
left_nav_view: string;
right_nav_view: string;
hideIndication: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import React from 'react';
import { Tab, Tabs } from '@mui/material';
import { Icon } from '@iobroker/adapter-react-v5';

import type { RxRenderWidgetProps, RxWidgetInfo } from '@iobroker/types-vis-2';
import type { RxRenderWidgetProps, RxWidgetInfo, WidgetData } from '@iobroker/types-vis-2';
import VisRxWidget, { type VisRxWidgetState } from '../../visRxWidget';

interface RxData {
interface RxData extends WidgetData {
show_tabs: number;
vertical: boolean;
variant: '' | 'centered' | 'fullWidth';
Expand Down
Loading

0 comments on commit 8dc3e78

Please sign in to comment.