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 */
|
|
|
|
|
|
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
|
|
|
//require('cy-verify-downloads').addCustomCommand();
|
|
|
|
|
const path = require("path");
|
2021-11-30 15:26:37 +00:00
|
|
|
|
2021-08-25 14:01:04 +00:00
|
|
|
const dayjs = require("dayjs");
|
2021-12-24 12:17:22 +00:00
|
|
|
const {
|
|
|
|
|
addMatchImageSnapshotCommand,
|
|
|
|
|
} = require("cypress-image-snapshot/command");
|
2020-03-27 09:02:11 +00:00
|
|
|
const loginPage = require("../locators/LoginPage.json");
|
2021-10-01 16:25:55 +00:00
|
|
|
const signupPage = require("../locators/SignupPage.json");
|
2022-02-25 06:13:16 +00:00
|
|
|
import homePage from "../locators/HomePage";
|
2023-02-21 13:38:16 +00:00
|
|
|
|
2020-04-02 04:47:48 +00:00
|
|
|
const pages = require("../locators/Pages.json");
|
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-06-24 14:28:20 +00:00
|
|
|
const viewWidgetsPage = require("../locators/ViewWidgets.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");
|
2021-11-30 15:26:37 +00:00
|
|
|
const publishWidgetspage = require("../locators/publishWidgetspage.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-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;
|
|
|
|
|
const entityExplorer = ObjectsRegistry.EntityExplorer;
|
2023-02-06 07:37:01 +00:00
|
|
|
|
2020-05-27 11:21:11 +00:00
|
|
|
let pageidcopy = " ";
|
2021-11-26 10:47:53 +00:00
|
|
|
const chainStart = Symbol();
|
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");
|
2021-07-02 06:04:36 +00:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
// Cypress.Commands.add("goToEditFromPublish", () => {
|
|
|
|
|
// cy.url().then((url) => {
|
|
|
|
|
// const urlObject = new URL(url);
|
|
|
|
|
// if (!urlObject.pathname.includes("edit")) {
|
|
|
|
|
// urlObject.pathname = urlObject.pathname + "/edit";
|
|
|
|
|
// cy.visit(urlObject.toString());
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// });
|
2021-08-04 12:50:40 +00:00
|
|
|
|
2020-09-08 10:54:55 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"dragTo",
|
|
|
|
|
{ prevSubject: "element" },
|
|
|
|
|
(subject, targetEl) => {
|
|
|
|
|
cy.wrap(subject).trigger("dragstart");
|
|
|
|
|
cy.get(targetEl).trigger("drop");
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2021-11-30 15:26:37 +00:00
|
|
|
Cypress.Commands.add("downloadData", (filetype) => {
|
|
|
|
|
cy.get(publishWidgetspage.downloadBtn).click({ force: true });
|
|
|
|
|
|
|
|
|
|
cy.get(publishWidgetspage.downloadOption)
|
|
|
|
|
.contains(filetype)
|
|
|
|
|
.click({ force: true });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("validateDownload", (fileName) => {
|
2022-04-12 10:01:22 +00:00
|
|
|
// const downloadedFilename = Cypress.config("downloadsFolder")
|
|
|
|
|
// .concat("/")
|
|
|
|
|
// .concat(fileName);
|
|
|
|
|
// cy.readFile(downloadedFilename, "binary", {
|
|
|
|
|
// timeout: 15000,
|
|
|
|
|
// }).should((buffer) => expect(buffer.length).to.be.gt(100));
|
|
|
|
|
|
|
|
|
|
let downloadsFolder = Cypress.config("downloadsFolder");
|
|
|
|
|
cy.log("downloadsFolder is:" + downloadsFolder);
|
|
|
|
|
cy.readFile(path.join(downloadsFolder, fileName)).should("exist");
|
2021-11-30 15:26:37 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"AddFilterWithOperator",
|
|
|
|
|
(operator, option, condition, value) => {
|
|
|
|
|
cy.get(publishWidgetspage.addFilter).click();
|
|
|
|
|
cy.get(publishWidgetspage.operatorsDropdown).click({ force: true });
|
|
|
|
|
cy.get(publishWidgetspage.attributeValue)
|
|
|
|
|
.contains(operator)
|
|
|
|
|
.click({ 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(publishWidgetspage.attributesDropdown).last().click({ force: true });
|
2021-11-30 15:26:37 +00:00
|
|
|
cy.get(publishWidgetspage.attributeValue)
|
|
|
|
|
.contains(option)
|
|
|
|
|
.click({ 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(publishWidgetspage.conditionDropdown).last().click({ force: true });
|
2021-11-30 15:26:37 +00:00
|
|
|
cy.get(publishWidgetspage.attributeValue)
|
|
|
|
|
.contains(condition)
|
|
|
|
|
.click({ 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(publishWidgetspage.inputValue).last().type(value);
|
2021-11-30 15:26:37 +00:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add(
|
2022-07-13 09:03:19 +00:00
|
|
|
"addOAuth2AuthorizationCodeDetails",
|
2021-04-06 13:29:27 +00:00
|
|
|
(accessTokenUrl, clientId, clientSecret, authURL) => {
|
|
|
|
|
cy.get(datasource.authType).click();
|
2021-12-27 12:04:45 +00:00
|
|
|
cy.get(datasource.OAuth2).click();
|
2021-04-06 13:29:27 +00:00
|
|
|
cy.get(datasource.grantType).click();
|
2022-07-13 09:03:19 +00:00
|
|
|
cy.get(datasource.authorizationCode).click();
|
2021-04-06 13:29:27 +00:00
|
|
|
cy.get(datasource.accessTokenUrl).type(accessTokenUrl);
|
|
|
|
|
cy.get(datasource.clienID).type(clientId);
|
|
|
|
|
cy.get(datasource.clientSecret).type(clientSecret);
|
|
|
|
|
cy.get(datasource.authorizationURL).type(authURL);
|
|
|
|
|
cy.xpath('//input[contains(@value,"api/v1/datasources/authorize")]')
|
|
|
|
|
.first()
|
|
|
|
|
.invoke("attr", "value")
|
|
|
|
|
.then((text) => {
|
|
|
|
|
const firstTxt = text;
|
|
|
|
|
cy.log("date time : ", firstTxt);
|
|
|
|
|
const expectedvalue = Cypress.config().baseUrl.concat(
|
|
|
|
|
"api/v1/datasources/authorize",
|
|
|
|
|
);
|
|
|
|
|
expect(firstTxt).to.equal(expectedvalue);
|
|
|
|
|
});
|
2022-07-21 10:40:36 +00:00
|
|
|
cy.testSelfSignedCertificateSettingsInREST(true);
|
2021-04-06 13:29:27 +00:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2022-07-13 09:03:19 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"addOAuth2ClientCredentialsDetails",
|
|
|
|
|
(accessTokenUrl, clientId, clientSecret, scope) => {
|
|
|
|
|
cy.get(datasource.authType).click();
|
|
|
|
|
cy.get(datasource.OAuth2).click();
|
|
|
|
|
cy.xpath("//span[text()='Client Credentials']").should("be.visible");
|
|
|
|
|
cy.get(datasource.accessTokenUrl).type(accessTokenUrl);
|
|
|
|
|
cy.get(datasource.clienID).type(clientId);
|
|
|
|
|
cy.get(datasource.clientSecret).type(clientSecret);
|
|
|
|
|
cy.get(datasource.scope).type(scope);
|
|
|
|
|
cy.get(datasource.clientAuthentication).should("be.visible");
|
|
|
|
|
cy.xpath("//span[text()='Send client credentials in body']").should(
|
|
|
|
|
"be.visible",
|
|
|
|
|
);
|
2022-07-21 10:40:36 +00:00
|
|
|
cy.testSelfSignedCertificateSettingsInREST(true);
|
2022-07-13 09:03:19 +00:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2022-07-21 10:40:36 +00:00
|
|
|
Cypress.Commands.add("testSelfSignedCertificateSettingsInREST", (isOAuth2) => {
|
|
|
|
|
cy.get(datasource.advancedSettings).click();
|
|
|
|
|
cy.get(datasource.useCertInAuth).should("not.exist");
|
|
|
|
|
cy.get(datasource.certificateDetails).should("not.exist");
|
|
|
|
|
cy.TargetDropdownAndSelectOption(datasource.useSelfSignedCert, "Yes");
|
|
|
|
|
if (isOAuth2) {
|
|
|
|
|
cy.get(datasource.useCertInAuth).should("exist");
|
|
|
|
|
} else {
|
|
|
|
|
cy.get(datasource.useCertInAuth).should("not.exist");
|
|
|
|
|
}
|
|
|
|
|
cy.get(datasource.certificateDetails).should("exist");
|
|
|
|
|
cy.TargetDropdownAndSelectOption(datasource.useSelfSignedCert, "No");
|
|
|
|
|
cy.get(datasource.advancedSettings).click();
|
|
|
|
|
});
|
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("DeleteApp", (appName) => {
|
2020-05-20 11:04:39 +00:00
|
|
|
cy.get(commonlocators.homeIcon).click({ force: true });
|
|
|
|
|
cy.wait("@applications").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
2020-06-10 12:16:50 +00:00
|
|
|
200,
|
|
|
|
|
);
|
2022-06-15 15:37:41 +00:00
|
|
|
cy.wait("@workspaces").should(
|
2020-06-10 12:16:50 +00:00
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
2020-05-20 11:04:39 +00:00
|
|
|
200,
|
|
|
|
|
);
|
2020-05-21 09:45:48 +00:00
|
|
|
cy.get('button span[icon="chevron-down"]').should("be.visible");
|
2023-05-11 18:45:06 +00:00
|
|
|
cy.get(homePage.searchInput).clear().type(appName, { force: true });
|
2020-08-18 06:40:11 +00:00
|
|
|
cy.get(homePage.applicationCard).trigger("mouseover");
|
2023-05-20 00:49:33 +00:00
|
|
|
cy.get("[data-testid=t--application-card-context-menu]")
|
2020-05-21 09:45:48 +00:00
|
|
|
.should("have.length", 1)
|
|
|
|
|
.first()
|
|
|
|
|
.click({ 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.deleteAppConfirm).should("be.visible").click({ force: true });
|
|
|
|
|
cy.get(homePage.deleteApp).should("be.visible").click({ force: true });
|
2020-05-20 11:04:39 +00:00
|
|
|
});
|
|
|
|
|
|
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
|
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.window().its("store").invoke("dispatch", { type: "LOGOUT_USER_INIT" });
|
2021-02-03 07:59:00 +00:00
|
|
|
cy.wait("@postLogout");
|
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) => {
|
|
|
|
|
goToLoginPage && cy.visit("/user/login");
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.wait(3000); //for login page to load fully for CI runs
|
|
|
|
|
cy.wait("@signUpLogin")
|
|
|
|
|
.its("response.body.responseMeta.status")
|
|
|
|
|
.should("eq", 200);
|
2020-03-27 09:02:11 +00:00
|
|
|
cy.get(loginPage.username).should("be.visible");
|
|
|
|
|
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();
|
2022-04-03 16:43:20 +00:00
|
|
|
cy.wait("@getMe");
|
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) {
|
|
|
|
|
cy.get(".t--applications-container .createnew").should("be.visible");
|
|
|
|
|
cy.get(".t--applications-container .createnew").should("be.enabled");
|
|
|
|
|
}
|
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
|
|
|
|
2023-03-29 17:56:24 +00:00
|
|
|
Cypress.Commands.add("LogintoAppTestUser", (uname, pword) => {
|
|
|
|
|
cy.LogOutUser();
|
|
|
|
|
cy.LoginUser(uname, pword);
|
|
|
|
|
initLocalstorage();
|
|
|
|
|
});
|
|
|
|
|
|
2021-10-01 16:25:55 +00:00
|
|
|
Cypress.Commands.add("Signup", (uname, pword) => {
|
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.window().its("store").invoke("dispatch", { type: "LOGOUT_USER_INIT" });
|
2021-10-01 16:25:55 +00:00
|
|
|
cy.wait("@postLogout");
|
|
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.visit("/user/signup", { timeout: 60000 });
|
|
|
|
|
cy.wait(4000); //for sign up page to open fully
|
|
|
|
|
cy.wait("@signUpLogin")
|
|
|
|
|
.its("response.body.responseMeta.status")
|
|
|
|
|
.should("eq", 200);
|
2021-10-01 16:25:55 +00:00
|
|
|
cy.get(signupPage.username).should("be.visible");
|
|
|
|
|
cy.get(signupPage.username).type(uname);
|
|
|
|
|
cy.get(signupPage.password).type(pword);
|
|
|
|
|
cy.get(signupPage.submitBtn).click();
|
2021-10-21 05:36:17 +00:00
|
|
|
cy.wait(1000);
|
2023-06-16 18:40:10 +00:00
|
|
|
cy.get("body").then(($body) => {
|
|
|
|
|
if ($body.find(signupPage.roleDropdown).length > 0) {
|
|
|
|
|
cy.get(signupPage.roleDropdown).click();
|
|
|
|
|
cy.get(signupPage.dropdownOption).click();
|
|
|
|
|
cy.get(signupPage.useCaseDropdown).click();
|
|
|
|
|
cy.get(signupPage.dropdownOption).click();
|
|
|
|
|
cy.get(signupPage.roleUsecaseSubmit).click({ force: true });
|
|
|
|
|
}
|
|
|
|
|
});
|
2022-04-03 16:43:20 +00:00
|
|
|
cy.wait("@getMe");
|
2021-11-17 15:45:48 +00:00
|
|
|
cy.wait(3000);
|
2021-10-01 16:25:55 +00:00
|
|
|
initLocalstorage();
|
|
|
|
|
});
|
|
|
|
|
|
2020-06-17 10:47:01 +00:00
|
|
|
Cypress.Commands.add("LoginFromAPI", (uname, pword) => {
|
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",
|
|
|
|
|
url: "api/v1/login",
|
|
|
|
|
headers: {
|
|
|
|
|
origin: baseURL,
|
|
|
|
|
},
|
|
|
|
|
followRedirect: true,
|
|
|
|
|
body: {
|
|
|
|
|
username: uname,
|
|
|
|
|
password: pword,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Check if cookie is present
|
|
|
|
|
cy.getCookie("SESSION").then((cookie) => {
|
|
|
|
|
expect(cookie).to.not.be.null;
|
|
|
|
|
cy.log(cookie.value);
|
|
|
|
|
|
|
|
|
|
cy.location().should((loc) => {
|
|
|
|
|
expect(loc.href).to.eq(loc.origin + "/applications");
|
|
|
|
|
});
|
|
|
|
|
|
2023-05-30 09:48:45 +00:00
|
|
|
if (CURRENT_REPO === REPO.EE) {
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
} else {
|
|
|
|
|
cy.wait("@getMe");
|
|
|
|
|
cy.wait("@applications").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
200,
|
|
|
|
|
);
|
|
|
|
|
cy.wait("@getReleaseItems");
|
|
|
|
|
}
|
2020-06-17 10:47:01 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("DeleteApp", (appName) => {
|
2020-06-17 10:47:01 +00:00
|
|
|
cy.get(commonlocators.homeIcon).click({ force: true });
|
|
|
|
|
cy.get(homePage.searchInput).type(appName);
|
2021-03-31 08:35:19 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2020-06-17 10:47:01 +00:00
|
|
|
cy.wait(2000);
|
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.applicationCard).first().trigger("mouseover");
|
|
|
|
|
cy.get(homePage.appMoreIcon).first().click({ force: true });
|
|
|
|
|
cy.get(homePage.deleteAppConfirm).should("be.visible").click({ force: true });
|
|
|
|
|
cy.get(homePage.deleteApp).contains("Are you sure?").click({ force: true });
|
2020-06-17 10:47:01 +00:00
|
|
|
});
|
|
|
|
|
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
Cypress.Commands.add("DeletepageFromSideBar", () => {
|
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(pages.popover).last().click({ force: true });
|
|
|
|
|
cy.get(pages.deletePage).first().click({ force: true });
|
|
|
|
|
cy.get(pages.deletePageConfirm).first().click({ force: true });
|
2021-03-31 08:35:19 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2020-06-17 10:47:01 +00:00
|
|
|
cy.wait(2000);
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-19 06:13:15 +00:00
|
|
|
Cypress.Commands.add("LogOut", () => {
|
2023-03-15 10:02:24 +00:00
|
|
|
cy.request({
|
|
|
|
|
method: "POST",
|
|
|
|
|
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("NavigateToWidgets", (pageName) => {
|
2020-04-02 04:47:48 +00:00
|
|
|
cy.get(pages.pagesIcon).click({ force: true });
|
2020-05-01 07:48:33 +00:00
|
|
|
cy.get(".t--page-sidebar-" + pageName + "")
|
2020-04-08 13:38:19 +00:00
|
|
|
.find(">div")
|
|
|
|
|
.click({ force: true });
|
2020-04-02 04:47:48 +00:00
|
|
|
cy.get("#loading").should("not.exist");
|
2020-04-21 14:19:12 +00:00
|
|
|
cy.get(pages.widgetsEditor).click();
|
2020-04-17 08:17:25 +00:00
|
|
|
cy.wait("@getPage");
|
2020-04-02 04:47:48 +00:00
|
|
|
cy.get("#loading").should("not.exist");
|
|
|
|
|
});
|
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
Cypress.Commands.add("SearchEntity", (apiname1, apiname2) => {
|
2022-05-20 05:02:13 +00:00
|
|
|
cy.get(commonlocators.searchEntityInExplorer)
|
2021-06-09 12:20:15 +00:00
|
|
|
.clear({ force: true })
|
|
|
|
|
.type(apiname1, { force: true });
|
2021-03-31 08:35:19 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2022-01-29 07:26:19 +00:00
|
|
|
cy.get(".t--entity-name").click({ multiple: true });
|
2020-08-20 11:18:10 +00:00
|
|
|
cy.wait(500);
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
cy.get(
|
|
|
|
|
commonlocators.entitySearchResult.concat(apiname1).concat("')"),
|
|
|
|
|
).should("be.visible");
|
|
|
|
|
cy.get(
|
|
|
|
|
commonlocators.entitySearchResult.concat(apiname2).concat("')"),
|
2021-01-14 05:44:07 +00:00
|
|
|
).should("not.exist");
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
});
|
|
|
|
|
|
2022-02-25 06:13:16 +00:00
|
|
|
Cypress.Commands.add("GlobalSearchEntity", (apiname1, dontAssertVisibility) => {
|
2021-06-09 12:20:15 +00:00
|
|
|
// entity explorer search will be hidden
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(commonlocators.searchEntityInExplorer).type(apiname1, { force: true });
|
2021-03-31 08:35:19 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2022-01-29 07:26:19 +00:00
|
|
|
cy.CheckAndUnfoldWidgets();
|
2020-08-20 11:18:10 +00:00
|
|
|
cy.wait(500);
|
2022-02-25 06:13:16 +00:00
|
|
|
if (!dontAssertVisibility) {
|
|
|
|
|
cy.get(
|
|
|
|
|
commonlocators.entitySearchResult.concat(apiname1).concat("')"),
|
|
|
|
|
).should("be.visible");
|
|
|
|
|
}
|
2020-05-12 13:47:13 +00:00
|
|
|
});
|
|
|
|
|
|
2020-09-02 13:13:06 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"EditEntityNameByDoubleClick",
|
|
|
|
|
(entityName, updatedName) => {
|
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(explorer.entity).contains(entityName).dblclick({ force: true });
|
2020-09-02 13:13:06 +00:00
|
|
|
cy.log(updatedName);
|
|
|
|
|
cy.get(explorer.editEntityField)
|
|
|
|
|
.clear()
|
|
|
|
|
.type(updatedName + "{enter}", { force: true });
|
|
|
|
|
cy.wait("@saveDatasource").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
2022-11-30 05:59:45 +00:00
|
|
|
201,
|
2020-09-02 13:13:06 +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
|
|
|
});
|
|
|
|
|
|
2020-08-20 05:38:08 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"paste",
|
|
|
|
|
{
|
|
|
|
|
prevSubject: true,
|
|
|
|
|
element: true,
|
|
|
|
|
},
|
|
|
|
|
($element, text) => {
|
2022-04-13 07:00:38 +00:00
|
|
|
const subString = text.slice(0, -1);
|
2020-08-20 05:38:08 +00:00
|
|
|
const lastChar = text.slice(-1);
|
|
|
|
|
|
|
|
|
|
cy.get(commonlocators.entityExplorersearch)
|
2021-06-09 12:20:15 +00:00
|
|
|
.clear({ force: true })
|
|
|
|
|
.click({ force: true })
|
2020-08-20 05:38:08 +00:00
|
|
|
.then(() => {
|
|
|
|
|
$element.text(subString);
|
|
|
|
|
$element.val(subString);
|
|
|
|
|
cy.get($element).type(lastChar);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2022-01-29 07:26:19 +00:00
|
|
|
Cypress.Commands.add("CheckAndUnfoldWidgets", () => {
|
|
|
|
|
cy.get(commonlocators.widgetSection)
|
2023-05-19 18:37:06 +00:00
|
|
|
.invoke("attr", "id")
|
|
|
|
|
.then((id) => {
|
|
|
|
|
if (id === "arrow-right-s-line") {
|
2022-01-29 07:26:19 +00:00
|
|
|
cy.get(commonlocators.widgetSection).click({ force: true });
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("SearchEntityandOpen", (apiname1) => {
|
2022-05-20 05:02:13 +00:00
|
|
|
cy.get(commonlocators.searchEntityInExplorer)
|
2021-06-09 12:20:15 +00:00
|
|
|
.clear({ force: true })
|
|
|
|
|
.type(apiname1, { force: true });
|
2022-01-29 07:26:19 +00:00
|
|
|
cy.CheckAndUnfoldWidgets();
|
2023-03-30 05:33:29 +00:00
|
|
|
cy.get(commonlocators.entitySearchResult.concat(apiname1).concat("')"))
|
|
|
|
|
.first()
|
|
|
|
|
.scrollIntoView({ easing: "linear" });
|
2021-03-31 08:35:19 +00:00
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2020-08-20 11:18:10 +00:00
|
|
|
cy.wait(500);
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
cy.get(
|
|
|
|
|
commonlocators.entitySearchResult.concat(apiname1).concat("')"),
|
|
|
|
|
).should("be.visible");
|
2020-10-29 13:53:10 +00:00
|
|
|
cy.get(commonlocators.entitySearchResult.concat(apiname1).concat("')"))
|
|
|
|
|
.last()
|
|
|
|
|
.click({ force: true });
|
2022-12-24 18:01:03 +00:00
|
|
|
//cy.get(".bp3-editable-text-content").should("contain.text", apiname1);
|
2022-01-29 07:26:19 +00:00
|
|
|
//cy.get('.t--entity-name').click({multiple:true})
|
2020-05-20 16:04:37 +00:00
|
|
|
});
|
2021-12-03 06:24:08 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("SearchEntityAndUnfold", (apiname1) => {
|
2022-05-20 05:02:13 +00:00
|
|
|
cy.get(commonlocators.searchEntityInExplorer)
|
2021-12-03 06:24:08 +00:00
|
|
|
.clear({ force: true })
|
|
|
|
|
.type(apiname1, { force: true });
|
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2022-01-29 07:26:19 +00:00
|
|
|
cy.CheckAndUnfoldWidgets();
|
2021-12-03 06:24:08 +00:00
|
|
|
cy.wait(500);
|
|
|
|
|
cy.get(
|
|
|
|
|
commonlocators.entitySearchResult.concat(apiname1).concat("')"),
|
|
|
|
|
).should("be.visible");
|
|
|
|
|
cy.get(commonlocators.entitySearchResult.concat(apiname1).concat("')"))
|
|
|
|
|
.parents(commonlocators.entityItem)
|
|
|
|
|
.first()
|
|
|
|
|
.children(commonlocators.entityCollapseToggle)
|
|
|
|
|
.last()
|
|
|
|
|
.click({ force: true });
|
|
|
|
|
});
|
|
|
|
|
|
2022-01-29 07:26:19 +00:00
|
|
|
Cypress.Commands.add("OpenBindings", (apiname1) => {
|
|
|
|
|
cy.wait(500);
|
2022-05-20 05:02:13 +00:00
|
|
|
cy.get(commonlocators.searchEntityInExplorer)
|
2022-01-29 07:26:19 +00:00
|
|
|
.clear({ force: true })
|
|
|
|
|
.type(apiname1, { force: true });
|
|
|
|
|
cy.CheckAndUnfoldWidgets();
|
|
|
|
|
cy.wait(500);
|
|
|
|
|
cy.get(
|
|
|
|
|
commonlocators.entitySearchResult.concat(apiname1).concat("')"),
|
|
|
|
|
).should("be.visible");
|
|
|
|
|
cy.get(commonlocators.entitySearchResult.concat(apiname1).concat("')"))
|
|
|
|
|
.parents(commonlocators.entityItem)
|
|
|
|
|
.first()
|
|
|
|
|
.trigger("mouseover")
|
|
|
|
|
.find(commonlocators.entityContextMenu)
|
|
|
|
|
.last()
|
|
|
|
|
.click({ force: true });
|
|
|
|
|
cy.get(commonlocators.entityContextMenuContent)
|
|
|
|
|
.children("li")
|
2023-05-19 18:37:06 +00:00
|
|
|
.contains("Show bindings")
|
2022-01-29 07:26:19 +00:00
|
|
|
.click({ force: true });
|
|
|
|
|
});
|
|
|
|
|
|
2021-09-07 12:48:38 +00:00
|
|
|
Cypress.Commands.add("SearchEntityandDblClick", (apiname1) => {
|
|
|
|
|
cy.get(
|
|
|
|
|
commonlocators.entitySearchResult.concat(apiname1).concat("')"),
|
|
|
|
|
).should("be.visible");
|
2021-10-21 04:37:34 +00:00
|
|
|
return cy
|
|
|
|
|
.get(commonlocators.entitySearchResult.concat(apiname1).concat("')"))
|
|
|
|
|
.dblclick()
|
2022-01-13 13:21:57 +00:00
|
|
|
.get("input[type=text]")
|
2021-10-21 04:37:34 +00:00
|
|
|
.last();
|
2021-09-07 12:48:38 +00:00
|
|
|
});
|
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
|
|
|
|
2023-06-15 13:21:11 +00:00
|
|
|
// Cypress.Commands.add("PublishtheApp", (validateSavedState = true) => {
|
|
|
|
|
// //cy.server();
|
|
|
|
|
// cy.intercept("POST", "/api/v1/applications/publish/*").as("publishApp");
|
|
|
|
|
// // Wait before publish
|
|
|
|
|
// // eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
|
// cy.wait(2000);
|
|
|
|
|
// cy.assertPageSave(validateSavedState);
|
|
|
|
|
|
|
|
|
|
// // Stubbing window.open to open in the same tab
|
|
|
|
|
// cy.window().then((window) => {
|
|
|
|
|
// cy.stub(window, "open").callsFake((url) => {
|
|
|
|
|
// window.location.href = Cypress.config().baseUrl + url.substring(1);
|
|
|
|
|
// window.location.target = "_self";
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// cy.get(homePage.publishButton).click();
|
|
|
|
|
// cy.wait("@publishApp");
|
|
|
|
|
// cy.log("pagename: " + localStorage.getItem("PageName"));
|
|
|
|
|
// cy.wait(1000); //wait time for page to load!
|
|
|
|
|
// });
|
2020-05-01 07:48:33 +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", () => {
|
|
|
|
|
const uuid = require("uuid");
|
|
|
|
|
const id = uuid.v4();
|
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 {
|
|
|
|
|
pageid = url.split("/")[5]?.split("-").pop();
|
|
|
|
|
}
|
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) {
|
|
|
|
|
cy.log(appId + "appId");
|
|
|
|
|
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
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("togglebar", (value) => {
|
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(value).check({ force: true }).should("be.checked");
|
2020-06-17 10:19:56 +00:00
|
|
|
});
|
2021-10-29 07:02:45 +00:00
|
|
|
|
2020-06-17 10:19:56 +00:00
|
|
|
Cypress.Commands.add("radiovalue", (value, value2) => {
|
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(value).click().clear().type(value2);
|
2020-06-17 10:19:56 +00:00
|
|
|
});
|
2021-10-29 07:02:45 +00:00
|
|
|
|
2020-06-17 10:19:56 +00:00
|
|
|
Cypress.Commands.add("optionValue", (value, value2) => {
|
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(value).click().clear().type(value2);
|
2020-06-17 10:19:56 +00:00
|
|
|
});
|
2021-10-29 07:02:45 +00:00
|
|
|
|
2022-03-24 19:34:28 +00:00
|
|
|
Cypress.Commands.add("typeIntoDraftEditor", (selector, text) => {
|
|
|
|
|
cy.get(selector).then((input) => {
|
|
|
|
|
var textarea = input.get(0);
|
|
|
|
|
textarea.dispatchEvent(new Event("focus"));
|
|
|
|
|
|
|
|
|
|
var textEvent = document.createEvent("TextEvent");
|
|
|
|
|
textEvent.initTextEvent("textInput", true, true, null, text);
|
|
|
|
|
textarea.dispatchEvent(textEvent);
|
|
|
|
|
|
|
|
|
|
textarea.dispatchEvent(new Event("blur"));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-08 05:40:14 +00:00
|
|
|
Cypress.Commands.add("getPluginFormsAndCreateDatasource", () => {
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
/*
|
2020-05-08 05:40:14 +00:00
|
|
|
cy.wait("@getPluginForm").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
200,
|
|
|
|
|
);
|
2022-11-30 05:59:45 +00:00
|
|
|
cy.wait("@saveDatasource").should(
|
2020-05-08 05:40:14 +00:00
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
201,
|
|
|
|
|
);
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
*/
|
2020-05-08 05:40:14 +00:00
|
|
|
});
|
|
|
|
|
|
2020-08-20 05:38:08 +00:00
|
|
|
Cypress.Commands.add("NavigateToWidgetsInExplorer", () => {
|
|
|
|
|
cy.get(explorer.entityWidget).click({ force: true });
|
|
|
|
|
});
|
|
|
|
|
|
2021-10-07 02:29:16 +00:00
|
|
|
Cypress.Commands.add("NavigateToJSEditor", () => {
|
2022-01-29 07:26:19 +00:00
|
|
|
cy.get(explorer.createNew).click({ force: true });
|
2023-06-09 08:52:27 +00:00
|
|
|
cy.get(`[data-testId="t--search-file-operation"]`).type("New JS Object");
|
|
|
|
|
cy.get("span:contains('New JS Object')").eq(0).click({ force: true });
|
2021-10-07 02:29:16 +00:00
|
|
|
});
|
|
|
|
|
|
2020-05-07 08:07:50 +00:00
|
|
|
Cypress.Commands.add("importCurl", () => {
|
|
|
|
|
cy.get(ApiEditor.curlImportBtn).click({ force: true });
|
|
|
|
|
cy.wait("@curlImport").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
201,
|
|
|
|
|
);
|
|
|
|
|
});
|
2020-05-08 15:31:36 +00:00
|
|
|
|
2021-11-18 14:27:51 +00:00
|
|
|
Cypress.Commands.add("NavigateToActiveTab", () => {
|
|
|
|
|
cy.get(explorer.activeTab).click({ force: true });
|
|
|
|
|
|
|
|
|
|
// cy.get(pages.integrationActiveTab)
|
|
|
|
|
// .should("be.visible")
|
|
|
|
|
// .click({ force: true });
|
|
|
|
|
});
|
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
|
2022-03-23 05:33:06 +00:00
|
|
|
Cypress.Commands.add("deleteActionAndConfirm", () => {
|
|
|
|
|
cy.selectAction("Delete");
|
|
|
|
|
cy.selectAction("Are you sure?");
|
|
|
|
|
});
|
|
|
|
|
|
2021-10-07 02:29:16 +00:00
|
|
|
Cypress.Commands.add("deleteJSObject", () => {
|
|
|
|
|
cy.hoverAndClick();
|
|
|
|
|
cy.get(jsEditorLocators.delete).click({ force: true });
|
2022-03-23 05:33:06 +00:00
|
|
|
cy.get(jsEditorLocators.deleteConfirm).click({ force: true });
|
2021-10-07 02:29:16 +00:00
|
|
|
cy.wait("@deleteJSCollection").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
200,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2020-08-20 05:38:08 +00:00
|
|
|
Cypress.Commands.add("deleteDataSource", () => {
|
|
|
|
|
cy.hoverAndClick();
|
|
|
|
|
cy.get(apiwidget.delete).click({ force: true });
|
2022-03-23 05:33:06 +00:00
|
|
|
cy.get(apiwidget.deleteConfirm).click({ force: true });
|
2020-08-20 05:38:08 +00:00
|
|
|
cy.wait("@deleteDatasource").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
200,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2020-12-11 13:48:01 +00:00
|
|
|
Cypress.Commands.add("dragAndDropToCanvas", (widgetType, { x, y }) => {
|
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)
|
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
|
|
|
|
|
|
|
|
const option = { eventConstructor: "MouseEvent" };
|
|
|
|
|
|
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);
|
2022-07-20 06:06:33 +00:00
|
|
|
cy.assertPageSave();
|
|
|
|
|
});
|
2020-09-08 10:54:55 +00:00
|
|
|
|
2021-08-26 15:24:37 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"dragAndDropToWidget",
|
|
|
|
|
(widgetType, destinationWidget, { x, y }) => {
|
|
|
|
|
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)
|
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)
|
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 }) => {
|
|
|
|
|
const selector = `.t--widget-card-draggable-${widgetType}`;
|
|
|
|
|
cy.wait(800);
|
|
|
|
|
cy.get(selector)
|
|
|
|
|
.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()
|
|
|
|
|
.type(buttonColor);
|
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-06-09 09:25:52 +00:00
|
|
|
cy.get(propPane._actionCallbacks).last().click();
|
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
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("isSelectRow", (index) => {
|
2021-11-26 10:47:53 +00:00
|
|
|
cy.get('.tbody .td[data-rowindex="' + index + '"][data-colindex="' + 0 + '"]')
|
|
|
|
|
.first()
|
|
|
|
|
.click({ force: true });
|
2022-05-25 09:46:14 +00:00
|
|
|
cy.wait(500); //for selection to show!
|
2020-05-16 07:28:13 +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
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("setDate", (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 expDate = dayjs().add(date, "days").format(dateFormate);
|
2020-05-18 04:28:41 +00:00
|
|
|
const sel = `.DayPicker-Day[aria-label=\"${expDate}\"]`;
|
|
|
|
|
cy.get(sel).click();
|
|
|
|
|
});
|
2020-05-18 05:34:49 +00:00
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("pageNo", (index) => {
|
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(".page-item").first().click({ force: true });
|
2020-05-16 07:28:13 +00:00
|
|
|
});
|
2020-05-18 05:34:49 +00:00
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("pageNoValidate", (index) => {
|
2020-05-16 07:28:13 +00:00
|
|
|
const data = '.e-numericcontainer a[index="' + index + '"]';
|
|
|
|
|
const pageVal = cy.get(data);
|
|
|
|
|
return pageVal;
|
|
|
|
|
});
|
2020-05-27 11:21:11 +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) => {
|
|
|
|
|
const editor = win.tinymce.editors[tinyMceId];
|
|
|
|
|
editor.setContent(content);
|
|
|
|
|
});
|
|
|
|
|
});
|
2020-05-28 06:37:47 +00:00
|
|
|
|
2021-04-06 13:29:27 +00:00
|
|
|
Cypress.Commands.add("startRoutesForDatasource", () => {
|
2023-06-15 13:21:11 +00:00
|
|
|
//cy.server();
|
|
|
|
|
cy.intercept("POST", "/api/v1/datasources").as("saveDatasource");
|
|
|
|
|
cy.intercept("POST", "/api/v1/datasources/test").as("testDatasource");
|
2022-11-30 05:59:45 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/datasources/*").as("updateDatasource");
|
2021-04-06 13:29:27 +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");
|
|
|
|
|
cy.intercept("GET", "/api/v1/plugins").as("getPlugins");
|
|
|
|
|
cy.intercept("POST", "/api/v1/logout").as("postLogout");
|
|
|
|
|
|
|
|
|
|
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",
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
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("GET", "api/v1/providers/categories").as("getCategories");
|
|
|
|
|
cy.intercept("GET", "api/v1/import/templateCollections").as(
|
2020-05-27 11:21:11 +00:00
|
|
|
"getTemplateCollections",
|
|
|
|
|
);
|
2023-06-15 13:21:11 +00:00
|
|
|
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");
|
|
|
|
|
cy.intercept("POST", "/api/v1/import?type=CURL&pageId=*&name=*").as(
|
|
|
|
|
"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");
|
|
|
|
|
cy.intercept(
|
|
|
|
|
"GET",
|
|
|
|
|
"/api/v1/marketplace/providers?category=*&page=*&size=*",
|
|
|
|
|
).as("get3PProviders");
|
|
|
|
|
cy.intercept("GET", "/api/v1/marketplace/templates?providerId=*").as(
|
2020-05-27 11:21:11 +00:00
|
|
|
"get3PProviderTemplates",
|
|
|
|
|
);
|
2023-06-15 13:21:11 +00:00
|
|
|
cy.intercept("POST", "/api/v1/items/addToPage").as("add3PApiToPage");
|
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");
|
|
|
|
|
cy.intercept("POST", "/api/v1/applications?workspaceId=*").as(
|
2022-06-15 15:37:41 +00:00
|
|
|
"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");
|
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-04-14 11:33:50 +00:00
|
|
|
cy.intercept("POST", "/api/v1/applications/snapshot/*").as("snapshotSuccess");
|
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
|
|
|
|
|
|
|
|
cy.intercept({
|
|
|
|
|
method: "PUT",
|
|
|
|
|
}).as("sucessSave");
|
2023-03-24 16:06:48 +00:00
|
|
|
|
|
|
|
|
cy.intercept("POST", "https://api.segment.io/v1/b", (req) => {
|
|
|
|
|
req.reply((res) => {
|
|
|
|
|
res.send({
|
|
|
|
|
//status: 200,
|
|
|
|
|
body: {
|
2023-06-15 13:21:11 +00:00
|
|
|
success: true, //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");
|
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
|
|
|
});
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("ValidateTableData", (value) => {
|
2020-09-08 13:04:51 +00:00
|
|
|
// cy.isSelectRow(0);
|
2021-01-04 10:16:08 +00:00
|
|
|
cy.readTabledata("0", "0").then((tabData) => {
|
2020-06-10 12:25:16 +00:00
|
|
|
const tableData = tabData;
|
2020-09-08 13:04:51 +00:00
|
|
|
expect(tableData).to.equal(value.toString());
|
2020-06-10 12:25:16 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2022-07-14 07:02:35 +00:00
|
|
|
Cypress.Commands.add("ValidateTableV2Data", (value) => {
|
|
|
|
|
// cy.isSelectRow(0);
|
|
|
|
|
cy.readTableV2data("0", "0").then((tabData) => {
|
|
|
|
|
const tableData = tabData;
|
|
|
|
|
expect(tableData).to.equal(value.toString());
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
Cypress.Commands.add("ValidatePublishTableData", (value) => {
|
2020-06-10 12:25:16 +00:00
|
|
|
cy.isSelectRow(0);
|
2021-01-04 10:16:08 +00:00
|
|
|
cy.readTabledataPublish("0", "0").then((tabData) => {
|
2020-06-10 12:25:16 +00:00
|
|
|
const tableData = tabData;
|
2020-08-18 10:30:36 +00:00
|
|
|
expect(tableData).to.equal(value);
|
2020-06-10 12:25:16 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2022-07-14 07:02:35 +00:00
|
|
|
Cypress.Commands.add("ValidatePublishTableV2Data", (value) => {
|
|
|
|
|
cy.isSelectRow(0);
|
|
|
|
|
cy.readTableV2dataPublish("0", "0").then((tabData) => {
|
|
|
|
|
const tableData = tabData;
|
|
|
|
|
expect(tableData).to.equal(value);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2023-03-15 11:03:14 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"ValidatePaginateResponseUrlData",
|
|
|
|
|
(runTestCss, isNext) => {
|
|
|
|
|
cy.CheckAndUnfoldEntityItem("Queries/JS");
|
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--entity-name").contains("Api2").click({ force: true });
|
2023-03-15 11:03:14 +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("@postExecute").then((interception) => {
|
|
|
|
|
let valueToTest = JSON.stringify(
|
|
|
|
|
interception.response.body.data.body[0].name,
|
|
|
|
|
);
|
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
2023-03-17 14:20:51 +00:00
|
|
|
cy.get(ApiEditor.ApiRunBtn).should("not.be.disabled");
|
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--entity-name").contains("Table1").click({ force: true });
|
2023-03-15 11:03:14 +00:00
|
|
|
cy.isSelectRow(0);
|
|
|
|
|
if (isNext) {
|
|
|
|
|
cy.wait("@postExecute").then((interception) => {
|
|
|
|
|
valueToTest = JSON.stringify(
|
|
|
|
|
interception.response.body.data.body[0].name,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
cy.readTabledata("0", "5").then((tabData) => {
|
|
|
|
|
const tableData = tabData;
|
|
|
|
|
expect(`\"${tableData}\"`).to.equal(valueToTest);
|
|
|
|
|
});
|
2020-06-10 12:25:16 +00:00
|
|
|
});
|
2023-03-15 11:03:14 +00:00
|
|
|
},
|
|
|
|
|
);
|
2020-06-10 12:25:16 +00:00
|
|
|
|
2023-03-15 11:03:14 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"ValidatePaginateResponseUrlDataV2",
|
|
|
|
|
(runTestCss, isNext) => {
|
|
|
|
|
cy.CheckAndUnfoldEntityItem("Queries/JS");
|
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--entity-name").contains("Api2").click({ force: true });
|
2023-03-15 11:03:14 +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("@postExecute").then((interception) => {
|
|
|
|
|
let valueToTest = JSON.stringify(
|
|
|
|
|
interception.response.body.data.body[0].name,
|
|
|
|
|
);
|
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
|
cy.get(ApiEditor.ApiRunBtn).should("not.be.disabled");
|
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--entity-name").contains("Table1").click({ force: true });
|
2023-03-15 11:03:14 +00:00
|
|
|
cy.isSelectRow(0);
|
|
|
|
|
if (isNext) {
|
|
|
|
|
cy.wait("@postExecute").then((interception) => {
|
|
|
|
|
valueToTest = JSON.stringify(
|
|
|
|
|
interception.response.body.data.body[0].name,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
cy.readTableV2data("0", "5").then((tabData) => {
|
|
|
|
|
const tableData = tabData;
|
|
|
|
|
expect(`\"${tableData}\"`).to.equal(valueToTest);
|
|
|
|
|
});
|
2022-07-14 07:02:35 +00:00
|
|
|
});
|
2023-03-15 11:03:14 +00:00
|
|
|
},
|
|
|
|
|
);
|
2022-07-14 07:02:35 +00:00
|
|
|
|
2023-03-11 07:01:39 +00:00
|
|
|
Cypress.Commands.add("ValidatePaginationInputData", (valueToTest) => {
|
2020-06-10 12:25:16 +00:00
|
|
|
cy.isSelectRow(0);
|
2023-03-11 07:01:39 +00:00
|
|
|
cy.readTabledataPublish("0", "5").then((tabData) => {
|
2020-08-18 10:30:36 +00:00
|
|
|
const tableData = tabData;
|
2023-03-11 07:01:39 +00:00
|
|
|
expect(`\"${tableData}\"`).to.equal(valueToTest);
|
2020-08-18 10:30:36 +00:00
|
|
|
});
|
2020-06-10 12:25:16 +00:00
|
|
|
});
|
|
|
|
|
|
2023-03-11 07:01:39 +00:00
|
|
|
Cypress.Commands.add("ValidatePaginationInputDataV2", (valueToTest) => {
|
2022-07-14 07:02:35 +00:00
|
|
|
cy.isSelectRow(0);
|
2023-03-11 07:01:39 +00:00
|
|
|
cy.readTableV2dataPublish("0", "5").then((tabData) => {
|
2022-07-14 07:02:35 +00:00
|
|
|
const tableData = tabData;
|
2023-03-11 07:01:39 +00:00
|
|
|
expect(`\"${tableData}\"`).to.equal(valueToTest);
|
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
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-22 06:01:25 +00:00
|
|
|
Cypress.Commands.add("assertPageSave", (validateSavedState = true) => {
|
|
|
|
|
if (validateSavedState) {
|
|
|
|
|
cy.CheckForPageSaveError();
|
|
|
|
|
cy.get(commonlocators.saveStatusContainer).should("not.exist", {
|
|
|
|
|
timeout: 30000,
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-06-18 04:55:16 +00:00
|
|
|
//assertHelper.AssertNetworkStatus("@sucessSave", 200);
|
2020-08-07 06:56:47 +00:00
|
|
|
});
|
2021-05-18 11:47:43 +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
|
|
|
|
2022-01-07 09:57:45 +00:00
|
|
|
Cypress.Commands.add("updateMapType", (mapType) => {
|
|
|
|
|
// Command to change the map chart type if the property pane of the map chart widget is opened.
|
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(viewWidgetsPage.mapType).last().click({ force: true });
|
2022-01-07 09:57:45 +00:00
|
|
|
cy.get(commonlocators.dropdownmenu)
|
|
|
|
|
.children()
|
|
|
|
|
.contains(mapType)
|
|
|
|
|
.click({ force: true });
|
|
|
|
|
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(viewWidgetsPage.mapType).should("have.text", mapType);
|
2022-01-07 09:57:45 +00:00
|
|
|
});
|
|
|
|
|
|
2021-10-07 02:29:16 +00:00
|
|
|
Cypress.Commands.add("createJSObject", (JSCode) => {
|
|
|
|
|
cy.NavigateToJSEditor();
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
cy.get(".CodeMirror textarea")
|
|
|
|
|
.first()
|
|
|
|
|
.focus()
|
2021-10-26 12:53:58 +00:00
|
|
|
.type("{downarrow}{downarrow}{downarrow}{downarrow} ")
|
2021-10-07 02:29:16 +00:00
|
|
|
.type(JSCode);
|
|
|
|
|
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(jsEditorLocators.runButton).first().click();
|
2021-10-07 02:29:16 +00:00
|
|
|
});
|
2021-10-29 07:02:45 +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
|
|
|
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.get(welcomePage.roleDropdown).click();
|
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(welcomePage.roleDropdownOption).eq(1).click();
|
2023-05-25 18:21:56 +00:00
|
|
|
cy.get(welcomePage.submitButton).should("be.disabled");
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.get(welcomePage.useCaseDropdown).click();
|
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(welcomePage.useCaseDropdownOption).eq(1).click();
|
2023-05-25 18:21:56 +00:00
|
|
|
cy.get(welcomePage.submitButton).should("not.be.disabled");
|
|
|
|
|
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-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",
|
|
|
|
|
headers: {
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
followRedirect: false,
|
|
|
|
|
form: true,
|
|
|
|
|
body: {
|
|
|
|
|
name: uname,
|
|
|
|
|
email: uname,
|
|
|
|
|
password: pword,
|
|
|
|
|
},
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
expect(response.status).equal(302);
|
|
|
|
|
cy.log(response.body);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//Generate CRUD page methods: <Aishwarya>
|
2021-10-29 07:02:45 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("startInterceptRoutesForMySQL", () => {
|
2021-11-18 14:27:51 +00:00
|
|
|
//All stubbing - updating app id to current app id for Delete app by api call to be successfull:
|
|
|
|
|
|
|
|
|
|
cy.replaceApplicationIdForInterceptPages(
|
|
|
|
|
"cypress/fixtures/mySQL_PUT_replaceLayoutWithCRUD.json",
|
|
|
|
|
);
|
|
|
|
|
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("POST", "/api/v1/datasources/test", {
|
|
|
|
|
fixture: "testAction.json",
|
|
|
|
|
}).as("testDatasource");
|
|
|
|
|
cy.intercept("GET", "/api/v1/datasources/*/structure?ignoreCache=*", {
|
|
|
|
|
fixture: "mySQL_GET_selectTableDropdown.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("getDatasourceStructure");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/pages/crud-page/*", {
|
|
|
|
|
fixture: "mySQL_PUT_replaceLayoutWithCRUD.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("replaceLayoutWithCRUDPage");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("GET", "/api/v1/actions*", {
|
|
|
|
|
fixture: "mySQL_GET_Actions.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("getActions");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("POST", "/api/v1/actions/execute", {
|
|
|
|
|
fixture: "mySQL_POST_Execute.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("postExecute");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("POST", "/api/v1/pages/crud-page", {
|
|
|
|
|
fixture: "mySQL_PUT_replaceLayoutWithCRUD.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("replaceLayoutWithCRUDPage");
|
2021-10-29 07:02:45 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("startInterceptRoutesForMongo", () => {
|
|
|
|
|
//All stubbing
|
2021-11-18 14:27:51 +00:00
|
|
|
cy.replaceApplicationIdForInterceptPages(
|
|
|
|
|
"cypress/fixtures/mongo_PUT_replaceLayoutWithCRUD.json",
|
|
|
|
|
);
|
|
|
|
|
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("POST", "/api/v1/datasources/test", {
|
|
|
|
|
fixture: "testAction.json",
|
|
|
|
|
}).as("testDatasource");
|
|
|
|
|
cy.intercept("GET", "/api/v1/datasources/*/structure?ignoreCache=*", {
|
|
|
|
|
fixture: "mongo_GET_selectTableDropdown.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("getDatasourceStructure");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("PUT", "/api/v1/pages/crud-page/*", {
|
|
|
|
|
fixture: "mongo_PUT_replaceLayoutWithCRUD.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("replaceLayoutWithCRUDPage");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("GET", "/api/v1/actions*", {
|
|
|
|
|
fixture: "mongo_GET_Actions.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("getActions");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("POST", "/api/v1/actions/execute", {
|
|
|
|
|
fixture: "mongo_POST_Actions.json",
|
2021-11-18 14:27:51 +00:00
|
|
|
}).as("postExecute");
|
2021-10-29 07:02:45 +00:00
|
|
|
cy.intercept("POST", "/api/v1/pages/crud-page", {
|
|
|
|
|
fixture: "mongo_PUT_replaceLayoutWithCRUD.json",
|
|
|
|
|
}).as("post_replaceLayoutCRUDStub");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
});
|
|
|
|
|
|
2021-11-18 14:27:51 +00:00
|
|
|
Cypress.Commands.add("replaceApplicationIdForInterceptPages", (fixtureFile) => {
|
|
|
|
|
let currentAppId, currentURL;
|
|
|
|
|
cy.readFile(fixtureFile, (err, data) => {
|
|
|
|
|
if (err) {
|
|
|
|
|
return console.error(err);
|
|
|
|
|
}
|
|
|
|
|
}).then((data) => {
|
|
|
|
|
cy.url().then((url) => {
|
|
|
|
|
currentURL = url;
|
|
|
|
|
const myRegexp = /applications(.*)/;
|
|
|
|
|
const match = myRegexp.exec(currentURL);
|
|
|
|
|
cy.log(currentURL + "currentURL from intercept is");
|
|
|
|
|
currentAppId = match ? match[1].split("/")[1] : null;
|
|
|
|
|
data.data.page.applicationId = currentAppId;
|
|
|
|
|
cy.writeFile(fixtureFile, JSON.stringify(data));
|
|
|
|
|
});
|
2021-10-29 09:10:30 +00:00
|
|
|
});
|
|
|
|
|
});
|
2021-11-18 14:27:51 +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);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
2021-11-26 10:47:53 +00:00
|
|
|
|
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);
|
|
|
|
|
// cy.xpath("//p[text()='" + fieldName + "']/following-sibling::div//div[@class='CodeMirror-code']//span/span").should((fieldValue) => {
|
|
|
|
|
// textF = fieldValue.innerText
|
|
|
|
|
// fieldValue.innerText = ""
|
|
|
|
|
// }).then(() => {
|
|
|
|
|
// cy.log("current field value is : '" + textF + "'")
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("checkCodeInputValue", (selector) => {
|
|
|
|
|
let inputVal = "";
|
|
|
|
|
cy.get(selector).then(($field) => {
|
|
|
|
|
cy.wrap($field)
|
|
|
|
|
.find(".CodeMirror-code span")
|
|
|
|
|
.first()
|
|
|
|
|
.invoke("text")
|
|
|
|
|
.then((text1) => {
|
|
|
|
|
inputVal = text1;
|
|
|
|
|
cy.log("checkCodeInputValue is:::: " + inputVal);
|
|
|
|
|
// const input = ins[0].CodeMirror;
|
|
|
|
|
// inputVal = input.getValue();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// to be chained with another cy command.
|
|
|
|
|
return cy.wrap(inputVal);
|
|
|
|
|
});
|
2021-11-26 10:47:53 +00:00
|
|
|
});
|
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
|
2021-12-29 05:41:30 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"actionContextMenuByEntityName",
|
2022-03-23 05:33:06 +00:00
|
|
|
(entityNameinLeftSidebar, action = "Delete", subAction) => {
|
2022-01-06 15:06:17 +00:00
|
|
|
cy.wait(2000);
|
2022-03-13 17:21:04 +00:00
|
|
|
// cy.get(
|
|
|
|
|
// commonlocators.entitySearchResult
|
|
|
|
|
// .concat(entityNameinLeftSidebar)
|
|
|
|
|
// .concat("')"),
|
|
|
|
|
// )
|
|
|
|
|
// .parents(commonlocators.entityItem)
|
|
|
|
|
// .first()
|
|
|
|
|
// .trigger("mouseover")
|
|
|
|
|
// .find(commonlocators.entityContextMenu)
|
|
|
|
|
// .last()
|
|
|
|
|
// .click({ force: true });
|
|
|
|
|
|
|
|
|
|
cy.xpath(
|
|
|
|
|
"//div[text()='" +
|
|
|
|
|
entityNameinLeftSidebar +
|
|
|
|
|
"']/ancestor::div[1]/following-sibling::div//div[contains(@class, 'entity-context-menu-icon')]",
|
2021-12-29 05:41:30 +00:00
|
|
|
)
|
2022-01-29 07:26:19 +00:00
|
|
|
.last()
|
2021-12-29 05:41:30 +00:00
|
|
|
.click({ force: true });
|
2021-11-26 10:47:53 +00:00
|
|
|
|
2021-12-29 05:41:30 +00:00
|
|
|
cy.xpath(
|
|
|
|
|
"//div[text()='" +
|
|
|
|
|
action +
|
2022-03-19 15:56:53 +00:00
|
|
|
"']/ancestor::a[contains(@class, 'single-select')]",
|
2021-12-29 05:41:30 +00:00
|
|
|
)
|
|
|
|
|
.click({ force: true })
|
|
|
|
|
.wait(500);
|
2021-12-02 05:20:44 +00:00
|
|
|
|
2022-03-23 05:33:06 +00:00
|
|
|
if (subAction) {
|
|
|
|
|
cy.xpath(
|
|
|
|
|
"//div[text()='" +
|
|
|
|
|
subAction +
|
|
|
|
|
"']/parent::a[contains(@class, 'single-select')]",
|
|
|
|
|
)
|
|
|
|
|
.click({ force: true })
|
|
|
|
|
.wait(500);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-05 05:41:15 +00:00
|
|
|
if (action === "Delete")
|
2021-12-29 05:41:30 +00:00
|
|
|
cy.xpath("//div[text()='" + entityNameinLeftSidebar + "']").should(
|
|
|
|
|
"not.exist",
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
2021-12-02 05:20:44 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("selectEntityByName", (entityNameinLeftSidebar) => {
|
|
|
|
|
cy.xpath(
|
|
|
|
|
"//div[contains(@class, 't--entity-name')][text()='" +
|
2021-12-03 06:24:08 +00:00
|
|
|
entityNameinLeftSidebar +
|
|
|
|
|
"']",
|
2021-12-02 05:20:44 +00:00
|
|
|
)
|
2021-12-21 09:37:30 +00:00
|
|
|
.last()
|
2021-12-02 05:20:44 +00:00
|
|
|
.click({ force: true })
|
|
|
|
|
.wait(2000);
|
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
|
|
|
//cy.wait(3000); //Increasing wait time to evaluate non-undefined values
|
|
|
|
|
// if (isDynamicValue) {
|
|
|
|
|
// const val = cy
|
|
|
|
|
// .get(commonlocators.evaluatedCurrentValue)
|
|
|
|
|
// .first()
|
|
|
|
|
// .should("be.visible")
|
|
|
|
|
// .invoke("text");
|
|
|
|
|
// if (toValidate) expect(val).to.eq(currentValue);
|
|
|
|
|
// }
|
|
|
|
|
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-02 05:20:44 +00:00
|
|
|
Cypress.Commands.add("renameWithInPane", (renameVal) => {
|
|
|
|
|
cy.get(apiwidget.ApiName).click({ force: true });
|
|
|
|
|
cy.get(apiwidget.apiTxt)
|
|
|
|
|
.clear()
|
|
|
|
|
.type(renameVal, { force: true })
|
|
|
|
|
.should("have.value", renameVal)
|
|
|
|
|
.blur();
|
|
|
|
|
});
|
|
|
|
|
|
2021-12-10 07:23:12 +00:00
|
|
|
Cypress.Commands.add("getEntityName", () => {
|
2021-12-13 05:44:01 +00:00
|
|
|
let entityName = cy.get(apiwidget.ApiName).invoke("text");
|
2021-12-10 07:23:12 +00:00
|
|
|
return entityName;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("VerifyErrorMsgAbsence", (errorMsgToVerifyAbsence) => {
|
2021-12-02 05:20:44 +00:00
|
|
|
// Give this element 10 seconds to appear
|
2021-12-21 09:37:30 +00:00
|
|
|
//cy.wait(10000)
|
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) => {
|
|
|
|
|
// Give this element 10 seconds to appear
|
|
|
|
|
//cy.wait(10000)
|
|
|
|
|
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) => {
|
|
|
|
|
cy.get(queryLocators.settings).click();
|
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);
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.xpath(queryLocators.query).click();
|
2021-12-02 05:20:44 +00:00
|
|
|
});
|
|
|
|
|
|
2022-02-24 03:11:35 +00:00
|
|
|
//Usage: If in need to type {enter} {esc} etc then .text('sometext').type('{enter}')
|
|
|
|
|
Cypress.Commands.add("text", { prevSubject: true }, (subject, text) => {
|
|
|
|
|
subject.val(text);
|
|
|
|
|
return cy.wrap(subject);
|
|
|
|
|
});
|
|
|
|
|
|
2021-12-21 09:37:30 +00:00
|
|
|
//Not Used!
|
|
|
|
|
Cypress.Commands.add("VerifyNoDataDisplayAbsence", () => {
|
|
|
|
|
cy.xpath("//div[text()='No data to display']", { timeout: 0 }).should(
|
|
|
|
|
"not.exist",
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Cypress.Commands.add('isNotInViewport', element => {
|
|
|
|
|
// cy.xpath(element).then($el => {
|
|
|
|
|
// const bottom = Cypress.$(cy.state('window')).height()
|
|
|
|
|
// const rect = $el[0].getBoundingClientRect()
|
|
|
|
|
|
|
|
|
|
// expect(rect.top).to.be.greaterThan(bottom)
|
|
|
|
|
// expect(rect.bottom).to.be.greaterThan(bottom)
|
|
|
|
|
// expect(rect.top).to.be.greaterThan(bottom)
|
|
|
|
|
// expect(rect.bottom).to.be.greaterThan(bottom)
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("isNotInViewport", (element) => {
|
|
|
|
|
cy.xpath(element).should(($el) => {
|
|
|
|
|
const bottom = Cypress.$(cy.state("window")).height();
|
|
|
|
|
const right = Cypress.$(cy.state("window")).width();
|
|
|
|
|
const rect = $el[0].getBoundingClientRect();
|
|
|
|
|
|
|
|
|
|
expect(rect).to.satisfy(
|
|
|
|
|
(rect) =>
|
|
|
|
|
rect.top < 0 || rect.top > bottom || rect.left < 0 || rect.left > right,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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("CheckAndUnfoldEntityItem", (item) => {
|
2023-06-15 13:21:11 +00:00
|
|
|
entityExplorer.ExpandCollapseEntity(item);
|
2022-03-11 15:47:42 +00:00
|
|
|
});
|
|
|
|
|
|
2021-11-26 10:47:53 +00:00
|
|
|
// Cypress.Commands.overwrite("type", (originalFn, element, text, options) => {
|
|
|
|
|
// const clearedText = '{selectall}{backspace}'+`${text}`;
|
|
|
|
|
// return originalFn(element, clearedText, options);
|
|
|
|
|
// });
|
2022-04-12 10:01:22 +00:00
|
|
|
|
2021-12-24 12:17:22 +00:00
|
|
|
addMatchImageSnapshotCommand({
|
2022-01-12 04:46:20 +00:00
|
|
|
failureThreshold: 0.1, // threshold for entire image
|
2021-12-24 12:17:22 +00:00
|
|
|
failureThresholdType: "percent",
|
|
|
|
|
});
|
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");
|
|
|
|
|
|
|
|
|
|
cy.openPropertyPane(widgetName);
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
// Set the label width to labelWidth cols
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(
|
|
|
|
|
`[class*='t--property-control-width'] .ads-v2-input__input-section-input`,
|
|
|
|
|
)
|
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
|
|
|
.first()
|
|
|
|
|
.focus()
|
|
|
|
|
.clear()
|
|
|
|
|
.type(`${labelWidth}`);
|
|
|
|
|
cy.wait(300);
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.log(labelWidth).log("labelwidth");
|
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 the label width
|
2022-08-18 06:26:07 +00:00
|
|
|
cy.get(labelContainer)
|
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
|
|
|
.first()
|
|
|
|
|
.should("have.css", "width", `${parentColumnSpace * labelWidth}px`);
|
|
|
|
|
// Increase the label width
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(
|
|
|
|
|
`[class*='t--property-control-width'] .ads-v2-input__input-section-icon-end`,
|
|
|
|
|
)
|
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
|
|
|
.first()
|
|
|
|
|
.click();
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.log(parentColumnSpace).log("labelWidthIncreased");
|
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 the increased label width
|
|
|
|
|
cy.wait(300);
|
2022-08-18 06:26:07 +00:00
|
|
|
cy.get(labelContainer)
|
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
|
|
|
.first()
|
|
|
|
|
.should("have.css", "width", `${parentColumnSpace * (labelWidth + 1)}px`);
|
|
|
|
|
// Decrease the label width
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(
|
|
|
|
|
`[class*='t--property-control-width'] .ads-v2-input__input-section-icon-start`,
|
|
|
|
|
)
|
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
|
|
|
.last()
|
|
|
|
|
.click();
|
|
|
|
|
cy.wait(300);
|
|
|
|
|
// Assert the decreased label width
|
2022-08-18 06:26:07 +00:00
|
|
|
cy.get(labelContainer)
|
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
|
|
|
.first()
|
|
|
|
|
.should("have.css", "width", `${parentColumnSpace * labelWidth}px`);
|
|
|
|
|
|
|
|
|
|
// Clean up the widget
|
|
|
|
|
cy.deleteWidget(widgetSelector);
|
|
|
|
|
});
|
2022-04-12 10:01:22 +00:00
|
|
|
let LOCAL_STORAGE_MEMORY = {};
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("saveLocalStorageCache", () => {
|
|
|
|
|
Object.keys(localStorage).forEach((key) => {
|
|
|
|
|
LOCAL_STORAGE_MEMORY[key] = localStorage[key];
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("restoreLocalStorageCache", () => {
|
|
|
|
|
Object.keys(LOCAL_STORAGE_MEMORY).forEach((key) => {
|
|
|
|
|
localStorage.setItem(key, LOCAL_STORAGE_MEMORY[key]);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
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("StopAllContainer", (path) => {
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: path,
|
|
|
|
|
qs: {
|
|
|
|
|
cmd: "docker kill $(docker ps -q)",
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
expect(res.status).equal(200);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-07 10:15:23 +00:00
|
|
|
Cypress.Commands.add("StartContainer", (path, containerName) => {
|
2022-08-28 06:28:01 +00:00
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: path,
|
|
|
|
|
qs: {
|
2023-02-07 10:15:23 +00:00
|
|
|
cmd: "docker restart " + containerName,
|
2022-08-28 06:28:01 +00:00
|
|
|
},
|
|
|
|
|
}).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("GetCWD", (path) => {
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: path,
|
|
|
|
|
qs: {
|
|
|
|
|
cmd: "pwd",
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
cy.log(res.body.stdout);
|
|
|
|
|
expect(res.status).equal(200);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2022-04-12 10:01:22 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"typeTab",
|
|
|
|
|
{ prevSubject: "element" },
|
|
|
|
|
(subject, shiftKey, ctrlKey) => {
|
|
|
|
|
cy.wrap(subject).trigger("keydown", {
|
|
|
|
|
keyCode: 9,
|
|
|
|
|
which: 9,
|
|
|
|
|
shiftKey: shiftKey,
|
|
|
|
|
ctrlKey: ctrlKey,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
2022-09-30 13:41:04 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("CreatePage", () => {
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(pages.AddPage).first().click();
|
|
|
|
|
cy.xpath("//span[text()='New blank page']/parent::div").click();
|
2022-09-30 13:41:04 +00:00
|
|
|
});
|
2022-10-19 14:13:51 +00:00
|
|
|
|
|
|
|
|
Cypress.Commands.add("GenerateCRUD", () => {
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(pages.AddPage).first().click();
|
|
|
|
|
cy.xpath("//span[text()='Generate page with data']/parent::div").click();
|
2022-10-19 14:13:51 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("AddPageFromTemplate", () => {
|
2023-05-19 18:37:06 +00:00
|
|
|
cy.get(pages.AddPage).first().click();
|
|
|
|
|
cy.xpath("//span[text()='Add page from template']/parent::div").click();
|
2022-10-19 14:13:51 +00:00
|
|
|
});
|
2022-12-16 05:15:25 +00:00
|
|
|
|
2022-12-22 08:30:49 +00:00
|
|
|
Cypress.Commands.add(`verifyCallCount`, (alias, expectedNumberOfCalls) => {
|
|
|
|
|
cy.wait(alias);
|
|
|
|
|
cy.get(`${alias}.all`).should("have.length", expectedNumberOfCalls);
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-14 16:07:31 +00:00
|
|
|
Cypress.Commands.add(
|
|
|
|
|
"RenameWidgetFromPropertyPane",
|
|
|
|
|
(widgetType, oldName, newName) => {
|
|
|
|
|
cy.openPropertyPaneByWidgetName(oldName, widgetType);
|
|
|
|
|
cy.get(".t--property-pane-title").click({ force: true });
|
|
|
|
|
cy.get(".t--property-pane-title")
|
|
|
|
|
.type(newName, { delay: 300 })
|
|
|
|
|
.type("{enter}");
|
|
|
|
|
cy.wait("@updateWidgetName").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
200,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2023-02-07 10:15:23 +00:00
|
|
|
Cypress.Commands.add("execute", (url, command) => {
|
|
|
|
|
cy.request({
|
|
|
|
|
method: "GET",
|
|
|
|
|
url: url,
|
|
|
|
|
qs: {
|
|
|
|
|
cmd: command,
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
cy.log(res.body.stdout, res.body.error);
|
|
|
|
|
expect(res.status).equal(200);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("RemoveMultiSelectItems", (dropdownOptions) => {
|
|
|
|
|
dropdownOptions.forEach(($each) => {
|
|
|
|
|
cy.get(`.rc-select-selection-overflow-item [title=${$each}] .remove-icon`)
|
|
|
|
|
.eq(0)
|
|
|
|
|
.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", () => {
|
|
|
|
|
onboarding.closeIntroModal();
|
|
|
|
|
onboarding.skipSignposting();
|
|
|
|
|
});
|