Merge branch 'release' of https://github.com/appsmithorg/appsmith into release

This commit is contained in:
Automated Github Action 2020-08-26 13:23:11 +00:00
commit 79e80f60ae
7 changed files with 376 additions and 33 deletions

View File

@ -0,0 +1,297 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1224,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1280,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"dynamicBindings": {
},
"version": 5,
"minHeight": 1292,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"isVisible": true,
"widgetName": "Form1",
"backgroundColor": "white",
"children": [
{
"isVisible": true,
"widgetName": "Canvas1",
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"children": [
{
"isVisible": true,
"text": "Form",
"textStyle": "HEADING",
"textAlign": "LEFT",
"widgetName": "Text1",
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 12,
"topRow": 0,
"bottomRow": 1,
"parentId": "qrqizehc5b",
"widgetId": "c481ah2q0i"
},
{
"isVisible": true,
"widgetName": "FormButton1",
"text": "Submit",
"isDefaultClickDisabled": true,
"buttonStyle": "PRIMARY_BUTTON",
"disabledWhenInvalid": true,
"resetFormOnClick": true,
"type": "FORM_BUTTON_WIDGET",
"isLoading": false,
"leftColumn": 12,
"rightColumn": 16,
"topRow": 12,
"bottomRow": 13,
"parentId": "qrqizehc5b",
"widgetId": "zsu1y41p1e"
},
{
"isVisible": true,
"widgetName": "FormButton2",
"text": "Reset",
"isDefaultClickDisabled": true,
"buttonStyle": "SECONDARY_BUTTON",
"disabledWhenInvalid": false,
"resetFormOnClick": true,
"type": "FORM_BUTTON_WIDGET",
"isLoading": false,
"leftColumn": 8,
"rightColumn": 12,
"topRow": 12,
"bottomRow": 13,
"parentId": "qrqizehc5b",
"widgetId": "7o0r2rp3s1"
},
{
"isVisible": true,
"label": "Data",
"widgetName": "Table1",
"searchKey": "",
"tableData": "[\n {\n \"id\": 2381224,\n \"email\": \"michael.lawson@reqres.in\",\n \"userName\": \"Michael Lawson\",\n \"productName\": \"Chicken Sandwich\",\n \"orderAmount\": 4.99\n },\n {\n \"id\": 2736212,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"userName\": \"Lindsay Ferguson\",\n \"productName\": \"Tuna Salad\",\n \"orderAmount\": 9.99\n },\n {\n \"id\": 6788734,\n \"email\": \"tobias.funke@reqres.in\",\n \"userName\": \"Tobias Funke\",\n \"productName\": \"Beef steak\",\n \"orderAmount\": 19.99\n }\n]",
"type": "TABLE_WIDGET",
"isLoading": false,
"parentColumnSpace": 71.5,
"parentRowSpace": 40,
"leftColumn": 0,
"rightColumn": 16,
"topRow": 1,
"bottomRow": 8,
"parentId": "qrqizehc5b",
"widgetId": "xptqefixji",
"dynamicBindings": {
}
},
{
"isVisible": true,
"inputType": "TEXT",
"label": "",
"widgetName": "Input1",
"type": "INPUT_WIDGET",
"isLoading": false,
"parentColumnSpace": 71.5,
"parentRowSpace": 40,
"leftColumn": 0,
"rightColumn": 5,
"topRow": 10,
"bottomRow": 11,
"parentId": "qrqizehc5b",
"widgetId": "r3xvjtuhad",
"dynamicBindings": {
"defaultText": true,
"isValid": true,
"value": true
},
"defaultText": "{{Table1.selectedRow.email}}"
},
{
"isVisible": true,
"text": "Email",
"textStyle": "LABEL",
"textAlign": "LEFT",
"widgetName": "Text2",
"type": "TEXT_WIDGET",
"isLoading": false,
"parentColumnSpace": 71.5,
"parentRowSpace": 40,
"leftColumn": 0,
"rightColumn": 4,
"topRow": 9,
"bottomRow": 10,
"parentId": "qrqizehc5b",
"widgetId": "672gf8vm2q",
"dynamicBindings": {
"value": true
}
}
],
"blueprint": {
"view": [
{
"type": "TEXT_WIDGET",
"size": {
"rows": 1,
"cols": 12
},
"position": {
"top": 0,
"left": 0
},
"props": {
"text": "Form",
"textStyle": "HEADING"
}
},
{
"type": "FORM_BUTTON_WIDGET",
"size": {
"rows": 1,
"cols": 4
},
"position": {
"top": 11,
"left": 12
},
"props": {
"text": "Submit",
"buttonStyle": "PRIMARY_BUTTON",
"disabledWhenInvalid": true,
"resetFormOnClick": true
}
},
{
"type": "FORM_BUTTON_WIDGET",
"size": {
"rows": 1,
"cols": 4
},
"position": {
"top": 11,
"left": 8
},
"props": {
"text": "Reset",
"buttonStyle": "SECONDARY_BUTTON",
"disabledWhenInvalid": false,
"resetFormOnClick": true
}
}
]
},
"minHeight": 520,
"type": "CANVAS_WIDGET",
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": 518,
"topRow": 0,
"bottomRow": 520,
"parentId": "ozm6zwjk4b",
"widgetId": "qrqizehc5b"
}
],
"blueprint": {
"view": [
{
"type": "CANVAS_WIDGET",
"position": {
"top": 0,
"left": 0
},
"props": {
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"children": [
],
"blueprint": {
"view": [
{
"type": "TEXT_WIDGET",
"size": {
"rows": 1,
"cols": 12
},
"position": {
"top": 0,
"left": 0
},
"props": {
"text": "Form",
"textStyle": "HEADING"
}
},
{
"type": "FORM_BUTTON_WIDGET",
"size": {
"rows": 1,
"cols": 4
},
"position": {
"top": 11,
"left": 12
},
"props": {
"text": "Submit",
"buttonStyle": "PRIMARY_BUTTON",
"disabledWhenInvalid": true,
"resetFormOnClick": true
}
},
{
"type": "FORM_BUTTON_WIDGET",
"size": {
"rows": 1,
"cols": 4
},
"position": {
"top": 11,
"left": 8
},
"props": {
"text": "Reset",
"buttonStyle": "SECONDARY_BUTTON",
"disabledWhenInvalid": false,
"resetFormOnClick": true
}
}
]
}
}
}
]
},
"type": "FORM_WIDGET",
"isLoading": false,
"parentColumnSpace": 74,
"parentRowSpace": 40,
"leftColumn": 0,
"rightColumn": 16,
"topRow": 0,
"bottomRow": 14,
"parentId": "0",
"widgetId": "ozm6zwjk4b"
}
]
}
}

View File

@ -0,0 +1,32 @@
const dsl = require("../../../fixtures/formResetDsl.json");
const widgetsPage = require("../../../locators/Widgets.json");
describe("Form reset functionality", function() {
before(() => {
cy.addDsl(dsl);
});
it("Resets the form ", () => {
cy.get(".tr")
.eq(2)
.click()
.should("have.class", "selected-row");
cy.get(widgetsPage.inputWidget + " " + "input")
.invoke("attr", "value")
.should("contain", "lindsay.ferguson@reqres.in");
cy.get(widgetsPage.formButtonWidget)
.contains("Reset")
.click();
cy.get(".tr")
.eq(2)
.click()
.should("not.have.class", "selected-row");
cy.get(widgetsPage.inputWidget + " " + "input")
.invoke("attr", "value")
.should("not.contain", "lindsay.ferguson@reqres.in");
});
});

View File

@ -1,8 +1,10 @@
const queryLocators = require("../../../locators/QueryEditor.json");
const datasource = require("../../../locators/DatasourcesEditor.json");
let datasourceName;
describe("Create a query with a postgres datasource, run, save and then delete the query", function() {
it("Create a query with a postgres datasource, run, save and then delete the query", function() {
it("Create a postgres datasource", function() {
cy.NavigateToDatasourceEditor();
cy.get(datasource.PostgreSQL).click();
@ -12,38 +14,43 @@ describe("Create a query with a postgres datasource, run, save and then delete t
cy.testSaveDatasource();
cy.NavigateToQueryEditor();
cy.get("@createDatasource").then(httpResponse => {
const datasourceName = httpResponse.response.body.data.name;
cy.get(".t--datasource-name")
.contains(datasourceName)
.click();
datasourceName = httpResponse.response.body.data.name;
});
cy.get("@getPluginForm").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
});
it("Create, runs and delete a query", () => {
cy.NavigateToQueryEditor();
cy.get(".t--datasource-name")
.contains(datasourceName)
.click();
cy.get(queryLocators.templateMenu).click();
cy.get(".CodeMirror textarea")
.first()
.focus()
.type("select * from users");
.type("select * from users limit 10");
cy.EvaluateCurrentValue("select * from users");
cy.EvaluateCurrentValue("select * from users limit 10");
cy.runAndDeleteQuery();
});
it("Create, runs and delete another query", () => {
cy.NavigateToQueryEditor();
cy.get(".t--datasource-name")
.contains(datasourceName)
.click();
cy.get(queryLocators.templateMenu).click();
cy.get(".CodeMirror textarea")
.first()
.focus()
.type("select * from configs");
cy.EvaluateCurrentValue("select * from configs");
cy.runAndDeleteQuery();
});
it("Deletes a datasource", () => {
cy.NavigateToDatasourceEditor();
cy.get(".t--entity-name:contains(PostgreSQL)").click();
cy.get("@createDatasource").then(httpResponse => {
const datasourceName = httpResponse.response.body.data.name;
cy.get(`.t--entity-name:contains(${datasourceName})`).click();
});
cy.get(`.t--entity-name:contains(${datasourceName})`).click();
cy.get(".t--delete-datasource").click();
cy.wait("@deleteDatasource").should(

View File

@ -5,6 +5,7 @@
"inputPropsDataType": ".t--property-control-datatype",
"inputdatatypeplaceholder": ".t--property-control-placeholder",
"buttonWidget": ".t--draggable-buttonwidget",
"formButtonWidget": ".t--widget-formbuttonwidget",
"textWidget": ".t--draggable-textwidget",
"tableWidget": ".t--draggable-tablewidget",
"tableOnRowSelected": ".t--property-control-onrowselected",
@ -37,4 +38,4 @@
"textInputval": ".t--draggable-textwidget span.t--widget-name",
"textAlign": ".t--property-control-textalign",
"ColumnAction": ".t--property-control-rowbutton button"
}
}

View File

@ -90,6 +90,12 @@ export function* fetchPageListSaga(
pageId: page.id,
isDefault: page.isDefault,
}));
yield put({
type: ReduxActionTypes.SET_CURRENT_ORG_ID,
payload: {
orgId,
},
});
yield put({
type: ReduxActionTypes.FETCH_PAGE_LIST_SUCCESS,
payload: {
@ -97,14 +103,6 @@ export function* fetchPageListSaga(
applicationId,
},
});
yield put({
type: ReduxActionTypes.SET_CURRENT_ORG_ID,
payload: {
orgId,
},
});
return;
}
} catch (error) {
yield put({

View File

@ -11,6 +11,9 @@ import { getCurrentOrgId } from "selectors/organizationSelectors";
function* fetchPluginsSaga() {
try {
const orgId = yield select(getCurrentOrgId);
if (!orgId) {
throw Error("Org id does not exist");
}
const pluginsResponse = yield call(PluginsApi.fetchPlugins, orgId);
const isValid = yield validateResponse(pluginsResponse);
if (isValid) {

View File

@ -200,9 +200,14 @@ class AnalyticsUtil {
});
}
if (windowDoc.hj) {
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
window.hj("identify", userData.email, { email: userData.email });
windowDoc.hj("identify", userData.email, { email: userData.email });
}
if (windowDoc.smartLook) {
windowDoc.smartlook("identify", userId, {
email: userData.email,
name: userData.name,
userId: userId,
});
}
}