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[dev = true] #848

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

VaibhavSingh8
Copy link
Contributor

Date: 23 Sep 2024

Developer Name: Vaibhav Singh


Issue Ticket Number #819

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 that the delete confirmation modal is rendered correctly for super users.
  • Added tests to verify that the cancel and confirm buttons work as expected.

Notes:
The actual delete functionality is currently logged to the console and will be implemented in a future update.
The feature is only available when the dev flag is enabled.

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-09-23 at 3 00 27 AM Screenshot 2024-09-23 at 3 17 58 AM Screenshot 2024-09-23 at 3 18 28 AM Screenshot 2024-09-23 at 3 18 12 AM Screenshot 2024-09-23 at 3 18 45 AM

Test Coverage

Screenshot 1 Screenshot 2024-09-23 at 2 58 56 AM

Additional Notes

Copy link

cloudflare-workers-and-pages bot commented Oct 10, 2024

Deploying dashboard-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9cd3e2f
Status: ✅  Deploy successful!
Preview URL: https://a26f1d60.dashboard-rds.pages.dev
Branch Preview URL: https://feat-delete-groups.dashboard-rds.pages.dev

View logs

listiclehub1 and others added 22 commits November 4, 2024 18:59
* made identity-service-logs page infinite scrollable

* made identity-service-logs page infinite scrollable

* made changes for feature flag

---------

Co-authored-by: Amit Prakash <[email protected]>
* Display applied filters on applications page with clear option

* Added test case and feature falg for filter
#856)

* Display applied filters on applications page with clear option

* Added test case and feature falg for filter

* fixed the lazy loading bug due to filter
* added the infinite user loading feature

* fixed the bugs in the loading

* altered the API_BASE_URL to original one

* added the infinite user loading feature

* fixed the bugs in the loading

* altered the API_BASE_URL to original one

* updated the loader property

* updated the test for the loading feature

---------

Co-authored-by: Vinit khandal <[email protected]>
* New UI for profile update requests page

* Error handeling

* Handle API behind feature flag

* Style changes

* Refactor filenames

* Refactored some code

* Renamed

* Refactored css and added css variables
…ew button for application card (#853)

* enhancement: added total count for selected status and removed the view button for application card

* added tests

* Update applications.test.js

* fix: made changes to the test name

* Update applications.test.js

* Update index.html

* Update utils.js

* Update script.js

* Update script.js

* Update style.css

* Update style.css

* Update style.css

* Update style.css

* Update script.js

* Update style.css

* Update script.js
…ment-page (#860)

* resolved the conflicts

* fixed the user search feature bugs

* refactored constants file

* implemented the old changes

* resolved the conflicts

* fixed the user search feature bugs

* refactored constants file

* implemented the old changes

* added the test fot the empty search after search once

* fixed the repeating code

---------

Co-authored-by: Yash Raj <[email protected]>
* shows index on pending applications

* added data test-id to applications

* removed logs
* changed port number from 5500 to 8000

* Disabled forced spaces for sublists

* changed port number to 5500
changed tasks container details
* chore: fix test workflow file

* chore: add comment for verify

* chore: fix failing test
* enhancement: added shimmer effect

* added e2e tests

* removed comments from style.css

* Update tests.yml

This will be removed eventually

* Update tests.yml

* added uniform design to the card

* fixed small error
* fix: Added footer contaning repo link for every webpage

* fix: Added footer contaning repo link for every webpage

* Enhancement: Added tests for new URLs

* Enhancement: Added tests for new URLs

* Fix: Removed Live URLs which do not have footer from testing

* Enhancement: Fixed position for footer

* fix: removed commented content

* Enhancement: Used adata-test-id instead of class/id

* Fix: footer position styling

* Fix: changes using data-test-id

* Fix: Prettier changes

* Fix: minor bug fixes

* Enhancement: Made reusable footer component

* Enhancement: Replaced footer of webpages with footer component

* Fix: Minor fixes

* Fix: Removed additional footers

* Fix: Removed additional footers

* Fix: Removed additional footers

* Fix: Added styles in global stylesheet

* Fix: Minor fix of stylesheet

* Fix: Test timeout error

* Fix: Using data-test-id instead of classes

---------

Co-authored-by: Vinit khandal <[email protected]>
* remove dev-ff from groups page

* removed redundant code in search option of groups

* chaging discord groups to prefix search
…ed (#900)

* Fix: Side panel data not updating when different user cards are clicked

* renamed the variable

* added tests

* using staging api url for testing
…o super_user only (#896)

* Restrict approve and reject buttons on the Task Request detail page to super users only

* fixes naming convention, button render logic

* fix: reject button should not be part of the dom if condition not met

* changed the superUser data, make the task-request/script.js type module

* added tests how buttons should render for non-super user

* Update task-requestDetails.test.js

removed unused variable

* using data-testid for the tests

* importing the superuser data

* removing reject button from dom after successful task update

* put the changes behind the feature flag

---------

Co-authored-by: Achintya Chatterjee <[email protected]>
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.