-
Notifications
You must be signed in to change notification settings - Fork 64
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
Remove lock to delete or rearrange process links #4850
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.
These changes break the existing functionality and are insufficient to fix the linked issue. Just allowing the user to click linked processes in the metadata editor does not work without actually adding functionality to tell the system what to do with selected linked processes.
Without that new functionality, with just these changes, selecting a linked process in the metadata editor leads to IllegalStateExceptions
like the following:
@matthias-ronge did you actually test your changes?
I only removed the block because we had a customer complaint that it was not possible to delete or move links. I had built in these functions two years ago and they worked at the time. I admit that I am amazed at the mistake. There should actually be no error. For example, you could give this element metadata—whether that is intentional or makes sense is another question. It's good that I'll look it again. |
this is the code where the /**
* Determine and return StructureElementViewInterface corresponding to structure element currently selected or to be
* added via AddDocStructTypeDialog.
*
* @param dataEditor DataEditorForm instance used to determine StructureElementViewInterface
* @return StructureElementViewInterface corresponding to structure element currently selected or to be added
*/
public static StructuralElementViewInterface getStructuralElementView(DataEditorForm dataEditor) {
Optional<LogicalDivision> selectedStructure = dataEditor.getSelectedStructure();
if (selectedStructure.isPresent()) {
return dataEditor.getRulesetManagement()
.getStructuralElementView(
selectedStructure.get().getType(),
dataEditor.getAcquisitionStage(), dataEditor.getPriorityList());
} else {
TreeNode selectedLogicalNode = dataEditor.getStructurePanel().getSelectedLogicalNode();
if (Objects.nonNull(selectedLogicalNode)
&& selectedLogicalNode.getData() instanceof StructureTreeNode) {
StructureTreeNode structureTreeNode = (StructureTreeNode) selectedLogicalNode.getData();
if (structureTreeNode.getDataObject() instanceof View) {
View view = (View) structureTreeNode.getDataObject();
if (Objects.nonNull(view.getPhysicalDivision())) {
return dataEditor.getRulesetManagement().getStructuralElementView(
view.getPhysicalDivision().getType(),
dataEditor.getAcquisitionStage(), dataEditor.getPriorityList());
}
}
}
}
throw new IllegalStateException();
} For me this is spontaneously confusing, because the selected structure should be given, right? Didn't you select anything when you selected the link? Or is the selection not considered selected by JSF? I am spontaneously at a loss. |
e7eb67a
to
0bf8eb1
Compare
I am not experiencing the exception you reported. For me, this works as expected. |
I checked in the debugger: When I click the link, the function is called, but |
I think I found out why you couldn't reproduce the error. It only occurs for me when I select parent processes in the structure tree, but not when I click on child processes: Bildschirmvideo.aufnehmen.2021-12-09.um.10.28.07.mov |
Additionally, I think something is not updated correctly when removing a linked child process in the metadata editor structure tree using the "Remove element" context menu option. |
Thanks for the hint. I'll take a closer look at that. If deleting doesn't work anymore, that's a bug. |
0bf8eb1
to
cca3157
Compare
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 still get the same error
Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java
Show resolved
Hide resolved
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.
The exception is now handled correctly and selecting linked processes does not result in an IlllegalStateException
anymore. 👍
But there are still some problems that need to be resolved:
- rearranging linked child processes via drag'n'drop results in wrong error messages (see first attached video below)
- removing a linked parent process does not work (see second attached video below); if this is not supposed to work, the corresponding option in the context menu should be deactivated/hidden when selecting parent processes
- context menu options
Element hinzufügen
,Typ des Strukturelements ändern
andMedien hochladen
do not work for linked processes and should be deactivated or hidden (see screenshots below)
rearrange-links-error.mov
remove-link-to-parent.mov
Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java
Show resolved
Hide resolved
Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java
Show resolved
Hide resolved
Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java
Show resolved
Hide resolved
Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java
Show resolved
Hide resolved
Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java
Show resolved
Hide resolved
6df05e4
to
55e94ef
Compare
A rebase is no longer possible because the diff is no longer understandable. Development is terminated. |
Fixes #3275