Ca peut être pas mal pour éviter la redondance quand on programme une scène
J’y pensais aussi justement !
Bonne idée La seule chose auquel il faut être sûr, c’est qu’il n’y ait pas de dépendance circulaire (une scène A appelle une scène B qui elle même appelle la scène A) ce qui ferait boucler Gladys et bloquerait l’instance de l’utilisateur…
Hop cette fonctionnalité a été mergée ici:
GladysAssistant:master
← rob-mccann:scene-chain
opened 02:55PM - 05 Apr 21 UTC
### Pull Request check-list
- [x] If your changes affects code, did your writ… e the tests?
- [x] Are tests passing? (`npm test` on both front/server)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new features/services, did you run integration comparator? (`npm run compare-translations` on front)
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
- [x] If you are adding a new features/services which needs explanation, did you modify the user documentation? See [the GitHub repo](https://github.com/GladysAssistant/v4-website) and the [website](https://gladysassistant.com).
- [x] 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](https://demo.gladysassistant.com).
### Description of change
This change adds an action to scenes which triggers another scene.
![image](https://user-images.githubusercontent.com/412744/113777609-398b1d80-9723-11eb-8f3f-53ba8c090031.png)
A few assumptions have been made here which I'd be happy to revisit based on feedback:
- There's no validation that a scene exists in the backend
- A scene can only trigger another scene once across all action groups
- In the cyclical scenario (for example, Scene A that triggers Scene B that triggers Scene A), each scene will be called once only and a warning message logged. This is handled at execution time by remembers which scenes were already called.
- There's no cyclical checks/validation done when a scene is created at the moment; I suggest this is handled in a separate PR to make this easier to review and in the interest of making it incrementally better :)
- At the moment, there isnt trigger shown in the scene being called
If you're happy with the approach, I'll go ahead and update the docs.
Closes #797
Je ferme le sujet
3 « J'aime »