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

Add time condition in scenes #1151

Merged
merged 7 commits into from
Apr 22, 2021
Merged

Add time condition in scenes #1151

merged 7 commits into from
Apr 22, 2021

Conversation

Pierre-Gilles
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles commented Apr 19, 2021

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • Did you add fake requests data for the demo mode (front/src/config/demo.json) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

Add a new condition in scenes:

Screenshot 2021-04-19 at 11 57 20

@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

Merging #1151 (889eabf) into master (8224fc1) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1151      +/-   ##
==========================================
+ Coverage   96.27%   96.30%   +0.02%     
==========================================
  Files         639      639              
  Lines        8112     8141      +29     
==========================================
+ Hits         7810     7840      +30     
+ Misses        302      301       -1     
Impacted Files Coverage Δ
server/models/scene.js 93.75% <ø> (ø)
server/utils/constants.js 100.00% <ø> (ø)
server/lib/scene/scene.actions.js 97.34% <100.00%> (+0.79%) ⬆️
server/lib/scene/scene.execute.js 100.00% <100.00%> (+8.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8224fc1...889eabf. Read the comment docs.

@Pierre-Gilles Pierre-Gilles requested review from atrovato and VonOx April 19, 2021 06:31
Copy link
Contributor

@atrovato atrovato left a comment

Choose a reason for hiding this comment

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

On screen
image

The list is AM / PM format, but not the field, any way to fix it?
And blue "remove" cross on field is not really sexy.

For more, I tried it, but condition time is in GMT.
I setup a condition between 18:40 and 18h45, run at 18:40:47.

2021-04-20T18:40:47+0200 <debug> scene.actions.js:152 (Object.condition.check-time) Condition isAfterHour not verified. Now = Tue, 20 Apr 2021 16:40:47 GMT < afterDate = Tue, 20 Apr 2021 16:40:47 GMT
2021-04-20T18:40:47+0200 <error> scene.execute.js:20 () AbortScene [Error]: CONDITION_IS_AFTER_HOUR_NOT_VERIFIED

front/src/routes/scene/edit-scene/actions/CheckTime.jsx Outdated Show resolved Hide resolved
@Pierre-Gilles
Copy link
Contributor Author

Pierre-Gilles commented Apr 22, 2021

The list is AM / PM format, but not the field, any way to fix it?

Right I forgot to add the user locale :) Fixing it.

And blue "remove" cross on field is not really sexy.

I know it's terrible, I'll try to do something but it's the lib ^^

I setup a condition between 18:40 and 18h45, run at 18:40:47.

Edit: Found the bug, fixing it now. I did a wrong usage of the dayjs library.

@Pierre-Gilles
Copy link
Contributor Author

We are lucky, the guy who build the react date picker lib just added the ability to customize the clear button 2 days ago! Nice!

Screenshot 2021-04-22 at 10 22 58

@Pierre-Gilles
Copy link
Contributor Author

So I put the cross in grey, it looks better. Still, if anyone is CSS master and want to make it even better i'm open :D

Screenshot 2021-04-22 at 10 27 17

@Pierre-Gilles Pierre-Gilles merged commit ff0bfbb into master Apr 22, 2021
@Pierre-Gilles Pierre-Gilles deleted the add-time-condition branch April 22, 2021 03:51
Jean-PhilippeD pushed a commit to Jean-PhilippeD/Gladys that referenced this pull request Oct 13, 2021
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.

2 participants