-
Notifications
You must be signed in to change notification settings - Fork 17
feat(Header): add manage DB dropdown #2680
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
Conversation
2059f25 to
1923a1b
Compare
src/containers/Header/Header.tsx
Outdated
| } | ||
| }); | ||
| }, | ||
| className: b('remove-db'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to define className, just use theme: 'danger',
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, there wasn't such option previously, fixed
src/containers/Header/Header.scss
Outdated
| align-items: center; | ||
| } | ||
|
|
||
| &__remove-db { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may be removed after using theme: 'danger', for menu item
|
bugbot run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a "Manage" dropdown menu to the Header component on database pages, providing users with edit and delete database functionality. The dropdown appears when viewing a specific database and contains actions for editing or deleting the database based on user permissions.
Key changes:
- Integration of database management actions into the Header component
- Addition of permission-based visibility for edit/delete operations
- Implementation of dropdown menu with proper loading states and navigation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/store/reducers/tenant/tenant.ts | Utilizes prepareTenants utility function for tenant data processing |
| src/containers/Header/i18n/en.json | Adds internationalization keys for manage dropdown actions |
| src/containers/Header/Header.tsx | Implements manage dropdown with edit/delete database functionality |
| src/containers/Header/Header.scss | Adds styling for delete action with red color indicator |
src/containers/Header/Header.tsx
Outdated
| const isEnoughtData = clusterName && databaseData; | ||
|
|
||
| if (isEditDBAvailable && onEditDB && isEnoughtData) { |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name 'isEnoughtData' contains a spelling error. It should be 'isEnoughData' (missing 'u' in 'enough').
| const isEnoughtData = clusterName && databaseData; | |
| if (isEditDBAvailable && onEditDB && isEnoughtData) { | |
| const isEnoughData = clusterName && databaseData; | |
| if (isEditDBAvailable && onEditDB && isEnoughData) { |
src/containers/Header/Header.tsx
Outdated
| const isEnoughtData = clusterName && databaseData; | ||
|
|
||
| if (isEditDBAvailable && onEditDB && isEnoughtData) { |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'isEnoughtData' contains a spelling error. It should be 'isEnoughData' (missing 'u' in 'enough').
| const isEnoughtData = clusterName && databaseData; | |
| if (isEditDBAvailable && onEditDB && isEnoughtData) { | |
| const isEnoughData = clusterName && databaseData; | |
| if (isEditDBAvailable && onEditDB && isEnoughData) { |
src/containers/Header/Header.tsx
Outdated
| }, | ||
| }); | ||
| } | ||
| if (isDeleteDBAvailable && onDeleteDB && isEnoughtData) { |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'isEnoughtData' contains a spelling error. It should be 'isEnoughData' (missing 'u' in 'enough').
| if (isDeleteDBAvailable && onDeleteDB && isEnoughtData) { | |
| if (isDeleteDBAvailable && onDeleteDB && isEnoughData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no bugs!
|
/claude_review |
|
Claude finished @astandrik's task —— View job Code Review ResultsI've completed the review of this PR that adds a "Manage" dropdown to the Header component. Here are my findings: Todo List:
📋 Overall AssessmentThe implementation is generally well-structured and follows most YDB Embedded UI patterns, but there are several issues that need to be addressed. ✅ What's Done Right
🔴 Critical Issues1. Spelling Error (src/containers/Header/Header.tsx:124)The variable 2. CSS Anti-pattern (src/containers/Header/Header.scss:37-40)Using // Instead of className with !important CSS
{
text: headerKeyset('action_delete-db'),
iconStart: <TrashBin />,
theme: 'danger', // Add this
action: () => { ... },
// Remove: className: b('remove-db'),
}3. Missing Error HandlingThe delete action (src/containers/Header/Header.tsx:140-145) lacks error handling. If // Should be:
action: async () => {
try {
const isDeleted = await onDeleteDB({clusterName, databaseData});
if (isDeleted) {
const path = getClusterPath('tenants');
history.push(path);
}
} catch (error) {
// Handle error - show toast notification
}
},
|
Stand: https://nda.ya.ru/t/EpvLxdjq7HGMbL
Go to Database page, Manage dropdown will be in the Header
Closes #2100
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: 🔽
Current: 85.32 MB | Main: 85.36 MB
Diff: 0.04 MB (-0.04%)
✅ Bundle size decreased.
ℹ️ CI Information