node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

Widget: Number Input

Open gayanSandamal opened this issue 1 year ago • 5 comments

Description

This feature contains the widget for the number input

ui-number-input

Related Issue(s)

Widget: Number Input

Checklist

  • Dashboard widget ✅
  • Tests ✅
  • Docs of the widget (including tryout button) ✅
  • Interactive dashboard docs - Will be created and published once the widget published 🚀
  • [x] I have read the contribution guidelines
  • [x] Suitable unit/system level tests have been added and they pass
  • [x] Documentation has been updated
    • [ ] Upgrade instructions
    • [ ] Configuration details
    • [ ] Concepts
  • [ ] Changes flowforge.yml?
    • [ ] Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • [ ] Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • [ ] Includes a DB migration? -> add the area:migration label

gayanSandamal avatar Aug 07 '24 09:08 gayanSandamal

Your 2 x E2E tests are failing, and have you 4 being skipped?

Screenshot 2024-08-08 at 12 22 06

joepavitt avatar Aug 08 '24 11:08 joepavitt

Your 2 x E2E tests are failing, and have you 4 being skipped?

Screenshot 2024-08-08 at 12 22 06

This is my bad. I saw couple of time out issues so I thought it's because of the existing issue https://github.com/FlowFuse/node-red-dashboard/issues/882

I will update them

gayanSandamal avatar Aug 08 '24 18:08 gayanSandamal

Checkout the other PR I've opened up for the E2E docs which will help get your local environment uo and running

joepavitt avatar Aug 08 '24 18:08 joepavitt

Checkout the other PR I've opened up for the E2E docs which will help get your local environment uo and running

Thank you so much. I will check it for sure

gayanSandamal avatar Aug 08 '24 19:08 gayanSandamal

Checkout the other PR I've opened up for the E2E docs which will help get your local environment uo and running

This is ready for to review

Screenshot 2024-08-09 at 23 58 28 Screenshot 2024-08-09 at 23 57 52

gayanSandamal avatar Aug 09 '24 18:08 gayanSandamal

If I type a double-digit number into the widget, then a message is sent halfway through typing the number - this isn't desirable.

I'd expect the event to be sent when either the up/down arrows are selected, or after I've move focus out of the number input, or set a 300ms timeout (or something similar) that waits to make sure no other input follows, before sending the message

joepavitt avatar Aug 13 '24 09:08 joepavitt

either

I'll work on that

gayanSandamal avatar Aug 13 '24 09:08 gayanSandamal

If I type a double-digit number into the widget, then a message is sent halfway through typing the number - this isn't desirable.

I'd expect the event to be sent when either the up/down arrows are selected, or after I've move focus out of the number input, or set a 300ms timeout (or something similar) that waits to make sure no other input follows, before sending the message

@joepavitt Ihis is handled by setting the delay to 300ms by default, as this widget emits its value immediately after each update. Therefore, the user can change the delay as desired.

Screenshot 2024-08-14 at 12 20 54

Updated the tests as well ✅

gayanSandamal avatar Aug 14 '24 06:08 gayanSandamal

Be careful. when you're pushing, you force pushed and overrode changes I had previously committed to your branch

joepavitt avatar Aug 14 '24 08:08 joepavitt

Be careful. when you're pushing, you force pushed and overrode changes I had previously committed to your branch

I apologize for that! I didn't realize I was overriding your changes. I'll be more cautious with force pushes in the future. Thanks for letting me know.

gayanSandamal avatar Aug 14 '24 09:08 gayanSandamal

I'll be more cautious with force pushes in the future.

If git has prompted you to do a force push, then that means you're likely doing something wrong, e.g. changes on the remote branch you haven't pulled/merged. You shouldn't ever have to force push except in exceptional circumstances

joepavitt avatar Aug 14 '24 09:08 joepavitt

@gayanSandamal you have many failing tests again, I checked locally and they're all failing there too - once again, please make sure your tests are passing locally before requesting review

joepavitt avatar Aug 14 '24 09:08 joepavitt

@gayanSandamal you have many failing tests again, I checked locally and they're all failing there too - once again, please make sure your tests are passing locally before requesting review

I ran the tests locally before pushing them and all the tests got passed as below and in the github actions also as below.

Screenshot 2024-08-14 at 12 11 57

Regarding the other test widget failures I thought it's because this random test failure reported https://github.com/FlowFuse/node-red-dashboard/issues/882

gayanSandamal avatar Aug 14 '24 09:08 gayanSandamal

Make sure you're running npm run cy:run not just the tests in isolation, as there may be unintended consequences across other tests.

#882 normally causes one or two failures in the control.spec and sometimes one or two form failures, but nothing else.

Running tests locally, all the number-input tests fail.

Screenshot 2024-08-14 at 10 20 37

You are right i that there do appear to be some other rogue E2E's that have snuck in though as seeing failures in https://github.com/FlowFuse/node-red-dashboard/actions/runs/10384786458/job/28752541405?pr=1206 too

joepavitt avatar Aug 14 '24 09:08 joepavitt

@joepavitt I'm marking this as ready to review as the tests are passing locally

Screenshot 2024-08-15 at 13 54 17

gayanSandamal avatar Aug 15 '24 08:08 gayanSandamal

Still getting a failure in GH - can you remove any tests that rely on a timeout please, and just keep tests where click interaction trigger the payload being sent, e.g. click of up/down arrows

No point us having the tests in there if they're inconsistently reporting as it'll be a distraction on every PR we open

joepavitt avatar Aug 15 '24 08:08 joepavitt

Still getting a failure in GH - can you remove any tests that rely on a timeout please, and just keep tests where click interaction trigger the payload being sent, e.g. click of up/down arrows

No point us having the tests in there if they're inconsistently reporting as it'll be a distraction on every PR we open

Removed the unstable tests of the number input as discussed. There's random test failure happens on other tests as well. I've tried by re-running the GH job

gayanSandamal avatar Aug 15 '24 10:08 gayanSandamal