Skip to content

Commit

Permalink
Merge branch 'develop' into merge/hash-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Wangtaofeng committed Oct 19, 2023
2 parents f44c112 + ec74e59 commit 06f9c7e
Show file tree
Hide file tree
Showing 57 changed files with 394 additions and 18,925 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ RUN apk add --no-cache \
## copy frontend
COPY nginx.conf /etc/nginx/nginx.conf
COPY illa-builder-frontend.conf /etc/nginx/conf.d/illa-builder-frontend.conf
COPY ./apps/builder/dist/index.html /opt/illa/illa-builder-frontend/index.html
COPY ./apps/builder/dist/assets /opt/illa/illa-builder-frontend/assets
COPY ./apps/builder/dist /opt/illa/illa-builder-frontend
RUN rm /etc/nginx/conf.d/default.conf

# test nginx
Expand Down
42 changes: 21 additions & 21 deletions apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,28 @@
"@editorjs/marker": "^1.3.0",
"@emotion/cache": "^11.11.0",
"@illa-design/react": "workspace:*",
"@illa-public/avatar": "workspace:*",
"@illa-public/code-editor": "workspace:*",
"@illa-public/cropper": "workspace:*",
"@illa-public/icon": "workspace:*",
"@illa-public/illa-net": "workspace:*",
"@illa-public/invite-modal": "workspace:*",
"@illa-public/layout-auto-change": "workspace:*",
"@illa-public/market-agent": "workspace:*",
"@illa-public/market-app": "workspace:*",
"@illa-public/member-page": "workspace:*",
"@illa-public/mixpanel-utils": "workspace:*",
"@illa-public/record-editor": "workspace:*",
"@illa-public/select": "workspace:*",
"@illa-public/sso-module": "workspace:*",
"@illa-public/upgrade-modal": "workspace:*",
"@illa-public/user-data": "workspace:*",
"@illa-public/user-role-utils": "workspace:*",
"@illa-public/illa-storage": "workspace:*",
"@illa-public/utils": "workspace:*",
"@illa-public/text-link": "workspace:*",
"@illa-public/resource-generator": "workspace:*",
"@illa-public/public-types": "workspace:*",
"@protobuf-ts/runtime": "^2.8.3",
"@react-google-maps/api": "^2.18.1",
"@rjsf/core": "^5.10.0",
Expand Down Expand Up @@ -106,27 +126,7 @@
"ts-key-enum": "^2.0.12",
"uuid": "^8.3.2",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz",
"fuse.js": "^6.6.2",
"@illa-public/user-role-utils": "workspace:*",
"@illa-public/mixpanel-utils": "workspace:*",
"@illa-public/code-editor": "workspace:*",
"@illa-public/cropper": "workspace:*",
"@illa-public/icon": "workspace:*",
"@illa-public/record-editor": "workspace:*",
"@illa-public/avatar": "workspace:*",
"@illa-public/select": "workspace:*",
"@illa-public/user-data": "workspace:*",
"@illa-public/market-agent": "workspace:*",
"@illa-public/market-app": "workspace:*",
"@illa-public/sso-module": "workspace:*",
"@illa-public/layout-auto-change": "workspace:*",
"@illa-public/invite-modal": "workspace:*",
"@illa-public/illa-net": "workspace:*",
"@illa-public/member-page": "workspace:*",
"@illa-public/upgrade-modal": "workspace:*",
"@illa-public/text-link": "workspace:*",
"@illa-public/resource-generator": "workspace:*",
"@illa-public/public-types": "workspace:*"
"fuse.js": "^6.6.2"
},
"devDependencies": {
"@mdx-js/rollup": "^2.3.0",
Expand Down
34 changes: 5 additions & 29 deletions apps/builder/src/api/http/interceptors/response/errorHandler.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,30 @@
import { isCloudVersion } from "@illa-public/utils"
import { removeAuthToken } from "@illa-public/utils"
import { getILLABuilderURL, removeAuthToken } from "@illa-public/utils"
import { AxiosError } from "axios"
import { cloudRedirect } from "@/router/constant"
import { getQS } from "@/router/utils/translateQS"
import { commonBillingErrorHandler } from "@/utils/billing/errorHandler"

const getRedirectPathWhen401 = (searchParams: URLSearchParams) => {
const inviteToken = searchParams.get("inviteToken")
const qs = getQS(searchParams)
if (inviteToken) {
return `/register${qs}`
} else {
return `/login${qs}`
}
}

export const errorHandlerInterceptor = (error: AxiosError) => {
const { response } = error
if (!response) return Promise.reject(error)
const { href } = location
const { status } = response
switch (status) {
// TODO: @aruseito maybe need custom error status, because of we'll have plugin to request other's api
case 401: {
removeAuthToken()
if (isCloudVersion) {
// navigate to illa cloud, avoid redirect loop
if (!href.includes("redirectURL")) {
window.location.href = cloudRedirect
}
} else {
const { href } = location
const url = new URL(href)
const searchParams = url.searchParams
const path = getRedirectPathWhen401(searchParams)
window.location.pathname = path
}
window.location.href = cloudRedirect
break
}
case 403: {
window.location.pathname = "/403"
window.location.href = `${getILLABuilderURL()}/403`
break
}
case 500: {
window.location.pathname = "/500"
window.location.href = `${getILLABuilderURL()}/500`
break
}
default: {
if (status >= 500) {
window.location.pathname = "/500"
window.location.href = `${getILLABuilderURL()}/500`
break
}
commonBillingErrorHandler(response)
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/src/assets/googlesheets/disabled-google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/builder/src/assets/googlesheets/google-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
149 changes: 0 additions & 149 deletions apps/builder/src/config/newAppConfig.tsx

This file was deleted.

Loading

0 comments on commit 06f9c7e

Please sign in to comment.