fix(#5251): expose the colors configured in the settings directly rather then calling a method which is not allowed from Thymeleaf 3.1.4#5285
Conversation
15f91d2 to
9c3ab2d
Compare
|
Looks good except that CssColorUtils can be a static Utility class and do not need to be injected (just like PathUtils). I have pushed a change for that. |
…her then calling a method which is not allowed from Thymeleaf 3.1.4
I realized that, but I didn't want to change it without knowing why you guys made it as a bean in the first place. By the way, the build is broken now with your change 😅 |
|
@SteKoe what do you think about the idea of adding some tests to verify that the colors are properly populated both for the controller method and the CSS file? I know the current implementation is quite trivial and it's maybe even an overkill to test it, but having them could potentially avoid bugs in the future due to refactoring. For example: pass twice the same grade value in the controller for different colors or use a non matching name in the CSS file. |
|
@SteKoe I was about to add the tests but you've been faster 🙂 |
sorry! :D |
No worries 👍 Your implementation is actually better than the one I was thinking about ;) |
Takeover of #5264.
Fixes #5251.
Tested locally with the servlet & reactive samples with the profiles
dev,insecure,themedactive (themedconfig copied from the servlet example into the reactive for this reason).@SteKoe some of the tests actually fail on Windows, but they do fail also with the master branch, so I assume it's safe.