2019-11-13 07:00:25 +00:00
|
|
|
/**
|
2019-02-10 13:06:05 +00:00
|
|
|
* Widget are responsible for accepting the abstraction layer inputs, interpretting them into rederable props and
|
|
|
|
|
* spawing components based on those props
|
|
|
|
|
* Widgets are also responsible for dispatching actions and updating the state tree
|
|
|
|
|
*/
|
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
|
|
|
import type { BatchPropertyUpdatePayload } from "actions/controlActions";
|
|
|
|
|
import type { EditorContextType } from "components/editorComponents/EditorContextProvider";
|
|
|
|
|
import { EditorContext } from "components/editorComponents/EditorContextProvider";
|
|
|
|
|
import type { ExecuteTriggerPayload } from "constants/AppsmithActionConstants/ActionConstants";
|
|
|
|
|
import type { PropertyPaneConfig } from "constants/PropertyControlConstants";
|
|
|
|
|
import type {
|
2021-06-21 11:09:51 +00:00
|
|
|
CSSUnit,
|
|
|
|
|
PositionType,
|
2019-03-18 15:10:30 +00:00
|
|
|
RenderMode,
|
2023-07-22 05:57:18 +00:00
|
|
|
WidgetTags,
|
2021-06-21 11:09:51 +00:00
|
|
|
WidgetType,
|
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
|
|
|
} from "constants/WidgetConstants";
|
2023-09-11 15:55:11 +00:00
|
|
|
import { RenderModes } from "constants/WidgetConstants";
|
2024-08-06 14:52:22 +00:00
|
|
|
import { ENTITY_TYPE } from "ee/entities/AppsmithConsole/utils";
|
2023-09-06 12:15:04 +00:00
|
|
|
import type { SetterConfig, Stylesheet } from "entities/AppTheming";
|
2024-10-28 11:55:42 +00:00
|
|
|
import type { Context, ReactNode, RefObject, SVGProps } from "react";
|
2023-09-11 15:55:11 +00:00
|
|
|
import { Component } from "react";
|
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
|
|
|
import type {
|
2023-03-04 07:25:54 +00:00
|
|
|
ModifyMetaWidgetPayload,
|
|
|
|
|
UpdateMetaWidgetPropertyPayload,
|
|
|
|
|
} from "reducers/entityReducers/metaWidgetsReducer";
|
2024-05-07 15:12:00 +00:00
|
|
|
import { SelectionRequestType } from "sagas/WidgetSelectUtils";
|
2019-11-04 14:22:50 +00:00
|
|
|
import shallowequal from "shallowequal";
|
2023-03-04 07:25:54 +00:00
|
|
|
import AppsmithConsole from "utils/AppsmithConsole";
|
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
|
|
|
import type {
|
2021-06-21 11:09:51 +00:00
|
|
|
DataTreeEvaluationProps,
|
2020-11-12 11:23:32 +00:00
|
|
|
WidgetDynamicPathListProps,
|
2021-06-21 11:09:51 +00:00
|
|
|
} from "utils/DynamicBindingUtils";
|
2023-09-06 12:15:04 +00:00
|
|
|
import type { DerivedPropertiesMap } from "WidgetProvider/factory";
|
|
|
|
|
import type {
|
2023-10-19 20:27:40 +00:00
|
|
|
AnvilConfig,
|
2023-09-06 12:15:04 +00:00
|
|
|
AutoLayoutConfig,
|
|
|
|
|
CanvasWidgetStructure,
|
|
|
|
|
FlattenedWidgetProps,
|
|
|
|
|
WidgetBaseConfiguration,
|
|
|
|
|
WidgetDefaultProps,
|
|
|
|
|
WidgetMethods,
|
|
|
|
|
} from "../WidgetProvider/constants";
|
2024-08-06 14:52:22 +00:00
|
|
|
import type { WidgetEntity } from "ee/entities/DataTree/types";
|
2023-09-06 12:15:04 +00:00
|
|
|
import type { AutocompletionDefinitions } from "../WidgetProvider/constants";
|
2023-09-11 15:55:11 +00:00
|
|
|
import type {
|
|
|
|
|
FlexVerticalAlignment,
|
|
|
|
|
LayoutDirection,
|
|
|
|
|
ResponsiveBehavior,
|
2023-10-02 19:41:05 +00:00
|
|
|
} from "layoutSystems/common/utils/constants";
|
2024-08-06 14:52:22 +00:00
|
|
|
import type { FeatureFlag } from "ee/entities/FeatureFlag";
|
2023-08-22 11:27:02 +00:00
|
|
|
import store from "store";
|
2024-08-06 14:52:22 +00:00
|
|
|
import { selectFeatureFlags } from "ee/selectors/featureFlagsSelectors";
|
2023-09-11 15:55:11 +00:00
|
|
|
import type { WidgetFeatures } from "utils/WidgetFeatures";
|
2023-10-04 08:54:16 +00:00
|
|
|
import { LayoutSystemTypes } from "layoutSystems/types";
|
2025-02-18 10:42:05 +00:00
|
|
|
import type { CanvasWidgetsReduxState } from "ee/reducers/entityReducers/canvasWidgetsReducer";
|
2024-01-24 16:25:08 +00:00
|
|
|
import type {
|
|
|
|
|
CopiedWidgetData,
|
|
|
|
|
PasteDestinationInfo,
|
|
|
|
|
PastePayload,
|
|
|
|
|
} from "layoutSystems/anvil/utils/paste/types";
|
|
|
|
|
import { type CallEffect, call } from "redux-saga/effects";
|
2020-03-06 09:45:21 +00:00
|
|
|
|
2019-11-13 07:00:25 +00:00
|
|
|
/***
|
|
|
|
|
* BaseWidget
|
|
|
|
|
*
|
|
|
|
|
* The abstract class which is extended/implemented by all widgets.
|
|
|
|
|
* Widgets must adhere to the abstractions provided by BaseWidget.
|
|
|
|
|
*
|
|
|
|
|
* Do not:
|
|
|
|
|
* 1) Use the context directly in the widgets
|
|
|
|
|
* 2) Update or access the dsl in the widgets
|
|
|
|
|
* 3) Call actions in widgets or connect the widgets to the entity reducers
|
|
|
|
|
*
|
|
|
|
|
*/
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
|
2023-02-14 16:07:31 +00:00
|
|
|
const REFERENCE_KEY = "$$refs$$";
|
|
|
|
|
|
2019-02-11 18:22:23 +00:00
|
|
|
abstract class BaseWidget<
|
2019-10-03 16:24:29 +00:00
|
|
|
T extends WidgetProps,
|
2023-02-14 16:07:31 +00:00
|
|
|
K extends WidgetState,
|
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
|
|
|
TCache = unknown,
|
2019-04-02 16:12:08 +00:00
|
|
|
> extends Component<T, K> {
|
2019-11-13 07:00:25 +00:00
|
|
|
static contextType = EditorContext;
|
2023-09-06 12:15:04 +00:00
|
|
|
|
2023-02-14 16:07:31 +00:00
|
|
|
context!: React.ContextType<Context<EditorContextType<TCache>>>;
|
2019-11-13 07:00:25 +00:00
|
|
|
|
2023-09-06 12:15:04 +00:00
|
|
|
static type = "BASE_WIDGET";
|
|
|
|
|
|
|
|
|
|
static getDefaults(): WidgetDefaultProps {
|
|
|
|
|
return {} as WidgetDefaultProps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getConfig(): WidgetBaseConfiguration {
|
|
|
|
|
return {
|
|
|
|
|
name: "baseWidget",
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getFeatures(): WidgetFeatures | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getMethods(): WidgetMethods {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getAutoLayoutConfig(): AutoLayoutConfig | null {
|
|
|
|
|
return null;
|
2023-10-19 20:27:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getAnvilConfig(): AnvilConfig | null {
|
|
|
|
|
return null;
|
2023-09-06 12:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getSetterConfig(): SetterConfig | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-24 22:05:04 +00:00
|
|
|
static getPropertyPaneConfig(): PropertyPaneConfig[] {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2019-11-19 12:44:58 +00:00
|
|
|
|
2022-09-29 05:24:49 +00:00
|
|
|
static getPropertyPaneContentConfig(): PropertyPaneConfig[] {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getPropertyPaneStyleConfig(): PropertyPaneConfig[] {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-17 09:28:26 +00:00
|
|
|
static getDerivedPropertiesMap(): DerivedPropertiesMap {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2021-06-18 07:42:57 +00:00
|
|
|
static getDefaultPropertiesMap(): Record<string, any> {
|
2020-04-17 16:15:09 +00:00
|
|
|
return {};
|
|
|
|
|
}
|
2023-01-28 02:17:06 +00:00
|
|
|
|
2023-10-27 12:48:42 +00:00
|
|
|
static getDependencyMap(): Record<string, string[]> {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-04 10:16:08 +00:00
|
|
|
// TODO Find a way to enforce this, (dont let it be set)
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2020-04-21 07:54:23 +00:00
|
|
|
static getMetaPropertiesMap(): Record<string, any> {
|
2020-04-17 16:15:09 +00:00
|
|
|
return {};
|
2020-02-18 10:41:52 +00:00
|
|
|
}
|
|
|
|
|
|
2022-11-28 04:44:31 +00:00
|
|
|
static getStylesheetConfig(): Stylesheet {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-14 06:27:49 +00:00
|
|
|
static getAutocompleteDefinitions(): AutocompletionDefinitions {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-24 16:25:08 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
|
|
|
static pasteOperationChecks(
|
|
|
|
|
allWidgets: CanvasWidgetsReduxState, // All widgets
|
|
|
|
|
oldWidget: FlattenedWidgetProps, // Original copied widget
|
|
|
|
|
newWidget: FlattenedWidgetProps, // Newly generated widget
|
|
|
|
|
widgetIdMap: Record<string, string>, // Map of oldWidgetId -> newWidgetId
|
|
|
|
|
): FlattenedWidgetProps | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
|
|
|
static *performPasteOperation(
|
|
|
|
|
allWidgets: CanvasWidgetsReduxState, // All widgets
|
|
|
|
|
copiedWidgets: CopiedWidgetData[], // Original copied widgets
|
|
|
|
|
destinationInfo: PasteDestinationInfo, // Destination info of copied widgets
|
|
|
|
|
widgetIdMap: Record<string, string>, // Map of oldWidgetId -> newWidgetId
|
|
|
|
|
reverseWidgetIdMap: Record<string, string>, // Map of newWidgetId -> oldWidgetId
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2024-01-24 16:25:08 +00:00
|
|
|
): Generator<CallEffect<PastePayload>, PastePayload, any> {
|
|
|
|
|
const res: PastePayload = yield call(function* () {
|
|
|
|
|
return { widgets: allWidgets, widgetIdMap, reverseWidgetIdMap };
|
|
|
|
|
});
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2024-01-24 16:25:08 +00:00
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-13 05:40:08 +00:00
|
|
|
/**
|
|
|
|
|
* getLoadingProperties returns a list of regexp's used to specify bindingPaths,
|
|
|
|
|
* which can set the isLoading prop of the widget.
|
|
|
|
|
* When:
|
|
|
|
|
* 1. the path is bound to an action (API/Query)
|
|
|
|
|
* 2. the action is currently in-progress
|
|
|
|
|
*
|
|
|
|
|
* if undefined, all paths can set the isLoading state
|
|
|
|
|
* if empty array, no paths can set the isLoading state
|
|
|
|
|
*/
|
|
|
|
|
static getLoadingProperties(): Array<RegExp> | undefined {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-13 07:00:25 +00:00
|
|
|
/**
|
|
|
|
|
* Widgets can execute actions using this `executeAction` method.
|
|
|
|
|
* Triggers may be specific to the widget
|
|
|
|
|
*/
|
2021-09-15 05:11:13 +00:00
|
|
|
executeAction(actionPayload: ExecuteTriggerPayload): void {
|
2019-10-03 16:24:29 +00:00
|
|
|
const { executeAction } = this.context;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2021-09-15 05:11:13 +00:00
|
|
|
executeAction &&
|
|
|
|
|
executeAction({
|
|
|
|
|
...actionPayload,
|
|
|
|
|
source: {
|
|
|
|
|
id: this.props.widgetId,
|
|
|
|
|
name: this.props.widgetName,
|
|
|
|
|
},
|
|
|
|
|
});
|
2021-04-23 13:50:55 +00:00
|
|
|
|
|
|
|
|
actionPayload.triggerPropertyName &&
|
|
|
|
|
AppsmithConsole.info({
|
2024-12-10 14:43:40 +00:00
|
|
|
text: `Event ${actionPayload.triggerPropertyName} fired`,
|
2021-04-23 13:50:55 +00:00
|
|
|
source: {
|
|
|
|
|
type: ENTITY_TYPE.WIDGET,
|
|
|
|
|
id: this.props.widgetId,
|
|
|
|
|
name: this.props.widgetName,
|
|
|
|
|
},
|
|
|
|
|
});
|
2019-10-03 16:24:29 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-09 11:39:26 +00:00
|
|
|
disableDrag(disable: boolean) {
|
|
|
|
|
const { disableDrag } = this.context;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2020-01-09 11:39:26 +00:00
|
|
|
disableDrag && disable !== undefined && disableDrag(disable);
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-15 11:42:11 +00:00
|
|
|
updateWidget(
|
|
|
|
|
operationName: string,
|
|
|
|
|
widgetId: string,
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2020-04-15 11:42:11 +00:00
|
|
|
widgetProperties: any,
|
|
|
|
|
): void {
|
|
|
|
|
const { updateWidget } = this.context;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2020-04-15 11:42:11 +00:00
|
|
|
updateWidget && updateWidget(operationName, widgetId, widgetProperties);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-16 10:29:08 +00:00
|
|
|
deleteWidgetProperty(propertyPaths: string[]): void {
|
|
|
|
|
const { deleteWidgetProperty } = this.context;
|
|
|
|
|
const { widgetId } = this.props;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2021-02-16 10:29:08 +00:00
|
|
|
if (deleteWidgetProperty && widgetId) {
|
|
|
|
|
deleteWidgetProperty(widgetId, propertyPaths);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-21 07:55:56 +00:00
|
|
|
batchUpdateWidgetProperty(
|
|
|
|
|
updates: BatchPropertyUpdatePayload,
|
|
|
|
|
shouldReplay = true,
|
|
|
|
|
): void {
|
2021-02-16 10:29:08 +00:00
|
|
|
const { batchUpdateWidgetProperty } = this.context;
|
|
|
|
|
const { widgetId } = this.props;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2021-02-16 10:29:08 +00:00
|
|
|
if (batchUpdateWidgetProperty && widgetId) {
|
2021-09-21 07:55:56 +00:00
|
|
|
batchUpdateWidgetProperty(widgetId, updates, shouldReplay);
|
2021-02-16 10:29:08 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2020-02-11 10:13:06 +00:00
|
|
|
updateWidgetProperty(propertyName: string, propertyValue: any): void {
|
2021-03-09 05:30:57 +00:00
|
|
|
this.batchUpdateWidgetProperty({
|
|
|
|
|
modify: { [propertyName]: propertyValue },
|
|
|
|
|
});
|
2019-11-07 11:17:53 +00:00
|
|
|
}
|
|
|
|
|
|
2020-03-06 09:45:21 +00:00
|
|
|
resetChildrenMetaProperty(widgetId: string) {
|
|
|
|
|
const { resetChildrenMetaProperty } = this.context;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2022-05-25 09:46:14 +00:00
|
|
|
if (resetChildrenMetaProperty) resetChildrenMetaProperty(widgetId);
|
2020-03-06 09:45:21 +00:00
|
|
|
}
|
|
|
|
|
|
2023-01-28 02:17:06 +00:00
|
|
|
selectWidgetRequest = (
|
|
|
|
|
selectionRequestType: SelectionRequestType,
|
|
|
|
|
payload?: string[],
|
|
|
|
|
) => {
|
|
|
|
|
const { selectWidgetRequest } = this.context;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2023-01-28 02:17:06 +00:00
|
|
|
if (selectWidgetRequest) {
|
|
|
|
|
selectWidgetRequest(selectionRequestType, payload);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-26 04:00:57 +00:00
|
|
|
unfocusWidget = () => {
|
|
|
|
|
const { unfocusWidget } = this.context;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2024-01-26 04:00:57 +00:00
|
|
|
if (unfocusWidget) {
|
|
|
|
|
unfocusWidget();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
2023-01-28 02:17:06 +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
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
2023-02-14 16:07:31 +00:00
|
|
|
componentDidUpdate(prevProps: T, prevState?: K) {
|
2023-02-08 11:23:39 +00:00
|
|
|
if (
|
|
|
|
|
!this.props.deferRender &&
|
|
|
|
|
this.props.deferRender !== prevProps.deferRender
|
|
|
|
|
) {
|
|
|
|
|
this.deferredComponentDidRender();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-27 09:02:11 +00:00
|
|
|
|
|
|
|
|
componentDidMount(): void {}
|
2023-01-28 02:17:06 +00:00
|
|
|
|
2023-02-08 11:23:39 +00:00
|
|
|
/*
|
|
|
|
|
* With lazy rendering, skeleton loaders are rendered for below fold widgets.
|
|
|
|
|
* This Appsmith widget life cycle method that gets called when the actual widget
|
|
|
|
|
* component renders instead of the skeleton loader.
|
|
|
|
|
*/
|
|
|
|
|
deferredComponentDidRender(): void {}
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
/* eslint-enable @typescript-eslint/no-empty-function */
|
|
|
|
|
|
2023-02-14 16:07:31 +00:00
|
|
|
modifyMetaWidgets = (modifications: ModifyMetaWidgetPayload) => {
|
|
|
|
|
this.context.modifyMetaWidgets?.({
|
|
|
|
|
...modifications,
|
|
|
|
|
creatorId: this.props.widgetId,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
deleteMetaWidgets = () => {
|
|
|
|
|
this.context?.deleteMetaWidgets?.({
|
|
|
|
|
creatorIds: [this.props.widgetId],
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
setWidgetCache = (data: TCache) => {
|
|
|
|
|
const key = this.getWidgetCacheKey();
|
|
|
|
|
|
|
|
|
|
if (key) {
|
|
|
|
|
this.context?.setWidgetCache?.(key, data);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
updateMetaWidgetProperty = (payload: UpdateMetaWidgetPropertyPayload) => {
|
|
|
|
|
const { widgetId } = this.props;
|
|
|
|
|
|
|
|
|
|
this.context.updateMetaWidgetProperty?.({
|
|
|
|
|
...payload,
|
|
|
|
|
creatorId: widgetId,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getWidgetCache = () => {
|
|
|
|
|
const key = this.getWidgetCacheKey();
|
|
|
|
|
|
|
|
|
|
if (key) {
|
|
|
|
|
return this.context?.getWidgetCache?.(key);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getWidgetCacheKey = () => {
|
|
|
|
|
return this.props.metaWidgetId || this.props.widgetId;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
setWidgetReferenceCache = <TRefCache,>(data: TRefCache) => {
|
|
|
|
|
const key = this.getWidgetCacheReferenceKey();
|
|
|
|
|
|
|
|
|
|
this.context?.setWidgetCache?.(`${key}.${REFERENCE_KEY}`, data);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getWidgetReferenceCache = <TRefCache,>() => {
|
|
|
|
|
const key = this.getWidgetCacheReferenceKey();
|
|
|
|
|
|
|
|
|
|
return this.context?.getWidgetCache?.<TRefCache>(`${key}.${REFERENCE_KEY}`);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getWidgetCacheReferenceKey = () => {
|
|
|
|
|
return this.props.referencedWidgetId || this.props.widgetId;
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-11 18:22:23 +00:00
|
|
|
render() {
|
2020-03-17 09:01:29 +00:00
|
|
|
return this.getWidgetView();
|
2019-02-11 18:22:23 +00:00
|
|
|
}
|
2019-02-10 13:06:05 +00:00
|
|
|
|
2023-07-04 14:12:00 +00:00
|
|
|
get isAutoLayoutMode() {
|
2023-10-04 08:54:16 +00:00
|
|
|
return this.props.layoutSystemType === LayoutSystemTypes.AUTO;
|
2023-07-04 14:12:00 +00:00
|
|
|
}
|
|
|
|
|
|
2023-06-01 17:26:05 +00:00
|
|
|
updateOneClickBindingOptionsVisibility(visibility: boolean) {
|
|
|
|
|
const { updateOneClickBindingOptionsVisibility } = this.context;
|
2024-09-18 16:35:28 +00:00
|
|
|
|
2024-05-07 15:12:00 +00:00
|
|
|
if (visibility) {
|
|
|
|
|
this.selectWidgetRequest(SelectionRequestType.One, [this.props.widgetId]);
|
|
|
|
|
}
|
2023-06-01 17:26:05 +00:00
|
|
|
|
|
|
|
|
updateOneClickBindingOptionsVisibility?.(visibility);
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-11 15:55:11 +00:00
|
|
|
abstract getWidgetView(): ReactNode;
|
2019-02-10 13:06:05 +00:00
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
// TODO(abhinav): Maybe make this a pure component to bailout from updating altogether.
|
|
|
|
|
// This would involve making all widgets which have "states" to not have states,
|
|
|
|
|
// as they're extending this one.
|
2020-04-13 08:24:13 +00:00
|
|
|
shouldComponentUpdate(nextProps: WidgetProps, nextState: WidgetState) {
|
|
|
|
|
return (
|
|
|
|
|
!shallowequal(nextProps, this.props) ||
|
|
|
|
|
!shallowequal(nextState, this.state)
|
|
|
|
|
);
|
2019-11-04 14:22:50 +00:00
|
|
|
}
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
// TODO(abhinav): These defaultProps seem unneccessary. Check it out.
|
|
|
|
|
static defaultProps: Partial<WidgetProps> | undefined = {
|
2019-09-19 22:25:37 +00:00
|
|
|
parentRowSpace: 1,
|
|
|
|
|
parentColumnSpace: 1,
|
2019-03-19 14:47:18 +00:00
|
|
|
topRow: 0,
|
2019-09-09 09:08:54 +00:00
|
|
|
leftColumn: 0,
|
2021-03-04 05:24:47 +00:00
|
|
|
isLoading: false,
|
|
|
|
|
renderMode: RenderModes.CANVAS,
|
2021-04-23 05:43:13 +00:00
|
|
|
dragDisabled: false,
|
|
|
|
|
dropDisabled: false,
|
|
|
|
|
isDeletable: true,
|
|
|
|
|
resizeDisabled: false,
|
|
|
|
|
disablePropertyPane: false,
|
2023-03-04 07:25:54 +00:00
|
|
|
isFlexChild: false,
|
|
|
|
|
isMobile: false,
|
2019-09-09 09:08:54 +00:00
|
|
|
};
|
2023-08-22 11:27:02 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Function to get a specific feature flag
|
|
|
|
|
* TODO(Keyur): To move the below function to the EditorContextProvider
|
|
|
|
|
*/
|
|
|
|
|
static getFeatureFlag(featureFlag: FeatureFlag) {
|
|
|
|
|
const state = store.getState();
|
|
|
|
|
const featureFlags = selectFeatureFlags(state);
|
|
|
|
|
|
|
|
|
|
return featureFlags[featureFlag];
|
|
|
|
|
}
|
2019-02-11 18:22:23 +00:00
|
|
|
}
|
2019-02-10 13:06:05 +00:00
|
|
|
|
2019-11-13 07:00:25 +00:00
|
|
|
export interface BaseStyle {
|
|
|
|
|
componentHeight: number;
|
|
|
|
|
componentWidth: number;
|
|
|
|
|
positionType: PositionType;
|
|
|
|
|
xPosition: number;
|
|
|
|
|
yPosition: number;
|
|
|
|
|
xPositionUnit: CSSUnit;
|
|
|
|
|
yPositionUnit: CSSUnit;
|
|
|
|
|
heightUnit?: CSSUnit;
|
|
|
|
|
widthUnit?: CSSUnit;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-12 13:06:05 +00:00
|
|
|
export type WidgetState = Record<string, unknown>;
|
2019-02-10 13:06:05 +00:00
|
|
|
|
2022-08-19 10:10:36 +00:00
|
|
|
export interface WidgetBuilder<
|
|
|
|
|
T extends CanvasWidgetStructure,
|
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
|
|
|
S extends WidgetState,
|
2022-08-19 10:10:36 +00:00
|
|
|
> {
|
2019-09-17 10:11:50 +00:00
|
|
|
buildWidget(widgetProps: T): JSX.Element;
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
export interface WidgetBaseProps {
|
2019-09-12 08:11:25 +00:00
|
|
|
widgetId: string;
|
2023-02-14 16:07:31 +00:00
|
|
|
metaWidgetId?: string;
|
2019-09-17 10:09:00 +00:00
|
|
|
type: WidgetType;
|
2019-09-12 08:11:25 +00:00
|
|
|
widgetName: string;
|
2021-03-04 05:24:47 +00:00
|
|
|
parentId?: string;
|
2020-03-27 09:02:11 +00:00
|
|
|
renderMode: RenderMode;
|
2021-02-23 12:35:09 +00:00
|
|
|
version: number;
|
2023-03-20 11:04:02 +00:00
|
|
|
childWidgets?: WidgetEntity[];
|
2023-02-14 16:07:31 +00:00
|
|
|
flattenedChildCanvasWidgets?: Record<string, FlattenedWidgetProps>;
|
|
|
|
|
metaWidgetChildrenStructure?: CanvasWidgetStructure[];
|
|
|
|
|
referencedWidgetId?: string;
|
|
|
|
|
requiresFlatWidgetChildren?: boolean;
|
|
|
|
|
hasMetaWidgets?: boolean;
|
|
|
|
|
creatorId?: string;
|
|
|
|
|
isMetaWidget?: boolean;
|
|
|
|
|
suppressAutoComplete?: boolean;
|
|
|
|
|
suppressDebuggerError?: boolean;
|
|
|
|
|
disallowCopy?: boolean;
|
|
|
|
|
/**
|
|
|
|
|
* The keys of the props mentioned here would always be picked from the canvas widget
|
|
|
|
|
* rather than the evaluated values in withWidgetProps HOC.
|
|
|
|
|
* */
|
|
|
|
|
additionalStaticProps?: string[];
|
2023-05-11 04:45:14 +00:00
|
|
|
mainCanvasWidth?: number;
|
2023-07-17 05:42:52 +00:00
|
|
|
isMobile?: boolean;
|
2023-10-02 19:41:05 +00:00
|
|
|
hasAutoHeight?: boolean;
|
|
|
|
|
hasAutoWidth?: boolean;
|
2023-10-06 06:59:02 +00:00
|
|
|
widgetSize?: { [key: string]: Record<string, string> };
|
2020-03-27 09:02:11 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-11 07:35:24 +00:00
|
|
|
export interface WidgetRowCols {
|
2019-08-29 11:22:09 +00:00
|
|
|
leftColumn: number;
|
|
|
|
|
rightColumn: number;
|
2020-03-27 09:02:11 +00:00
|
|
|
topRow: number;
|
|
|
|
|
bottomRow: number;
|
|
|
|
|
minHeight?: number; // Required to reduce the size of CanvasWidgets.
|
2023-03-04 07:25:54 +00:00
|
|
|
mobileLeftColumn?: number;
|
|
|
|
|
mobileRightColumn?: number;
|
|
|
|
|
mobileTopRow?: number;
|
|
|
|
|
mobileBottomRow?: number;
|
2022-11-23 09:48:23 +00:00
|
|
|
height?: number;
|
2023-10-11 07:35:24 +00:00
|
|
|
}
|
2020-03-27 09:02:11 +00:00
|
|
|
|
|
|
|
|
export interface WidgetPositionProps extends WidgetRowCols {
|
2019-08-29 11:22:09 +00:00
|
|
|
parentColumnSpace: number;
|
|
|
|
|
parentRowSpace: number;
|
2020-03-27 09:02:11 +00:00
|
|
|
// The detachFromLayout flag tells use about the following properties when enabled
|
|
|
|
|
// 1) Widget does not drag/resize
|
|
|
|
|
// 2) Widget CAN (but not neccessarily) be a dropTarget
|
|
|
|
|
// Examples: MainContainer is detached from layout,
|
|
|
|
|
// MODAL_WIDGET is also detached from layout.
|
|
|
|
|
detachFromLayout?: boolean;
|
2021-04-23 05:43:13 +00:00
|
|
|
noContainerOffset?: boolean; // This won't offset the child in parent
|
2023-03-04 07:25:54 +00:00
|
|
|
isFlexChild?: boolean;
|
|
|
|
|
direction?: LayoutDirection;
|
|
|
|
|
responsiveBehavior?: ResponsiveBehavior;
|
|
|
|
|
minWidth?: number; // Required to avoid squishing of widgets on mobile viewport.
|
|
|
|
|
isMobile?: boolean;
|
|
|
|
|
flexVerticalAlignment?: FlexVerticalAlignment;
|
2023-10-04 08:54:16 +00:00
|
|
|
layoutSystemType?: LayoutSystemTypes;
|
2023-04-07 13:51:35 +00:00
|
|
|
widthInPercentage?: number; // Stores the widget's width set by the user
|
|
|
|
|
mobileWidthInPercentage?: number;
|
2023-10-02 19:41:05 +00:00
|
|
|
width?: number;
|
2020-03-27 09:02:11 +00:00
|
|
|
}
|
|
|
|
|
|
2023-12-28 06:46:28 +00:00
|
|
|
export interface WidgetCanvasProps {
|
|
|
|
|
isWidgetSelected?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-18 07:42:57 +00:00
|
|
|
export const WIDGET_DISPLAY_PROPS = {
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isLoading: true,
|
|
|
|
|
isDisabled: true,
|
|
|
|
|
backgroundColor: true,
|
|
|
|
|
};
|
2024-12-10 14:43:40 +00:00
|
|
|
|
2023-07-06 11:45:15 +00:00
|
|
|
export interface WidgetError extends Error {
|
|
|
|
|
type: "property" | "configuration" | "other";
|
2023-07-27 10:43:37 +00:00
|
|
|
path?: string;
|
2023-07-06 11:45:15 +00:00
|
|
|
}
|
2024-12-10 14:43:40 +00:00
|
|
|
|
2023-07-06 11:45:15 +00:00
|
|
|
export interface WidgetErrorProps {
|
|
|
|
|
errors?: WidgetError[];
|
|
|
|
|
}
|
2021-06-18 07:42:57 +00:00
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
export interface WidgetDisplayProps {
|
|
|
|
|
//TODO(abhinav): Some of these props are mandatory
|
2019-09-13 10:45:49 +00:00
|
|
|
isVisible?: boolean;
|
2019-11-20 08:10:01 +00:00
|
|
|
isLoading: boolean;
|
2019-11-13 07:00:25 +00:00
|
|
|
isDisabled?: boolean;
|
2019-10-08 09:09:30 +00:00
|
|
|
backgroundColor?: string;
|
2021-12-14 07:55:58 +00:00
|
|
|
animateLoading?: boolean;
|
2023-02-08 11:23:39 +00:00
|
|
|
deferRender?: boolean;
|
|
|
|
|
wrapperRef?: RefObject<HTMLDivElement>;
|
2023-03-23 05:43:07 +00:00
|
|
|
selectedWidgetAncestry?: string[];
|
2023-10-20 03:00:46 +00:00
|
|
|
classList?: string[];
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
export interface WidgetDataProps
|
|
|
|
|
extends WidgetBaseProps,
|
2023-07-06 11:45:15 +00:00
|
|
|
WidgetErrorProps,
|
2020-03-27 09:02:11 +00:00
|
|
|
WidgetPositionProps,
|
2023-12-28 06:46:28 +00:00
|
|
|
WidgetDisplayProps,
|
|
|
|
|
WidgetCanvasProps {}
|
2020-03-27 09:02:11 +00:00
|
|
|
|
2020-11-12 11:23:32 +00:00
|
|
|
export interface WidgetProps
|
|
|
|
|
extends WidgetDataProps,
|
|
|
|
|
WidgetDynamicPathListProps,
|
2021-06-21 11:09:51 +00:00
|
|
|
DataTreeEvaluationProps {
|
2020-03-27 09:02:11 +00:00
|
|
|
key?: string;
|
|
|
|
|
isDefaultClickDisabled?: boolean;
|
2023-01-28 02:17:06 +00:00
|
|
|
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2020-03-27 09:02:11 +00:00
|
|
|
[key: string]: any;
|
|
|
|
|
}
|
2019-09-17 10:11:50 +00:00
|
|
|
|
2019-09-06 09:30:22 +00:00
|
|
|
export interface WidgetCardProps {
|
2023-04-07 13:51:35 +00:00
|
|
|
rows: number;
|
|
|
|
|
columns: number;
|
2019-09-17 10:09:00 +00:00
|
|
|
type: WidgetType;
|
2019-08-29 11:22:09 +00:00
|
|
|
key?: string;
|
2021-09-09 15:10:22 +00:00
|
|
|
displayName: string;
|
2024-08-27 06:45:45 +00:00
|
|
|
displayOrder?: number;
|
2021-09-09 15:10:22 +00:00
|
|
|
icon: string;
|
2024-02-16 12:48:32 +00:00
|
|
|
thumbnail?: string;
|
2021-04-23 05:43:13 +00:00
|
|
|
isBeta?: boolean;
|
2023-07-22 05:57:18 +00:00
|
|
|
tags?: WidgetTags[];
|
2023-12-28 06:46:28 +00:00
|
|
|
isSearchWildcard?: boolean;
|
2024-10-28 11:55:42 +00:00
|
|
|
IconCmp?: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
|
|
|
ThumbnailCmp?: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
2019-08-21 12:49:16 +00:00
|
|
|
}
|
|
|
|
|
|
2019-09-19 22:25:37 +00:00
|
|
|
export const WidgetOperations = {
|
|
|
|
|
MOVE: "MOVE",
|
|
|
|
|
RESIZE: "RESIZE",
|
|
|
|
|
ADD_CHILD: "ADD_CHILD",
|
|
|
|
|
UPDATE_PROPERTY: "UPDATE_PROPERTY",
|
|
|
|
|
DELETE: "DELETE",
|
2020-09-16 10:28:01 +00:00
|
|
|
ADD_CHILDREN: "ADD_CHILDREN",
|
2019-09-17 15:09:55 +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
|
|
|
export type WidgetOperation =
|
|
|
|
|
(typeof WidgetOperations)[keyof typeof WidgetOperations];
|
2019-09-17 15:09:55 +00:00
|
|
|
|
2019-09-09 09:08:54 +00:00
|
|
|
export default BaseWidget;
|