Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed type of ignoreInVersions in visWidgets #2629

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

GermanBluefox
Copy link
Contributor

No description provided.

@foxriver76
Copy link
Collaborator

foxriver76 commented Mar 11, 2024

is it correct like this or recent change? If it was a recent design change, then we should avoid having properties with free chooseable names and fixed names on the same level.

Also in the schema it is not on level of visWidgets property but on the level of the individual widgetSet.. so what is now if I want to provide one widget set exclusive for vis1 another exclusive for vis2? This would no longer be configurable..

@GermanBluefox
Copy link
Contributor Author

is it correct like this or recent change? If it was a recent design change, then we should avoid having properties with free chooseable names and fixed names on the same level.

Also in the schema it is not on level of visWidgets property but on the level of the individual widgetSet.. so what is now if I want to provide one widget set exclusive for vis1 another exclusive for vis2? This would no longer be configurable..

I changed a bit

@@ -677,7 +675,8 @@ declare global {
unsafePerm?: true;
/** The available version in the ioBroker repo. */
version: string;
visWidgets?: Record<string, VisWidget>;
/** The vis widget does not support the listed major versions of vis */
visWidgets?: Record<string, VisWidget> | { ignoreInVersions?: number[] };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you can either define via widgets or ignore I do not think it is the intention. See also my previous comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it works in vis like this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, please confirm:

Valid:

....
"visWidgets": {
    "ignoreInVersions": [2]
}
.... 

Valid:

....
"visWidgets": {
    "mySuperWidget": { ... }
}
.... 

Invalid:

....
"visWidgets": {
    "mySuperWidget": { ... },
    "ignoreInVersions": [2]
},
.... 

Maybe add some type tests to types-public package in index.test-d.ts to ensure it works like intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants