Skip to content

Commit

Permalink
fix: GUI action links now opens in new window as a link instead of do…
Browse files Browse the repository at this point in the history
…ing a GET fetch (#1024)
  • Loading branch information
alexdigdir authored Aug 26, 2024
1 parent e8f60c2 commit 196910a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/src/api/useDialogById.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function mapDialogDtoToInboxItem(
url: guiAction.url,
hidden: !guiAction.isAuthorized,
priority: guiAction.priority,
httpMethod: guiAction.action,
httpMethod: guiAction.httpMethod,
title: getPropertyByCultureCode(guiAction.title),
prompt: getPropertyByCultureCode(guiAction.prompt),
isDeleteAction: guiAction.isDeleteDialogAction,
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/InboxItem/GuiActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface GuiActionButtonProps {
url: string;
priority: GuiActionPriority;
isDeleteAction: boolean;
httpMethod: string;
httpMethod: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
title: string;
prompt?: string;
disabled?: boolean;
Expand All @@ -40,7 +40,7 @@ const handleButtonClick = async (props: GuiActionButtonProps, dialogToken: strin
}

if (httpMethod === 'GET') {
window.location.href = url;
window.open(url, '_blank');
} else {
try {
const response = await fetch(url, {
Expand Down

0 comments on commit 196910a

Please sign in to comment.