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

Comment section: Use int for part hash. #10965

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gokaysatir
Copy link
Contributor

@gokaysatir gokaysatir commented Jan 20, 2025

Check container existence before setting edit mode.

Fixes adding comment to wrong part in Impress.

@gokaysatir
Copy link
Contributor Author

@lpranam can you have a look when you have time? This fixes the issue you found earlier. cc @eszkadev

@gokaysatir gokaysatir requested a review from eszkadev January 20, 2025 14:41
@lpranam
Copy link
Member

lpranam commented Jan 21, 2025

When I click somewhere in empty area and then try to insert comment with keyboard shortcut I am getting A comment is being edited dialog

Check container existence before setting edit mode.

Signed-off-by: Gökay Şatır <[email protected]>
Change-Id: I4c3a4a27c515f1ee3c44c501b5a64550128c50bd
Fetching the comments can be initiated also by us.

Signed-off-by: Gökay Şatır <[email protected]>
Change-Id: I006f0f8bd264f72356f13e8c77269279d7a5001d
@gokaysatir gokaysatir force-pushed the private/gokay/latlng-6 branch from 6da2971 to 241edd6 Compare January 21, 2025 14:17
@@ -120,7 +120,7 @@ export class Comment extends CanvasSectionObject {
this.sectionProperties.showSelectedCoordinate = true; // Writer.

if (app.map._docLayer._docType === 'presentation' || app.map._docLayer._docType === 'drawing') {
this.sectionProperties.parthash = this.sectionProperties.data.parthash;
this.sectionProperties.parthash = parseInt(this.sectionProperties.data.parthash);
Copy link
Contributor

Choose a reason for hiding this comment

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

if parthash inside data should be always a number, shouldn't we do it once when we receive that data and assign to sectionProperties? so we don't have to convert again.
Can we have number type assigned to it so TS compiler will warn about incorrect usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is the right place. This is constructor and sectionProperties.data is an input parameter.

@eszkadev
Copy link
Contributor

Can we have some cypress test here too?

@@ -2366,17 +2366,6 @@ export class CommentSection extends app.definitions.canvasSectionObject {
this.disableLayoutAnimation = true;
var comment;
if (Comment.isAnyEdit()) {
this.map.uiManager.showConfirmModal(
Copy link
Contributor

Choose a reason for hiding this comment

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

So probably we should detect when we initiate import or not (as optional param?)
Then we can show the dialog only when needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have below lines:

			if (refreshAnnotation)
				app.socket.sendMessage('commandvalues command=.uno:ViewAnnotations');

I guess that re-import breaks things. My take is to keep this modal out for now. We have onACKComment and it also seems to do the job.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it is only for now, then would be good to keep strings so we will not lost translations already done.
Could you move it to separate method (not used) - if that's the case. If not we can delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact, i think refreshAnnotation boolean is somehow needed and it re-imports all the comments. In that case, "importComments" is not something that is called at initialization. All the comments are re-imported when that function is called. Including the one we just created and still editing. So i think we can't have that confirmation modal there.

We need to remove it. Then we can have a better look at the function calls and add something else i guess.

@lpranam
Copy link
Member

lpranam commented Jan 22, 2025

comments are working as expected now

@gokaysatir
Copy link
Contributor Author

Can we have some cypress test here too?

I will check and hopefully add a Cypress test soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Review
Development

Successfully merging this pull request may close these issues.

3 participants