From a27abaf617508d5c7bcdf0b48d1a6456078c98fd Mon Sep 17 00:00:00 2001
From: ChandanBalajiBP <104058110+ChandanBalajiBP@users.noreply.github.com>
Date: Mon, 1 May 2023 11:16:19 +0530
Subject: [PATCH] fix: entity link in errors (#22641)
## Description
> Fixes broken entity link to SAAS plugins
Fixes #21816
#21289
## Type of change
> Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)
## How Has This Been Tested?
- Manual
### Test Plan
> Add Testsmith test cases links that relate to this PR
### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag
### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---
.../src/components/editorComponents/Debugger/EntityLink.tsx | 6 +++++-
.../Debugger/ErrorLogs/components/LogEntityLink.tsx | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/app/client/src/components/editorComponents/Debugger/EntityLink.tsx b/app/client/src/components/editorComponents/Debugger/EntityLink.tsx
index a014fe737b..e9b936a782 100644
--- a/app/client/src/components/editorComponents/Debugger/EntityLink.tsx
+++ b/app/client/src/components/editorComponents/Debugger/EntityLink.tsx
@@ -21,6 +21,7 @@ import history, { NavigationMethod } from "utils/history";
import { getQueryParams } from "utils/URLUtils";
import { datasourcesEditorIdURL, jsCollectionIdURL } from "RouteBuilder";
import type LOG_TYPE from "entities/AppsmithConsole/logtype";
+import type { Plugin } from "api/PluginApi";
function ActionLink(props: EntityLinkProps) {
const applicationId = useSelector(getCurrentApplicationId);
@@ -30,7 +31,9 @@ function ActionLink(props: EntityLinkProps) {
if (action) {
const { id, pageId, pluginType } = action;
const actionConfig = getActionConfig(pluginType);
- const url = applicationId && actionConfig?.getURL(pageId, id, pluginType);
+ const url =
+ applicationId &&
+ actionConfig?.getURL(pageId, id, pluginType, props.plugin);
if (!url) return;
history.push(url);
const actionType = action.pluginType === PluginType.API ? "API" : "QUERY";
@@ -199,6 +202,7 @@ function EntityLink(props: EntityLinkProps) {
type EntityLinkProps = {
uiComponent: DebuggerLinkUI;
+ plugin?: Plugin;
errorType?: LOG_TYPE;
errorSubType?: string;
appsmithErrorCode?: string;
diff --git a/app/client/src/components/editorComponents/Debugger/ErrorLogs/components/LogEntityLink.tsx b/app/client/src/components/editorComponents/Debugger/ErrorLogs/components/LogEntityLink.tsx
index 7166e928c2..05ec4ee51c 100644
--- a/app/client/src/components/editorComponents/Debugger/ErrorLogs/components/LogEntityLink.tsx
+++ b/app/client/src/components/editorComponents/Debugger/ErrorLogs/components/LogEntityLink.tsx
@@ -77,7 +77,7 @@ export default function LogEntityLink(props: LogItemProps) {
// this case is highly unlikely to happen.
return ;
};
-
+ const plugin = props.iconId ? pluginGroups[props.iconId] : undefined;
return (