Skip to content
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

chore: Updating the UX related to Action Response tabs #37859

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
opening the response tab when the execution has errored out
ankitakinger committed Nov 29, 2024

Verified

This commit was signed with the committer’s verified signature.
bukka Jakub Zelenka
commit 78c6e44263aec99a70a8fe49921d29332b248b90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect } from "react";
import React, { useCallback, useEffect, useMemo } from "react";
import { IDEBottomView, ViewHideBehaviour } from "IDE";
import { ActionExecutionResizerHeight } from "./constants";
import EntityBottomTabs from "components/editorComponents/EntityBottomTabs";
@@ -13,6 +13,7 @@ import { doesPluginRequireDatasource } from "ee/entities/Engine/actionHelpers";
import useShowSchema from "./hooks/useShowSchema";
import { actionResponseDisplayDataFormats } from "pages/Editor/utils";
import { PluginType } from "entities/Action";
import { hasFailed } from "./utils";

function PluginActionResponse() {
const dispatch = useDispatch();
@@ -31,6 +32,11 @@ function PluginActionResponse() {
const { responseDisplayFormat } =
actionResponseDisplayDataFormats(actionResponse);

const executionFailed = useMemo(
() => (actionResponse ? hasFailed(actionResponse) : false),
[actionResponse],
);
ankitakinger marked this conversation as resolved.
Show resolved Hide resolved

// These useEffects are used to open the response tab by default for page load queries
// as for page load queries, query response is available and can be shown in response tab
useEffect(
@@ -55,6 +61,20 @@ function PluginActionResponse() {
],
);

useEffect(
function openResponseTabOnError() {
if (executionFailed) {
dispatch(
setPluginActionEditorDebuggerState({
open: true,
selectedTab: DEBUGGER_TAB_KEYS.RESPONSE_TAB,
}),
);
}
},
[executionFailed, dispatch],
);

useEffect(
function openDefaultTabWhenNoTabIsSelected() {
if (showSchema && !selectedTab) {