Hotfix :: Components not showing up in dropdown for csa using page event handler (#7539)

* fix :: componenets not showing up on page events for csa

* remove comment
This commit is contained in:
Kiran Ashok 2023-09-29 10:58:15 +05:30 committed by GitHub
parent 3c4954ae4d
commit dea78173f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,19 +121,18 @@ export const EventManager = ({
});
return componentOptions;
}
// currently blocking items inside subcontainer because they can't be controlled through event manager
// use components instead of currentState?.components to get all the components in canvas
function getComponentOptionsOfComponentsWithActions(componentType = '') {
let componentOptions = [];
Object.values(currentState?.components || {}).forEach((value) => {
Object.keys(components || {}).forEach((key) => {
const targetComponentMeta = componentTypes.find(
(componentType) => components[value.id]?.component?.component === componentType?.component
(componentType) => components[key].component.component === componentType.component
);
if ((targetComponentMeta?.actions?.length ?? 0) > 0) {
if (componentType === '' || components[value.id].component.component === componentType) {
if (componentType === '' || components[key].component.component === componentType) {
componentOptions.push({
name: components[value.id].component.name,
value: value.id,
name: components[key].component.name,
value: key,
});
}
}