chore: CE linting changes (#28629)
## Description #### PR fixes following issue(s) Fixes # (issue number) #### Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### 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 - [ ] 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 - [ ] 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
parent
bba8b907c8
commit
ed1a662ead
|
|
@ -1,68 +0,0 @@
|
||||||
import type {
|
|
||||||
WidgetEntity as TWidgetEntity,
|
|
||||||
AppsmithEntity as TAppsmithEntity,
|
|
||||||
DataTreeEntityConfig,
|
|
||||||
WidgetEntityConfig as TWidgetEntityConfig,
|
|
||||||
JSActionEntity as TJSActionEntity,
|
|
||||||
ActionEntity as TActionEntity,
|
|
||||||
ActionEntityConfig as TActionEntityConfig,
|
|
||||||
JSActionEntityConfig as TJSActionEntityConfig,
|
|
||||||
} from "@appsmith/entities/DataTree/types";
|
|
||||||
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
|
|
||||||
import type { EntityParser } from "plugins/Linting/utils/entityParser";
|
|
||||||
import {
|
|
||||||
ENTITY_TYPE,
|
|
||||||
type IEntity,
|
|
||||||
} from "@appsmith/plugins/Linting/lib/entity/types";
|
|
||||||
import type { EntityDiffGenerator } from "plugins/Linting/utils/diffGenerator";
|
|
||||||
import { ActionEntity } from "plugins/Linting/lib/entity/ActionEntity";
|
|
||||||
import { AppsmithEntity } from "plugins/Linting/lib/entity/AppsmithEntity";
|
|
||||||
import { JSEntity } from "plugins/Linting/lib/entity/JSActionEntity";
|
|
||||||
import { WidgetEntity } from "plugins/Linting/lib/entity/WidgetEntity";
|
|
||||||
|
|
||||||
export const entityConstructorMap: Record<
|
|
||||||
string,
|
|
||||||
(props: {
|
|
||||||
entity: DataTreeEntity;
|
|
||||||
Parser: new () => EntityParser;
|
|
||||||
DiffGenerator: new () => EntityDiffGenerator;
|
|
||||||
config?: DataTreeEntityConfig;
|
|
||||||
}) => IEntity
|
|
||||||
> = {
|
|
||||||
[ENTITY_TYPE.ACTION]: (props) => {
|
|
||||||
const { config, DiffGenerator, entity, Parser } = props;
|
|
||||||
return new ActionEntity(
|
|
||||||
entity as TActionEntity,
|
|
||||||
config as TActionEntityConfig,
|
|
||||||
new Parser(),
|
|
||||||
new DiffGenerator(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
[ENTITY_TYPE.APPSMITH]: (props) => {
|
|
||||||
const { DiffGenerator, entity, Parser } = props;
|
|
||||||
return new AppsmithEntity(
|
|
||||||
entity as TAppsmithEntity,
|
|
||||||
undefined,
|
|
||||||
new Parser(),
|
|
||||||
new DiffGenerator(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
[ENTITY_TYPE.JSACTION]: (props) => {
|
|
||||||
const { config, DiffGenerator, entity, Parser } = props;
|
|
||||||
return new JSEntity(
|
|
||||||
entity as TJSActionEntity,
|
|
||||||
config as TJSActionEntityConfig,
|
|
||||||
new Parser(),
|
|
||||||
new DiffGenerator(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
[ENTITY_TYPE.WIDGET]: (props) => {
|
|
||||||
const { config, DiffGenerator, entity, Parser } = props;
|
|
||||||
return new WidgetEntity(
|
|
||||||
entity as TWidgetEntity,
|
|
||||||
config as TWidgetEntityConfig,
|
|
||||||
new Parser(),
|
|
||||||
new DiffGenerator(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
@ -6,10 +6,9 @@ import {
|
||||||
type IEntity,
|
type IEntity,
|
||||||
} from "@appsmith/plugins/Linting/lib/entity/types";
|
} from "@appsmith/plugins/Linting/lib/entity/types";
|
||||||
|
|
||||||
|
export type DynamicEntityType = JSEntity | WidgetEntity | ActionEntity;
|
||||||
// only Widgets, jsActions and Actions have paths that can be dynamic
|
// only Widgets, jsActions and Actions have paths that can be dynamic
|
||||||
export function isDynamicEntity(
|
export function isDynamicEntity(entity: IEntity): entity is DynamicEntityType {
|
||||||
entity: IEntity,
|
|
||||||
): entity is JSEntity | WidgetEntity | ActionEntity {
|
|
||||||
return [
|
return [
|
||||||
ENTITY_TYPE.JSACTION,
|
ENTITY_TYPE.JSACTION,
|
||||||
ENTITY_TYPE.WIDGET,
|
ENTITY_TYPE.WIDGET,
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export * from "ce/plugins/Linting/lib/entity/entityConstructorMap";
|
|
||||||
Loading…
Reference in New Issue
Block a user