Skip to content

Commit 966e867

Browse files
committed
fix: SidePanelDocumentation - update iframe source logic to handle theme parameter correctly
1 parent 2dce2a5 commit 966e867

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/ClusterNodes/NodeActions/EditTaintsModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ const EditTaintsModal = ({ name, version, kind, taints, closePopup }: EditTaints
201201
documentationLinkText="View documentation"
202202
documentationLink="TAINT"
203203
additionalContent={<AdditionalContent />}
204+
openInNewTab
204205
/>
205206
</div>
206207
<Button

src/components/common/SidePanel/SidePanelDocumentation.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export const SidePanelDocumentation = ({ onClose }: SidePanelDocumentationProps)
2424
const iframeRef = useRef<HTMLIFrameElement | null>(null)
2525

2626
// CONSTANTS
27-
const iframeSrc = `${docLink}&theme=${appTheme}`
27+
const iframeSrc = docLink
28+
? `${docLink}${docLink.includes('?') ? `&theme=${appTheme}` : `?theme=${appTheme}`}`
29+
: null
2830

2931
return (
3032
<>
@@ -57,7 +59,7 @@ export const SidePanelDocumentation = ({ onClose }: SidePanelDocumentationProps)
5759
</div>
5860
</div>
5961
<div className="flex-grow-1">
60-
{docLink && (
62+
{iframeSrc && (
6163
<iframe
6264
key={iframeSrc}
6365
ref={iframeRef}
@@ -69,7 +71,6 @@ export const SidePanelDocumentation = ({ onClose }: SidePanelDocumentationProps)
6971
height="100%"
7072
allow="clipboard-read; clipboard-write"
7173
sandbox="allow-same-origin allow-scripts allow-popups"
72-
referrerPolicy="no-referrer"
7374
/>
7475
)}
7576
</div>

0 commit comments

Comments
 (0)