Skip to content

Commit

Permalink
* (bluefox) Improved icon selector: you can upload your own icon dire…
Browse files Browse the repository at this point in the history
…ctly
  • Loading branch information
GermanBluefox committed Sep 17, 2023
1 parent 52e3e93 commit e3ffe9c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ E.g., if it was used in a menu and the menu is red, the circle would be red.

## Todo
- Ignore not used widgets in runtime
- Allow by default upload of files only in the current project directory

<!--
Placeholder for the next version (at the beginning of the line):
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@devbookhq/splitter": "^1.4.2",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@iobroker/adapter-react-v5": "^4.5.3",
"@iobroker/adapter-react-v5": "^4.5.4",
"@iobroker/vis-2-widgets-react-dev": "^0.4.6",
"@material-icons/svg": "^1.0.33",
"@mui/icons-material": "^5.14.8",
Expand Down
2 changes: 2 additions & 0 deletions src/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,8 @@ class App extends Runtime {
return this.state.legacyFileSelector ? <SelectFileDialog
title={I18n.t('Select file')}
onClose={() => this.setState({ legacyFileSelector: false })}
restrictToFolder={`${this.adapterName}.${this.instance}/${this.state.projectName}`}
allowNonRestricted
allowUpload
allowDownload
allowCreateFolder
Expand Down
2 changes: 2 additions & 0 deletions src/src/Attributes/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,8 @@ const View = props => {
{showDialog ? <SelectFileDialog
title={I18n.t('Select file')}
onClose={() => setShowDialog(false)}
restrictToFolder={`${props.adapterName}.${props.instance}/${props.projectName}`}
allowNonRestricted
allowUpload
allowDownload
allowCreateFolder
Expand Down
2 changes: 2 additions & 0 deletions src/src/Attributes/Widget/WidgetField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ const WidgetField = props => {
{idDialog ? <SelectFileDialog
title={t('Select file')}
onClose={() => setIdDialog(false)}
restrictToFolder={`${adapterName}.${instance}/${projectName}`}
allowNonRestricted
allowUpload
allowDownload
allowCreateFolder
Expand Down
3 changes: 2 additions & 1 deletion src/src/Components/MaterialIconSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
} from '@mui/icons-material';

import { I18n, Utils, Icon } from '@iobroker/adapter-react-v5';
import UploadFile from "./UploadFile";

import UploadFile from './UploadFile';

const MAX_ICONS = 250;

Expand Down
2 changes: 2 additions & 0 deletions src/src/Toolbar/Projects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ const Tools = props => {
filesDialog ? <SelectFileDialog
title={I18n.t('Browse files')}
onClose={() => setFilesDialog(false)}
restrictToFolder={`${props.adapterName}.${props.instance}/${props.projectName}`}
allowNonRestricted
ready
allowUpload
allowDownload
Expand Down

0 comments on commit e3ffe9c

Please sign in to comment.