-
Notifications
You must be signed in to change notification settings - Fork 364
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: [M3-7197] - "Support Ticket" button in network tab not working properly #11074
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
b274baf
unit test coverage for HostNameTableCell
cpathipa f958dab
Revert "unit test coverage for HostNameTableCell"
cpathipa 5d0a476
Merge branch 'linode:develop' into develop
cpathipa 93aab07
Merge branch 'linode:develop' into develop
cpathipa d7deb4f
Merge branch 'linode:develop' into develop
cpathipa a550f05
Merge branch 'linode:develop' into develop
cpathipa de0f63e
Merge branch 'linode:develop' into develop
cpathipa 426c42c
Merge branch 'linode:develop' into develop
cpathipa 3fb49a6
Merge branch 'linode:develop' into develop
cpathipa 6c76508
Merge branch 'linode:develop' into develop
cpathipa 1653a6b
Merge branch 'linode:develop' into develop
cpathipa 00421cf
Merge branch 'linode:develop' into develop
cpathipa 959730a
Merge branch 'linode:develop' into develop
cpathipa d9bd490
Merge branch 'linode:develop' into develop
cpathipa 960415e
Merge branch 'linode:develop' into develop
cpathipa b9f4745
Merge branch 'linode:develop' into develop
cpathipa b0b9264
Merge branch 'linode:develop' into develop
cpathipa 6c70559
Merge branch 'linode:develop' into develop
cpathipa 96eb34d
Merge branch 'linode:develop' into develop
cpathipa 74b1635
Merge branch 'linode:develop' into develop
cpathipa 70d1422
Merge branch 'linode:develop' into develop
cpathipa 342fd96
Merge branch 'linode:develop' into develop
cpathipa bfed239
Merge branch 'linode:develop' into develop
cpathipa 8a19f9b
Merge branch 'linode:develop' into develop
cpathipa 9e9c14f
Merge branch 'linode:develop' into develop
cpathipa a25728e
Merge branch 'linode:develop' into develop
cpathipa 3196f2a
Merge branch 'linode:develop' into develop
cpathipa 4794d04
Merge branch 'linode:develop' into develop
cpathipa e977a94
Merge branch 'linode:develop' into develop
cpathipa add3f10
Merge branch 'linode:develop' into develop
cpathipa 2fafd33
Merge branch 'linode:develop' into develop
cpathipa b3463ae
Merge branch 'linode:develop' into develop
cpathipa a325e30
Merge branch 'linode:develop' into develop
cpathipa b1e2a51
chore: [M3-8662] - Update Github Actions actions (#11009)
bnussman-akamai 1b0931b
Merge branch 'develop' of github.com:cpathipa/manager into develop
cpathipa 9b2de1d
Merge branch 'linode:develop' into develop
cpathipa ff89c50
Merge branch 'linode:develop' into develop
cpathipa 9b9f995
fix: [M3-7197] - "Support Ticket" button in network tab not working pβ¦
cpathipa a23ac7f
Create pr-11074-fixed-1728476792585.md
cpathipa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Fixed | ||
--- | ||
|
||
"Support Ticket" button in network tab not working properly ([#11074](https://github.com/linode/manager/pull/11074)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
packages/manager/src/features/Linodes/LinodesDetail/LinodeNetworking/ExplainerCopy.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { screen } from '@testing-library/react'; | ||
import * as React from 'react'; | ||
import { vi } from 'vitest'; | ||
|
||
import { renderWithTheme } from 'src/utilities/testHelpers'; | ||
|
||
import { ExplainerCopy } from './ExplainerCopy'; | ||
|
||
const queryMocks = vi.hoisted(() => ({ | ||
useLinodeQuery: vi.fn().mockReturnValue({ data: undefined }), | ||
})); | ||
|
||
vi.mock('src/queries/linodes/linodes', async () => { | ||
const actual = await vi.importActual('src/queries/linodes/linodes'); | ||
return { | ||
...actual, | ||
useLinodeQuery: queryMocks.useLinodeQuery, | ||
}; | ||
}); | ||
|
||
describe('ExplainerCopy Component', () => { | ||
const linodeId = 1234; | ||
|
||
beforeEach(() => { | ||
queryMocks.useLinodeQuery.mockReturnValue({ | ||
data: { label: 'Test Linode' }, | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
vi.resetAllMocks(); | ||
}); | ||
|
||
it('renders the correct content for v4Private IPType', () => { | ||
renderWithTheme(<ExplainerCopy ipType="v4Private" linodeId={linodeId} />); | ||
|
||
expect( | ||
screen.getByText(/Add a private IP address to your Linode/i) | ||
).toBeVisible(); | ||
expect( | ||
screen.getByText(/Data sent explicitly to and from private IP addresses/i) | ||
).toBeVisible(); | ||
}); | ||
|
||
it('renders the correct content for v4Public IPType with SupportLink', () => { | ||
renderWithTheme(<ExplainerCopy ipType="v4Public" linodeId={linodeId} />); | ||
|
||
expect( | ||
screen.getByText(/Public IP addresses, over and above the one included/i) | ||
).toBeVisible(); | ||
expect(screen.getByRole('link', { name: 'Support Ticket' })).toBeVisible(); | ||
}); | ||
|
||
it('displays no content when an unknown IPType is provided', () => { | ||
renderWithTheme(<ExplainerCopy ipType={null as any} linodeId={linodeId} />); | ||
|
||
expect(screen.queryByText(/Add a private IP address/i)).toBeNull(); | ||
expect(screen.queryByText(/Support Ticket/)).toBeNull(); | ||
}); | ||
}); |
43 changes: 43 additions & 0 deletions
43
packages/manager/src/features/Linodes/LinodesDetail/LinodeNetworking/ExplainerCopy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import * as React from 'react'; | ||
|
||
import { SupportLink } from 'src/components/SupportLink'; | ||
import { useLinodeQuery } from 'src/queries/linodes/linodes'; | ||
|
||
import type { IPType } from './AddIPDrawer'; | ||
|
||
interface ExplainerCopyProps { | ||
ipType: IPType; | ||
linodeId: number; | ||
} | ||
|
||
export const ExplainerCopy = ({ ipType, linodeId }: ExplainerCopyProps) => { | ||
const { data: linode } = useLinodeQuery(linodeId); | ||
|
||
switch (ipType) { | ||
case 'v4Private': | ||
return ( | ||
<> | ||
Add a private IP address to your Linode. Data sent explicitly to and | ||
from private IP addresses in the same data center does not incur | ||
transfer quota usage. To ensure that the private IP is properly | ||
configured once added, it’s best to reboot your Linode. | ||
</> | ||
); | ||
case 'v4Public': | ||
return ( | ||
<> | ||
Public IP addresses, over and above the one included with each Linode, | ||
incur an additional monthly charge. If you need an additional Public | ||
IP Address you must request one. Please open a{' '} | ||
<SupportLink | ||
entity={{ id: linodeId, type: 'linode_id' }} | ||
text="Support Ticket" | ||
title={`Additional Public IP Address on ${linode?.label}`} | ||
/>{' '} | ||
if you have not done so already. | ||
</> | ||
); | ||
default: | ||
return null; | ||
} | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, thanks for pre-filling.