-
Notifications
You must be signed in to change notification settings - Fork 63
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 switch to hide/show inactive templates #5353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*/ | ||
public List<TemplateDTO> getTemplates() { | ||
return templates; | ||
return templates.stream().filter(TemplateDTO::isActive).collect(Collectors.toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better not to add logic to a DTO bean. If inactive templates are not needed when querying a project for its templates, they should probably not be indexed in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you in principle about avoiding business logic in DTOs, but I think we still need to add inactive templates to the index. Most list views are filled from the index and unless I miss something here we wouldn't be able to edit and re-activate inactive templates if they were not in the index and consequently would not appear in the list.
65e52e1
to
6ef11be
Compare
6ef11be
to
16dc7f2
Compare
16dc7f2
to
5f989d6
Compare
5f989d6
to
951c10d
Compare
951c10d
to
a5dbf1e
Compare
Fixes #3311
Instead of removing the switch to create unreachable templates, as was proposed in the linked issue, this pull requests restores the - presumably - intended behaviour of filtering the list of templates available to create a new process for a project by the templates
active
values. In addition, a switch in the template list on the project page can be used to toggle whether inactive templates are shown in that list or not.