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

Enable edit and delete info-comments #5703

Merged

Conversation

pontus-osterdahl
Copy link
Contributor

@pontus-osterdahl pontus-osterdahl commented Jul 4, 2023

This pull request adds the functionality to edit and delete info-comments. Fixes #5702

  • Add editCommentDialog.xhtml

  • Enable removal of Comment in CommentService and CommentsForm

  • Add integration test for CommentService

  • Changed properties of comments association in Process bean

  • Add messages for editing and deleting comments

  • Update kitodo.css

matthias-ronge and others added 30 commits March 30, 2023 10:20
If someone get this message as he use a non valid entry it would be very
difficult to find the right place and the causing issue. Maybe something
like that "Used not supported reimport case {}" where{} is replaced by
the wrong value can make it easier for him.
... of a class that implements an interface. Even if an object
implements an interface, it's still an object and not an interface, so
this naming is misleading. It fixes a bit of Javadoc as well, and
eliminates an unnecessary call to the module loader every time a script
is run, since the module was loaded when the class was instantiated.
* Add editCommentDialog.xhtml

* Enable removal of Comment in CommentService and CommentsForm

* Add integration test for CommentService

* Changed properties of comments association in Process bean

* Add edit comment messages

* Update kitodo.css
* Added missing javadoc

* Codacy issue
Codacy
@oliver-stoehr
Copy link
Collaborator

I think you got it right, but I recorded a video just to be clear:
error

It seems like the editCommentDialog.xhtml is rendered after an action like pressing "Save" updated the page. I think the rendering fails because editedComment is already set to null at that point.
Adding rendered="#{CommentForm.getEditedComment() ne null}" to the editCommentForm seems to fix the issue!

Ensure editcommentform is only rendered when edited comment is not null
@solth
Copy link
Member

solth commented Sep 21, 2023

@pontus-osterdahl would you mind rebasing your branch against the current master since there have been some fixes for the tests and builds since you first opened this pull request?

pontus-osterdahl and others added 10 commits September 21, 2023 13:05
* Add editCommentDialog.xhtml

* Enable removal of Comment in CommentService and CommentsForm

* Add integration test for CommentService

* Changed properties of comments association in Process bean

* Add edit comment messages

* Update kitodo.css
* Added missing javadoc

* Codacy issue
Codacy
* Only allow edit/delete by author and newest comment

* Corrected incorrect include
* Remove unnecessary code CommentService.java

* Add Comment to ObjectType.java

* Add helper method call in CommentForm.java
Ensure editcommentform is only rendered when edited comment is not null
@pontus-osterdahl
Copy link
Contributor Author

@solth done.

@solth
Copy link
Member

solth commented Sep 21, 2023

@pontus-osterdahl thank you for the update. I think something went wrong with the Github logic, though, since your pull request now lists 113 changed files with 2052 added and 474 deleted lines in those files:

Bildschirmfoto 2023-09-21 um 14 07 57

Your pull request now seems to (wrongly) list all files changed in the master since you first opened your pull request as changes of your pull request and differences between your branch and the master.

The commit message of the merge commit also looks a little suspicious:

Bildschirmfoto 2023-09-21 um 14 14 52

Shouldn't this read "Merge branch 'master' of https://github.com/kitodo/kitodo-production into Enable-editing-and-delete-info-comments"?

Clicking on your branch in your fork however correctly states the number of changed files and lines:

Bildschirmfoto 2023-09-21 um 14 09 38

so I guess the branch itself is in the correct state, just the pull request is somehow broken.

I am not sure what went wrong here but I have a bad feeling about merging this pull request in this form. Could you open a new pull request from the branch - without any additional changes - to see if it will state the number of changes correctly? Sorry for the additional hassle!

@pontus-osterdahl pontus-osterdahl marked this pull request as draft September 21, 2023 18:15
@pontus-osterdahl
Copy link
Contributor Author

pontus-osterdahl commented Sep 21, 2023

@solth Thanks for your comment and please excuse the inconvenience! I opened a new pull request #5785 and I think that it looks ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It should be possible to edit/delete comments
9 participants