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: UI for deleting discord groups by super users #909

Merged
merged 3 commits into from
Nov 9, 2024

Conversation

VaibhavSingh8
Copy link
Contributor

@VaibhavSingh8 VaibhavSingh8 commented Nov 5, 2024

Date: 06 Nov 2024

Developer Name: Vaibhav Singh


Issue Ticket Number

Description

This PR introduces the ability for super users to delete discord groups. The feature is currently gated behind a development flag (dev). The following changes were made to implement this feature:

Changes:

  1. createElement.js:
  • createCard Function:

    • Added a delete button to the card's HTML if isSuperUser is true.
    • Added an event listener to the delete button to call onDelete with the group's ID.
  • createDeleteConfirmationModal Function:

    • Created a new function to generate the delete confirmation modal with onClose and onConfirm handlers.
  1. render.js:
  • renderGroupById Function:

    • Updated to pass onDelete and isSuperUser to createCard.
  • renderDeleteConfirmationModal Function:

    • Created a new function to render the delete confirmation modal.
  • removeDeleteConfirmationModal Function:

    • Created a new function to remove the delete confirmation modal.
  1. script.js:
  • Helper Functions:

    • Added showDeleteModal function to render the delete confirmation modal for super users.
  • Rendering Logic:

    • Updated the renderAllGroups function to include the onDelete handler for super users when the dev flag is enabled.

Tests:

  • Added tests to ensure the functionality is available only under the feature flag
  • Added tests to ensure the delete confirmation modal is rendered correctly for super users.
  • Added tests to verify that the cancel and confirm buttons work as expected.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1 Screenshot 2024-11-06 at 2 58 32 AM Screenshot 2024-11-06 at 2 58 42 AM Screenshot 2024-11-06 at 2 59 16 AM Screenshot 2024-11-06 at 3 00 00 AM

Test Coverage

Screenshot 1 Screenshot 2024-11-06 at 2 47 06 AM

Additional Notes

@VaibhavSingh8
Copy link
Contributor Author

Hi @vinit717 @Achintya-Chatterjee @yesyash

Please review my PR.

Thank you!

@iamitprakash iamitprakash merged commit de2e4aa into develop Nov 9, 2024
5 checks passed
@iamitprakash iamitprakash deleted the feat/delete-groups-ui branch November 9, 2024 14:02
@VaibhavSingh8 VaibhavSingh8 mentioned this pull request Nov 21, 2024
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.

Feature: Super user can delete Discord groups
2 participants