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

feat: add delete confirmation dialog before real delete to prevent unexpected operation #1197

Merged

Conversation

xinatcg
Copy link
Contributor

@xinatcg xinatcg commented Apr 10, 2024

image

currently, all modal messages are the same, but the service supports custom titles and content for different usage.

#1123

Copy link
Member

@sesposito sesposito left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution!
The PR looks good, however, if possible, could you also replace the usage of the confirmDelete modal in config and chatMessages with the same approach?
Before this can be merged, you'll also need to run npm run-script build

@xinatcg
Copy link
Contributor Author

xinatcg commented Apr 11, 2024

Thank you very much for your contribution! The PR looks good, however, if possible, could you also replace the usage of the confirmDelete modal in config and chatMessages with the same approach? Before this can be merged, you'll also need to run npm run-script build

I just checked the config and chatMessage, there are existing modal with some special feature:
config: need Type 'DELETE' to confirm
https://github.com/xinatcg/nakama/blob/40b94f02ba508d9f816250f697525fdc741ec5f4/console/ui/src/app/config/config.component.html#L103-L110
chatMessage: Choose how many days to retain:
https://github.com/xinatcg/nakama/blob/40b94f02ba508d9f816250f697525fdc741ec5f4/console/ui/src/app/channels/chatMessages.component.html#L142-L151

do you think we should keep them? or need make the new shared service support these special feature?

@sesposito
Copy link
Member

sesposito commented Apr 11, 2024

@xinatcg it would be ideal if we can retain the current behavior, since these are specialized I don't think we need a shared service.

@xinatcg
Copy link
Contributor Author

xinatcg commented Apr 11, 2024

The PR looks good, however, if possible, could you also replace the usage of the confirmDelete modal in config and chatMessages with the same approach?

Ok, if so

The PR looks good, however, if possible, could you also replace the usage of the confirmDelete modal in config and chatMessages with the same approach?

Should we leave them out and only keep the code for others without confirmation?

@sesposito
Copy link
Member

sesposito commented Apr 11, 2024

I'll approve without those changes, but it would be good to touch on them as part of this PR, if possible. I think those modals aren't being displayed correctly due to the upgrade to Angular 15 changes.

@xinatcg
Copy link
Contributor Author

xinatcg commented Apr 11, 2024

I'll approve without those changes, but it would be good to touch on them as part of this PR, if possible. I think those modals aren't being displayed correctly due to the upgrade to Angular 15 changes.

make some updates to support formGroup with 2 control in the confirm component

Copy link
Member

@sesposito sesposito left a comment

Choose a reason for hiding this comment

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

Left a couple of suggestions but otherwise LGTM 👍

console/ui/src/app/config/config.component.ts Outdated Show resolved Hide resolved
console/ui/src/app/config/config.component.ts Outdated Show resolved Hide resolved
xinatcg and others added 2 commits April 12, 2024 16:10
Co-authored-by: Simon Esposito <simon@heroiclabs.com>
Co-authored-by: Simon Esposito <simon@heroiclabs.com>
@xinatcg
Copy link
Contributor Author

xinatcg commented Apr 12, 2024

Left a couple of suggestions but otherwise LGTM 👍

update with 2 suggestions. thanks

@sesposito
Copy link
Member

Please rerun npm run build and we'll get this merged 👍

@xinatcg
Copy link
Contributor Author

xinatcg commented Apr 12, 2024

Please rerun npm run build and we'll get this merged 👍

done

@sesposito sesposito merged commit b457bda into heroiclabs:master Apr 13, 2024
4 checks passed
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.

None yet

2 participants