Skip to content

Commit

Permalink
Merge branch 'master' into remove-double-file-browser
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/admin/src-admin/src/components/ObjectBrowser.tsx
  • Loading branch information
GermanBluefox committed Nov 5, 2024
2 parents caf99b5 + 1d5a5e6 commit b88e676
Show file tree
Hide file tree
Showing 34 changed files with 578 additions and 2,055 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
run: |
cd packages/admin/src-admin
npm run check-ts
# Wait till js-controller 7 types are available
continue-on-error: true

- name: 'Build'
run: |
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ The icons may not be reused in other projects without the proper flaticon licens
<!--
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
- (@GermanBluefox) Corrected cloud icon for admin

### 7.2.6 (2024-10-11)

- (@GermanBluefox) Trying to fix a GUI build process
Expand Down
981 changes: 156 additions & 825 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@alcalzone/release-script-plugin-lerna": "^3.7.0",
"@iobroker/build-tools": "^2.0.6",
"@iobroker/eslint-config": "^0.1.6",
"@emotion/styled": "^11.13.0",
"@emotion/react": " ^11.13.3",
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/x-data-grid": "^7.18.0",
"@mui/x-date-pickers": "^7.18.0",
"lerna": "^8.1.8"
},
"scripts": {
Expand Down
10 changes: 1 addition & 9 deletions packages/adapter-react-v5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ If you want to create the configuration page with ReactJS:
"dependencies": {
"@iobroker/adapter-react-v5": "^7.2.6",
"@iobroker/build-tools": "^1.0.0",
"@iobroker/eslint-config": "^0.1.2",
"@mui/material": "^6.0.2",
"@mui/icons-material": "^6.0.2",
"@sentry/browser": "^8.28.0",
"babel-eslint": "^10.1.0",
"eslint": "^9.10.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "^5.0.1",
"react-icons": "^5.3.0"
"react-scripts": "^5.0.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
14 changes: 7 additions & 7 deletions packages/adapter-react-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@
},
"homepage": "https://github.com/ioBroker/iobroker.admin#readme",
"dependencies": {
"@emotion/styled": "^11.13.0",
"@emotion/react": "^11.13.3",
"@iobroker/js-controller-common": "^6.0.11",
"@iobroker/js-controller-common-db": "^6.0.11",
"@iobroker/socket-client": "^3.1.1",
"@iobroker/types": "^6.0.11",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@mui/x-date-pickers": "^7.19.0",
"@sentry/browser": "^8.33.1",
"@mui/icons-material": "^6.1.5",
"@mui/material": "^6.1.5",
"@sentry/browser": "^8.35.0",
"cronstrue": "^2.50.0",
"react-color": "^2.19.3",
"react-colorful": "^5.6.1",
"react-cropper": "^2.3.3",
"react-dropzone": "^14.2.9",
"react-icons": "^5.3.0",
"react-inlinesvg": "^4.1.3"
"react-dropzone": "^14.2.10",
"react-inlinesvg": "^4.1.4"
},
"devDependencies": {
"@babel/core": "^7.25.7",
Expand Down
8 changes: 6 additions & 2 deletions packages/adapter-react-v5/src/Components/FileViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import React, { Component, type JSX } from 'react';
import { TextField, Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton } from '@mui/material';

// Icons
import { FaCopy as CopyIcon } from 'react-icons/fa';
import { Close as CloseIcon, Save as SaveIcon, Brightness6 as Brightness5Icon } from '@mui/icons-material';
import {
Close as CloseIcon,
Save as SaveIcon,
Brightness6 as Brightness5Icon,
ContentCopy as CopyIcon,
} from '@mui/icons-material';

import type { Connection } from '@iobroker/socket-client';

Expand Down
3 changes: 1 addition & 2 deletions packages/adapter-react-v5/src/Components/UploadImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Cropper, type ReactCropperElement } from 'react-cropper';

import { Menu, MenuItem, Tooltip, IconButton } from '@mui/material';

import { Close as IconClose, Crop as CropIcon } from '@mui/icons-material';
import { FaFileUpload as UploadIcon } from 'react-icons/fa';
import { Close as IconClose, Crop as CropIcon, UploadFileOutlined as UploadIcon } from '@mui/icons-material';

import { I18n } from '../i18n';
import { Icon } from './Icon';
Expand Down
10 changes: 4 additions & 6 deletions packages/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"body-parser": "^1.20.3",
"compression": "^1.7.4",
"connect-flash": "^0.1.1",
"cookie-parser": "^1.4.6",
"express": "^4.21.0",
"cookie-parser": "^1.4.7",
"express": "^4.21.1",
"express-fileupload": "^1.5.1",
"express-session": "^1.18.0",
"express-session": "^1.18.1",
"json5": "^2.2.3",
"mime": "^3.0.0",
"passport": "^0.7.0",
Expand All @@ -49,11 +49,9 @@
"devDependencies": {
"@iobroker/build-tools": "^2.0.6",
"@iobroker/dm-gui-components": "file:../dm-gui-components",
"@iobroker/eslint-config": "^0.1.6",
"@iobroker/json-config": "file:../jsonConfig",
"@iobroker/legacy-testing": "^1.0.13",
"@iobroker/testing": "^5.0.0",
"@iobroker/types": "^7.0.0",
"@types/archiver": "^6.0.2",
"@types/body-parser": "^1.19.5",
"@types/compression": "^1.7.5",
Expand All @@ -69,7 +67,7 @@
"colorette": "^2.0.20",
"less": "^4.2.0",
"mocha": "^10.7.3",
"puppeteer": "^23.5.3",
"puppeteer": "^23.6.0",
"sinon-chai": "^3.7.0",
"src-rx": "file:src-admin",
"typescript": "^5.6.3"
Expand Down
34 changes: 10 additions & 24 deletions packages/admin/src-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@iobroker/dm-gui-components": "file:../../dm-gui-components",
"@iobroker/json-config": "file:../../jsonConfig",
"@iobroker/adapter-react-v5": "file:../../adapter-react-v5",
"http-proxy-middleware": "^3.0.2"
"http-proxy-middleware": "^3.0.3"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
Expand All @@ -36,67 +36,53 @@
"@honkhonk/vite-plugin-svgr": "^1.1.0",
"@iobroker/admin-component-easy-access": "^1.0.8",
"@iobroker/dm-utils": "^0.5.0",
"@iobroker/eslint-config": "^0.1.6",
"@iobroker/js-controller-common-db": "^7.0.0",
"@iobroker/socket-client": "^3.1.1",
"@iobroker/types": "^7.0.0",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@react-leaflet/core": "^2.1.0",
"@sentry/browser": "^8.33.1",
"@tsconfig/node16": "^16.1.3",
"@types/ace": "^0.0.52",
"@types/crypto-js": "^4.2.2",
"@types/leaflet": "^1.9.12",
"@types/leaflet": "^1.9.14",
"@types/less": "^3.0.6",
"@types/lodash": "^4.17.10",
"@types/mocha": "^10.0.8",
"@types/node": "^22.7.4",
"@types/react": "^18.3.11",
"@types/lodash": "^4.17.12",
"@types/mocha": "^10.0.9",
"@types/node": "^22.8.1",
"@types/react": "^18.3.12",
"@types/react-color": "^3.0.12",
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^18.3.1",
"buffer": "^6.0.3",
"copy-to-clipboard": "^3.3.3",
"craco-babel-loader": "^1.0.4",
"craco-module-federation": "^1.1.0",
"cron-parser": "^4.9.0",
"cronstrue": "^2.50.0",
"crypto-js": "^4.2.0",
"date-fns": "^4.1.0",
"echarts": "^5.5.1",
"echarts-for-react": "^3.0.2",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-react": "^7.0.1",
"eslint-plugin-react": "^7.37.2",
"ipaddr.js": "^2.2.0",
"json5": "^2.2.3",
"leaflet": "^1.9.4",
"leaflet-geosearch": "^4.0.0",
"less": "^4.2.0",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"ol": "^10.2.1",
"react": "^18.3.1",
"react-ace": "^12.0.0",
"react-color": "^2.19.3",
"react-cropper": "^2.3.3",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd-multi-backend": "^8.0.3",
"react-dnd-preview": "^8.0.3",
"react-dnd-touch-backend": "^16.0.1",
"react-dom": "^18.3.1",
"react-dropzone": "^14.2.9",
"react-icons": "^5.3.0",
"react-inlinesvg": "^4.1.3",
"react-leaflet": "^4.2.1",
"react-markdown": "^9.0.1",
"react-monaco-editor": "^0.56.1",
"react-monaco-editor": "^0.56.2",
"react-qr-code": "^2.0.15",
"react-scripts": "^5.0.1",
"react-showdown": "^2.3.1",
"react-sortable-hoc": "^2.0.0",
"semver": "^7.6.3",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.6.2"
"tsconfig-paths-webpack-plugin": "^4.1.0"
},
"proxya": "http://127.0.0.1:8081",
"plugins": [
Expand Down
6 changes: 6 additions & 0 deletions packages/admin/src-admin/public/img/admin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions packages/admin/src-admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2384,9 +2384,13 @@ class App extends Router<AppProps, AppState> {
if (this.state.user && this.props.width !== 'xs' && this.props.width !== 'sm') {
return (
<div>
{this.state.systemConfig.common.siteName ? (
<div style={styles.siteName}>{this.state.systemConfig.common.siteName}</div>
) : null}
{
// @ts-expect-error fixed in js-controller 7
this.state.systemConfig.common.siteName ? (
// @ts-expect-error fixed in js-controller 7
<div style={styles.siteName}>{this.state.systemConfig.common.siteName}</div>
) : null
}

<Box
component="div"
Expand Down Expand Up @@ -2429,7 +2433,9 @@ class App extends Router<AppProps, AppState> {
</div>
);
}
// @ts-expect-error fixed in js-controller 7
if (this.props.width !== 'xs' && this.props.width !== 'sm' && this.state.systemConfig.common.siteName) {
// @ts-expect-error fixed in js-controller 7
return <div style={styles.siteName}>{this.state.systemConfig.common.siteName}</div>;
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,7 @@ export default abstract class AdapterGeneric<
.getObject(`system.adapter.${this.props.adapterName}`)
.then(obj => {
if (obj?.common) {
// @ts-expect-error must be defined
obj.common.ignoreVersion = ignoreVersion;
(obj.common as any).ignoreVersion = ignoreVersion;
this.props.context.socket
.setObject(obj._id, obj)
.catch(error => window.alert(`Cannot write object: ${error}`));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ class BaseSettingsLog extends Component<BaseSettingsLogProps, BaseSettingsLogSta
if (settings.transport[id].type === 'file') {
const multiplier =
typeof settings.transport[id].maxSize === 'string'
? settings.transport[id].maxSize.includes('k')
? (settings.transport[id].maxSize as string).includes('k')
? 0.1
: settings.transport[id].maxSize.includes('g')
: (settings.transport[id].maxSize as string).includes('g')
? 10
: 1
: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ const DragObjectBrowser = (props: DragObjectBrowserProps): JSX.Element => {
style={props.stylesParent.icon}
src={
objectRef.current
? getSelectIdIconFromObjects(
? (getSelectIdIconFromObjects(
objectRef.current,
dragProps.item.data.obj._id,
props.lang,
)
) as string | React.JSX.Element)
: dragProps.item.data.obj.common.icon
}
/>
Expand Down
12 changes: 6 additions & 6 deletions packages/admin/src-admin/src/components/IsVisible.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type JSX } from 'react';
import { type ReactElement, type JSX } from 'react';

function getAttr(obj: Record<any, any>, attr: string | string[]): boolean {
if (!obj) {
Expand All @@ -22,20 +22,20 @@ interface IsVisibleProps {
name?: string;
config?: Record<string, any>;
value?: boolean;
children: JSX.Element | JSX.Element[] | string;
children: JSX.Element | JSX.Element[];
}

function IsVisible(props: IsVisibleProps): JSX.Element | JSX.Element[] | string {
function IsVisible(props: IsVisibleProps): ReactElement<any, any> {
const { config, children, name, value } = props;

if (value !== undefined) {
return value === false ? null : children;
return value === false ? null : (children as ReactElement<any, any>);
}
if (!config) {
return children;
return children as ReactElement<any, any>;
}
if (getAttr(config, name) !== false) {
return children;
return children as ReactElement<any, any>;
}
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/src-admin/src/components/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class Markdown extends Component<MarkdownProps, MarkdownState> {
prefix: string;
}) => JSX.Element;

private readonly meta: () => string;
private readonly meta: (_props: any) => JSX.Element;

private readonly link: () => JSX.Element;

Expand Down Expand Up @@ -579,7 +579,7 @@ class Markdown extends Component<MarkdownProps, MarkdownState> {
</h6>
);
};
this.meta = () => 'meta'; // text, id, level, prefix,
this.meta = () => <span>meta</span>; // text, id, level, prefix,

this.link = () => <div>linkAAAAA</div>; // text, id, level, prefix,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ class ObjectChart extends Component<ObjectChartProps, ObjectChartState> {
},
},
xAxis: {
type: 'time',
// type: 'time',
splitLine: {
show: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ class ObjectCustomEditor extends Component<ObjectCustomEditorProps, ObjectCustom
// evaluate function
if (
this._executeCustom(
this.jsonConfigs[adapter].json.hidden,
this.jsonConfigs[adapter].json.hidden as string,
data,
customObj,
instanceObj,
Expand All @@ -573,7 +573,7 @@ class ObjectCustomEditor extends Component<ObjectCustomEditorProps, ObjectCustom
(this.jsonConfigs[adapter].json.help as Record<ioBroker.Languages, string>)[this.props.lang] ||
(this.jsonConfigs[adapter].json.help as Record<ioBroker.Languages, string>).en;
} else {
help = this.props.t(this.jsonConfigs[adapter].json.help);
help = this.props.t(this.jsonConfigs[adapter].json.help as string);
}
}

Expand Down
Loading

0 comments on commit b88e676

Please sign in to comment.