Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
AruSeito committed Dec 18, 2023
2 parents 8c83f02 + 3535d4d commit d61cc97
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 211 deletions.
8 changes: 3 additions & 5 deletions apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@mui/x-data-grid-premium": "^6.18.2",
"@protobuf-ts/runtime": "^2.8.3",
"@react-google-maps/api": "^2.18.1",
"@reduxjs/toolkit": "^1.9.7",
"@reduxjs/toolkit": "^2.0.1",
"@rjsf/core": "^5.10.0",
"@rjsf/utils": "^5.10.0",
"@rjsf/validator-ajv8": "^5.10.0",
Expand All @@ -84,7 +84,7 @@
"@uiw/react-color-sketch": "^1.4.2",
"acorn": "^8.7.1",
"acorn-walk": "^8.2.0",
"axios": "^0.26.1",
"axios": "^1.6.2",
"chart.js": "^3.9.1",
"chroma-js": "^2.4.2",
"copy-to-clipboard": "^3.3.2",
Expand Down Expand Up @@ -120,7 +120,7 @@
"react-markdown": "^8.0.3",
"react-pdf": "^6.2.2",
"react-player": "^2.11.2",
"react-redux": "^8.1.3",
"react-redux": "^9.0.4",
"react-rnd": "^10.3.7",
"react-router-dom": "^6.14.0",
"react-selecto": "^1.22.0",
Expand All @@ -130,7 +130,6 @@
"react-virtuoso": "^4.3.11",
"react-window": "^1.8.9",
"react-window-infinite-loader": "^1.0.9",
"redux-logger": "^3.0.6",
"rehype-raw": "^6.1.1",
"rehype-sanitize": "^5.0.1",
"remark-gfm": "^3.0.1",
Expand Down Expand Up @@ -159,7 +158,6 @@
"@types/react-slick": "^0.23.10",
"@types/react-window": "^1.8.5",
"@types/react-window-infinite-loader": "^1.0.6",
"@types/redux-logger": "^3.0.9",
"@types/streamsaver": "^2.0.1",
"@types/tern": "^0.23.5",
"@types/toposort": "^2.0.4",
Expand Down
9 changes: 6 additions & 3 deletions apps/builder/src/api/http/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { actionRuntimeAxios, needAuthAxios } from "@illa-public/illa-net/base"
import { authInterceptor } from "@/api/http/interceptors/request/auth"
import { errorHandlerInterceptor } from "@/api/http/interceptors/response/errorHandler"
import {
actionRuntimeAxios,
authInterceptor,
errorHandlerInterceptor,
needAuthAxios,
} from "@illa-public/illa-net"

needAuthAxios.interceptors.request.use(authInterceptor)
needAuthAxios.interceptors.response.use(undefined, errorHandlerInterceptor)
Expand Down
13 changes: 0 additions & 13 deletions apps/builder/src/api/http/interceptors/request/auth.ts

This file was deleted.

35 changes: 0 additions & 35 deletions apps/builder/src/api/http/interceptors/response/errorHandler.ts

This file was deleted.

5 changes: 4 additions & 1 deletion apps/builder/src/middleware/guideAsync/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Middleware } from "@reduxjs/toolkit"
import { Middleware, isAction } from "@reduxjs/toolkit"
import { guideUpdate } from "@/middleware/guideAsync/guideUpdate"
import { getGuideStatus } from "@/redux/guide/guideSelector"

export const guideAsync: Middleware = (store) => (next) => (action) => {
if (!isAction(action) || !("payload" in action)) {
return next(action)
}
const isGuideOpen = getGuideStatus(store.getState())
if (isGuideOpen) {
guideUpdate(store.getState(), store.dispatch, action)
Expand Down
5 changes: 4 additions & 1 deletion apps/builder/src/middleware/mixpanelReport/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Middleware } from "@reduxjs/toolkit"
import { Middleware, isAction } from "@reduxjs/toolkit"
import { reportMessage } from "./reportMessage"

export const mixpanelReport: Middleware = (store) => (next) => (action) => {
if (!isAction(action) || !("payload" in action)) {
return next(action)
}
const { type } = action
const typeList = type.split("/")
const isRemoteAction = typeList[typeList.length - 1] === "remote"
Expand Down
7 changes: 5 additions & 2 deletions apps/builder/src/middleware/reduxAsync/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import * as Redux from "@reduxjs/toolkit"
import { Middleware, isAction } from "@reduxjs/toolkit"
import { illaSnapshot } from "@/page/App/components/DotPanel/constant/snapshotNew"
import { getExecutionWidgetLayoutInfo } from "@/redux/currentApp/executionTree/executionSelector"
import { RootState } from "@/store"
import { receiveMessage } from "./receiveMessages"
import { sendMessage } from "./sendMessage"

export const reduxAsync: Redux.Middleware = (store) => (next) => (action) => {
export const reduxAsync: Middleware = (store) => (next) => (action) => {
if (!isAction(action) || !("payload" in action)) {
return next(action)
}
const { type } = action
const typeList = type.split("/")
const isRemoteAction = typeList[typeList.length - 1] === "remote"
Expand Down
7 changes: 5 additions & 2 deletions apps/builder/src/middleware/undoRedo/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { Middleware } from "@reduxjs/toolkit"
import { Middleware, isAction } from "@reduxjs/toolkit"
import { REDUX_ACTION_FROM } from "./interface"
import { undoRedoMethod } from "./method"

export const UndoRedo: Middleware = (store) => (next) => (action) => {
if (action.from && action.from === REDUX_ACTION_FROM.WS) {
if (!isAction(action) || !("payload" in action)) {
return next(action)
}
if ("from" in action && action.from && action.from === REDUX_ACTION_FROM.WS) {
const resp = next(action)
return resp
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const ShareAppButton: FC<ShareAppButtonProps> = (props) => {
dispatch(
appInfoActions.updateAppInfoReducer({
...appInfo,
appName: appConfig.publishWithAIAgent,
appName: appConfig.appName,
config: {
...appInfo.config,
description: appConfig.appDesc,
Expand Down
8 changes: 1 addition & 7 deletions apps/builder/src/redux/currentApp/appInfo/appInfoSlice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { AppInfoShape } from "@illa-public/public-types"
import { createSlice } from "@reduxjs/toolkit"
import { SliceCaseReducers } from "@reduxjs/toolkit/src/createSlice"
import {
updateAppContributeReducer,
updateAppDeployedReducer,
Expand All @@ -9,11 +7,7 @@ import {
} from "@/redux/currentApp/appInfo/appInfoReducer"
import { DashboardAppInitialState } from "./appInfoState"

const appInfoSlice = createSlice<
AppInfoShape,
SliceCaseReducers<AppInfoShape>,
"appInfo"
>({
const appInfoSlice = createSlice({
name: "appInfo",
initialState: DashboardAppInitialState,
reducers: {
Expand Down
5 changes: 0 additions & 5 deletions apps/builder/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
configureStore,
createListenerMiddleware,
} from "@reduxjs/toolkit"
import { logger } from "redux-logger"
import { guideAsync } from "@/middleware/guideAsync"
import { reduxAsync } from "@/middleware/reduxAsync"
import aiAgent from "@/redux/aiAgent/dashboardTeamAIAgentSlice"
Expand Down Expand Up @@ -40,10 +39,6 @@ const appReducer = combineReducers({

const middlewares = [reduxAsync, UndoRedo, guideAsync]

if (import.meta.env.ILLA_APP_ENV === "development") {
middlewares.push(logger)
}

if (isCloudVersion) {
middlewares.unshift(mixpanelReport)
}
Expand Down
6 changes: 3 additions & 3 deletions apps/cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@illa-public/user-data": "workspace:*",
"@illa-public/user-role-utils": "workspace:*",
"@illa-public/utils": "workspace:*",
"@reduxjs/toolkit": "^1.9.7",
"axios": "^0.26.1",
"@reduxjs/toolkit": "^2.0.1",
"axios": "^1.6.2",
"dayjs": "^1.11.10",
"fuse.js": "^6.6.2",
"i18next": "^23.7.6",
Expand All @@ -44,7 +44,7 @@
"lodash": "^4.17.21",
"react-hook-form": "^7.40.0",
"react-i18next": "^13.5.0",
"react-redux": "^8.1.3",
"react-redux": "^9.0.4",
"react-router-dom": "^6.14.0",
"swr": "^2.2.4",
"uuid": "^9.0.0"
Expand Down
8 changes: 5 additions & 3 deletions apps/cloud/src/api/http/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { needAuthAxios } from "@illa-public/illa-net"
import { authInterceptor } from "./interceptors/request/auth"
import { errorHandlerInterceptor } from "./interceptors/response/errorHandler"
import {
authInterceptor,
errorHandlerInterceptor,
needAuthAxios,
} from "@illa-public/illa-net"

needAuthAxios.interceptors.request.use(authInterceptor)
needAuthAxios.interceptors.response.use(undefined, errorHandlerInterceptor)
13 changes: 0 additions & 13 deletions apps/cloud/src/api/http/interceptors/request/auth.ts

This file was deleted.

22 changes: 0 additions & 22 deletions apps/cloud/src/api/http/interceptors/response/errorHandler.ts

This file was deleted.

Loading

0 comments on commit d61cc97

Please sign in to comment.