Fix for timeout being sent in a different location (#2708)
This commit is contained in:
parent
9e0f36a6f2
commit
40e42b296d
|
|
@ -5,7 +5,7 @@ import {
|
||||||
DEFAULT_EXECUTE_ACTION_TIMEOUT_MS,
|
DEFAULT_EXECUTE_ACTION_TIMEOUT_MS,
|
||||||
} from "constants/ApiConstants";
|
} from "constants/ApiConstants";
|
||||||
import axios, { AxiosPromise, CancelTokenSource } from "axios";
|
import axios, { AxiosPromise, CancelTokenSource } from "axios";
|
||||||
import { Action } from "entities/Action";
|
import { Action, ActionViewMode } from "entities/Action";
|
||||||
|
|
||||||
export interface CreateActionRequest<T> extends APIRequest {
|
export interface CreateActionRequest<T> extends APIRequest {
|
||||||
datasourceId: string;
|
datasourceId: string;
|
||||||
|
|
@ -127,7 +127,7 @@ class ActionAPI extends API {
|
||||||
|
|
||||||
static fetchActionsForViewMode(
|
static fetchActionsForViewMode(
|
||||||
applicationId: string,
|
applicationId: string,
|
||||||
): AxiosPromise<GenericApiResponse<Action[]>> {
|
): AxiosPromise<GenericApiResponse<ActionViewMode[]>> {
|
||||||
return API.get(`${ActionAPI.url}/view`, { applicationId });
|
return API.get(`${ActionAPI.url}/view`, { applicationId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,13 @@ export interface QueryAction extends BaseAction {
|
||||||
datasource: StoredDatasource;
|
datasource: StoredDatasource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ActionViewMode = {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
pageId: string;
|
||||||
|
jsonPathKeys: string[];
|
||||||
|
confirmBeforeExecute?: boolean;
|
||||||
|
timeoutInMillisecond?: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type Action = ApiAction | QueryAction;
|
export type Action = ApiAction | QueryAction;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ import {
|
||||||
} from "selectors/editorSelectors";
|
} from "selectors/editorSelectors";
|
||||||
import AnalyticsUtil from "utils/AnalyticsUtil";
|
import AnalyticsUtil from "utils/AnalyticsUtil";
|
||||||
import { QUERY_CONSTANT } from "constants/QueryEditorConstants";
|
import { QUERY_CONSTANT } from "constants/QueryEditorConstants";
|
||||||
import { Action } from "entities/Action";
|
import { Action, ActionViewMode } from "entities/Action";
|
||||||
import { ActionData } from "reducers/entityReducers/actionsReducer";
|
import { ActionData } from "reducers/entityReducers/actionsReducer";
|
||||||
import {
|
import {
|
||||||
getAction,
|
getAction,
|
||||||
|
|
@ -145,14 +145,22 @@ export function* fetchActionsForViewModeSaga(
|
||||||
{ mode: "VIEWER", appId: applicationId },
|
{ mode: "VIEWER", appId: applicationId },
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
const response: GenericApiResponse<Action[]> = yield ActionAPI.fetchActionsForViewMode(
|
const response: GenericApiResponse<ActionViewMode[]> = yield ActionAPI.fetchActionsForViewMode(
|
||||||
applicationId,
|
applicationId,
|
||||||
);
|
);
|
||||||
|
const correctFormatResponse = response.data.map((action) => {
|
||||||
|
return {
|
||||||
|
...action,
|
||||||
|
actionConfiguration: {
|
||||||
|
timeoutInMillisecond: action.timeoutInMillisecond,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
const isValidResponse = yield validateResponse(response);
|
const isValidResponse = yield validateResponse(response);
|
||||||
if (isValidResponse) {
|
if (isValidResponse) {
|
||||||
yield put({
|
yield put({
|
||||||
type: ReduxActionTypes.FETCH_ACTIONS_VIEW_MODE_SUCCESS,
|
type: ReduxActionTypes.FETCH_ACTIONS_VIEW_MODE_SUCCESS,
|
||||||
payload: response.data,
|
payload: correctFormatResponse,
|
||||||
});
|
});
|
||||||
PerformanceTracker.stopAsyncTracking(
|
PerformanceTracker.stopAsyncTracking(
|
||||||
PerformanceTransactionName.FETCH_ACTIONS_API,
|
PerformanceTransactionName.FETCH_ACTIONS_API,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user