Merge branch 'release' of https://github.com/appsmithorg/appsmith into release
This commit is contained in:
commit
c23cbe8a2d
|
|
@ -0,0 +1,49 @@
|
|||
const dsl = require("../../../fixtures/tableWidgetDsl.json");
|
||||
|
||||
describe("API Panel Test Functionality", function() {
|
||||
before(() => {
|
||||
cy.addDsl(dsl);
|
||||
});
|
||||
it("Will load an api on load", function() {
|
||||
cy.NavigateToAPI_Panel();
|
||||
cy.CreateAPI("PageLoadApi");
|
||||
cy.enterDatasourceAndPath("https://reqres.in/api/", "users");
|
||||
cy.WaitAutoSave();
|
||||
cy.get("li:contains('Settings')").click({ force: true });
|
||||
cy.get("[data-cy=executeOnLoad]")
|
||||
.find(".bp3-switch")
|
||||
.click();
|
||||
|
||||
cy.wait("@setExecuteOnLoad");
|
||||
|
||||
cy.SearchEntityandOpen("Table1");
|
||||
cy.testJsontext("tabledata", "{{PageLoadApi.data.data");
|
||||
|
||||
cy.wait("@updateLayout");
|
||||
|
||||
cy.reload();
|
||||
cy.wait("@postExecute").should(
|
||||
"have.nested.property",
|
||||
"response.body.responseMeta.status",
|
||||
200,
|
||||
);
|
||||
});
|
||||
|
||||
it("Will not crash the app for failure", function() {
|
||||
cy.SearchEntityandOpen("PageLoadApi");
|
||||
cy.get("li:contains('Settings')").click({ force: true });
|
||||
cy.get("[data-cy='actionConfiguration.timeoutInMillisecond']")
|
||||
.find(".bp3-input")
|
||||
.type("{backspace}{backspace}{backspace}");
|
||||
|
||||
cy.NavigateToAPI_Panel();
|
||||
cy.CreateAPI("NormalApi");
|
||||
cy.enterDatasourceAndPath("https://reqres.in/api/", "users");
|
||||
cy.WaitAutoSave();
|
||||
|
||||
cy.reload();
|
||||
cy.wait("@postExecute");
|
||||
cy.RunAPI();
|
||||
cy.ResponseStatusCheck("200 OK");
|
||||
});
|
||||
});
|
||||
|
|
@ -1668,6 +1668,7 @@ Cypress.Commands.add("startServerAndRoutes", () => {
|
|||
|
||||
cy.route("POST", "/track/*").as("postTrack");
|
||||
cy.route("POST", "/api/v1/actions/execute").as("postExecute");
|
||||
cy.route("PUT", "/api/v1/actions/executeOnLoad/*").as("setExecuteOnLoad");
|
||||
|
||||
cy.route("POST", "/api/v1/actions").as("createNewApi");
|
||||
cy.route("POST", "/api/v1/import?type=CURL&pageId=*&name=*").as("curlImport");
|
||||
|
|
|
|||
|
|
@ -117,24 +117,27 @@ class Api {
|
|||
static get(
|
||||
url: string,
|
||||
queryParams?: any,
|
||||
config?: Partial<AxiosRequestConfig>,
|
||||
config: Partial<AxiosRequestConfig> = {},
|
||||
) {
|
||||
return axiosInstance.get(
|
||||
url + convertObjectToQueryParams(queryParams),
|
||||
_.merge(apiRequestConfig, config),
|
||||
);
|
||||
return axiosInstance.get(url + convertObjectToQueryParams(queryParams), {
|
||||
...apiRequestConfig,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
static post(
|
||||
url: string,
|
||||
body?: any,
|
||||
queryParams?: any,
|
||||
config?: Partial<AxiosRequestConfig>,
|
||||
config: Partial<AxiosRequestConfig> = {},
|
||||
) {
|
||||
return axiosInstance.post(
|
||||
url + convertObjectToQueryParams(queryParams),
|
||||
body,
|
||||
_.merge(apiRequestConfig, config),
|
||||
{
|
||||
...apiRequestConfig,
|
||||
...config,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -142,24 +145,27 @@ class Api {
|
|||
url: string,
|
||||
body?: any,
|
||||
queryParams?: any,
|
||||
config?: Partial<AxiosRequestConfig>,
|
||||
config: Partial<AxiosRequestConfig> = {},
|
||||
) {
|
||||
return axiosInstance.put(
|
||||
url + convertObjectToQueryParams(queryParams),
|
||||
body,
|
||||
_.merge(apiRequestConfig, config),
|
||||
{
|
||||
...apiRequestConfig,
|
||||
...config,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static delete(
|
||||
url: string,
|
||||
queryParams?: any,
|
||||
config?: Partial<AxiosRequestConfig>,
|
||||
config: Partial<AxiosRequestConfig> = {},
|
||||
) {
|
||||
return axiosInstance.delete(
|
||||
url + convertObjectToQueryParams(queryParams),
|
||||
_.merge(apiRequestConfig, config),
|
||||
);
|
||||
return axiosInstance.delete(url + convertObjectToQueryParams(queryParams), {
|
||||
...apiRequestConfig,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export function InputText(props: {
|
|||
const { name, placeholder, dataType, label, isRequired } = props;
|
||||
|
||||
return (
|
||||
<div style={{ width: "50vh" }}>
|
||||
<div style={{ width: "50vh" }} data-cy={name}>
|
||||
<FormLabel>
|
||||
{label} {isRequired && "*"}
|
||||
</FormLabel>
|
||||
|
|
|
|||
|
|
@ -671,21 +671,29 @@ function* executePageLoadAction(pageAction: PageAction) {
|
|||
}
|
||||
|
||||
function* executePageLoadActionsSaga(action: ReduxAction<PageAction[][]>) {
|
||||
const pageActions = action.payload;
|
||||
const actionCount = _.flatten(pageActions).length;
|
||||
PerformanceTracker.startAsyncTracking(
|
||||
PerformanceTransactionName.EXECUTE_PAGE_LOAD_ACTIONS,
|
||||
{ numActions: actionCount },
|
||||
);
|
||||
for (const actionSet of pageActions) {
|
||||
// Load all sets in parallel
|
||||
yield* yield all(
|
||||
actionSet.map(apiAction => call(executePageLoadAction, apiAction)),
|
||||
try {
|
||||
const pageActions = action.payload;
|
||||
const actionCount = _.flatten(pageActions).length;
|
||||
PerformanceTracker.startAsyncTracking(
|
||||
PerformanceTransactionName.EXECUTE_PAGE_LOAD_ACTIONS,
|
||||
{ numActions: actionCount },
|
||||
);
|
||||
for (const actionSet of pageActions) {
|
||||
// Load all sets in parallel
|
||||
yield* yield all(
|
||||
actionSet.map(apiAction => call(executePageLoadAction, apiAction)),
|
||||
);
|
||||
}
|
||||
PerformanceTracker.stopAsyncTracking(
|
||||
PerformanceTransactionName.EXECUTE_PAGE_LOAD_ACTIONS,
|
||||
);
|
||||
} catch (e) {
|
||||
log.error(e);
|
||||
AppToaster.show({
|
||||
message: "Failed to load onPageLoad actions",
|
||||
type: ToastType.ERROR,
|
||||
});
|
||||
}
|
||||
PerformanceTracker.stopAsyncTracking(
|
||||
PerformanceTransactionName.EXECUTE_PAGE_LOAD_ACTIONS,
|
||||
);
|
||||
}
|
||||
|
||||
export function* watchActionExecutionSagas() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user