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: [UIE-8259] dbaas summary blank read-only host should be N/A #11265

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11265-fixed-1731619488790.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

dbaas summary read-only host field is blank ([#11265](https://github.com/linode/manager/pull/11265))
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,27 @@ describe('DatabaseSummaryConnectionDetails', () => {
});
});

it('should display N/A for default DB with blank read-only Host field', async () => {
const database = databaseFactory.build({
engine: POSTGRESQL,
hosts: {
primary: DEFAULT_PRIMARY,
secondary: undefined,
standby: undefined,
},
id: 99,
platform: 'rdbms-default',
port: 22496,
ssl_connection: true,
});

const { queryAllByText } = renderWithTheme(
<DatabaseSummaryConnectionDetails database={database} />
);

expect(queryAllByText('N/A')).toHaveLength(1);
});

it('should display correctly for legacy db', async () => {
queryMocks.useDatabaseCredentialsQuery.mockReturnValue({
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,14 @@ export const DatabaseSummaryConnectionDetails = (props: Props) => {
database?.hosts?.standby ?? database?.hosts?.secondary ?? '';

const readOnlyHost = () => {
const defaultValue = isLegacy ? '-' : 'not available';
const value = readOnlyHostValue ?? defaultValue;
const defaultValue = isLegacy ? '-' : 'N/A';
const value = readOnlyHostValue ? readOnlyHostValue : defaultValue;
const displayCopyTooltip = value !== '-' && value !== 'N/A';
return (
<>
{value}
{value && (
<CopyTooltip
className={classes.inlineCopyToolTip}
text={readOnlyHostValue}
/>
{value && displayCopyTooltip && (
<CopyTooltip className={classes.inlineCopyToolTip} text={value} />
)}
{isLegacy && (
<TooltipIcon
Expand Down