feat: add user ban functionality with API integration and UI components #14725
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Done
This pull request introduces a new feature for managing user bans in the credentials dashboard. It includes the addition of new API functions, UI components, and data handling for user bans. The most important changes are summarised below:
New API Functions
getUserBans
andensureCUEUserBan
functions to handle fetching and updating user bans. (static/js/src/advantage/credentials/dashboard/api/queryFns.ts
)UI Components
UserBanForm
andUserBans
components to create and display user bans, respectively. (static/js/src/advantage/credentials/dashboard/components/UserBanForm/UserBanForm.tsx
) [1] (static/js/src/advantage/credentials/dashboard/components/UserBans/UserBans.tsx
) [2]Routes
component. (static/js/src/advantage/credentials/dashboard/components/Routes/Routes.tsx
)Sidebar
component to include a link to the user bans page. (static/js/src/advantage/credentials/dashboard/components/Sidebar/Sidebar.tsx
)Utility Functions
common.ts
. (static/js/src/advantage/credentials/dashboard/utils/common.ts
)Backend Integration
webapp/app.py
) [1] (webapp/shop/api/ua_contracts/api.py
) [2] (webapp/shop/cred/views.py
) [3]QA
./run serve
ordotrun
/credentials/dashboard/users/ensure-ban
and create a user ban/credentials/dashboard/users/user-bans
Issue / Card
Fixes
WD-18762
WD-18763
WD-18764
Help
QA steps - Commit guidelines