eclipse-thingweb / node-red

Collection of Node-RED packages of Eclipse Thingweb
https://thingweb.io
3 stars 3 forks source link

Consumer Flow Creating Issues #19

Open egekorkan opened 6 months ago

egekorkan commented 6 months ago

Otherwise, it works

egekorkan commented 6 months ago

I forgot to tag you @hidetak, but do you think you can have a look at these points? Also let me know if these are intended in a way

egekorkan commented 6 months ago

After this, I think we can publish the release ;)

hidetak commented 6 months ago

@egekorkan

Thanks for the confirmation!

TD is not accepted if the action does not have an input. Pasting http://plugfest.thingweb.io:8083/testthing gives tdAction.input is undefined. First, we should be more flexible since not all actions have an input. Second, the error should be pointing to the action if we want to show the error.

As described in the README, it is unclear how to implement the case where there are no action arguments or return values, and it is not currently supported. Do you know of any implementation examples? If there is a example, I would like to refer to it.

Sorry, the above was a comment about uncertainties regarding Server-side nodes. Your point is only about the Consumer Flow generation functionality. I will modify it to output a text form if the TD does not contain a type.

Same for properties. I get DATATYPES[tdProperty.type] is undefined when there is no type. This has no type: http://plugfest.thingweb.io:8083/counter for countAsImage

I thought Property required a type. I'll check to see how it works without a type.

It would be better to add an invoke button to actions and a message saying "action invoked". Enter gives feedback if the action works as intended but if the action does not work, I cannot be sure if I managed to invoke it in the first place. Something similar would be good for properties and events as well, i.e. "property X read" etc.

I too thought it would be better to execute it with a button, but the timing of when the text form sends the message needs to be selected from below.

image

Therefore, if it were controlled by a button, the flow would be complicated by the need to temporarily store it in a context. Since this flow also serves as a sample for creating a WoT consumer, I thought it would be better to keep it simple and decided to control it with the enter key. I agree about displaying text when enter is pressed. I will try to fix it.

Not sure if this is from the plugin or from flowfuse, but when I have two UIs deployed, pressing on "Open Dashboard" on the second thing's flow brings me to the first thing's UI.

If multiple UIs are implemented in one flow, they can be selected from the hamburger menu in the upper left corner as shown below.

image

egekorkan commented 6 months ago

Thank you taking a look!

I thought Property required a type. I'll check to see how it works without a type.

There can be directly an enum or oneOf( or other combinations words) so for properties you can generate a text field if you don't see a type

I will modify it to output a text form if the TD does not contain a type.

For actions, you should not generate any form if there's no input but that means we would need a button to invoke. I understand the annoyance it causes and for now we can have a "dummy" text input that says "please click on the text field and press enter to invoke the action"

If multiple UIs are implemented in one flow, they can be selected from the hamburger menu in the upper left corner as shown below.

Alright thanks :)

hidetak commented 5 months ago

@egekorkan

An example of Consumer UI is provided.

image

I will proceed with the implementation here, but I would appreciate any comments you may have.

egekorkan commented 5 months ago

@hidetak the direction looks really nice and I do not see any issues at this stage

hidetak commented 5 months ago

@egekorkan I have corrected the points you raised and created a PR #25. I apologize for the inconvenience, but I would be happy if you could check it.