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

fix(ui): enhance notification and authorization logic in UI components #4428

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

luannmoreira
Copy link
Member

Description

This PR introduces several improvements to the notification handling and authorization logic in the UI. These updates modernize the code structure, enhance role-based permissions, and improve the maintainability of critical components.
Key Changes:

Authorizer Update:
    Added actions.notification.view to the authorizer object to enable role-based access to notification views.

Notification.vue Refactor:
    Migrated to <script setup> syntax for better readability and alignment with modern Vue practices.
    Simplified computed properties and watchers, consolidating logic for fetching and displaying notifications.
    Improved error handling for notifications, ensuring consistency across edge cases.

ApiKeyGenerate.vue Enhancement:
    Updated role logic by replacing isOwner with isAdmin to support both administrator and owner roles.
    Adjusted the dropdown role handling for API key roles to reflect these changes.

General Improvements:
    Reduced redundancy and improved code clarity in notification-related operations.
    Increased alignment of components with best practices.

Impact:

Improved UX: More consistent handling of notifications and API roles.
Code Maintainability: Refactored structure simplifies further enhancements and debugging.
Expanded Role Flexibility: Supports more nuanced role definitions for permissions.

Testing Notes:

Verify notification display and error handling under different roles and namespaces.
Test API key generation dropdown logic to ensure roles are correctly enabled/disabled based on permissions.
Confirm backward compatibility with existing user flows.

- Added `actions.notification.view` to `authorizer` for improved role-based
permissions.

- Refactored `Notification.vue` to use `<script setup>` syntax for better
maintainability.

- Consolidated notification logic for fetching and displaying notifications.

- Enhanced `ApiKeyGenerate.vue` by replacing `isOwner` with `isAdmin` to handle
multiple roles (`administrator`, `owner`).

- Updated role-based UI logic in API key roles dropdown.

These changes improve role-based authorization and modernize the codebase
for better readability and functionality.
@luannmoreira luannmoreira added kind/bug Something isn't working area/ui javascript Pull requests that update Javascript code status/good-to-merge labels Dec 12, 2024
@luannmoreira luannmoreira self-assigned this Dec 12, 2024
@luannmoreira luannmoreira requested a review from a team as a code owner December 12, 2024 17:36
@gustavosbarreto gustavosbarreto merged commit b93945e into master Dec 13, 2024
16 checks passed
@gustavosbarreto gustavosbarreto deleted the fix/authorization-overhaul branch December 13, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui javascript Pull requests that update Javascript code kind/bug Something isn't working status/good-to-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants