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 switch to hide/show inactive templates #5353

Closed
wants to merge 4 commits into from

Conversation

solth
Copy link
Member

@solth solth commented Sep 15, 2022

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.

@solth solth requested a review from thomaslow September 16, 2022 10:45
Copy link
Collaborator

@thomaslow thomaslow left a comment

Choose a reason for hiding this comment

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

The implemented toggle UI component looks a bit out of character:
image

In other views there is a menu at the bottom of the list, which allows to show or hide certain elements, e.g. the task list:

image

Maybe such a menu would be more consistent with the existing design language of Kitodo?

*/
public List<TemplateDTO> getTemplates() {
return templates;
return templates.stream().filter(TemplateDTO::isActive).collect(Collectors.toList());
Copy link
Collaborator

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?

Copy link
Member Author

@solth solth Jan 14, 2023

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.

Kitodo/src/test/java/org/kitodo/selenium/ListingST.java Outdated Show resolved Hide resolved
@solth solth force-pushed the inactive-templates branch 2 times, most recently from 65e52e1 to 6ef11be Compare October 6, 2022 13:56
@solth solth force-pushed the inactive-templates branch from 6ef11be to 16dc7f2 Compare November 1, 2022 13:59
@solth solth force-pushed the inactive-templates branch from 16dc7f2 to 5f989d6 Compare November 22, 2022 08:05
@solth solth force-pushed the inactive-templates branch from 5f989d6 to 951c10d Compare February 7, 2023 08:41
@solth solth force-pushed the inactive-templates branch from 951c10d to a5dbf1e Compare February 7, 2023 14:24
@solth solth closed this Mar 24, 2023
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.

Remove switch to create unreachable production templates
2 participants