PromucFlow_constructor/app/client/src/utils/NavigationSelector/ActionChildren.ts
Ankita Kinger ae05e93ec9
chore: Removing feature flag for app level invites (#22650)
## Description

Removing feature flag for app-level invites. Also, updating import
statements to use `@appsmith/..` instead of `ce/..`

Fixes [#22657](https://github.com/appsmithorg/appsmith/issues/22657)

## Type of change
- Chore (housekeeping or task changes that don't impact user perception)


## How Has This Been Tested?
- Manual
- Jest
- Cypress

## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] 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
- [x] 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
2023-04-26 12:48:16 +05:30

50 lines
1.9 KiB
TypeScript

import { entityDefinitions } from "@appsmith/utils/autocomplete/EntityDefinitions";
import type { DataTree } from "entities/DataTree/dataTreeFactory";
import { ENTITY_TYPE } from "entities/DataTree/dataTreeFactory";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { EntityNavigationData } from "selectors/navigationSelectors";
import { createNavData } from "./common";
import type { ActionEntity } from "entities/DataTree/types";
export const getActionChildrenNavData = (
action: ActionData,
dataTree: DataTree,
) => {
const dataTreeAction = dataTree[action.config.name] as ActionEntity;
if (dataTreeAction) {
const definitions = entityDefinitions.ACTION(dataTreeAction, {});
const peekData: Record<string, unknown> = {};
const childNavData: EntityNavigationData = {};
Object.keys(definitions).forEach((key) => {
if (key.indexOf("!") === -1) {
if (key === "data" || key === "isLoading" || key === "responseMeta") {
peekData[key] = dataTreeAction[key];
childNavData[key] = createNavData({
id: `${action.config.name}.${key}`,
name: `${action.config.name}.${key}`,
type: ENTITY_TYPE.ACTION,
url: undefined,
peekable: true,
peekData: undefined,
children: {},
});
} else if (key === "run" || key === "clear") {
// eslint-disable-next-line @typescript-eslint/no-empty-function
peekData[key] = function () {}; // tern inference required here
childNavData[key] = createNavData({
id: `${action.config.name}.${key}`,
name: `${action.config.name}.${key}`,
type: ENTITY_TYPE.ACTION,
url: undefined,
peekable: true,
peekData: undefined,
children: {},
});
}
}
});
return { peekData, childNavData };
}
};