Skip to content

Commit

Permalink
fix: [UIE-8259] dbaas summary blank read-only host should be N/A
Browse files Browse the repository at this point in the history
  • Loading branch information
smans-akamai committed Nov 15, 2024
1 parent 1d0051e commit 2bba2be
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
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

0 comments on commit 2bba2be

Please sign in to comment.