From 60cb6dafe9778fd11e98b33802b6f4d0160b2ccb Mon Sep 17 00:00:00 2001 From: Scenery <1507337624@qq.com> Date: Tue, 30 Jan 2024 16:20:18 +0800 Subject: [PATCH 1/9] feat: update select for data grid id generate --- .../PanelSetters/DataGridSetter/utils.ts | 31 ++++++++++++++----- .../widgetLibrary/DataGridWidget/dataGrid.tsx | 10 ++++-- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/apps/builder/src/page/App/components/InspectPanel/PanelSetters/DataGridSetter/utils.ts b/apps/builder/src/page/App/components/InspectPanel/PanelSetters/DataGridSetter/utils.ts index e764b665e1..759b495e70 100644 --- a/apps/builder/src/page/App/components/InspectPanel/PanelSetters/DataGridSetter/utils.ts +++ b/apps/builder/src/page/App/components/InspectPanel/PanelSetters/DataGridSetter/utils.ts @@ -1,10 +1,13 @@ import { isObject, isString } from "lodash-es" -import { v4 } from "uuid" import { isNumber } from "@illa-design/react" import { JSToString, stringToJS } from "@/utils/evaluateDynamicString/utils" import { UNIQUE_ID_NAME } from "@/widgetLibrary/DataGridWidget/constants" -export function dealRawData2ArrayData(rawData: unknown): object[] { +export function dealRawData2ArrayData( + rawData: unknown, + enableServerSidePagination?: boolean, + serverSideOffset?: number, +): object[] { if (rawData === undefined || rawData === "" || rawData === null) { return [] } @@ -13,33 +16,45 @@ export function dealRawData2ArrayData(rawData: unknown): object[] { return [] } else { if (isObject(rawData[0])) { - return rawData.map((item) => { + return rawData.map((item, i) => { + let uniqueID = i + if (enableServerSidePagination && serverSideOffset) { + uniqueID = serverSideOffset + i + } return { - [UNIQUE_ID_NAME]: v4(), + [UNIQUE_ID_NAME]: uniqueID, ...item, } }) } else { - return rawData.map((item) => { + return rawData.map((item, i) => { + let uniqueID = i + if (enableServerSidePagination && serverSideOffset) { + uniqueID = serverSideOffset + i + } return { - [UNIQUE_ID_NAME]: v4(), + [UNIQUE_ID_NAME]: uniqueID, field: item, } }) } } } else { + let uniqueID = 0 + if (enableServerSidePagination && serverSideOffset) { + uniqueID = serverSideOffset + } if (isObject(rawData)) { return [ { - [UNIQUE_ID_NAME]: v4(), + [UNIQUE_ID_NAME]: uniqueID, ...rawData, }, ] } else { return [ { - [UNIQUE_ID_NAME]: v4(), + [UNIQUE_ID_NAME]: uniqueID, field: rawData, }, ] diff --git a/apps/builder/src/widgetLibrary/DataGridWidget/dataGrid.tsx b/apps/builder/src/widgetLibrary/DataGridWidget/dataGrid.tsx index eeca20d4e8..b722eda6ad 100644 --- a/apps/builder/src/widgetLibrary/DataGridWidget/dataGrid.tsx +++ b/apps/builder/src/widgetLibrary/DataGridWidget/dataGrid.tsx @@ -64,10 +64,16 @@ export const DataGridWidget: FC = (props) => { } = props const rawData = dataSourceMode === "dynamic" ? dataSourceJS : dataSource + const serverSideOffset = (page ?? 0) * (pageSize ?? 10) const arrayData: object[] = useMemo( - () => dealRawData2ArrayData(rawData), - [rawData], + () => + dealRawData2ArrayData( + rawData, + enableServerSidePagination, + serverSideOffset, + ), + [rawData, enableServerSidePagination, serverSideOffset], ) const ref = useRef(null) as MutableRefObject From eced25bcf52a7d00a07050249cfe8b59839b6e0a Mon Sep 17 00:00:00 2001 From: chenlongbo Date: Tue, 30 Jan 2024 16:29:50 +0800 Subject: [PATCH 2/9] fix: text md style --- .../AI/components/MarkdownMessage/index.tsx | 78 +++++++++++-------- .../src/widgetLibrary/TextWidget/text.tsx | 27 ++++++- 2 files changed, 70 insertions(+), 35 deletions(-) diff --git a/apps/builder/src/page/AI/components/MarkdownMessage/index.tsx b/apps/builder/src/page/AI/components/MarkdownMessage/index.tsx index afdd55bd09..a1c7959c11 100644 --- a/apps/builder/src/page/AI/components/MarkdownMessage/index.tsx +++ b/apps/builder/src/page/AI/components/MarkdownMessage/index.tsx @@ -15,7 +15,7 @@ import ReactMarkdown from "react-markdown" import rehypeRaw from "rehype-raw" import rehypeSanitize from "rehype-sanitize" import remarkGfm from "remark-gfm" -import { Link, Paragraph } from "@illa-design/react" +import { Heading, Link, Paragraph, Typography } from "@illa-design/react" import { MarkdownMessageProps } from "@/page/AI/components/MarkdownMessage/interface" import { markdownMessageStyle } from "@/page/AI/components/MarkdownMessage/style" import { HTMLTags } from "@/widgetLibrary/TextWidget/constans" @@ -29,39 +29,49 @@ export const MarkdownMessage: FC = (props) => { return ( - ( - - {children} - - ), - p: ({ children }) => {children}, - tr: ({ children }) => {children}, - th: ({ children }) => ( - {children} - ), - td: ({ children }) => {children}, - thead: ({ children }) => {children}, - tbody: ({ children }) => {children}, - tfoot: ({ children }) => {children}, - table: ({ children }) => ( - - {children}
-
- ), - code: ({ children }) => ( -
-              
-            
- ), - }} - > - {children ?? ""} -
+ + {children}, + h2: ({ children }) => {children}, + h3: ({ children }) => {children}, + h4: ({ children }) => {children}, + h5: ({ children }) => {children}, + h6: ({ children }) => {children}, + a: ({ href, children }) => ( + + {children} + + ), + p: ({ children }) => {children}, + tr: ({ children }) => {children}, + th: ({ children }) => ( + {children} + ), + td: ({ children }) => ( + {children} + ), + thead: ({ children }) => {children}, + tbody: ({ children }) => {children}, + tfoot: ({ children }) => {children}, + table: ({ children }) => ( + + {children}
+
+ ), + code: ({ children }) => ( +
+                
+              
+ ), + }} + > + {children ?? ""} +
+
) } diff --git a/apps/builder/src/widgetLibrary/TextWidget/text.tsx b/apps/builder/src/widgetLibrary/TextWidget/text.tsx index de1d76c74c..1a91cd16cb 100644 --- a/apps/builder/src/widgetLibrary/TextWidget/text.tsx +++ b/apps/builder/src/widgetLibrary/TextWidget/text.tsx @@ -1,4 +1,14 @@ -import { FC, useEffect, useLayoutEffect, useRef } from "react" +import { + Table, + TableBody, + TableCell, + TableContainer, + TableFooter, + TableHead, + TableRow, +} from "@mui/material" +import Paper from "@mui/material/Paper" +import React, { FC, useEffect, useLayoutEffect, useRef } from "react" import ReactMarkdown from "react-markdown" import rehypeRaw from "rehype-raw" import rehypeSanitize from "rehype-sanitize" @@ -95,6 +105,21 @@ export const Text: FC = (props) => { {children} ), + tr: ({ children }) => {children}, + th: ({ children }) => ( + {children} + ), + td: ({ children }) => ( + {children} + ), + thead: ({ children }) => {children}, + tbody: ({ children }) => {children}, + tfoot: ({ children }) => {children}, + table: ({ children }) => ( + + {children}
+
+ ), }} > {value ?? ""} From 1879a98d230c27cfa802e81997fbaa4f22f3b931 Mon Sep 17 00:00:00 2001 From: AruSeito Date: Tue, 30 Jan 2024 17:08:51 +0800 Subject: [PATCH 3/9] Update .env.cloud --- apps/builder/.env.cloud | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/builder/.env.cloud b/apps/builder/.env.cloud index a5fc567c2e..5452d10d4e 100644 --- a/apps/builder/.env.cloud +++ b/apps/builder/.env.cloud @@ -1,6 +1,6 @@ ILLA_API_BASE_URL=CLOUD_API_PATH ILLA_CLOUD_URL=CLOUD_PATH -ILLA_SENTRY_SERVER_API=https://108bf202506643c89b2c487eb9ab5f8c@sentry.illasoft.com/3 +ILLA_SENTRY_SERVER_API=https://d471afe04ac2e9c62c7214eae9e6e31a@o4506653590880256.ingest.sentry.io/4506653593894912 ILLA_INSTANCE_ID=CLOUD ILLA_APP_VERSION=0.0.0 ILLA_APP_ENV=production @@ -8,4 +8,4 @@ ILLA_GOOGLE_MAP_KEY=google_map_key ILLA_MIXPANEL_API_KEY=0 ILLA_BUILDER_URL=BUILDER_PATH ILLA_MARKET_URL=MARKET_PATH -ILLA_SENTRY_AUTH_TOKEN=SENTRY_AUTH_TOKEN \ No newline at end of file +ILLA_SENTRY_AUTH_TOKEN=SENTRY_AUTH_TOKEN From 974ef75eb20b688c0ec5d80fffe16b26317eed90 Mon Sep 17 00:00:00 2001 From: chenlongbo Date: Tue, 30 Jan 2024 17:16:24 +0800 Subject: [PATCH 4/9] feat: add amplitude --- .github/workflows/build-docker.yml | 1 + packages/illa-public-component | 2 +- pnpm-lock.yaml | 55 ++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index ba10f7bec0..2b73e37d04 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -10,6 +10,7 @@ on: env: ILLA_GOOGLE_MAP_KEY: ${{ secrets.ILLA_GOOGLE_MAP_KEY }} ILLA_MIXPANEL_API_KEY: ${{ secrets.ILLA_MIXPANEL_API_KEY }} + ILLA_AMPLITUDEAPI_KEY: ${{ secrets.ILLA_AMPLITUDE_API_KEY }} ILLA_MUI_LICENSE: ${{ secrets.ILLA_MUI_LICENSE }} ILLA_SENTRY_AUTH_TOKEN: ${{ secrets.ILLA_SENTRY_AUTH_TOKEN }} DO_CLUSTER: ${{ secrets.DO_CLUSTER }} diff --git a/packages/illa-public-component b/packages/illa-public-component index f5f5000e80..41265618ca 160000 --- a/packages/illa-public-component +++ b/packages/illa-public-component @@ -1 +1 @@ -Subproject commit f5f5000e80065733d0e7c33c08f5333404b77ffb +Subproject commit 41265618cad05995db0eefee0fa085ca003812c2 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ea02372c1..ac09a870a5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3471,6 +3471,9 @@ importers: packages/illa-public-component/MixpanelUtils: dependencies: + '@amplitude/analytics-browser': + specifier: ^2.4.0 + version: 2.4.0 '@fingerprintjs/fingerprintjs': specifier: ^3.4.0 version: 3.4.0 @@ -4089,6 +4092,58 @@ packages: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} + /@amplitude/analytics-browser@2.4.0: + resolution: {integrity: sha512-QHEHCxGiEYeYv052MCnRWmPVD56micO65kODsR5hqWMkJQcemql8gvZfwYPt0rDGxxmvTxEN95uxHbbV2p3bpw==} + dependencies: + '@amplitude/analytics-client-common': 2.0.11 + '@amplitude/analytics-core': 2.2.0 + '@amplitude/analytics-types': 2.4.0 + '@amplitude/plugin-page-view-tracking-browser': 2.1.0 + '@amplitude/plugin-web-attribution-browser': 2.1.0 + tslib: 2.6.2 + dev: false + + /@amplitude/analytics-client-common@2.0.11: + resolution: {integrity: sha512-f2zzo7Sk1hz8/WT7kPB6HZqAyHJrxMzw9nTqbLoRsaG9xm4YOJ0WCwtlu42RVRqIoWR89RTmIkqIjqimqMaHEQ==} + dependencies: + '@amplitude/analytics-connector': 1.5.0 + '@amplitude/analytics-core': 2.2.0 + '@amplitude/analytics-types': 2.4.0 + tslib: 2.6.2 + dev: false + + /@amplitude/analytics-connector@1.5.0: + resolution: {integrity: sha512-T8mOYzB9RRxckzhL0NTHwdge9xuFxXEOplC8B1Y3UX3NHa3BLh7DlBUZlCOwQgMc2nxDfnSweDL5S3bhC+W90g==} + dev: false + + /@amplitude/analytics-core@2.2.0: + resolution: {integrity: sha512-JVx1chKa/sfqpBNEZn6jaZZV3DW/6cOoJxx8b5oqHIn+5HXizEOV85aLFY0rrtZ/uR/HrdffxrMKzr/uBFlV+A==} + dependencies: + '@amplitude/analytics-types': 2.4.0 + tslib: 2.6.2 + dev: false + + /@amplitude/analytics-types@2.4.0: + resolution: {integrity: sha512-GVj9W4X3XMVyGfqXdES2vFU8pqTIHvihj/vNOjOrwYHVdia3GjlcGl77GXuERCIwr52MoiUVTGXmXn3adf+A+Q==} + dev: false + + /@amplitude/plugin-page-view-tracking-browser@2.1.0: + resolution: {integrity: sha512-iAZzLcmk6RGFf0emihBLtVBX2mZwmW6pyQOHQT7dLxCE8+L/Sgj2zhMyoRomL3RBoUUnXfu03ET3L9fv30LMGA==} + dependencies: + '@amplitude/analytics-client-common': 2.0.11 + '@amplitude/analytics-types': 2.4.0 + tslib: 2.6.2 + dev: false + + /@amplitude/plugin-web-attribution-browser@2.1.0: + resolution: {integrity: sha512-2b/LTZifOLvx8XTVPfyaxh39uX5ANNbvypByk9zywprucbKUj+1hzycgP57lN8Xw2iuqRfypQz7V2YGdR9w4MQ==} + dependencies: + '@amplitude/analytics-client-common': 2.0.11 + '@amplitude/analytics-core': 2.2.0 + '@amplitude/analytics-types': 2.4.0 + tslib: 2.6.2 + dev: false + /@ampproject/remapping@2.2.0: resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} engines: {node: '>=6.0.0'} From 3a34c7e31459ce15f9e225d95d586dda1c81c4ec Mon Sep 17 00:00:00 2001 From: chenlongbo Date: Tue, 30 Jan 2024 18:02:01 +0800 Subject: [PATCH 5/9] fix: add some other props --- apps/builder/src/router/loader/cloudAuthLoader.ts | 8 ++++---- packages/illa-public-component | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/builder/src/router/loader/cloudAuthLoader.ts b/apps/builder/src/router/loader/cloudAuthLoader.ts index 39d5746d24..c435b23bd1 100644 --- a/apps/builder/src/router/loader/cloudAuthLoader.ts +++ b/apps/builder/src/router/loader/cloudAuthLoader.ts @@ -8,12 +8,12 @@ import { } from "@illa-public/user-data" import { canAccessManage } from "@illa-public/user-role-utils" import { + getAuthToken, getILLACloudURL, isCloudVersion, sendConfigEvent, setAuthToken, } from "@illa-public/utils" -import { getAuthToken } from "@illa-public/utils" import { LoaderFunction, redirect } from "react-router-dom" import i18n from "@/i18n/config" import { fetchMyTeamsInfo } from "@/services/team" @@ -52,16 +52,16 @@ export const getUserInfoLoader: LoaderFunction = async () => { i18n.changeLanguage(lng) window.location.reload() } - ILLAMixpanel.getMixpanelInstance()?.identify(response.data.userID) + ILLAMixpanel.setUserID(response.data.userID) const reportedUserInfo: Record = {} Object.entries(response.data).forEach(([key, value]) => { reportedUserInfo[`illa_${key}`] = value }) - ILLAMixpanel.getMixpanelInstance()?.people.set(reportedUserInfo) + ILLAMixpanel.setUserProperties(reportedUserInfo) store.dispatch(currentUserActions.updateCurrentUserReducer(response.data)) return null } catch (e) { - ILLAMixpanel.getMixpanelInstance()?.reset() + ILLAMixpanel.reset() return redirect("/403") } } diff --git a/packages/illa-public-component b/packages/illa-public-component index 41265618ca..98de65d845 160000 --- a/packages/illa-public-component +++ b/packages/illa-public-component @@ -1 +1 @@ -Subproject commit 41265618cad05995db0eefee0fa085ca003812c2 +Subproject commit 98de65d845b26cfc33e8def427526aa02590e1e5 From a0bf95e52920999e50f4e555f8d3b3637a60dd43 Mon Sep 17 00:00:00 2001 From: chenlongbo Date: Tue, 30 Jan 2024 18:26:21 +0800 Subject: [PATCH 6/9] fix: add amplitude --- packages/illa-public-component | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/illa-public-component b/packages/illa-public-component index 98de65d845..d0700a6e0a 160000 --- a/packages/illa-public-component +++ b/packages/illa-public-component @@ -1 +1 @@ -Subproject commit 98de65d845b26cfc33e8def427526aa02590e1e5 +Subproject commit d0700a6e0abcf5b71cb3b3039708910aea66c2ec From 2732a761b40ccc6007b65b66b86e7b305baf954f Mon Sep 17 00:00:00 2001 From: chenlongbo Date: Tue, 30 Jan 2024 18:28:26 +0800 Subject: [PATCH 7/9] fix: docker build scripe --- .github/workflows/build-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 2b73e37d04..71aecfb14b 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -10,7 +10,7 @@ on: env: ILLA_GOOGLE_MAP_KEY: ${{ secrets.ILLA_GOOGLE_MAP_KEY }} ILLA_MIXPANEL_API_KEY: ${{ secrets.ILLA_MIXPANEL_API_KEY }} - ILLA_AMPLITUDEAPI_KEY: ${{ secrets.ILLA_AMPLITUDE_API_KEY }} + ILLA_AMPLITUDE_API_KEY: ${{ secrets.ILLA_AMPLITUDE_API_KEY }} ILLA_MUI_LICENSE: ${{ secrets.ILLA_MUI_LICENSE }} ILLA_SENTRY_AUTH_TOKEN: ${{ secrets.ILLA_SENTRY_AUTH_TOKEN }} DO_CLUSTER: ${{ secrets.DO_CLUSTER }} From b9c5508db4aa49af2a44407c2672ce2ef967e9b1 Mon Sep 17 00:00:00 2001 From: chenlongbo Date: Tue, 30 Jan 2024 19:03:45 +0800 Subject: [PATCH 8/9] fix: docker build scripe --- apps/builder/.env.cloud | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/builder/.env.cloud b/apps/builder/.env.cloud index 5452d10d4e..7fd8782bdb 100644 --- a/apps/builder/.env.cloud +++ b/apps/builder/.env.cloud @@ -6,6 +6,7 @@ ILLA_APP_VERSION=0.0.0 ILLA_APP_ENV=production ILLA_GOOGLE_MAP_KEY=google_map_key ILLA_MIXPANEL_API_KEY=0 +ILLA_AMPLITUDE_API_KEY=0 ILLA_BUILDER_URL=BUILDER_PATH ILLA_MARKET_URL=MARKET_PATH ILLA_SENTRY_AUTH_TOKEN=SENTRY_AUTH_TOKEN From 96006bd3309940068290dd340bf6786a49bb68a1 Mon Sep 17 00:00:00 2001 From: Scenery <1507337624@qq.com> Date: Tue, 30 Jan 2024 19:42:32 +0800 Subject: [PATCH 9/9] [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 8b3c0cfbf0..c22b5e344e 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.4.1", + "version": "4.4.2", "scripts": { "dev": "vite --strictPort --force", "build-cloud": "NODE_OPTIONS=--max-old-space-size=12288 vite build --mode cloud",