-
Notifications
You must be signed in to change notification settings - Fork 361
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: [UIE-8007] - DBaaS enhancements summary and settings #10939
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/api-v4": Upcoming Features | ||
--- | ||
|
||
DBaaS V2 readonly hosts ([#10939](https://github.com/linode/manager/pull/10939)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
DBaaS V2 enhancements to the Summary and Settings tabs ([#10939](https://github.com/linode/manager/pull/10939)) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,8 +19,6 @@ import { FormControlLabel } from 'src/components/FormControlLabel'; | |||||
import { RadioGroup } from 'src/components/RadioGroup'; | ||||||
import { useDatabaseMutation } from 'src/queries/databases/databases'; | ||||||
|
||||||
// import { updateDatabaseSchema } from '@linode/validation/src/databases.schema'; | ||||||
|
||||||
const useStyles = makeStyles()((theme: Theme) => ({ | ||||||
formControlDropdown: { | ||||||
'& label': { | ||||||
|
@@ -173,22 +171,30 @@ export const MaintenanceWindow = (props: Props) => { | |||||
onSubmit: handleSaveMaintenanceWindow, | ||||||
}); | ||||||
|
||||||
const isLegacy = database.platform === 'rdbms-legacy'; | ||||||
|
||||||
const typographyDatabase = | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: I think we normally use capitalized snake case for copy constants, but someone correct me if I'm wrong!
Suggested change
these constants could also be moved to the top of the scope, outside the component. Alternatively, you could do something like you did with the copies in
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, other places have camelCase for text copy. Personally, I'd do CAPS for const but not sure the standard. |
||||||
'Select when you want the required OS and DB engine updates to take place. The maintenance may cause downtime on clusters with less than 3 nodes (non high-availability clusters).'; | ||||||
|
||||||
const typographyLegacyDatabase = | ||||||
"OS and DB engine updates will be performed on the schedule below. Select the frequency, day, and time you'd prefer maintenance to occur."; | ||||||
|
||||||
return ( | ||||||
<form onSubmit={handleSubmit}> | ||||||
<div className={classes.topSection}> | ||||||
<div className={classes.sectionTitleAndText}> | ||||||
<Typography className={classes.sectionTitle} variant="h3"> | ||||||
Maintenance Window | ||||||
{isLegacy | ||||||
? 'Maintenance Window' | ||||||
: 'Set a Weekly Maintenance Window'} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All other headings on this page don't use verbs. I'd prefer if we keep headings consistent, but that's just my opinion.
Suggested change
|
||||||
</Typography> | ||||||
{maintenanceUpdateError ? ( | ||||||
<Notice spacingTop={8} variant="error"> | ||||||
{maintenanceUpdateError[0].reason} | ||||||
</Notice> | ||||||
) : null} | ||||||
<Typography className={classes.sectionText}> | ||||||
OS and DB engine updates will be performed on the schedule below. | ||||||
Select the frequency, day, and time you’d prefer maintenance | ||||||
to occur.{' '} | ||||||
{isLegacy ? typographyLegacyDatabase : typographyDatabase} | ||||||
{database.cluster_size !== 3 | ||||||
? 'For non-HA plans, expect downtime during this window.' | ||||||
: null} | ||||||
|
@@ -261,7 +267,7 @@ export const MaintenanceWindow = (props: Props) => { | |||||
/> | ||||||
<TooltipIcon | ||||||
sxTooltipIcon={{ | ||||||
marginTop: '1.25rem', | ||||||
marginTop: '1.75rem', | ||||||
padding: '0px 8px', | ||||||
}} | ||||||
text={ | ||||||
|
@@ -277,44 +283,46 @@ export const MaintenanceWindow = (props: Props) => { | |||||
</div> | ||||||
</FormControl> | ||||||
</div> | ||||||
<FormControl | ||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||||||
setFormTouched(true); | ||||||
setFieldValue('frequency', e.target.value); | ||||||
if (e.target.value === 'weekly') { | ||||||
// If the frequency is weekly, set the 'week_of_month' field to null since that should only be specified for a monthly frequency. | ||||||
setFieldValue('week_of_month', null); | ||||||
} | ||||||
{isLegacy && ( | ||||||
<FormControl | ||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||||||
setFormTouched(true); | ||||||
setFieldValue('frequency', e.target.value); | ||||||
if (e.target.value === 'weekly') { | ||||||
// If the frequency is weekly, set the 'week_of_month' field to null since that should only be specified for a monthly frequency. | ||||||
setFieldValue('week_of_month', null); | ||||||
} | ||||||
|
||||||
if (e.target.value === 'monthly') { | ||||||
const dayOfWeek = | ||||||
daySelectionMap.find( | ||||||
(option) => option.value === values.day_of_week | ||||||
) ?? daySelectionMap[0]; | ||||||
if (e.target.value === 'monthly') { | ||||||
const dayOfWeek = | ||||||
daySelectionMap.find( | ||||||
(option) => option.value === values.day_of_week | ||||||
) ?? daySelectionMap[0]; | ||||||
|
||||||
weekSelectionModifier(dayOfWeek.label, weekSelectionMap); | ||||||
setFieldValue( | ||||||
'week_of_month', | ||||||
modifiedWeekSelectionMap[0].value | ||||||
); | ||||||
} | ||||||
}} | ||||||
disabled={disabled} | ||||||
> | ||||||
<RadioGroup | ||||||
style={{ marginBottom: 0, marginTop: 0 }} | ||||||
value={values.frequency} | ||||||
weekSelectionModifier(dayOfWeek.label, weekSelectionMap); | ||||||
setFieldValue( | ||||||
'week_of_month', | ||||||
modifiedWeekSelectionMap[0].value | ||||||
); | ||||||
} | ||||||
}} | ||||||
disabled={disabled} | ||||||
> | ||||||
{maintenanceFrequencyMap.map((option) => ( | ||||||
<FormControlLabel | ||||||
control={<Radio />} | ||||||
key={option.value} | ||||||
label={option.key} | ||||||
value={option.value} | ||||||
/> | ||||||
))} | ||||||
</RadioGroup> | ||||||
</FormControl> | ||||||
<RadioGroup | ||||||
style={{ marginBottom: 0, marginTop: 0 }} | ||||||
value={values.frequency} | ||||||
> | ||||||
{maintenanceFrequencyMap.map((option) => ( | ||||||
<FormControlLabel | ||||||
control={<Radio />} | ||||||
key={option.value} | ||||||
label={option.key} | ||||||
value={option.value} | ||||||
/> | ||||||
))} | ||||||
</RadioGroup> | ||||||
</FormControl> | ||||||
)} | ||||||
<div> | ||||||
{values.frequency === 'monthly' ? ( | ||||||
<FormControl | ||||||
|
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.
Nice job on this test. Clean and concise π§Ό