Merge branch 'main' into release-rebase-1/platformv20

This commit is contained in:
gsmithun4 2024-09-18 22:30:44 +05:30
commit 84d9661a1e
5 changed files with 30 additions and 4 deletions

View file

@ -1 +1 @@
2.66.1
2.66.2

View file

@ -1 +1 @@
2.66.1
2.66.2

View file

@ -1584,7 +1584,12 @@ const EditorComponent = (props) => {
if (!isVersionReleased && selectedComponents?.length > 1) {
let newDefinition = JSON.parse(JSON.stringify(appDefinition));
removeSelectedComponent(currentPageId, newDefinition, selectedComponents, appDefinitionChanged);
const toDeleteComponents = removeSelectedComponent(
currentPageId,
newDefinition,
selectedComponents,
appDefinitionChanged
);
const platform = navigator?.userAgentData?.platform || navigator?.platform || 'unknown';
if (platform.toLowerCase().indexOf('mac') > -1) {
toast('Selected components deleted! (⌘ + Z to undo)', {
@ -1595,6 +1600,26 @@ const EditorComponent = (props) => {
icon: '🗑️',
});
}
const allAppHints = useResolveStore.getState().suggestions.appHints ?? [];
const allHintsAssociatedWithQuery = [];
if (allAppHints.length > 0) {
toDeleteComponents.forEach((id) => {
const componentName = appDefinition.pages[currentPageId].components[id]?.component?.name;
if (componentName) {
allAppHints.forEach((suggestion) => {
if (suggestion?.hint.includes(componentName)) {
allHintsAssociatedWithQuery.push(suggestion.hint);
}
});
}
});
}
useResolveStore.getState().actions.removeEntitiesFromMap(toDeleteComponents);
useResolveStore.getState().actions.removeAppSuggestions(allHintsAssociatedWithQuery);
updateEditorState({ selectedComponents: [] });
} else if (isVersionReleased) {
useAppVersionStore.getState().actions.enableReleasedVersionPopupState();

View file

@ -2098,6 +2098,7 @@ export const removeSelectedComponent = (pageId, newDefinition, selectedComponent
useResolveStore.getState().actions.removeAppSuggestions(allHintsAssociatedWithQuery);
updateAppDefinition(newDefinition, { componentDefinitionChanged: true, componentDeleted: true, componentCut: true });
return toDeleteComponents;
};
const getSelectedText = () => {

View file

@ -1 +1 @@
2.66.1
2.66.2