-
Notifications
You must be signed in to change notification settings - Fork 390
fix: [UIE-9003] - DBaaS - node selector options for premium and provide plan disabling behavior in resize #12634
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: [UIE-9003] - DBaaS - node selector options for premium and provide plan disabling behavior in resize #12634
Conversation
…ans and provide disabling behavior for plans by region in resize
| onSelect={(selected: string) => setSelectedPlanId(selected)} | ||
| regionsData={regionData ? [regionData] : undefined} | ||
| selectedId={selectedPlanId} | ||
| selectedRegionID={databaseRegion} |
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.
Providing the selectedRegionID is what allows the plansPanel to check for region availability and whether a region supports specific types of plans. Though the region for the database cluster can't be changed in resize, we still need to provide it so that the disabling logic works.
…rom PlansPanel are only made for new database clusters
| const databaseRegion = | ||
| flags.databasePremium && database.platform === 'rdbms-default' | ||
| ? database.region | ||
| : ''; |
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.
Pushed up a change so that this logic is only applied to new database clusters.
| regionAvailabilities: regionAvailabilities ?? [], | ||
| selectedRegionId: databaseRegion, | ||
| }) | ||
| : false; |
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.
nit(non-blocking): I think getIsLimitedAvailability returns a boolean of false if falsy
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.
@jaalah-akamai It was written this way because the plan provided to getIsLimitedAvailability can't be undefined. However, since currentPlan uses the .find method, it has both the plan type and undefined.
const currentPlan = displayTypes?.find((type) => type.id === database.type);
const isCurrentPlanUnavailable = currentPlan
? getIsLimitedAvailability({
plan: currentPlan,
regionAvailabilities: regionAvailabilities ?? [],
selectedRegionId: databaseRegion,
})
: false;Removing it causes a type error, so I did this make sure we have a currentPlan before we provide it to the function. Here's the LimitedAvailabilityPlanStatusOptions type that getIsLimitedAvailability uses.
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.
I could update the type, but that seemed intentional, so I left it as is and opted for this workaround.
|
Overall this looks good - thanks for the walkthrough.
|
| Boolean(flags.soldOutChips) && | ||
| Boolean(flags.databasePremium) && | ||
| Boolean(databaseRegion) |
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.
Can we just use one Boolean?
| Boolean(flags.soldOutChips) && | |
| Boolean(flags.databasePremium) && | |
| Boolean(databaseRegion) | |
| Boolean(flags.soldOutChips && flags.databasePremium && databaseRegion) |
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.
Yes we can! I'll update this!
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.
I've applied this change!
|
|
||
| const currentPlanUnavailableNotice = ( | ||
| <Notice variant="warning"> | ||
| <PlanNoticeTypography variant="h3">{`Warning: Your current plan is currently unavailable and it can't be used to resize the cluster. You can only resize the cluster using other available plans.`}</PlanNoticeTypography> |
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.
Do we need the backticks?
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.
@hana-akamai I'm using the backtickets because of the apostrophe can't. I see examples in the UI replacing the apostrophe with, \u{2019} (eg. 'You can\u{2019}t delete the currently active user.')
I'll try using that instead.
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.
@hana-akamai I pushed up a fix for this and I can see the banner appearing as expected.

| "@linode/manager": Added | ||
| --- | ||
|
|
||
| PlansPanel additionalBanners property to handle rendering additional notification banners provided from parent and disabled property for DatabaseNodeSelector ([#12634](https://github.com/linode/manager/pull/12634)) |
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.
Can we simplify this sentence?
| PlansPanel additionalBanners property to handle rendering additional notification banners provided from parent and disabled property for DatabaseNodeSelector ([#12634](https://github.com/linode/manager/pull/12634)) | |
| PlansPanel additionalBanners property for rendering additional banners and disabled property for DatabaseNodeSelector ([#12634](https://github.com/linode/manager/pull/12634)) |
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.
Thanks, I've updated the changeset
Cloud Manager UI test results🔺 2 failing tests on test run #6 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/linodes/linode-storage.spec.ts,cypress/e2e/core/notificationsAndEvents/qemu-reboot-upgrade-notice.spec.ts" |
||||||||||||||||||||
|
This is good to go - the QEMU test will be resolved with #12639 |
…de plan disabling behavior in resize (linode#12634) * fix: [UIE-9003] - DBaaS - expand node selector options for premium plans and provide disabling behavior for plans by region in resize * Adding changesets * Updating added changeset * Updating logic so that region queries that allow disabling behavior from PlansPanel are only made for new database clusters * Applying additional feedback
Description 📝
This pull request applies a a fix for the premium plans feature in DBaaS, fixing the node options that are available and applies the plan disabling by region functionality present in Create. It also includes some additional handling for an edge case.
Changes 🔄
List any change(s) relevant to the reviewer.
additionalBannersproperty added to handle rendering additional notification banners provided from parentdisabledproperty added for DatabaseNodeSelectorScope 🚢
Upon production release, changes in this PR will be visible to:
Target release date 🗓️
8/12/25
Preview 📷
Node Selection Fix
Region Does Not Support Plan Disabling Behavior

Current Plan Unavailable Due To Limited Availability in Region with Notification

How to test 🧪
Prerequisites
(How to setup test environment)
databasePremiumfeature flag enabledReproduction steps
(How to reproduce the issue, if applicable)
Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
database.type = 'premium-4';database.region = 'us-iad';database.platform = 'rdbms-default';This will provide consistent data in resize
In the develop branch with the mock data running. Access the Database Create view and switch the premium plans tab
See that only the 1 and 3 nodes options are displayed
Access the details for a database cluster with support for premium plans and navigate to the Resize tab
See that only the 1 and 3 nodes options are displayed
Verification steps
(How to verify changes)
Scenario 1: View updated node selection for premium plans in Create and Resize:
Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
database.type = 'premium-4';database.region = 'us-iad';database.platform = 'rdbms-default';This will provide consistent data in resize for this scenario
Switch back to the branch with these changes
In this feature branch with the mock data running. Access the Database Create view and switch the premium plans tab
Verify that all nodes options are displayed
Access the details for a database cluster with support for premium plans and navigate to the resize tab
Verify that all nodes options are displayed (1, 2, and 3).
Scenario 2: View scenario when current plan is unavailable:
Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
database.region = 'us-iad';database.type = 'premium-32';database.platform = 'rdbms-default';This will provide consistent data in resize for this scenario.
Access the details for a database cluster and navigate to the resize tab
Verify that the current plan is disabled
Verify that the node selections are disabled
Verify that all node selections are disabled (1, 2, and 3) and you can't make changes to the node selection to enable the resize button
Verify that the node selector buttons are enabled upon selecting a new plan
Verify that a notification is displayed at the top that says,
"Warning: The current plan for this cluster is currently unavailable and can't be used to resize the cluster. You can only resize the cluster using other available plans."Scenario 3: View Disabled panel when premium plans are not supported by the region
Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
database.region = 'us-east';database.platform = 'rdbms-default';This will provide consistent data in resize for this scenario.
Access the details for a database cluster and navigate to the resize tab
Verify that all plans in the premium plans panel is disabled with a notice above the plans panel
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅