From 59ed2d9a96389d393410cd35f9d887907884d586 Mon Sep 17 00:00:00 2001 From: AruSeito <41471697+AruSeito@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:38:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=F0=9F=90=9B=20tabs=20link=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Module/DataWorkspace/components/BaseDataItem/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/builder/src/page/App/Module/DataWorkspace/components/BaseDataItem/index.tsx b/apps/builder/src/page/App/Module/DataWorkspace/components/BaseDataItem/index.tsx index d10637efa5..3801e70a29 100644 --- a/apps/builder/src/page/App/Module/DataWorkspace/components/BaseDataItem/index.tsx +++ b/apps/builder/src/page/App/Module/DataWorkspace/components/BaseDataItem/index.tsx @@ -125,6 +125,7 @@ export const BaseDataItem: FC = (props) => { > {value.$childrenNode.map((item, index) => { if (value.$widgetType === "CONTAINER_WIDGET") { + if (!(value.viewList as ViewItemShape[])[index]) return null return ( Date: Tue, 5 Mar 2024 11:40:06 +0800 Subject: [PATCH 2/4] [ci skip] Update package.json --- apps/builder/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/builder/package.json b/apps/builder/package.json index 1056395cae..64caac102f 100644 --- a/apps/builder/package.json +++ b/apps/builder/package.json @@ -5,7 +5,7 @@ "private": true, "author": "ILLA Cloud ", "license": "Apache-2.0", - "version": "4.5.12", + "version": "4.5.13", "scripts": { "dev": "vite --strictPort --force", "build-cloud": "NODE_OPTIONS=--max-old-space-size=12288 vite build --mode cloud", From e99c2ca31c1e15d7a9a827eaf5420656b97a31b7 Mon Sep 17 00:00:00 2001 From: AruSeito <41471697+AruSeito@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:02:49 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=F0=9F=90=9B=20evalute=20script=20fa?= =?UTF-8?q?iled=20need=20set=20to=20undefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ListWidgetWithServerPagination/index.tsx | 1 - .../TransformWidgetWrapper/index.tsx | 20 ++++++++++--------- .../TransformWidgetWrapper/renderWithJSON.tsx | 20 ++++++++++--------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithServerPagination/index.tsx b/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithServerPagination/index.tsx index a82a2d1210..87edabc42c 100644 --- a/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithServerPagination/index.tsx +++ b/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithServerPagination/index.tsx @@ -354,7 +354,6 @@ const ListWidgetWithServerPagination: FC = ( const isClickOnContainer = !!( e.target as HTMLElement )?.getAttribute("data-list-widget-container") - handleUpdateSelectedItem(index, isClickOnContainer) }} > diff --git a/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/index.tsx b/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/index.tsx index ca92b6ee37..22f01f597e 100644 --- a/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/index.tsx +++ b/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/index.tsx @@ -277,9 +277,9 @@ export const TransformWidgetWrapper: FC = memo( const realPath = isFunction(formatPath) ? formatPath(path) : convertPathToString(toPath(path).slice(1)) - try { - const dynamicString = get(needRunEvents, realPath, "") - if (dynamicString) { + const dynamicString = get(needRunEvents, realPath, "") + if (dynamicString) { + try { const calcValue = evaluateDynamicString( `events${realPath}`, dynamicString, @@ -294,8 +294,10 @@ export const TransformWidgetWrapper: FC = memo( } else { set(needRunEvents, realPath, calcValue) } + } catch { + set(needRunEvents, realPath, undefined) } - } catch (_ignore) {} + } }) needRunEvents.forEach((scriptObj: any) => { @@ -322,10 +324,10 @@ export const TransformWidgetWrapper: FC = memo( ? formatPath(path) : convertPathToString(toPath(path).slice(2)) - try { - const dynamicString = get(needRunEvents, realPath, "") + const dynamicString = get(needRunEvents, realPath, "") - if (dynamicString) { + if (dynamicString) { + try { const calcValue = evaluateDynamicString( `events${realPath}`, dynamicString, @@ -346,9 +348,9 @@ export const TransformWidgetWrapper: FC = memo( } } set(needRunEvents, realPath, valueToSet) + } catch { + set(needRunEvents, realPath, undefined) } - } catch (e) { - console.log(e) } }) needRunEvents.forEach((scriptObj: any) => { diff --git a/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/renderWithJSON.tsx b/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/renderWithJSON.tsx index 0ea40ed4d4..9dafeab8cf 100644 --- a/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/renderWithJSON.tsx +++ b/apps/builder/src/widgetLibrary/PublicSector/TransformWidgetWrapper/renderWithJSON.tsx @@ -155,18 +155,18 @@ export const TransformWidgetWrapperWithJson: FC { @@ -184,9 +184,9 @@ export const TransformWidgetWrapperWithJson: FC { const realPath = convertPathToString(toPath(path).slice(2)) - try { - const dynamicString = get(needRunEvents, realPath, "") - if (dynamicString) { + const dynamicString = get(needRunEvents, realPath, "") + if (dynamicString) { + try { const calcValue = evaluateDynamicString( "", dynamicString, @@ -197,8 +197,10 @@ export const TransformWidgetWrapperWithJson: FC { runEventHandler(scriptObj, finalContext) From b44b33e1430c757275b2241e5a94ef49fa7297ec Mon Sep 17 00:00:00 2001 From: AruSeito <41471697+AruSeito@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:20:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=F0=9F=90=9B=20select=20created=20re?= =?UTF-8?q?source=20&=20change=20subpage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Actions/ActionPanel/PanelHeader/index.tsx | 21 ++++++++++++++++++- .../components/DotPanel/hooks/sectionUtils.ts | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/builder/src/page/App/components/Actions/ActionPanel/PanelHeader/index.tsx b/apps/builder/src/page/App/components/Actions/ActionPanel/PanelHeader/index.tsx index 58b8d64a42..e489350321 100644 --- a/apps/builder/src/page/App/components/Actions/ActionPanel/PanelHeader/index.tsx +++ b/apps/builder/src/page/App/components/Actions/ActionPanel/PanelHeader/index.tsx @@ -2,6 +2,7 @@ import { ILLA_MIXPANEL_BUILDER_PAGE_NAME, MixpanelTrackProvider, } from "@illa-public/mixpanel-utils" +import { getInitialContent } from "@illa-public/public-configs" import { Resource } from "@illa-public/public-types" import { ACTION_MODAL_WIDTH, @@ -13,7 +14,11 @@ import { FC, useState } from "react" import { useTranslation } from "react-i18next" import { useDispatch, useSelector } from "react-redux" import { Modal, Space, TriggerProvider } from "@illa-design/react" -import { getCachedAction } from "@/redux/config/configSelector" +import { + getCachedAction, + getSelectedAction, +} from "@/redux/config/configSelector" +import { configActions } from "@/redux/config/configSlice" import { getAllResources } from "@/redux/resource/resourceSelector" import { resourceActions } from "@/redux/resource/resourceSlice" import { track } from "@/utils/mixpanelHelper" @@ -33,6 +38,8 @@ const PanelHeader: FC = () => { const resourceList = useSelector(getAllResources) const action = useSelector(getCachedAction)!! + const selectedAction = useSelector(getSelectedAction)!! + const dispatch = useDispatch() const createOrUpdateResourceCallback = ( @@ -40,10 +47,22 @@ const PanelHeader: FC = () => { isUpdate: boolean, ) => { setEditorVisible(false) + setGeneratorVisible(false) if (isUpdate) { dispatch(resourceActions.updateResourceItemReducer(resource)) } else { dispatch(resourceActions.addResourceItemReducer(resource)) + dispatch( + configActions.updateCachedAction({ + ...action, + actionType: resource.resourceType, + resourceID: resource.resourceID, + content: + selectedAction.actionType === resource.resourceType + ? selectedAction.content + : getInitialContent(resource.resourceType), + }), + ) } } diff --git a/apps/builder/src/page/App/components/DotPanel/hooks/sectionUtils.ts b/apps/builder/src/page/App/components/DotPanel/hooks/sectionUtils.ts index 5c732f7052..4d93c127ba 100644 --- a/apps/builder/src/page/App/components/DotPanel/hooks/sectionUtils.ts +++ b/apps/builder/src/page/App/components/DotPanel/hooks/sectionUtils.ts @@ -1,7 +1,7 @@ export const getCurrentDisplayName = ( sectionViewConfigs: any[], viewSortedKey: string[], - defaultViewKey: string, + defaultViewPath: string, isProduction: boolean, viewPath: string | undefined, currentViewIndex: number, @@ -9,7 +9,7 @@ export const getCurrentDisplayName = ( if (!Array.isArray(sectionViewConfigs) || !Array.isArray(viewSortedKey)) return "sub-page1" const defaultedViewConfig = sectionViewConfigs.find( - (item) => item.key === defaultViewKey, + (item) => item.path === defaultViewPath, ) const defaultedViewKey = viewSortedKey.includes( defaultedViewConfig?.viewDisplayName,