2021-02-16 10:29:08 +00:00
|
|
|
/* eslint-disable cypress/no-unnecessary-waiting */
|
|
|
|
|
/* eslint-disable cypress/no-assigning-return-values */
|
2022-04-11 03:30:37 +00:00
|
|
|
/* This file is used to maintain comman methods across tests , refer other *.js files for adding common methods */
|
2025-03-07 12:03:16 +00:00
|
|
|
import { ANVIL_EDITOR_TEST, AI_AGENTS_TEST } from "./Constants.js";
|
2024-11-04 10:33:03 +00:00
|
|
|
import advancedFormat from "dayjs/plugin/advancedFormat";
|
2022-04-11 03:30:37 +00:00
|
|
|
|
2023-11-23 10:16:13 +00:00
|
|
|
import EditorNavigation, {
|
|
|
|
|
EntityType,
|
2023-11-28 11:11:54 +00:00
|
|
|
AppSidebar,
|
2023-11-29 11:11:33 +00:00
|
|
|
PageLeftPane,
|
2024-01-12 14:43:58 +00:00
|
|
|
PagePaneSegment,
|
2023-11-23 10:16:13 +00:00
|
|
|
} from "./Pages/EditorNavigation";
|
2023-11-15 02:31:12 +00:00
|
|
|
|
2021-11-30 15:26:37 +00:00
|
|
|
require("cy-verify-downloads").addCustomCommand();
|
2020-12-03 05:32:50 +00:00
|
|
|
require("cypress-file-upload");
|
2022-04-12 10:01:22 +00:00
|
|
|
const path = require("path");
|
2024-01-25 13:41:48 +00:00
|
|
|
import { v4 as uuidv4 } from "uuid";
|
2024-07-10 08:52:39 +00:00
|
|
|
|
2021-08-25 14:01:04 +00:00
|
|
|
const dayjs = require("dayjs");
|
2020-03-27 09:02:11 +00:00
|
|
|
const loginPage = require("../locators/LoginPage.json");
|
2022-02-25 06:13:16 +00:00
|
|
|
import homePage from "../locators/HomePage";
|
2024-12-30 05:11:52 +00:00
|
|
|
|
2024-11-04 10:33:03 +00:00
|
|
|
dayjs.extend(advancedFormat);
|
2023-02-21 13:38:16 +00:00
|
|
|
|
2020-04-08 13:38:19 +00:00
|
|
|
const commonlocators = require("../locators/commonlocators.json");
|
2020-05-01 07:48:33 +00:00
|
|
|
const widgetsPage = require("../locators/Widgets.json");
|
2022-03-02 16:54:43 +00:00
|
|
|
import ApiEditor from "../locators/ApiEditor";
|
2023-03-31 11:37:09 +00:00
|
|
|
import { CURRENT_REPO, REPO } from "../fixtures/REPO";
|
2023-02-21 13:38:16 +00:00
|
|
|
|
2020-05-12 13:47:13 +00:00
|
|
|
const apiwidget = require("../locators/apiWidgetslocator.json");
|
2020-08-20 05:38:08 +00:00
|
|
|
const explorer = require("../locators/explorerlocators.json");
|
2021-04-06 13:29:27 +00:00
|
|
|
const datasource = require("../locators/DatasourcesEditor.json");
|
2021-10-07 02:29:16 +00:00
|
|
|
const jsEditorLocators = require("../locators/JSEditor.json");
|
2021-11-18 14:27:51 +00:00
|
|
|
const queryLocators = require("../locators/QueryEditor.json");
|
2021-10-29 09:10:30 +00:00
|
|
|
const welcomePage = require("../locators/welcomePage.json");
|
2023-04-04 15:56:57 +00:00
|
|
|
import { ObjectsRegistry } from "../support/Objects/Registry";
|
2023-05-18 10:08:38 +00:00
|
|
|
import RapidMode from "./RapidMode";
|
2023-07-05 14:09:04 +00:00
|
|
|
import { featureFlagIntercept } from "./Objects/FeatureFlags";
|
2024-12-03 03:51:43 +00:00
|
|
|
import { PluginActionForm } from "./Pages/PluginActionForm";
|
2023-04-06 16:49:12 +00:00
|
|
|
|
|
|
|
|
const propPane = ObjectsRegistry.PropertyPane;
|
|
|
|
|
const agHelper = ObjectsRegistry.AggregateHelper;
|
|
|
|
|
const locators = ObjectsRegistry.CommonLocators;
|
2023-05-02 09:52:05 +00:00
|
|
|
const onboarding = ObjectsRegistry.Onboarding;
|
2023-05-19 18:37:06 +00:00
|
|
|
const apiPage = ObjectsRegistry.ApiPage;
|
2023-06-15 13:21:11 +00:00
|
|
|
const deployMode = ObjectsRegistry.DeployMode;
|
2023-08-08 09:14:46 +00:00
|
|
|
const assertHelper = ObjectsRegistry.AssertHelper;
|
2023-10-17 14:56:24 +00:00
|
|
|
const homePageTS = ObjectsRegistry.HomePage;
|
2024-05-31 08:31:06 +00:00
|
|
|
const table = ObjectsRegistry.Table;
|
2023-02-06 07:37:01 +00:00
|
|
|
|
2021-11-26 10:47:53 +00:00
|
|
|
const chainStart = Symbol();
|
2024-12-03 03:51:43 +00:00
|
|
|
const pluginActionForm = new PluginActionForm();
|
2020-03-10 09:38:12 +00:00
|
|
|
|
2021-07-02 06:04:36 +00:00
|
|
|
export const initLocalstorage = () => {
|
|
|
|
|
cy.window().then((window) => {
|
|
|
|
|
window.localStorage.setItem("ShowCommentsButtonToolTip", "");
|
2022-03-25 10:43:26 +00:00
|
|
|
window.localStorage.setItem("updateDismissed", "true");
|
2024-12-30 05:11:52 +00:00
|
|
|
window.localStorage.setItem("NUDGE_SHOWN_SPLIT_PANE", "true");
|
2021-07-02 06:04:36 +00:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-31 14:19:36 +00:00
|
|
|
export const addIndexedDBKey = (key, value) => {
|
|
|
|
|
cy.window().then((window) => {
|
|
|
|
|
// Opening the database
|
|
|
|
|
const request = window.indexedDB.open("Appsmith", 2);
|
|
|
|
|
|
|
|
|
|
// Handling database opening success
|
|
|
|
|
request.onsuccess = (event) => {
|
|
|
|
|
const db = event.target.result;
|
|
|
|
|
|
|
|
|
|
// Creating a transaction to access the object store : keyvaluepairs
|
|
|
|
|
const transaction = db.transaction(["keyvaluepairs"], "readwrite");
|
|
|
|
|
const objectStore = transaction.objectStore("keyvaluepairs");
|
|
|
|
|
|
|
|
|
|
// Adding the key
|
|
|
|
|
const addRequest = objectStore.put(value, key);
|
|
|
|
|
|
|
|
|
|
// Handling add success
|
|
|
|
|
addRequest.onsuccess = () => {
|
|
|
|
|
console.log("Key added successfully");
|
|
|
|
|
// Closing the database connection
|
|
|
|
|
db.close();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Handling add error
|
|
|
|
|
addRequest.onerror = (event) => {
|
|
|
|
|
console.log("Error adding key:", event.target.error);
|
|
|
|
|
// Closing the database connection
|
|
|
|
|
db.close();
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Handling database opening error
|
|
|
|
|
request.onerror = (event) => {
|
|
|
|
|
console.log("Error opening database:", event.target.error);
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2021-04-06 13:29:27 +00:00
|
|
|
Cypress.Commands.add("stubPostHeaderReq", () => {
|
|
|
|
|
cy.intercept("POST", "/api/v1/users/invite", (req) => {
|
2021-11-23 08:01:46 +00:00
|
|
|
req.headers["origin"] = "Cypress";
|
2021-04-06 13:29:27 +00:00
|
|
|
}).as("mockPostInvite");
|
2023-04-21 13:23:05 +00:00
|
|
|
cy.intercept("POST", "/api/v1/applications/invite", (req) => {
|
|
|
|
|
req.headers["origin"] = "Cypress";
|
|
|
|
|
}).as("mockPostAppInvite");
|
2021-04-06 13:29:27 +00:00
|
|
|
});
|
|
|
|
|
|
2022-07-21 10:40:36 +00:00
|
|
|
Cypress.Commands.add("testSelfSignedCertificateSettingsInREST", (isOAuth2) => {
|
|
|
|
|
cy.get(datasource.useCertInAuth).should("not.exist");
|
|
|
|
|
cy.get(datasource.certificateDetails).should("not.exist");
|
2023-07-04 12:11:56 +00:00
|
|
|
// cy.TargetDropdownAndSelectOption(datasource.useSelfSignedCert, "Yes");
|
2024-06-06 09:55:08 +00:00
|
|
|
agHelper.CheckUncheck(datasource.useSelfSignedCert);
|
2023-07-04 12:11:56 +00:00
|
|
|
cy.get(datasource.useSelfSignedCert).should("be.checked");
|
2022-07-21 10:40:36 +00:00
|
|
|
if (isOAuth2) {
|
|
|
|
|
cy.get(datasource.useCertInAuth).should("exist");
|
|
|
|
|
} else {
|
|
|
|
|
cy.get(datasource.useCertInAuth).should("not.exist");
|
|
|
|
|
}
|
2024-06-10 14:25:17 +00:00
|
|
|
agHelper.CheckUncheck(datasource.useSelfSignedCert, false);
|
2022-07-21 10:40:36 +00:00
|
|
|
});
|
|
|
|
|
|
2021-05-10 11:57:54 +00:00
|
|
|
Cypress.Commands.add("addBasicProfileDetails", (username, password) => {
|
|
|
|
|
cy.get(datasource.authType).click();
|
|
|
|
|
cy.xpath(datasource.basic).click();
|
|
|
|
|
cy.get(datasource.basicUsername).type(username);
|
|
|
|
|
cy.get(datasource.basicPassword).type(password);
|
|
|
|
|
});
|
|
|
|
|
|
2023-03-29 17:56:24 +00:00
|
|
|
Cypress.Commands.add("GetUrlQueryParams", () => {
|
|
|
|
|
return cy.url().then((url) => {
|
|
|
|
|
const arr = url.split("?")[1]?.split("&");
|
|
|
|
|
const paramObj = {};
|
|
|
|
|
arr &&
|
|
|
|
|
arr.forEach((param) => {
|
|
|
|
|
const [key, value] = param.split("=");
|
|
|
|
|
paramObj[key] = value;
|
|
|
|
|
});
|
|
|
|
|
return cy.wrap(paramObj);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("LogOutUser", () => {
|
2022-03-02 16:54:43 +00:00
|
|
|
cy.wait(1000); //waiting for window to load
|
2023-10-17 14:56:24 +00:00
|
|
|
homePageTS.InvokeDispatchOnStore();
|
2023-11-20 11:14:18 +00:00
|
|
|
//Logout is still a POST request in CE
|
|
|
|
|
if (CURRENT_REPO === REPO.CE) {
|
|
|
|
|
assertHelper.AssertNetworkStatus("@postLogout", 200);
|
|
|
|
|
}
|
2023-03-29 17:56:24 +00:00
|
|
|
});
|
2021-02-03 07:59:00 +00:00
|
|
|
|
2023-03-29 17:56:24 +00:00
|
|
|
Cypress.Commands.add("LoginUser", (uname, pword, goToLoginPage = true) => {
|
2023-06-30 18:46:57 +00:00
|
|
|
goToLoginPage && cy.visit("/user/login", { timeout: 60000 });
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.wait(3000); //for login page to load fully for CI runs
|
2024-01-24 06:44:16 +00:00
|
|
|
cy.wait("@getConsolidatedData");
|
2024-02-23 07:48:01 +00:00
|
|
|
agHelper.AssertElementVisibility(loginPage.username);
|
2020-03-27 09:02:11 +00:00
|
|
|
cy.get(loginPage.username).type(uname);
|
2022-03-31 11:51:08 +00:00
|
|
|
cy.get(loginPage.password).type(pword, { log: false });
|
2020-03-27 09:02:11 +00:00
|
|
|
cy.get(loginPage.submitBtn).click();
|
2024-01-24 06:44:16 +00:00
|
|
|
cy.wait("@getConsolidatedData");
|
2021-11-17 15:45:48 +00:00
|
|
|
cy.wait(3000);
|
2023-03-29 17:56:24 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("LogintoApp", (uname, pword) => {
|
|
|
|
|
cy.LogOutUser();
|
|
|
|
|
cy.LoginUser(uname, pword);
|
2023-03-31 11:37:09 +00:00
|
|
|
if (CURRENT_REPO === REPO.CE) {
|
2024-01-25 13:41:48 +00:00
|
|
|
cy.get(".createnew").should("be.visible");
|
|
|
|
|
cy.get(".createnew").should("be.enabled");
|
2023-03-31 11:37:09 +00:00
|
|
|
}
|
2021-07-02 06:04:36 +00:00
|
|
|
initLocalstorage();
|
2020-03-27 09:02:11 +00:00
|
|
|
});
|
2020-06-17 10:47:01 +00:00
|
|
|
|
2025-04-02 06:50:06 +00:00
|
|
|
Cypress.Commands.add("LoginFromAPI", (uname, pword, redirectUrl) => {
|
2024-06-14 15:22:49 +00:00
|
|
|
homePageTS.LogOutviaAPI();
|
2023-05-30 06:32:07 +00:00
|
|
|
let baseURL = Cypress.config().baseUrl;
|
|
|
|
|
baseURL = baseURL.endsWith("/") ? baseURL.slice(0, -1) : baseURL;
|
|
|
|
|
|
|
|
|
|
// Clear cookies to avoid stale cookies on cypress CI
|
|
|
|
|
cy.clearCookie("SESSION");
|
|
|
|
|
|
|
|
|
|
cy.visit({
|
|
|
|
|
method: "POST",
|
2025-04-02 06:50:06 +00:00
|
|
|
url: `api/v1/login${redirectUrl ? "?redirectUrl=" + redirectUrl : ""}`,
|
2023-05-30 06:32:07 +00:00
|
|
|
headers: {
|
|
|
|
|
origin: baseURL,
|
2025-03-08 15:31:02 +00:00
|
|
|
"X-Requested-By": "Appsmith",
|
2023-05-30 06:32:07 +00:00
|
|
|
},
|
|
|
|
|
followRedirect: true,
|
|
|
|
|
body: {
|
|
|
|
|
username: uname,
|
|
|
|
|
password: pword,
|
|
|
|
|
},
|
2023-06-20 19:24:18 +00:00
|
|
|
timeout: 60000,
|
2023-05-30 06:32:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Check if cookie is present
|
|
|
|
|
cy.getCookie("SESSION").then((cookie) => {
|
|
|
|
|
expect(cookie).to.not.be.null;
|
2023-10-25 14:03:07 +00:00
|
|
|
cy.log("cookie.value is: " + cookie.value);
|
2023-05-30 06:32:07 +00:00
|
|
|
|
2023-11-28 13:33:07 +00:00
|
|
|
if (CURRENT_REPO === REPO.EE) {
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
cy.url().then((url) => {
|
|
|
|
|
if (url.indexOf("/license") > -1) {
|
|
|
|
|
cy.validateLicense();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-30 06:32:07 +00:00
|
|
|
cy.location().should((loc) => {
|
2025-04-02 06:50:06 +00:00
|
|
|
if (redirectUrl) {
|
|
|
|
|
expect(loc.href).to.eq(loc.origin + redirectUrl);
|
|
|
|
|
} else {
|
|
|
|
|
expect(loc.href).to.eq(loc.origin + "/applications");
|
|
|
|
|
}
|
2023-05-30 06:32:07 +00:00
|
|
|
});
|
|
|
|
|
|
2023-05-30 09:48:45 +00:00
|
|
|
if (CURRENT_REPO === REPO.EE) {
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
} else {
|
2025-04-02 06:50:06 +00:00
|
|
|
if (!redirectUrl) {
|
|
|
|
|
assertHelper.AssertNetworkStatus("getAllWorkspaces");
|
|
|
|
|
}
|
2024-01-24 06:44:16 +00:00
|
|
|
assertHelper.AssertNetworkStatus("getConsolidatedData");
|
2023-05-30 09:48:45 +00:00
|
|
|
}
|
2020-06-17 10:47:01 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2023-10-25 14:03:07 +00:00
|
|
|
Cypress.Commands.add("LogOut", (toCheckgetPluginForm = true) => {
|
|
|
|
|
agHelper.WaitUntilAllToastsDisappear();
|
2023-11-20 11:14:18 +00:00
|
|
|
|
|
|
|
|
// Logout is a POST request in CE
|
2023-11-28 11:11:54 +00:00
|
|
|
let httpMethod = "POST";
|
2023-11-20 11:14:18 +00:00
|
|
|
|
2023-10-25 14:03:07 +00:00
|
|
|
if (CURRENT_REPO === REPO.CE)
|
|
|
|
|
toCheckgetPluginForm &&
|
2024-01-24 06:44:16 +00:00
|
|
|
assertHelper.AssertNetworkResponseData("@getConsolidatedData", false);
|
2023-10-25 14:03:07 +00:00
|
|
|
|
2023-03-15 10:02:24 +00:00
|
|
|
cy.request({
|
2023-11-20 11:14:18 +00:00
|
|
|
method: httpMethod,
|
2023-03-15 10:02:24 +00:00
|
|
|
url: "/api/v1/logout",
|
|
|
|
|
headers: {
|
|
|
|
|
"X-Requested-By": "Appsmith",
|
|
|
|
|
},
|
2023-04-19 09:37:39 +00:00
|
|
|
}).then((response) => {
|
|
|
|
|
expect(response.status).equal(200); //Verifying logout is success
|
2023-03-15 10:02:24 +00:00
|
|
|
});
|
2020-05-19 06:13:15 +00:00
|
|
|
});
|
2020-04-02 04:47:48 +00:00
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("SearchApp", (appname) => {
|
2023-05-11 18:45:06 +00:00
|
|
|
cy.get(homePage.searchInput).type(appname, { force: true });
|
2021-03-31 08:35:19 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2020-05-01 07:48:33 +00:00
|
|
|
cy.wait(2000);
|
2020-09-17 17:01:01 +00:00
|
|
|
cy.get(homePage.applicationCard)
|
|
|
|
|
.first()
|
|
|
|
|
.trigger("mouseover", { force: true });
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(homePage.appEditIcon).first().click({ force: true });
|
2020-04-21 14:19:12 +00:00
|
|
|
cy.get("#loading").should("not.exist");
|
2020-05-01 07:48:33 +00:00
|
|
|
// Wait added because after opening the application editor, sometimes it takes a little time.
|
2020-04-02 04:47:48 +00:00
|
|
|
});
|
|
|
|
|
|
2020-06-10 17:42:51 +00:00
|
|
|
Cypress.Commands.add("WaitAutoSave", () => {
|
2020-07-03 08:58:58 +00:00
|
|
|
// wait for save query to trigger
|
2021-03-31 08:35:19 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2022-07-26 03:25:48 +00:00
|
|
|
cy.wait(3000);
|
2020-07-21 12:05:06 +00:00
|
|
|
cy.wait("@saveAction");
|
2020-05-12 13:47:13 +00:00
|
|
|
});
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("SelectAction", (action) => {
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(ApiEditor.ApiVerb).first().click({ force: true });
|
|
|
|
|
cy.xpath(action).should("be.visible").click({ force: true });
|
2020-05-20 16:04:37 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("ClearSearch", () => {
|
2023-02-03 08:47:01 +00:00
|
|
|
cy.get(commonlocators.entityExplorersearch).clear({ force: true });
|
2020-05-20 16:04:37 +00:00
|
|
|
});
|
|
|
|
|
|
2022-04-11 03:30:37 +00:00
|
|
|
Cypress.Commands.add("clickTest", (testbutton) => {
|
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
cy.wait("@saveAction");
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(testbutton).first().click({ force: true });
|
2022-04-11 03:30:37 +00:00
|
|
|
cy.wait("@postExecute");
|
2020-05-20 16:04:37 +00:00
|
|
|
});
|
|
|
|
|
|
2023-02-09 11:09:54 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"EvaluateCurrentValue",
|
|
|
|
|
(currentValue, isValueToBeEvaluatedDynamic = false) => {
|
|
|
|
|
// if the value is not dynamic, evaluated popup must be hidden
|
|
|
|
|
if (!isValueToBeEvaluatedDynamic) {
|
|
|
|
|
cy.get(commonlocators.evaluatedCurrentValue).should("not.exist");
|
|
|
|
|
} else {
|
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
|
cy.wait(3000);
|
|
|
|
|
cy.get(commonlocators.evaluatedCurrentValue)
|
|
|
|
|
.first()
|
|
|
|
|
.should("be.visible")
|
|
|
|
|
.should("not.have.text", "undefined");
|
|
|
|
|
cy.get(commonlocators.evaluatedCurrentValue)
|
|
|
|
|
.first()
|
|
|
|
|
//.should("be.visible")
|
|
|
|
|
.click({ force: true })
|
|
|
|
|
.then(($text) => {
|
|
|
|
|
if ($text.text()) expect($text.text()).to.eq(currentValue);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
2020-11-12 12:04:44 +00:00
|
|
|
|
2022-04-11 03:30:37 +00:00
|
|
|
Cypress.Commands.add("tabPopertyUpdate", (tabId, newTabName) => {
|
|
|
|
|
cy.get("[data-rbd-draggable-id='" + tabId + "'] input")
|
|
|
|
|
.scrollIntoView()
|
|
|
|
|
.should("be.visible")
|
|
|
|
|
.click({
|
|
|
|
|
force: true,
|
|
|
|
|
});
|
|
|
|
|
cy.get("[data-rbd-draggable-id='" + tabId + "'] input").clear({
|
|
|
|
|
force: true,
|
2022-03-18 08:45:38 +00:00
|
|
|
});
|
2022-04-11 03:30:37 +00:00
|
|
|
cy.get("[data-rbd-draggable-id='" + tabId + "'] input").type(newTabName, {
|
|
|
|
|
force: true,
|
2022-03-28 05:10:07 +00:00
|
|
|
});
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(`.t--tabid-${tabId}`).contains(newTabName).should("be.visible");
|
2020-05-01 07:48:33 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("generateUUID", () => {
|
2024-01-25 13:41:48 +00:00
|
|
|
let id = uuidv4();
|
2020-09-16 11:50:47 +00:00
|
|
|
return id.split("-")[0];
|
2020-05-01 07:48:33 +00:00
|
|
|
});
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("addDsl", (dsl) => {
|
2023-05-18 10:08:38 +00:00
|
|
|
let pageid, layoutId, appId;
|
2021-01-04 10:16:08 +00:00
|
|
|
cy.url().then((url) => {
|
2023-05-18 10:08:38 +00:00
|
|
|
if (RapidMode.config.enabled && RapidMode.config.usesDSL) {
|
|
|
|
|
pageid = RapidMode.config.pageID;
|
|
|
|
|
} else {
|
2024-06-22 13:03:29 +00:00
|
|
|
pageid = agHelper.extractPageIdFromUrl(url);
|
|
|
|
|
expect(pageid).to.not.be.null;
|
2023-05-18 10:08:38 +00:00
|
|
|
}
|
2023-05-02 10:47:23 +00:00
|
|
|
|
2020-05-01 07:48:33 +00:00
|
|
|
//Fetch the layout id
|
2021-01-04 10:16:08 +00:00
|
|
|
cy.request("GET", "api/v1/pages/" + pageid).then((response) => {
|
2021-06-21 11:09:51 +00:00
|
|
|
const respBody = JSON.stringify(response.body);
|
2023-05-02 10:47:23 +00:00
|
|
|
const data = JSON.parse(respBody).data;
|
|
|
|
|
layoutId = data.layouts[0].id;
|
|
|
|
|
appId = data.applicationId;
|
2021-06-21 11:09:51 +00:00
|
|
|
// Dumping the DSL to the created page
|
2023-03-15 10:02:24 +00:00
|
|
|
cy.request({
|
|
|
|
|
method: "PUT",
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
url:
|
|
|
|
|
"api/v1/layouts/" +
|
2022-10-11 05:32:44 +00:00
|
|
|
layoutId +
|
|
|
|
|
"/pages/" +
|
|
|
|
|
pageid +
|
|
|
|
|
"?applicationId=" +
|
|
|
|
|
appId,
|
2023-03-15 10:02:24 +00:00
|
|
|
body: dsl,
|
|
|
|
|
headers: {
|
|
|
|
|
"X-Requested-By": "Appsmith",
|
|
|
|
|
},
|
|
|
|
|
}).then((response) => {
|
2021-06-21 11:09:51 +00:00
|
|
|
cy.log(response.body);
|
2020-05-01 07:48:33 +00:00
|
|
|
expect(response.status).equal(200);
|
2023-05-18 10:08:38 +00:00
|
|
|
if (RapidMode.config.enabled && RapidMode.config.usesDSL) {
|
|
|
|
|
cy.visit(RapidMode.url());
|
|
|
|
|
} else {
|
|
|
|
|
cy.reload();
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-02 10:47:23 +00:00
|
|
|
cy.wait("@getWorkspace");
|
2020-05-01 07:48:33 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2020-05-08 05:40:14 +00:00
|
|
|
|
2020-05-12 04:35:21 +00:00
|
|
|
Cypress.Commands.add("DeleteAppByApi", () => {
|
2022-03-25 10:43:26 +00:00
|
|
|
const appId = localStorage.getItem("applicationId");
|
|
|
|
|
if (appId !== null) {
|
2023-10-20 02:15:47 +00:00
|
|
|
cy.log("appId to delete is:" + appId);
|
2022-03-25 10:43:26 +00:00
|
|
|
cy.request({
|
|
|
|
|
method: "DELETE",
|
|
|
|
|
url: "api/v1/applications/" + appId,
|
|
|
|
|
failOnStatusCode: false,
|
2023-03-15 10:02:24 +00:00
|
|
|
headers: {
|
|
|
|
|
"X-Requested-By": "Appsmith",
|
|
|
|
|
},
|
2022-03-25 10:43:26 +00:00
|
|
|
}).then((response) => {
|
|
|
|
|
cy.log(response.body);
|
|
|
|
|
cy.log(response.status);
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-05-12 04:35:21 +00:00
|
|
|
});
|
2021-10-29 07:02:45 +00:00
|
|
|
|
2023-10-20 02:15:47 +00:00
|
|
|
Cypress.Commands.add("DeleteWorkspaceByApi", () => {
|
|
|
|
|
const workspaceId = localStorage.getItem("workspaceId");
|
|
|
|
|
if (workspaceId !== null) {
|
|
|
|
|
cy.log("workspaceId to delete is:" + workspaceId);
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "DELETE",
|
|
|
|
|
url: "api/v1/workspaces/" + workspaceId,
|
|
|
|
|
failOnStatusCode: false,
|
|
|
|
|
headers: {
|
|
|
|
|
"X-Requested-By": "Appsmith",
|
|
|
|
|
},
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
cy.log(response.body);
|
|
|
|
|
cy.log(response.status);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2021-10-07 02:29:16 +00:00
|
|
|
Cypress.Commands.add("NavigateToJSEditor", () => {
|
2024-01-12 14:43:58 +00:00
|
|
|
PageLeftPane.switchSegment(PagePaneSegment.JS);
|
|
|
|
|
PageLeftPane.switchToAddNew();
|
2021-10-07 02:29:16 +00:00
|
|
|
});
|
|
|
|
|
|
2022-01-29 07:26:19 +00:00
|
|
|
Cypress.Commands.add("selectAction", (option) => {
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(".ads-v2-menu__menu-item-children")
|
|
|
|
|
.contains(option)
|
|
|
|
|
.click({ force: true });
|
2022-01-29 07:26:19 +00:00
|
|
|
});
|
|
|
|
|
|
2020-12-11 13:48:01 +00:00
|
|
|
Cypress.Commands.add("dragAndDropToCanvas", (widgetType, { x, y }) => {
|
2024-01-12 14:43:58 +00:00
|
|
|
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
|
|
|
|
PageLeftPane.switchToAddNew();
|
2020-09-08 10:54:55 +00:00
|
|
|
const selector = `.t--widget-card-draggable-${widgetType}`;
|
2021-10-04 15:34:37 +00:00
|
|
|
cy.wait(500);
|
2020-09-08 10:54:55 +00:00
|
|
|
cy.get(selector)
|
2023-07-22 05:57:18 +00:00
|
|
|
.first()
|
2021-08-12 05:45:38 +00:00
|
|
|
.trigger("dragstart", { force: true })
|
2020-12-11 13:48:01 +00:00
|
|
|
.trigger("mousemove", x, y, { force: true });
|
2023-02-08 11:23:39 +00:00
|
|
|
|
2024-02-23 07:17:10 +00:00
|
|
|
const option = { eventConstructor: "MouseEvent", scrollBehavior: false };
|
2023-02-08 11:23:39 +00:00
|
|
|
|
2020-09-08 10:54:55 +00:00
|
|
|
cy.get(explorer.dropHere)
|
2023-02-08 11:23:39 +00:00
|
|
|
.trigger("mousemove", x, y, option)
|
|
|
|
|
.trigger("mousemove", x, y, option)
|
|
|
|
|
.trigger("mouseup", x, y, option);
|
2024-06-06 07:41:03 +00:00
|
|
|
agHelper.AssertAutoSave();
|
2022-07-20 06:06:33 +00:00
|
|
|
});
|
2020-09-08 10:54:55 +00:00
|
|
|
|
2021-08-26 15:24:37 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"dragAndDropToWidget",
|
|
|
|
|
(widgetType, destinationWidget, { x, y }) => {
|
2024-01-12 14:43:58 +00:00
|
|
|
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
|
|
|
|
PageLeftPane.switchToAddNew();
|
2021-08-26 15:24:37 +00:00
|
|
|
const selector = `.t--widget-card-draggable-${widgetType}`;
|
2022-03-02 16:54:43 +00:00
|
|
|
cy.wait(800);
|
2021-08-26 15:24:37 +00:00
|
|
|
cy.get(selector)
|
2023-07-22 05:57:18 +00:00
|
|
|
.first()
|
2022-04-03 16:43:20 +00:00
|
|
|
.scrollIntoView()
|
2021-08-26 15:24:37 +00:00
|
|
|
.trigger("dragstart", { force: true })
|
|
|
|
|
.trigger("mousemove", x, y, { force: true });
|
|
|
|
|
const selector2 = `.t--draggable-${destinationWidget}`;
|
|
|
|
|
cy.get(selector2)
|
2023-07-22 05:57:18 +00:00
|
|
|
.first()
|
2022-04-03 16:43:20 +00:00
|
|
|
.scrollIntoView()
|
2021-08-26 15:24:37 +00:00
|
|
|
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
|
|
|
|
|
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
|
|
|
|
|
.trigger("mouseup", x, y, { eventConstructor: "MouseEvent" });
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2023-03-02 15:49:14 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"dragAndDropToWidgetBySelector",
|
|
|
|
|
(widgetType, destinationSelector, { x, y }) => {
|
2024-01-12 14:43:58 +00:00
|
|
|
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
|
|
|
|
PageLeftPane.switchToAddNew();
|
2023-03-02 15:49:14 +00:00
|
|
|
const selector = `.t--widget-card-draggable-${widgetType}`;
|
|
|
|
|
cy.wait(800);
|
|
|
|
|
cy.get(selector)
|
2023-07-22 05:57:18 +00:00
|
|
|
.first()
|
2023-03-02 15:49:14 +00:00
|
|
|
.scrollIntoView()
|
|
|
|
|
.trigger("dragstart", { force: true })
|
|
|
|
|
.trigger("mousemove", x, y, { force: true });
|
|
|
|
|
cy.get(destinationSelector)
|
|
|
|
|
.first()
|
|
|
|
|
.scrollIntoView()
|
|
|
|
|
.scrollTo("top", { ensureScrollable: false })
|
|
|
|
|
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
|
|
|
|
|
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
|
|
|
|
|
.trigger("mouseup", x, y, { eventConstructor: "MouseEvent" });
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2021-09-23 15:14:24 +00:00
|
|
|
Cypress.Commands.add("changeButtonColor", (buttonColor) => {
|
|
|
|
|
cy.get(widgetsPage.buttonColor)
|
|
|
|
|
.click({ force: true })
|
|
|
|
|
.clear()
|
2023-08-22 09:50:03 +00:00
|
|
|
.type(buttonColor, { delay: 0 });
|
2023-06-15 13:21:11 +00:00
|
|
|
deployMode.DeployApp();
|
2021-06-15 10:19:30 +00:00
|
|
|
cy.get(widgetsPage.widgetBtn).should(
|
|
|
|
|
"have.css",
|
|
|
|
|
"background-color",
|
|
|
|
|
buttonColor,
|
|
|
|
|
);
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
});
|
|
|
|
|
|
2020-06-04 13:49:22 +00:00
|
|
|
Cypress.Commands.add("closePropertyPane", () => {
|
2021-11-23 08:01:46 +00:00
|
|
|
cy.get(commonlocators.canvas).click({ force: true });
|
2020-06-04 13:49:22 +00:00
|
|
|
});
|
|
|
|
|
|
2023-04-06 16:49:12 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"onClickActions",
|
2023-06-09 09:25:52 +00:00
|
|
|
(forSuccess, forFailure, actionType, actionValue, idx = 0) => {
|
2023-04-06 16:49:12 +00:00
|
|
|
propPane.SelectActionByTitleAndValue(actionType, actionValue);
|
|
|
|
|
|
2023-07-25 12:27:16 +00:00
|
|
|
agHelper.Sleep();
|
2023-04-06 16:49:12 +00:00
|
|
|
|
|
|
|
|
// add a success callback
|
|
|
|
|
cy.get(propPane._actionAddCallback("success")).click().wait(500);
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(locators._dropDownValue("Show alert")).click().wait(500);
|
2023-04-06 16:49:12 +00:00
|
|
|
agHelper.TypeText(
|
|
|
|
|
propPane._actionSelectorFieldByLabel("Message"),
|
|
|
|
|
forSuccess,
|
|
|
|
|
);
|
|
|
|
|
agHelper.GetNClick(propPane._actionSelectorPopupClose);
|
|
|
|
|
|
|
|
|
|
// add a failure callback
|
|
|
|
|
cy.get(propPane._actionAddCallback("failure")).click().wait(500);
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(locators._dropDownValue("Show alert")).click().wait(500);
|
2023-04-06 16:49:12 +00:00
|
|
|
agHelper.TypeText(
|
|
|
|
|
propPane._actionSelectorFieldByLabel("Message"),
|
|
|
|
|
forFailure,
|
|
|
|
|
);
|
|
|
|
|
agHelper.GetNClick(propPane._actionSelectorPopupClose);
|
|
|
|
|
},
|
|
|
|
|
);
|
2021-06-17 13:47:54 +00:00
|
|
|
|
2020-05-18 04:28:41 +00:00
|
|
|
Cypress.Commands.add("getDate", (date, dateFormate) => {
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
const eDate = dayjs().add(date, "days").format(dateFormate);
|
2020-05-28 06:37:47 +00:00
|
|
|
return eDate;
|
2020-05-18 04:28:41 +00:00
|
|
|
});
|
|
|
|
|
|
2024-11-05 11:41:02 +00:00
|
|
|
Cypress.Commands.add("setDate", (date, dateFormate, ver = "v2") => {
|
|
|
|
|
if (ver == "v2") {
|
|
|
|
|
const expDate = dayjs().add(date, "days").format("dddd, MMMM D");
|
|
|
|
|
cy.get(`.react-datepicker__day[aria-label^="Choose ${expDate}"]`)
|
|
|
|
|
.first()
|
|
|
|
|
.click();
|
|
|
|
|
} else if (ver == "v1") {
|
|
|
|
|
const expDate = dayjs().add(date, "days").format(dateFormate);
|
|
|
|
|
const sel = `.DayPicker-Day[aria-label=\"${expDate}\"]`;
|
|
|
|
|
cy.get(sel).click();
|
|
|
|
|
}
|
2020-05-18 04:28:41 +00:00
|
|
|
});
|
2020-05-18 05:34:49 +00:00
|
|
|
|
2020-05-28 06:37:47 +00:00
|
|
|
Cypress.Commands.add("validateDisableWidget", (widgetCss, disableCss) => {
|
|
|
|
|
cy.get(widgetCss + disableCss).should("exist");
|
|
|
|
|
});
|
|
|
|
|
|
2021-10-13 12:40:52 +00:00
|
|
|
Cypress.Commands.add("validateToolbarVisible", (widgetCss, toolbarCss) => {
|
2022-04-03 16:43:20 +00:00
|
|
|
cy.get(widgetCss + toolbarCss).should("exist");
|
2021-10-13 12:40:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("validateToolbarHidden", (widgetCss, toolbarCss) => {
|
2022-04-03 16:43:20 +00:00
|
|
|
cy.get(widgetCss + toolbarCss).should("not.exist");
|
2021-10-13 12:40:52 +00:00
|
|
|
});
|
|
|
|
|
|
2020-05-28 06:37:47 +00:00
|
|
|
Cypress.Commands.add("validateEnableWidget", (widgetCss, disableCss) => {
|
|
|
|
|
cy.get(widgetCss + disableCss).should("not.exist");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("validateHTMLText", (widgetCss, htmlTag, value) => {
|
2021-01-04 10:16:08 +00:00
|
|
|
cy.get(widgetCss + " iframe").then(($iframe) => {
|
2020-05-28 06:37:47 +00:00
|
|
|
const $body = $iframe.contents().find("body");
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.wrap($body).find(htmlTag).should("have.text", value);
|
2020-05-28 06:37:47 +00:00
|
|
|
});
|
|
|
|
|
});
|
2022-01-18 18:54:34 +00:00
|
|
|
Cypress.Commands.add("setTinyMceContent", (tinyMceId, content) => {
|
|
|
|
|
cy.window().then((win) => {
|
2024-03-29 06:37:35 +00:00
|
|
|
const editor = win.tinymce.EditorManager.get(tinyMceId);
|
2022-01-18 18:54:34 +00:00
|
|
|
editor.setContent(content);
|
|
|
|
|
});
|
|
|
|
|
});
|
2020-05-28 06:37:47 +00:00
|
|
|
|
2020-05-27 11:21:11 +00:00
|
|
|
Cypress.Commands.add("startServerAndRoutes", () => {
|
2021-01-14 05:44:07 +00:00
|
|
|
//To update route with intercept after working on alias wrt wait and alias
|
2023-06-15 13:21:11 +00:00
|
|
|
//cy.server();
|
|
|
|
|
cy.intercept("PUT", "/api/v1/themes/applications/*").as("updateTheme");
|
|
|
|
|
cy.intercept("POST", "/api/v1/datasources/test").as("testDatasource");
|
|
|
|
|
cy.intercept("POST", "/api/v1/datasources").as("saveDatasource");
|
|
|
|
|
cy.intercept("GET", "/api/v1/applications/new").as("applications");
|
|
|
|
|
cy.intercept("GET", "/api/v1/users/profile").as("getUser");
|
2023-06-27 08:20:54 +00:00
|
|
|
cy.intercept("GET", "/api/v1/plugins?workspaceId=*").as("getPlugins");
|
2023-11-20 11:14:18 +00:00
|
|
|
|
2025-02-18 06:49:05 +00:00
|
|
|
cy.intercept("POST", "/api/v1/logout").as("postLogout");
|
|
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("GET", "/api/v1/datasources?workspaceId=*").as("getDataSources");
|
|
|
|
|
cy.intercept("GET", "/api/v1/pages?*mode=EDIT").as("getPagesForCreateApp");
|
|
|
|
|
cy.intercept("GET", "/api/v1/pages?*mode=PUBLISHED").as("getPagesForViewApp");
|
|
|
|
|
cy.intercept("GET", "/api/v1/applications/releaseItems").as(
|
|
|
|
|
"getReleaseItems",
|
|
|
|
|
);
|
2024-01-25 13:41:48 +00:00
|
|
|
cy.intercept("GET", "/api/v1/workspaces/home").as("getAllWorkspaces");
|
|
|
|
|
cy.intercept("GET", "/api/v1/applications/home?workspaceId=*").as(
|
|
|
|
|
"getApplicationsOfWorkspace",
|
|
|
|
|
);
|
2023-06-15 13:21:11 +00:00
|
|
|
|
|
|
|
|
cy.intercept("POST");
|
|
|
|
|
cy.intercept("GET", "/api/v1/pages/*").as("getPage");
|
|
|
|
|
cy.intercept("GET", "/api/v1/applications/*/pages/*/edit").as(
|
|
|
|
|
"getAppPageEdit",
|
|
|
|
|
);
|
|
|
|
|
cy.intercept("GET", "/api/v1/actions*").as("getActions");
|
|
|
|
|
cy.intercept("PUT", "/api/v1/pages/*").as("updatePage");
|
|
|
|
|
cy.intercept("PUT", "api/v1/applications/*/page/*/makeDefault").as(
|
2022-12-02 05:49:51 +00:00
|
|
|
"makePageDefault",
|
|
|
|
|
);
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("DELETE", "/api/v1/applications/*").as("deleteApp");
|
|
|
|
|
cy.intercept("DELETE", "/api/v1/pages/*").as("deletePage");
|
|
|
|
|
//cy.intercept("POST", "/api/v1/datasources").as("createDatasource");
|
|
|
|
|
cy.intercept("DELETE", "/api/v1/datasources/*").as("deleteDatasource");
|
|
|
|
|
cy.intercept("GET", "/api/v1/datasources/*/structure?ignoreCache=*").as(
|
2020-09-21 09:11:42 +00:00
|
|
|
"getDatasourceStructure",
|
|
|
|
|
);
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/datasources/datasource-query/*").as(
|
2021-08-20 06:57:01 +00:00
|
|
|
"datasourceQuery",
|
|
|
|
|
);
|
2020-05-27 11:21:11 +00:00
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("POST", "/api/v1/datasources/*/trigger").as("trigger");
|
feat: Simplified Google Sheets queries (#14869)
* Client changes 1
* add DSL functionality
* Temp commit for refactoring changes
* Do I even know what I'm doing here?
* chore: Second GS layout
* Update: Visibility conditional outputs for schemas
- Added the output from conditional outputs for schema children too
* Update: Entity selector visibility control
- Added logic for controlling visibility of sub components via the JS expressions system
* Update: Passing disabled prop to toggle button
* Update: Passing disabled prop to toggle btn
* Update: Styled component for toggle button
- Added disabled styles based on the disabled prop sent to the toggle form view JSON button
* Update: configProperty role in Entity Selector
- Removed dependance of the configProperty of the entity selector children to it's parent component
* Update: type of placeholder key
- Made placeholder key from form config JSON to accept either string or an object
- Earlier only string was accepted
- This is for pagination component
* Update: Added placeholder control for pagination
* Client changes 1
* add DSL functionality
* Do I even know what I'm doing here?
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design
* fix: updated tooltip component for wrong ui on entity explore
* temp triggers
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design (#12395)
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design
* fix: updated tooltip component for wrong ui on entity explore
* fix: updated tooltip ui, where condition placement, sort by ui
* temp form data access logic
* fix: updated sorting type width ui
* fix: updated ui for spacing, width and text issues
* Update: Type for tooltip of UQI forms
- Added option to send an object to the tooltipText object.
- This allows for composite components like pagination to have tooltips for each sub component
* Update: tooltip for pagination component
- Added handling to parse the tooltip for multiple components.
- This allows for composite components like pagination to have tooltips for each sub component
* Update: Type cast for tooltip component
- Made the content passed to tooltip component as a string only
* Update: Fixed tooltip component CSS
* Update: Dropdown option component
- Added a tooltip wrapper to each option
- This is to show on hover text like disabled state
* fix: updated ẇhere clause broken ui for condition
* Add: functions to check and extract expressions
- Loop through the formConfig and find any keys that have a value that is bindable
- Used pre defined regex to check if value is a moustache binding
* Add: Types for evaluated form configs
- Added types for the form configs to be evaluated and their output post eval
* Add: Flow to run the form config
- Run the form config and update the result to the redux state
* Update: Name of the type for formconfigs
- Updated since it was clashing with a component of the same name
* Add: Function to enforce config type checks
- This is done so that the improper configs can be weeded out and the rest of the form can be shown
* Add: Function to update evaluated config
- Added option to update the config if it's values needed evaluation
* Add: Type check for schema sections
* Update: Error handling for invalid control type
- We were throwing an exception till now, changed it to a warning text
* Add: Exposed tooltip for dropdown option disabled state
* Update: switch to json mode functionality
- Added logic to convert data to a string rather than an object when the first switch to JSON mode happens
* Update: Added key to tooltip for dropdown options
* Trigger API modification
* Add: function to fetch default trigger URL
* Update: Made URL optional in dynamic trigger config
* Update: Dynamic trigger API call
- Made the API call for dynamic triggers have URL as optional field
- Added type check to the response of the API call
* Update: resp type for trigger APIs
* Update: Moved code to utils folder
- Moved functions for UQI form eval processing to utils file
* Update: passing original controltype to JS switch
* Update: config for JSON editor mode
- Updated the config to have different options for JSON mode depending on the original control type
* Update: Connected line numbers flag to config
* Revert: CSS changes for tooltip
* Refactor: Removed consle
* Add: type for the config of dynamic values
* Add: Feature to evaluate config for triggers
* Refactor: fix type check errors
* fix: dropdown ui width with text alignment
* Update: fixed selector for dynamic values
* Update: selector call for fetchDynamicValues
* Add table header index prop for columns selector
* migration partial commit
* migration partial commit
* Refactor: removed unused import
* Update: reused function for checking dynamic value
* Update: removed unused import
* Fix format JSON issues
* Retrieve binding paths from entity selector components
* Fixes 6 remaining issues with UQI implementation
* Fix dropdown issues
* Fix dropdown height issues and fixes triggering of APIs when option is deselected
* Migration changes
* Fix QA generated UQI issues
* Fix projection component height and route change logic
* Fix multi select dropdown placeholder text issue and json stringify issue with switching view types
* Reset entity type value when command value changes
* Test changes
* Review comments
* Moved migrations around
* Corrected import statement
* Added JSON schema migration
* Updated schema version
* perf improvements and filter dropdown options feature
* Fix Code mirror component config for toggleComponentToJson input fields.
* Fix prettier issues
* fix prettier issues
* Fix style issues as a result of the merged conflicts
* Fix failing test case
* Fixed a few other flows (#14225)
* Fixed a few other flows
* Review comments
* Fix generate CRUD, fix evaluation of dynamic bindings and fix various styling issues.
* More fixes (#14367)
* Factor in the root formconfig parent key.
* Fix flickering issues, and evaluatedFormConfig issues
* fix: Teeny bugs (#14455)
* Teeny bugs
* Added previous functionality as is
* Improvements in the way we fetch dynamic values
* Fix stringiification issue and cyclic dependency issues
* Resolve projection component values deletion
* Resolve merge conflicts and fix prettier issues
* fix: Tsc issues
* Fix property pane connection navigation
* updating ee locator
* updating inputfield locator
* dropdown locator update
* Merge conflict not properly resolved.
* Fix s3 spec
* Fix Mongo Spec
* Fix some more tests
* fix: prevent cyclic dependency when switching to js mode (#14668)
* add delete events for change from array to string in diff
* add test to assert absence of cyclic dependency error when switching to js in switchgroup widget
* Assert that evaluation is not disabled when no cyclic dependency happens
* Cypress test preparations for google sheets and form controls
* Fixed a few test errors (#14874)
* Add: unit tests for uqi UI updates
- view type tests
- conditional output extraction
- processing conditional output to handle view/enabled state of the component
* Add: completed isValidFormConfig test
* Update: improved tests for update config
- These tests cover the functionality to update a section config after it's components are done evaluating
* Fix failing cypress tests and cyclic dependency issue
* Fixes some more tests
* Fixed migration of row objects (#14896)
* Bumped the version of design system package
* Update: reverted change to EE selector
* Fix deletion pointer
* Update: selector for js on load spec
- Synced with changes related to ADS dropdown
* Fix mongoDBShoppingCart spec
* Remove comments
* Fix: mongo shopping cart test failures
* fix: mongo shopping cart spec
* Dummy push to retrigger vercel
* fix: mongo shopping cart spec
* Update MongoDBShoppingCart_spec.js
* fix: removed unused click away
* dummy commit
* Update: moved helper functions to separate file
* Add: added tests for saga functions
- Worked on testing for
- extractFetchDynamicValueFormConfigs
- extractQueueOfValuesToBeFetched
* Add if check for queueOfValuesToBeFetched
* Resolve review comments
* Empty-Commit
Co-authored-by: Irongade <adeoluayangade@yahoo.com>
Co-authored-by: Ayush Pahwa <ayush@appsmith.com>
Co-authored-by: Aman Agarwal <aman@appsmith.com>
Co-authored-by: Ayangade Adeoluwa <37867493+Irongade@users.noreply.github.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
Co-authored-by: Albin <albin@appsmith.com>
2022-07-04 05:43:27 +00:00
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/pages/crud-page/*").as(
|
|
|
|
|
"replaceLayoutWithCRUDPage",
|
|
|
|
|
);
|
|
|
|
|
cy.intercept("POST", "/api/v1/pages/crud-page").as("generateCRUDPage");
|
2021-07-29 08:13:10 +00:00
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("GET", "/api/v1/workspaces").as("workspaces");
|
|
|
|
|
cy.intercept("GET", "/api/v1/workspaces/*").as("getWorkspace");
|
2020-08-28 18:51:16 +00:00
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("POST", "/api/v1/applications/publish/*").as("publishApp");
|
|
|
|
|
cy.intercept("PUT", "/api/v1/layouts/*/pages/*").as("updateLayout");
|
2020-05-27 11:21:11 +00:00
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("POST", "/track/*").as("postTrack");
|
|
|
|
|
cy.intercept("PUT", "/api/v1/actions/executeOnLoad/*").as("setExecuteOnLoad");
|
2020-05-27 11:21:11 +00:00
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("POST", "/api/v1/actions").as("createNewApi");
|
2024-02-15 06:21:25 +00:00
|
|
|
cy.intercept("POST", "/api/v1/import?type=CURL&contextId=*&name=*").as(
|
2023-06-15 13:21:11 +00:00
|
|
|
"curlImport",
|
2021-11-02 06:34:43 +00:00
|
|
|
);
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("DELETE", "/api/v1/actions/*").as("deleteAction");
|
2020-05-27 11:21:11 +00:00
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("GET", "/api/v1/plugins/*/form").as("getPluginForm");
|
|
|
|
|
cy.intercept("DELETE", "/api/v1/applications/*").as("deleteApplication");
|
2025-03-17 06:32:29 +00:00
|
|
|
cy.intercept("POST", "/api/v1/applications", (req) => {
|
|
|
|
|
// we don't let creating application in anvil or ai agents test with create application button,
|
|
|
|
|
// but our tests are written to use the create application button, so we override the request body
|
|
|
|
|
// to create an application with anvil layout system and hide the navbar
|
|
|
|
|
if (
|
|
|
|
|
Cypress.currentTest.titlePath[0].includes(ANVIL_EDITOR_TEST) ||
|
|
|
|
|
Cypress.currentTest.titlePath[0].includes(AI_AGENTS_TEST)
|
|
|
|
|
) {
|
|
|
|
|
req.body.positioningType = "ANVIL";
|
|
|
|
|
req.body.showNavbar = false;
|
|
|
|
|
}
|
|
|
|
|
}).as("createNewApplication");
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/applications/*").as("updateApplication");
|
|
|
|
|
cy.intercept("PUT", "/api/v1/actions/*").as("saveAction");
|
|
|
|
|
cy.intercept("PUT", "/api/v1/actions/move").as("moveAction");
|
|
|
|
|
|
|
|
|
|
cy.intercept("POST", "/api/v1/workspaces").as("createWorkspace");
|
|
|
|
|
cy.intercept("POST", "api/v1/applications/import/*").as(
|
|
|
|
|
"importNewApplication",
|
|
|
|
|
);
|
|
|
|
|
cy.intercept("GET", "api/v1/applications/export/*").as("exportApplication");
|
|
|
|
|
cy.intercept("GET", "/api/v1/workspaces/*/permissionGroups").as("getRoles");
|
|
|
|
|
cy.intercept("GET", "/api/v1/users/me").as("getMe");
|
|
|
|
|
cy.intercept("POST", "/api/v1/pages").as("createPage");
|
|
|
|
|
cy.intercept("POST", "/api/v1/pages/clone/*").as("clonePage");
|
|
|
|
|
cy.intercept("POST", "/api/v1/applications/clone/*").as("cloneApp");
|
|
|
|
|
cy.intercept("PUT", "/api/v1/applications/*/changeAccess").as("changeAccess");
|
|
|
|
|
|
|
|
|
|
cy.intercept("PUT", "/api/v1/workspaces/*").as("updateWorkspace");
|
|
|
|
|
cy.intercept("GET", "/api/v1/pages/view/application/*").as("viewApp");
|
|
|
|
|
cy.intercept("GET", "/api/v1/pages/*/view?*").as("viewPage");
|
|
|
|
|
cy.intercept("POST", "/api/v1/workspaces/*/logo").as("updateLogo");
|
|
|
|
|
cy.intercept("DELETE", "/api/v1/workspaces/*/logo").as("deleteLogo");
|
|
|
|
|
cy.intercept("POST", "/api/v1/applications/*/fork/*").as(
|
|
|
|
|
"postForkAppWorkspace",
|
|
|
|
|
);
|
|
|
|
|
cy.intercept("PUT", "/api/v1/users/leaveWorkspace/*").as(
|
|
|
|
|
"leaveWorkspaceApiCall",
|
|
|
|
|
);
|
|
|
|
|
cy.intercept("DELETE", "api/v1/workspaces/*").as("deleteWorkspaceApiCall");
|
|
|
|
|
|
|
|
|
|
cy.intercept("POST", "/api/v1/comments/threads").as("createNewThread");
|
|
|
|
|
cy.intercept("POST", "/api/v1/comments?threadId=*").as("createNewComment");
|
|
|
|
|
|
|
|
|
|
cy.intercept("POST", "api/v1/git/commit/app/*").as("commit");
|
|
|
|
|
cy.intercept("POST", "/api/v1/git/import/*").as("importFromGit");
|
|
|
|
|
cy.intercept("POST", "/api/v1/git/merge/app/*").as("mergeBranch");
|
|
|
|
|
cy.intercept("POST", "/api/v1/git/merge/status/app/*").as("mergeStatus");
|
|
|
|
|
cy.intercept("PUT", "api/v1/collections/actions/refactor").as(
|
|
|
|
|
"renameJsAction",
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
cy.intercept("POST", "/api/v1/collections/actions").as(
|
|
|
|
|
"createNewJSCollection",
|
|
|
|
|
);
|
|
|
|
|
cy.intercept("POST", "/api/v1/pages/crud-page").as(
|
|
|
|
|
"replaceLayoutWithCRUDPage",
|
|
|
|
|
);
|
2021-12-02 05:20:44 +00:00
|
|
|
|
2023-01-11 11:54:33 +00:00
|
|
|
cy.intercept("PUT", "api/v1/collections/actions/*").as("jsCollections");
|
|
|
|
|
cy.intercept("DELETE", "/api/v1/collections/actions/*").as(
|
|
|
|
|
"deleteJSCollection",
|
|
|
|
|
);
|
2021-10-29 09:10:30 +00:00
|
|
|
cy.intercept("POST", "/api/v1/users/super").as("createSuperUser");
|
2021-12-02 05:20:44 +00:00
|
|
|
cy.intercept("POST", "/api/v1/actions/execute").as("postExecute");
|
2021-12-16 14:17:16 +00:00
|
|
|
cy.intercept("GET", "/api/v1/admin/env").as("getEnvVariables");
|
2022-07-07 07:05:03 +00:00
|
|
|
cy.intercept("DELETE", "/api/v1/git/branch/app/*").as("deleteBranch");
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("GET", "/api/v1/git/branch/app/*").as("getBranch");
|
2023-10-25 14:03:07 +00:00
|
|
|
cy.intercept("POST", "/api/v1/git/create-branch/app/*").as("createBranch");
|
2022-07-07 07:05:03 +00:00
|
|
|
cy.intercept("GET", "/api/v1/git/status/app/*").as("gitStatus");
|
2022-01-25 13:56:52 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/layouts/refactor").as("updateWidgetName");
|
2022-06-15 15:37:41 +00:00
|
|
|
cy.intercept("GET", "/api/v1/workspaces/*/members").as("getMembers");
|
2022-08-01 11:46:00 +00:00
|
|
|
cy.intercept("POST", "/api/v1/datasources/mocks").as("getMockDb");
|
2022-10-19 14:13:51 +00:00
|
|
|
cy.intercept("GET", "/api/v1/app-templates").as("fetchTemplate");
|
|
|
|
|
cy.intercept("POST", "/api/v1/app-templates/*").as("importTemplate");
|
2023-02-10 06:11:35 +00:00
|
|
|
cy.intercept("GET", /\/api\/v1\/app-templates\/(?!(filters)).*/).as(
|
|
|
|
|
"getTemplatePages",
|
|
|
|
|
);
|
2022-11-30 05:59:45 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/datasources/*").as("updateDatasource");
|
2023-01-25 05:39:02 +00:00
|
|
|
cy.intercept("POST", "/api/v1/applications/ssh-keypair/*").as("generateKey");
|
2023-10-25 14:03:07 +00:00
|
|
|
cy.intercept("GET", "/api/v1/applications/ssh-keypair/*").as("generatedKey");
|
2023-04-14 11:33:50 +00:00
|
|
|
cy.intercept("POST", "/api/v1/applications/snapshot/*").as("snapshotSuccess");
|
2024-01-25 13:41:48 +00:00
|
|
|
cy.intercept("GET", "/api/v1/applications/snapshot/*").as("pageSnap");
|
2023-01-25 05:39:02 +00:00
|
|
|
cy.intercept(
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
url: "/api/v1/git/connect/app/*",
|
|
|
|
|
hostname: window.location.host,
|
|
|
|
|
},
|
|
|
|
|
(req) => {
|
|
|
|
|
req.headers["origin"] = "Cypress";
|
|
|
|
|
},
|
|
|
|
|
).as("connectGitLocalRepo");
|
2023-02-06 07:37:01 +00:00
|
|
|
|
2023-03-24 16:06:48 +00:00
|
|
|
cy.intercept("POST", "https://api.segment.io/v1/b", (req) => {
|
2023-06-22 12:05:59 +00:00
|
|
|
req.reply({
|
|
|
|
|
statusCode: 200,
|
|
|
|
|
body: {
|
|
|
|
|
success: false, //since anything can be faked!
|
|
|
|
|
},
|
2023-03-24 16:06:48 +00:00
|
|
|
});
|
|
|
|
|
});
|
2023-03-28 10:15:44 +00:00
|
|
|
|
|
|
|
|
cy.intercept("PUT", "/api/v1/admin/env", (req) => {
|
|
|
|
|
req.headers["origin"] = "Cypress";
|
|
|
|
|
}).as("postEnv");
|
|
|
|
|
|
2023-03-24 16:06:48 +00:00
|
|
|
cy.intercept("GET", "/settings/general").as("getGeneral");
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("GET", "/api/v1/tenants/current").as("signUpLogin");
|
2023-06-16 13:31:00 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/tenants", (req) => {
|
|
|
|
|
req.headers["origin"] = "Cypress";
|
|
|
|
|
}).as("postTenant");
|
2023-06-22 12:05:59 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/git/discard/app/*").as("discardChanges");
|
2023-06-27 08:20:54 +00:00
|
|
|
cy.intercept("GET", "/api/v1/libraries/*").as("getLibraries");
|
2024-02-08 11:25:58 +00:00
|
|
|
|
2025-03-07 12:03:16 +00:00
|
|
|
if (
|
|
|
|
|
Cypress.currentTest.titlePath[0].includes(ANVIL_EDITOR_TEST) ||
|
|
|
|
|
Cypress.currentTest.titlePath[0].includes(AI_AGENTS_TEST)
|
|
|
|
|
) {
|
2024-01-31 05:32:38 +00:00
|
|
|
// intercept features call for creating pages that support Anvil + WDS tests
|
2024-04-12 17:24:04 +00:00
|
|
|
featureFlagIntercept({ release_anvil_enabled: true }, false);
|
2024-01-31 05:32:38 +00:00
|
|
|
} else {
|
|
|
|
|
featureFlagIntercept({}, false);
|
|
|
|
|
}
|
2024-02-08 11:25:58 +00:00
|
|
|
|
2023-08-10 07:06:03 +00:00
|
|
|
cy.intercept(
|
|
|
|
|
{
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: "/api/v1/product-alert/alert",
|
|
|
|
|
},
|
|
|
|
|
(req) => {
|
|
|
|
|
req.reply((res) => {
|
|
|
|
|
if (res) {
|
|
|
|
|
if (res.statusCode === 200) {
|
|
|
|
|
// Modify the response body to have empty data
|
|
|
|
|
res.send({
|
|
|
|
|
responseMeta: {
|
|
|
|
|
status: 200,
|
|
|
|
|
success: true,
|
|
|
|
|
},
|
|
|
|
|
data: {},
|
|
|
|
|
errorDisplay: "",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Do nothing or handle the case where the response object is not present
|
|
|
|
|
}
|
2023-08-04 11:12:47 +00:00
|
|
|
});
|
2023-08-10 07:06:03 +00:00
|
|
|
},
|
|
|
|
|
).as("productAlert");
|
2023-09-20 19:11:08 +00:00
|
|
|
cy.intercept(
|
|
|
|
|
{
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: /domain\/docs\.appsmith\.com\/token$/,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
statusCode: 200,
|
|
|
|
|
},
|
|
|
|
|
).as("docsCall");
|
2023-10-06 12:05:19 +00:00
|
|
|
cy.intercept("POST", "/api/v1/datasources/*/schema-preview").as(
|
|
|
|
|
"schemaPreview",
|
|
|
|
|
);
|
2024-01-25 13:41:48 +00:00
|
|
|
cy.intercept("GET", "/api/v1/pages/*/view?v=*").as("templatePreview");
|
2021-12-02 05:20:44 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("startErrorRoutes", () => {
|
|
|
|
|
cy.intercept("POST", "/api/v1/actions/execute", { statusCode: 500 }).as(
|
|
|
|
|
"postExecuteError",
|
|
|
|
|
);
|
2020-05-27 11:21:11 +00:00
|
|
|
});
|
|
|
|
|
|
2020-06-10 12:25:16 +00:00
|
|
|
Cypress.Commands.add("NavigateToPaginationTab", () => {
|
2023-05-19 18:37:06 +00:00
|
|
|
apiPage.SelectPaneTab("Pagination");
|
|
|
|
|
agHelper.GetNClick(ApiEditor.apiPaginationTab);
|
2020-06-10 12:25:16 +00:00
|
|
|
});
|
|
|
|
|
|
2023-08-24 08:40:24 +00:00
|
|
|
Cypress.Commands.add("ValidatePaginateResponseUrlData", (runTestCss) => {
|
2023-11-23 10:16:13 +00:00
|
|
|
EditorNavigation.SelectEntityByName("Api2", EntityType.Api);
|
2023-08-24 08:40:24 +00:00
|
|
|
cy.wait(3000);
|
|
|
|
|
cy.NavigateToPaginationTab();
|
|
|
|
|
cy.RunAPI();
|
|
|
|
|
cy.get(ApiEditor.apiPaginationNextTest).click();
|
|
|
|
|
cy.wait("@postExecute");
|
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
cy.get(runTestCss).click();
|
|
|
|
|
cy.wait(2000);
|
2025-01-15 10:33:07 +00:00
|
|
|
cy.xpath("//div[@class='tr'][1]//div[@class='td as-mask'][6]//span")
|
2023-08-24 08:40:24 +00:00
|
|
|
.invoke("text")
|
|
|
|
|
.then((valueToTest) => {
|
2023-03-15 11:03:14 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2023-03-17 14:20:51 +00:00
|
|
|
cy.get(ApiEditor.ApiRunBtn).should("not.be.disabled");
|
2023-11-23 10:16:13 +00:00
|
|
|
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);
|
2024-05-31 08:31:06 +00:00
|
|
|
table.SelectTableRow(0);
|
2023-03-15 11:03:14 +00:00
|
|
|
cy.readTabledata("0", "5").then((tabData) => {
|
|
|
|
|
const tableData = tabData;
|
2023-11-06 09:48:00 +00:00
|
|
|
expect(valueToTest).contains(tableData);
|
2023-03-15 11:03:14 +00:00
|
|
|
});
|
2020-06-10 12:25:16 +00:00
|
|
|
});
|
2023-08-24 08:40:24 +00:00
|
|
|
});
|
2020-06-10 12:25:16 +00:00
|
|
|
|
2023-08-24 08:40:24 +00:00
|
|
|
Cypress.Commands.add("ValidatePaginateResponseUrlDataV2", (runTestCss) => {
|
2023-11-23 10:16:13 +00:00
|
|
|
EditorNavigation.SelectEntityByName("Api2", EntityType.Api);
|
2023-08-24 08:40:24 +00:00
|
|
|
cy.wait(3000);
|
|
|
|
|
cy.NavigateToPaginationTab();
|
|
|
|
|
cy.RunAPI();
|
|
|
|
|
cy.get(ApiEditor.apiPaginationNextTest).click();
|
|
|
|
|
cy.wait("@postExecute");
|
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
cy.get(runTestCss).click();
|
|
|
|
|
cy.wait(2000);
|
2025-01-15 10:33:07 +00:00
|
|
|
cy.xpath("//div[@class='tr'][1]//div[@class='td as-mask'][6]//span")
|
2023-08-24 08:40:24 +00:00
|
|
|
.invoke("text")
|
|
|
|
|
.then((valueToTest) => {
|
2023-03-15 11:03:14 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
|
cy.get(ApiEditor.ApiRunBtn).should("not.be.disabled");
|
2023-11-23 10:16:13 +00:00
|
|
|
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);
|
2023-08-24 08:40:24 +00:00
|
|
|
cy.wait(2000);
|
2024-05-31 08:31:06 +00:00
|
|
|
table.SelectTableRow(0, 0, true, "v2");
|
2023-03-15 11:03:14 +00:00
|
|
|
cy.readTableV2data("0", "5").then((tabData) => {
|
|
|
|
|
const tableData = tabData;
|
2023-08-24 08:40:24 +00:00
|
|
|
cy.log(valueToTest);
|
2023-11-03 06:57:24 +00:00
|
|
|
expect(valueToTest).contains(tableData);
|
2023-03-15 11:03:14 +00:00
|
|
|
});
|
2022-07-14 07:02:35 +00:00
|
|
|
});
|
2023-08-24 08:40:24 +00:00
|
|
|
});
|
2022-07-14 07:02:35 +00:00
|
|
|
|
2023-01-09 10:34:25 +00:00
|
|
|
Cypress.Commands.add("CheckForPageSaveError", () => {
|
2023-01-18 09:24:15 +00:00
|
|
|
// Wait for "saving" status to disappear
|
2023-02-14 07:00:40 +00:00
|
|
|
cy.get(commonlocators.statusSaving, {
|
2023-02-23 17:59:05 +00:00
|
|
|
timeout: 30000,
|
2023-02-14 07:00:40 +00:00
|
|
|
}).should("not.exist");
|
2023-01-18 09:24:15 +00:00
|
|
|
// Check for page save error
|
2023-01-09 10:34:25 +00:00
|
|
|
cy.get("body").then(($ele) => {
|
|
|
|
|
if ($ele.find(commonlocators.saveStatusError).length) {
|
2023-01-10 04:53:08 +00:00
|
|
|
cy.reload();
|
2023-01-09 10:34:25 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2021-07-08 07:04:47 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"validateCodeEditorContent",
|
|
|
|
|
(selector, contentToValidate) => {
|
|
|
|
|
cy.get(selector).within(() => {
|
|
|
|
|
cy.get(".CodeMirror-code").should("have.text", contentToValidate);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
2021-07-29 08:13:10 +00:00
|
|
|
|
2021-11-18 14:27:51 +00:00
|
|
|
Cypress.Commands.add("createSuperUser", () => {
|
2021-11-26 10:47:53 +00:00
|
|
|
cy.wait(1000);
|
2023-05-25 18:21:56 +00:00
|
|
|
cy.get(welcomePage.firstName).should("be.visible");
|
|
|
|
|
cy.get(welcomePage.lastName).should("be.visible");
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.get(welcomePage.email).should("be.visible");
|
|
|
|
|
cy.get(welcomePage.password).should("be.visible");
|
|
|
|
|
cy.get(welcomePage.verifyPassword).should("be.visible");
|
2023-05-31 09:13:25 +00:00
|
|
|
cy.get(welcomePage.continueButton).should("be.disabled");
|
2021-11-18 14:27:51 +00:00
|
|
|
|
2023-05-25 18:21:56 +00:00
|
|
|
cy.get(welcomePage.firstName).type(Cypress.env("USERNAME"));
|
2023-05-31 09:13:25 +00:00
|
|
|
cy.get(welcomePage.continueButton).should("be.disabled");
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.get(welcomePage.email).type(Cypress.env("USERNAME"));
|
2023-05-31 09:13:25 +00:00
|
|
|
cy.get(welcomePage.continueButton).should("be.disabled");
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.get(welcomePage.password).type(Cypress.env("PASSWORD"));
|
2023-05-31 09:13:25 +00:00
|
|
|
cy.get(welcomePage.continueButton).should("be.disabled");
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.get(welcomePage.verifyPassword).type(Cypress.env("PASSWORD"));
|
2023-05-31 09:13:25 +00:00
|
|
|
cy.get(welcomePage.continueButton).should("not.be.disabled");
|
|
|
|
|
cy.get(welcomePage.continueButton).click();
|
2023-05-25 18:21:56 +00:00
|
|
|
|
2023-12-25 12:24:46 +00:00
|
|
|
cy.get(welcomePage.proficiencyGroupButton).eq(0).click();
|
2023-05-25 18:21:56 +00:00
|
|
|
cy.get(welcomePage.submitButton).should("be.disabled");
|
2023-12-25 12:24:46 +00:00
|
|
|
cy.get(welcomePage.useCaseGroupButton).eq(0).click();
|
2023-05-25 18:21:56 +00:00
|
|
|
cy.get(welcomePage.submitButton).should("not.be.disabled");
|
2023-12-25 12:24:46 +00:00
|
|
|
|
2023-05-25 18:21:56 +00:00
|
|
|
cy.get(welcomePage.submitButton).click();
|
2023-05-26 17:26:52 +00:00
|
|
|
//in case of airgapped both anonymous data and newsletter are disabled
|
2023-05-31 09:13:25 +00:00
|
|
|
if (Cypress.env("AIRGAPPED")) {
|
2023-05-26 17:26:52 +00:00
|
|
|
cy.wait("@createSuperUser").then((interception) => {
|
2023-05-31 09:13:25 +00:00
|
|
|
expect(interception.request.body).to.not.contain(
|
2023-05-26 17:26:52 +00:00
|
|
|
"allowCollectingAnonymousData=true",
|
|
|
|
|
);
|
2023-05-31 09:13:25 +00:00
|
|
|
expect(interception.request.body).to.not.contain(
|
|
|
|
|
"signupForNewsletter=true",
|
|
|
|
|
);
|
2023-05-26 17:26:52 +00:00
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
cy.wait("@createSuperUser").then((interception) => {
|
2023-05-31 09:13:25 +00:00
|
|
|
expect(interception.request.body).contains(
|
2023-05-26 17:26:52 +00:00
|
|
|
"allowCollectingAnonymousData=true",
|
|
|
|
|
);
|
2023-05-31 09:13:25 +00:00
|
|
|
expect(interception.request.body).contains("signupForNewsletter=true");
|
2023-05-26 17:26:52 +00:00
|
|
|
});
|
|
|
|
|
}
|
2023-10-25 14:03:07 +00:00
|
|
|
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
|
|
|
|
|
if (CURRENT_REPO === REPO.CE) {
|
2024-04-03 05:31:05 +00:00
|
|
|
assertHelper.AssertNetworkStatus("@getApplicationsOfWorkspace");
|
2024-03-15 05:43:14 +00:00
|
|
|
agHelper.WaitUntilEleAppear(onboarding.locators.skipStartFromData);
|
|
|
|
|
agHelper.GetNClick(onboarding.locators.skipStartFromData);
|
2023-10-25 14:03:07 +00:00
|
|
|
cy.get("#loading").should("not.exist");
|
2024-01-12 14:43:58 +00:00
|
|
|
AppSidebar.assertVisible();
|
2023-10-25 14:03:07 +00:00
|
|
|
}
|
2023-04-04 15:56:57 +00:00
|
|
|
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.LogOut();
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("SignupFromAPI", (uname, pword) => {
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "POST",
|
|
|
|
|
url: "api/v1/users",
|
2025-03-08 15:31:02 +00:00
|
|
|
headers: {
|
|
|
|
|
"X-Requested-By": "Appsmith",
|
|
|
|
|
},
|
2021-11-18 14:27:51 +00:00
|
|
|
followRedirect: false,
|
|
|
|
|
form: true,
|
|
|
|
|
body: {
|
|
|
|
|
name: uname,
|
|
|
|
|
email: uname,
|
|
|
|
|
password: pword,
|
|
|
|
|
},
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
expect(response.status).equal(302);
|
|
|
|
|
cy.log(response.body);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2021-10-29 07:02:45 +00:00
|
|
|
Cypress.Commands.add("startInterceptRoutesForS3", () => {
|
|
|
|
|
cy.intercept("POST", "/api/v1/datasources/test").as("testDatasource");
|
|
|
|
|
cy.intercept("PUT", "/api/v1/datasources/datasource-query/*").as(
|
|
|
|
|
"put_datasources",
|
|
|
|
|
);
|
2022-01-13 06:03:50 +00:00
|
|
|
cy.intercept("GET", "/api/v1/datasources/*/structure?ignoreCache=*").as(
|
|
|
|
|
"getDatasourceStructure",
|
|
|
|
|
);
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/pages/crud-page/*").as("put_replaceLayoutCRUD");
|
|
|
|
|
cy.intercept("POST", "/api/v1/pages/crud-page").as("post_replaceLayoutCRUD");
|
|
|
|
|
cy.intercept("GET", "/api/v1/actions*").as("get_Actions");
|
|
|
|
|
cy.intercept("POST", "/api/v1/actions/execute").as("post_Execute");
|
|
|
|
|
});
|
|
|
|
|
|
feat: Simplified Google Sheets queries (#14869)
* Client changes 1
* add DSL functionality
* Temp commit for refactoring changes
* Do I even know what I'm doing here?
* chore: Second GS layout
* Update: Visibility conditional outputs for schemas
- Added the output from conditional outputs for schema children too
* Update: Entity selector visibility control
- Added logic for controlling visibility of sub components via the JS expressions system
* Update: Passing disabled prop to toggle button
* Update: Passing disabled prop to toggle btn
* Update: Styled component for toggle button
- Added disabled styles based on the disabled prop sent to the toggle form view JSON button
* Update: configProperty role in Entity Selector
- Removed dependance of the configProperty of the entity selector children to it's parent component
* Update: type of placeholder key
- Made placeholder key from form config JSON to accept either string or an object
- Earlier only string was accepted
- This is for pagination component
* Update: Added placeholder control for pagination
* Client changes 1
* add DSL functionality
* Do I even know what I'm doing here?
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design
* fix: updated tooltip component for wrong ui on entity explore
* temp triggers
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design (#12395)
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design
* fix: updated tooltip component for wrong ui on entity explore
* fix: updated tooltip ui, where condition placement, sort by ui
* temp form data access logic
* fix: updated sorting type width ui
* fix: updated ui for spacing, width and text issues
* Update: Type for tooltip of UQI forms
- Added option to send an object to the tooltipText object.
- This allows for composite components like pagination to have tooltips for each sub component
* Update: tooltip for pagination component
- Added handling to parse the tooltip for multiple components.
- This allows for composite components like pagination to have tooltips for each sub component
* Update: Type cast for tooltip component
- Made the content passed to tooltip component as a string only
* Update: Fixed tooltip component CSS
* Update: Dropdown option component
- Added a tooltip wrapper to each option
- This is to show on hover text like disabled state
* fix: updated ẇhere clause broken ui for condition
* Add: functions to check and extract expressions
- Loop through the formConfig and find any keys that have a value that is bindable
- Used pre defined regex to check if value is a moustache binding
* Add: Types for evaluated form configs
- Added types for the form configs to be evaluated and their output post eval
* Add: Flow to run the form config
- Run the form config and update the result to the redux state
* Update: Name of the type for formconfigs
- Updated since it was clashing with a component of the same name
* Add: Function to enforce config type checks
- This is done so that the improper configs can be weeded out and the rest of the form can be shown
* Add: Function to update evaluated config
- Added option to update the config if it's values needed evaluation
* Add: Type check for schema sections
* Update: Error handling for invalid control type
- We were throwing an exception till now, changed it to a warning text
* Add: Exposed tooltip for dropdown option disabled state
* Update: switch to json mode functionality
- Added logic to convert data to a string rather than an object when the first switch to JSON mode happens
* Update: Added key to tooltip for dropdown options
* Trigger API modification
* Add: function to fetch default trigger URL
* Update: Made URL optional in dynamic trigger config
* Update: Dynamic trigger API call
- Made the API call for dynamic triggers have URL as optional field
- Added type check to the response of the API call
* Update: resp type for trigger APIs
* Update: Moved code to utils folder
- Moved functions for UQI form eval processing to utils file
* Update: passing original controltype to JS switch
* Update: config for JSON editor mode
- Updated the config to have different options for JSON mode depending on the original control type
* Update: Connected line numbers flag to config
* Revert: CSS changes for tooltip
* Refactor: Removed consle
* Add: type for the config of dynamic values
* Add: Feature to evaluate config for triggers
* Refactor: fix type check errors
* fix: dropdown ui width with text alignment
* Update: fixed selector for dynamic values
* Update: selector call for fetchDynamicValues
* Add table header index prop for columns selector
* migration partial commit
* migration partial commit
* Refactor: removed unused import
* Update: reused function for checking dynamic value
* Update: removed unused import
* Fix format JSON issues
* Retrieve binding paths from entity selector components
* Fixes 6 remaining issues with UQI implementation
* Fix dropdown issues
* Fix dropdown height issues and fixes triggering of APIs when option is deselected
* Migration changes
* Fix QA generated UQI issues
* Fix projection component height and route change logic
* Fix multi select dropdown placeholder text issue and json stringify issue with switching view types
* Reset entity type value when command value changes
* Test changes
* Review comments
* Moved migrations around
* Corrected import statement
* Added JSON schema migration
* Updated schema version
* perf improvements and filter dropdown options feature
* Fix Code mirror component config for toggleComponentToJson input fields.
* Fix prettier issues
* fix prettier issues
* Fix style issues as a result of the merged conflicts
* Fix failing test case
* Fixed a few other flows (#14225)
* Fixed a few other flows
* Review comments
* Fix generate CRUD, fix evaluation of dynamic bindings and fix various styling issues.
* More fixes (#14367)
* Factor in the root formconfig parent key.
* Fix flickering issues, and evaluatedFormConfig issues
* fix: Teeny bugs (#14455)
* Teeny bugs
* Added previous functionality as is
* Improvements in the way we fetch dynamic values
* Fix stringiification issue and cyclic dependency issues
* Resolve projection component values deletion
* Resolve merge conflicts and fix prettier issues
* fix: Tsc issues
* Fix property pane connection navigation
* updating ee locator
* updating inputfield locator
* dropdown locator update
* Merge conflict not properly resolved.
* Fix s3 spec
* Fix Mongo Spec
* Fix some more tests
* fix: prevent cyclic dependency when switching to js mode (#14668)
* add delete events for change from array to string in diff
* add test to assert absence of cyclic dependency error when switching to js in switchgroup widget
* Assert that evaluation is not disabled when no cyclic dependency happens
* Cypress test preparations for google sheets and form controls
* Fixed a few test errors (#14874)
* Add: unit tests for uqi UI updates
- view type tests
- conditional output extraction
- processing conditional output to handle view/enabled state of the component
* Add: completed isValidFormConfig test
* Update: improved tests for update config
- These tests cover the functionality to update a section config after it's components are done evaluating
* Fix failing cypress tests and cyclic dependency issue
* Fixes some more tests
* Fixed migration of row objects (#14896)
* Bumped the version of design system package
* Update: reverted change to EE selector
* Fix deletion pointer
* Update: selector for js on load spec
- Synced with changes related to ADS dropdown
* Fix mongoDBShoppingCart spec
* Remove comments
* Fix: mongo shopping cart test failures
* fix: mongo shopping cart spec
* Dummy push to retrigger vercel
* fix: mongo shopping cart spec
* Update MongoDBShoppingCart_spec.js
* fix: removed unused click away
* dummy commit
* Update: moved helper functions to separate file
* Add: added tests for saga functions
- Worked on testing for
- extractFetchDynamicValueFormConfigs
- extractQueueOfValuesToBeFetched
* Add if check for queueOfValuesToBeFetched
* Resolve review comments
* Empty-Commit
Co-authored-by: Irongade <adeoluayangade@yahoo.com>
Co-authored-by: Ayush Pahwa <ayush@appsmith.com>
Co-authored-by: Aman Agarwal <aman@appsmith.com>
Co-authored-by: Ayangade Adeoluwa <37867493+Irongade@users.noreply.github.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
Co-authored-by: Albin <albin@appsmith.com>
2022-07-04 05:43:27 +00:00
|
|
|
// the way we target form controls from now on has to change
|
|
|
|
|
// we would be getting the form controls by their class names and not their xpaths.
|
|
|
|
|
// the xpath method is flaky and highly subjected to change.
|
2023-02-09 11:09:54 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"typeValueNValidate",
|
|
|
|
|
(valueToType, fieldName = "", isDynamic = false) => {
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
if (fieldName) {
|
|
|
|
|
cy.get(fieldName).then(($field) => {
|
|
|
|
|
cy.updateCodeInput($field, valueToType);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
cy.xpath("//div[@class='CodeEditorTarget']").then(($field) => {
|
|
|
|
|
cy.updateCodeInput($field, valueToType);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
cy.EvaluateCurrentValue(valueToType, isDynamic);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2022-08-01 11:46:00 +00:00
|
|
|
Cypress.Commands.add("clickButton", (btnVisibleText, toForceClick = true) => {
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.xpath("//span[text()='" + btnVisibleText + "']/ancestor::button")
|
2022-01-29 07:26:19 +00:00
|
|
|
.first()
|
2021-12-29 05:41:30 +00:00
|
|
|
.scrollIntoView()
|
2022-08-01 11:46:00 +00:00
|
|
|
.click({ force: toForceClick });
|
2021-11-26 10:47:53 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"EvaluatFieldValue",
|
|
|
|
|
(fieldName = "", currentValue = "") => {
|
2023-02-09 11:09:54 +00:00
|
|
|
let val = "";
|
2021-11-26 10:47:53 +00:00
|
|
|
if (fieldName) {
|
feat: Simplified Google Sheets queries (#14869)
* Client changes 1
* add DSL functionality
* Temp commit for refactoring changes
* Do I even know what I'm doing here?
* chore: Second GS layout
* Update: Visibility conditional outputs for schemas
- Added the output from conditional outputs for schema children too
* Update: Entity selector visibility control
- Added logic for controlling visibility of sub components via the JS expressions system
* Update: Passing disabled prop to toggle button
* Update: Passing disabled prop to toggle btn
* Update: Styled component for toggle button
- Added disabled styles based on the disabled prop sent to the toggle form view JSON button
* Update: configProperty role in Entity Selector
- Removed dependance of the configProperty of the entity selector children to it's parent component
* Update: type of placeholder key
- Made placeholder key from form config JSON to accept either string or an object
- Earlier only string was accepted
- This is for pagination component
* Update: Added placeholder control for pagination
* Client changes 1
* add DSL functionality
* Do I even know what I'm doing here?
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design
* fix: updated tooltip component for wrong ui on entity explore
* temp triggers
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design (#12395)
* fix: updated uqi forms ui, clubbed JS switch button to ads, updated tooltip design
* fix: updated tooltip component for wrong ui on entity explore
* fix: updated tooltip ui, where condition placement, sort by ui
* temp form data access logic
* fix: updated sorting type width ui
* fix: updated ui for spacing, width and text issues
* Update: Type for tooltip of UQI forms
- Added option to send an object to the tooltipText object.
- This allows for composite components like pagination to have tooltips for each sub component
* Update: tooltip for pagination component
- Added handling to parse the tooltip for multiple components.
- This allows for composite components like pagination to have tooltips for each sub component
* Update: Type cast for tooltip component
- Made the content passed to tooltip component as a string only
* Update: Fixed tooltip component CSS
* Update: Dropdown option component
- Added a tooltip wrapper to each option
- This is to show on hover text like disabled state
* fix: updated ẇhere clause broken ui for condition
* Add: functions to check and extract expressions
- Loop through the formConfig and find any keys that have a value that is bindable
- Used pre defined regex to check if value is a moustache binding
* Add: Types for evaluated form configs
- Added types for the form configs to be evaluated and their output post eval
* Add: Flow to run the form config
- Run the form config and update the result to the redux state
* Update: Name of the type for formconfigs
- Updated since it was clashing with a component of the same name
* Add: Function to enforce config type checks
- This is done so that the improper configs can be weeded out and the rest of the form can be shown
* Add: Function to update evaluated config
- Added option to update the config if it's values needed evaluation
* Add: Type check for schema sections
* Update: Error handling for invalid control type
- We were throwing an exception till now, changed it to a warning text
* Add: Exposed tooltip for dropdown option disabled state
* Update: switch to json mode functionality
- Added logic to convert data to a string rather than an object when the first switch to JSON mode happens
* Update: Added key to tooltip for dropdown options
* Trigger API modification
* Add: function to fetch default trigger URL
* Update: Made URL optional in dynamic trigger config
* Update: Dynamic trigger API call
- Made the API call for dynamic triggers have URL as optional field
- Added type check to the response of the API call
* Update: resp type for trigger APIs
* Update: Moved code to utils folder
- Moved functions for UQI form eval processing to utils file
* Update: passing original controltype to JS switch
* Update: config for JSON editor mode
- Updated the config to have different options for JSON mode depending on the original control type
* Update: Connected line numbers flag to config
* Revert: CSS changes for tooltip
* Refactor: Removed consle
* Add: type for the config of dynamic values
* Add: Feature to evaluate config for triggers
* Refactor: fix type check errors
* fix: dropdown ui width with text alignment
* Update: fixed selector for dynamic values
* Update: selector call for fetchDynamicValues
* Add table header index prop for columns selector
* migration partial commit
* migration partial commit
* Refactor: removed unused import
* Update: reused function for checking dynamic value
* Update: removed unused import
* Fix format JSON issues
* Retrieve binding paths from entity selector components
* Fixes 6 remaining issues with UQI implementation
* Fix dropdown issues
* Fix dropdown height issues and fixes triggering of APIs when option is deselected
* Migration changes
* Fix QA generated UQI issues
* Fix projection component height and route change logic
* Fix multi select dropdown placeholder text issue and json stringify issue with switching view types
* Reset entity type value when command value changes
* Test changes
* Review comments
* Moved migrations around
* Corrected import statement
* Added JSON schema migration
* Updated schema version
* perf improvements and filter dropdown options feature
* Fix Code mirror component config for toggleComponentToJson input fields.
* Fix prettier issues
* fix prettier issues
* Fix style issues as a result of the merged conflicts
* Fix failing test case
* Fixed a few other flows (#14225)
* Fixed a few other flows
* Review comments
* Fix generate CRUD, fix evaluation of dynamic bindings and fix various styling issues.
* More fixes (#14367)
* Factor in the root formconfig parent key.
* Fix flickering issues, and evaluatedFormConfig issues
* fix: Teeny bugs (#14455)
* Teeny bugs
* Added previous functionality as is
* Improvements in the way we fetch dynamic values
* Fix stringiification issue and cyclic dependency issues
* Resolve projection component values deletion
* Resolve merge conflicts and fix prettier issues
* fix: Tsc issues
* Fix property pane connection navigation
* updating ee locator
* updating inputfield locator
* dropdown locator update
* Merge conflict not properly resolved.
* Fix s3 spec
* Fix Mongo Spec
* Fix some more tests
* fix: prevent cyclic dependency when switching to js mode (#14668)
* add delete events for change from array to string in diff
* add test to assert absence of cyclic dependency error when switching to js in switchgroup widget
* Assert that evaluation is not disabled when no cyclic dependency happens
* Cypress test preparations for google sheets and form controls
* Fixed a few test errors (#14874)
* Add: unit tests for uqi UI updates
- view type tests
- conditional output extraction
- processing conditional output to handle view/enabled state of the component
* Add: completed isValidFormConfig test
* Update: improved tests for update config
- These tests cover the functionality to update a section config after it's components are done evaluating
* Fix failing cypress tests and cyclic dependency issue
* Fixes some more tests
* Fixed migration of row objects (#14896)
* Bumped the version of design system package
* Update: reverted change to EE selector
* Fix deletion pointer
* Update: selector for js on load spec
- Synced with changes related to ADS dropdown
* Fix mongoDBShoppingCart spec
* Remove comments
* Fix: mongo shopping cart test failures
* fix: mongo shopping cart spec
* Dummy push to retrigger vercel
* fix: mongo shopping cart spec
* Update MongoDBShoppingCart_spec.js
* fix: removed unused click away
* dummy commit
* Update: moved helper functions to separate file
* Add: added tests for saga functions
- Worked on testing for
- extractFetchDynamicValueFormConfigs
- extractQueueOfValuesToBeFetched
* Add if check for queueOfValuesToBeFetched
* Resolve review comments
* Empty-Commit
Co-authored-by: Irongade <adeoluayangade@yahoo.com>
Co-authored-by: Ayush Pahwa <ayush@appsmith.com>
Co-authored-by: Aman Agarwal <aman@appsmith.com>
Co-authored-by: Ayangade Adeoluwa <37867493+Irongade@users.noreply.github.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
Co-authored-by: Favour Ohanekwu <fohanekwu@gmail.com>
Co-authored-by: Albin <albin@appsmith.com>
2022-07-04 05:43:27 +00:00
|
|
|
cy.get(fieldName).click();
|
2023-02-09 11:09:54 +00:00
|
|
|
val = cy.get(fieldName).then(($field) => {
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.wrap($field).find(".CodeMirror-code span").first().invoke("text");
|
2023-02-09 11:09:54 +00:00
|
|
|
});
|
2021-11-26 10:47:53 +00:00
|
|
|
} else {
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.xpath("//div[@class='CodeMirror-code']").first().click();
|
2023-02-09 11:09:54 +00:00
|
|
|
val = cy
|
|
|
|
|
.xpath(
|
|
|
|
|
"//div[@class='CodeMirror-code']//span[contains(@class,'cm-m-javascript')]",
|
|
|
|
|
)
|
|
|
|
|
.then(($field) => {
|
|
|
|
|
cy.wrap($field).invoke("text");
|
|
|
|
|
});
|
2021-11-26 10:47:53 +00:00
|
|
|
}
|
2023-02-09 11:09:54 +00:00
|
|
|
if (currentValue) expect(val).to.eq(currentValue);
|
|
|
|
|
|
2021-11-26 10:47:53 +00:00
|
|
|
return val;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2022-03-19 15:56:53 +00:00
|
|
|
// Cypress >=8.3.x onwards
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.all = function (...commands) {
|
2021-11-26 10:47:53 +00:00
|
|
|
const _ = Cypress._;
|
2022-03-19 15:56:53 +00:00
|
|
|
// eslint-disable-next-line
|
2021-11-26 10:47:53 +00:00
|
|
|
const chain = cy.wrap(null, { log: false });
|
2022-03-19 15:56:53 +00:00
|
|
|
const stopCommand = _.find(cy.queue.get(), {
|
2021-11-26 10:47:53 +00:00
|
|
|
attributes: { chainerId: chain.chainerId },
|
|
|
|
|
});
|
2022-03-19 15:56:53 +00:00
|
|
|
const startCommand = _.find(cy.queue.get(), {
|
2021-11-26 10:47:53 +00:00
|
|
|
attributes: { chainerId: commands[0].chainerId },
|
|
|
|
|
});
|
|
|
|
|
const p = chain.then(() => {
|
|
|
|
|
return _(commands)
|
|
|
|
|
.map((cmd) => {
|
|
|
|
|
return cmd[chainStart]
|
|
|
|
|
? cmd[chainStart].attributes
|
2022-03-19 15:56:53 +00:00
|
|
|
: _.find(cy.queue.get(), {
|
2021-12-03 06:24:08 +00:00
|
|
|
attributes: { chainerId: cmd.chainerId },
|
|
|
|
|
}).attributes;
|
2021-11-26 10:47:53 +00:00
|
|
|
})
|
|
|
|
|
.concat(stopCommand.attributes)
|
|
|
|
|
.slice(1)
|
|
|
|
|
.flatMap((cmd) => {
|
|
|
|
|
return cmd.prev.get("subject");
|
|
|
|
|
})
|
|
|
|
|
.value();
|
|
|
|
|
});
|
|
|
|
|
p[chainStart] = startCommand;
|
|
|
|
|
return p;
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-10 07:23:12 +00:00
|
|
|
Cypress.Commands.add("getEntityName", () => {
|
2024-12-03 03:51:43 +00:00
|
|
|
let entityName = agHelper.GetObjectName();
|
2021-12-10 07:23:12 +00:00
|
|
|
return entityName;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("VerifyErrorMsgAbsence", (errorMsgToVerifyAbsence) => {
|
2021-12-13 05:44:01 +00:00
|
|
|
cy.xpath(
|
|
|
|
|
"//div[@class='Toastify']//span[contains(text(),'" +
|
|
|
|
|
errorMsgToVerifyAbsence +
|
|
|
|
|
"')]",
|
|
|
|
|
{ timeout: 0 },
|
|
|
|
|
).should("not.exist");
|
2021-12-10 07:23:12 +00:00
|
|
|
});
|
|
|
|
|
|
2022-08-12 07:19:17 +00:00
|
|
|
Cypress.Commands.add("VerifyErrorMsgPresence", (errorMsgToVerifyAbsence) => {
|
|
|
|
|
cy.xpath(
|
|
|
|
|
"//div[@class='Toastify']//span[contains(text(),'" +
|
|
|
|
|
errorMsgToVerifyAbsence +
|
|
|
|
|
"')]",
|
|
|
|
|
{ timeout: 0 },
|
|
|
|
|
).should("exist");
|
|
|
|
|
});
|
|
|
|
|
|
2021-12-10 07:23:12 +00:00
|
|
|
Cypress.Commands.add("setQueryTimeout", (timeout) => {
|
2024-12-03 03:51:43 +00:00
|
|
|
pluginActionForm.toolbar.toggleSettings();
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.xpath(queryLocators.queryTimeout).clear().type(timeout);
|
2024-12-03 03:51:43 +00:00
|
|
|
pluginActionForm.toolbar.toggleSettings();
|
2021-12-02 05:20:44 +00:00
|
|
|
});
|
|
|
|
|
|
2021-12-21 09:37:30 +00:00
|
|
|
Cypress.Commands.add("isInViewport", (element) => {
|
2022-11-15 06:20:18 +00:00
|
|
|
cy.xpath(element)
|
|
|
|
|
.scrollIntoView()
|
|
|
|
|
.then(($el) => {
|
|
|
|
|
const bottom = Cypress.$(cy.state("window")).height();
|
|
|
|
|
const rect = $el[0].getBoundingClientRect();
|
|
|
|
|
|
|
|
|
|
expect(rect.top).not.to.be.greaterThan(bottom);
|
|
|
|
|
expect(rect.bottom).not.to.be.greaterThan(bottom);
|
|
|
|
|
expect(rect.top).not.to.be.greaterThan(bottom);
|
|
|
|
|
expect(rect.bottom).not.to.be.greaterThan(bottom);
|
|
|
|
|
});
|
2021-12-21 09:37:30 +00:00
|
|
|
});
|
|
|
|
|
|
2022-02-10 11:36:18 +00:00
|
|
|
Cypress.Commands.add("validateEvaluatedValue", (value) => {
|
|
|
|
|
cy.get(".t-property-evaluated-value").should("contain", value);
|
|
|
|
|
});
|
|
|
|
|
|
2022-03-11 15:47:42 +00:00
|
|
|
Cypress.Commands.add("DeleteEntityStateLocalStorage", () => {
|
|
|
|
|
let currentURL;
|
|
|
|
|
let appId;
|
|
|
|
|
cy.url().then((url) => {
|
|
|
|
|
currentURL = url;
|
|
|
|
|
const myRegexp = /applications(.*)/;
|
|
|
|
|
const match = myRegexp.exec(currentURL);
|
|
|
|
|
appId = match ? match[1].split("/")[1] : null;
|
|
|
|
|
|
|
|
|
|
if (appId !== null) {
|
|
|
|
|
window.localStorage.removeItem(`explorerState_${appId}`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2022-04-12 10:01:22 +00:00
|
|
|
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
Cypress.Commands.add("checkLabelForWidget", (options) => {
|
|
|
|
|
// Variables
|
|
|
|
|
const widgetName = options.widgetName;
|
|
|
|
|
const labelText = options.labelText;
|
|
|
|
|
const parentColumnSpace = options.parentColumnSpace;
|
|
|
|
|
const isCompact = options.isCompact;
|
|
|
|
|
const widgetSelector = `.t--widget-${widgetName}`;
|
|
|
|
|
const labelSelector = `${widgetSelector} label`;
|
2022-08-18 06:26:07 +00:00
|
|
|
const labelContainer = `${widgetSelector} .label-container`;
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
const containerSelector = `${widgetSelector} ${options.containerSelector}`;
|
|
|
|
|
const labelPositionSelector = ".t--property-control-position";
|
|
|
|
|
const labelAlignmentRightSelector =
|
2023-05-19 18:37:06 +00:00
|
|
|
".t--property-control-alignment .ads-v2-segmented-control__segments-container-segment[data-value='right']";
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
const labelWidth = options.labelWidth;
|
|
|
|
|
|
|
|
|
|
// Drag a widget
|
|
|
|
|
cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 });
|
|
|
|
|
cy.get(`.t--widget-${widgetName}`).should("exist");
|
|
|
|
|
|
|
|
|
|
// Set the label text
|
|
|
|
|
cy.updateCodeInput(".t--property-control-text", labelText);
|
|
|
|
|
// Assert label presence
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(labelSelector).first().contains(labelText);
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
|
|
|
|
|
// Set the label position: Auto
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(".ads-v2-segmented-control-value-Auto").click({ force: true });
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
// Assert label position: Auto
|
2022-10-28 10:06:15 +00:00
|
|
|
cy.get(containerSelector).should("have.css", "flex-direction", "column");
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
|
|
|
|
|
// Change the label position to Top
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(".ads-v2-segmented-control-value-Top").click({ force: true });
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
// Assert label position: Top
|
|
|
|
|
cy.get(containerSelector).should("have.css", "flex-direction", "column");
|
|
|
|
|
|
|
|
|
|
// Change the label position to Left
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(".ads-v2-segmented-control-value-Left").click({ force: true });
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
// Assert label position: Left
|
|
|
|
|
cy.get(containerSelector).should("have.css", "flex-direction", "row");
|
|
|
|
|
|
|
|
|
|
// Set the label alignment to RIGHT
|
|
|
|
|
cy.get(labelAlignmentRightSelector).click();
|
|
|
|
|
// Assert label alignment
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(labelSelector).first().should("have.css", "text-align", "right");
|
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
|
|
|
|
|
|
|
|
// Clean up the widget
|
|
|
|
|
cy.deleteWidget(widgetSelector);
|
|
|
|
|
});
|
2022-04-12 10:01:22 +00:00
|
|
|
let LOCAL_STORAGE_MEMORY = {};
|
|
|
|
|
|
2023-02-07 10:15:23 +00:00
|
|
|
Cypress.Commands.add("StopContainer", (path, containerName) => {
|
2022-08-28 06:28:01 +00:00
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: path,
|
|
|
|
|
qs: {
|
|
|
|
|
cmd: "docker stop " + containerName,
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
2023-02-07 10:15:23 +00:00
|
|
|
cy.log(res.body.stdout, res.body.stderr);
|
2022-08-28 06:28:01 +00:00
|
|
|
expect(res.status).equal(200);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add(
|
2023-02-14 11:35:59 +00:00
|
|
|
"StartNewContainer",
|
2022-08-28 06:28:01 +00:00
|
|
|
(url, path, version, containerName) => {
|
|
|
|
|
let comm =
|
2023-02-07 10:15:23 +00:00
|
|
|
"docker run -d --name " +
|
2022-08-28 06:28:01 +00:00
|
|
|
containerName +
|
2023-02-07 10:15:23 +00:00
|
|
|
' -p 8081:80 -p 9002:9002 -v "' +
|
2022-08-28 06:28:01 +00:00
|
|
|
path +
|
2023-02-14 11:35:59 +00:00
|
|
|
'/stacks:/appsmith-stacks" ' +
|
2022-08-28 06:28:01 +00:00
|
|
|
version;
|
|
|
|
|
|
|
|
|
|
cy.log(comm);
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: url,
|
|
|
|
|
qs: {
|
|
|
|
|
cmd: comm,
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
2023-02-07 10:15:23 +00:00
|
|
|
cy.log("ContainerID", res.body.stdout);
|
2022-08-28 06:28:01 +00:00
|
|
|
cy.log(res.body.stderr);
|
|
|
|
|
expect(res.status).equal(200);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("GetPath", (path, containerName) => {
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: path,
|
|
|
|
|
qs: {
|
|
|
|
|
cmd:
|
|
|
|
|
"docker inspect -f '{{ .Mounts }}' " +
|
|
|
|
|
containerName +
|
|
|
|
|
"|awk '{print $2}'",
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
return res.body.stdout;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("GetAndVerifyLogs", (path, containerName) => {
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: path,
|
|
|
|
|
qs: {
|
|
|
|
|
cmd: "docker logs " + containerName + " 2>&1 | grep 'APPLIED'",
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
expect(res.status).equal(200);
|
2023-02-07 10:15:23 +00:00
|
|
|
//expect(res.body.stdout).not.equal("");
|
2022-08-28 06:28:01 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-07 10:15:23 +00:00
|
|
|
Cypress.Commands.add("forceVisit", (url) => {
|
|
|
|
|
cy.window().then((win) => {
|
|
|
|
|
return win.open(url, "_self");
|
|
|
|
|
});
|
|
|
|
|
});
|
2023-02-21 04:13:25 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("SelectDropDown", (dropdownOption) => {
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.wait(1000);
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(".t--widget-selectwidget button").first().scrollIntoView().click();
|
2023-02-21 04:13:25 +00:00
|
|
|
cy.get(".t--widget-selectwidget button .cancel-icon")
|
|
|
|
|
.first()
|
|
|
|
|
.click({ force: true })
|
|
|
|
|
.wait(1000);
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.get(".t--widget-selectwidget button").first().click({ force: true });
|
2023-02-21 04:13:25 +00:00
|
|
|
cy.document()
|
|
|
|
|
.its("body")
|
|
|
|
|
.find(".menu-item-link:contains('" + dropdownOption + "')")
|
|
|
|
|
.click({
|
|
|
|
|
force: true,
|
|
|
|
|
})
|
|
|
|
|
.wait(1000);
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-23 15:32:31 +00:00
|
|
|
Cypress.Commands.add("RemoveAllSelections", () => {
|
|
|
|
|
cy.get(`.rc-select-selection-overflow-item .remove-icon`).each(($each) => {
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.wrap($each).click({ force: true }).wait(1000);
|
2023-02-23 15:32:31 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-21 04:13:25 +00:00
|
|
|
Cypress.Commands.add("SelectFromMultiSelect", (options) => {
|
|
|
|
|
const option = (value) =>
|
|
|
|
|
`.rc-select-item-option[title=${value}] input[type='checkbox']`;
|
|
|
|
|
cy.get(" .t--widget-multiselectwidgetv2 div.rc-select-selector")
|
|
|
|
|
.eq(0)
|
|
|
|
|
.scrollIntoView()
|
|
|
|
|
.then(($element) => {
|
|
|
|
|
// here, we try to click on downArrow in dropdown of multiSelect.
|
|
|
|
|
// the position is calculated from top left of the element
|
|
|
|
|
const dropdownCenterPosition = +$element.height / 2;
|
|
|
|
|
const dropdownArrowApproxPosition = +$element.width - 10;
|
|
|
|
|
cy.get($element).click(
|
|
|
|
|
dropdownArrowApproxPosition,
|
|
|
|
|
dropdownCenterPosition,
|
|
|
|
|
{
|
|
|
|
|
force: true,
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
options.forEach(($each) => {
|
|
|
|
|
cy.document()
|
|
|
|
|
.its("body")
|
|
|
|
|
.find(".rc-select-dropdown.multi-select-dropdown")
|
|
|
|
|
.not(".rc-select-dropdown-hidden")
|
|
|
|
|
.find(option($each))
|
|
|
|
|
.check({ force: true })
|
|
|
|
|
.wait(1000);
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] 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
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
cy.document().its("body").find(option($each)).should("be.checked");
|
2023-02-21 04:13:25 +00:00
|
|
|
});
|
2023-06-15 13:21:11 +00:00
|
|
|
//Closing dropdown
|
|
|
|
|
cy.get(" .t--widget-multiselectwidgetv2 div.rc-select-selector")
|
|
|
|
|
.eq(0)
|
|
|
|
|
.scrollIntoView()
|
|
|
|
|
.then(($element) => {
|
|
|
|
|
// here, we try to click on downArrow in dropdown of multiSelect.
|
|
|
|
|
// the position is calculated from top left of the element
|
|
|
|
|
const dropdownCenterPosition = +$element.height / 2;
|
|
|
|
|
const dropdownArrowApproxPosition = +$element.width - 10;
|
|
|
|
|
cy.get($element).click(
|
|
|
|
|
dropdownArrowApproxPosition,
|
|
|
|
|
dropdownCenterPosition,
|
|
|
|
|
{
|
|
|
|
|
force: true,
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
//cy.document().its("body").type("{esc}");
|
2023-02-21 04:13:25 +00:00
|
|
|
});
|
2023-05-02 09:52:05 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("skipSignposting", () => {
|
2023-08-31 09:04:35 +00:00
|
|
|
onboarding.skipSignposting();
|
2023-05-02 09:52:05 +00:00
|
|
|
});
|
2023-08-16 12:38:10 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("stubPricingPage", () => {
|
|
|
|
|
cy.window().then((win) => {
|
|
|
|
|
cy.stub(win, "open", (url) => {
|
|
|
|
|
win.location.href = "https://www.appsmith.com/pricing?";
|
|
|
|
|
}).as("pricingPage");
|
|
|
|
|
});
|
|
|
|
|
});
|
2024-04-02 04:36:54 +00:00
|
|
|
|
2024-04-16 13:35:07 +00:00
|
|
|
Cypress.Commands.add("stubCustomerPortalPage", () => {
|
|
|
|
|
cy.window().then((win) => {
|
|
|
|
|
cy.stub(win, "open", (url) => {
|
|
|
|
|
win.location.href = "https://customer.appsmith.com?";
|
|
|
|
|
}).as("customerPortalPage");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-03 09:22:09 +00:00
|
|
|
/**
|
|
|
|
|
* @param tooltipSelector
|
|
|
|
|
* @param expectedText
|
|
|
|
|
* @returns
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"assertTooltipPresence",
|
|
|
|
|
(tooltipSelector = "", expectedText) => {
|
|
|
|
|
cy.get(tooltipSelector).should("be.visible").and("contain", expectedText);
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-05-22 06:08:16 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"paste",
|
|
|
|
|
{ prevSubject: true },
|
|
|
|
|
(selector, pastePayload) => {
|
|
|
|
|
cy.wrap(selector).then(($destination) => {
|
|
|
|
|
const pasteEvent = Object.assign(
|
|
|
|
|
new Event("paste", { bubbles: true, cancelable: true }),
|
|
|
|
|
{
|
|
|
|
|
clipboardData: {
|
|
|
|
|
getData: () => pastePayload,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
$destination[0].dispatchEvent(pasteEvent);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-05-22 17:57:26 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("LogintoAppTestUser", (uname, pword) => {
|
|
|
|
|
cy.LogOutUser();
|
|
|
|
|
cy.LoginUser(uname, pword);
|
|
|
|
|
initLocalstorage();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("createJSObject", (JSCode) => {
|
|
|
|
|
cy.NavigateToJSEditor();
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
cy.get(".CodeMirror textarea")
|
|
|
|
|
.first()
|
|
|
|
|
.focus()
|
|
|
|
|
.type("{downarrow}{downarrow}{downarrow}{downarrow} ")
|
|
|
|
|
.type(JSCode);
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
cy.get(jsEditorLocators.runButton).first().click();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("CheckAndUnfoldEntityItem", (item) => {
|
|
|
|
|
PageLeftPane.expandCollapseItem(item);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("text", { prevSubject: true }, (subject, text) => {
|
|
|
|
|
subject.val(text);
|
|
|
|
|
return cy.wrap(subject);
|
|
|
|
|
});
|