Skip to content

Commit

Permalink
Merge pull request #3694 from illacloud/release/4.5.0
Browse files Browse the repository at this point in the history
Release/4.5.0
  • Loading branch information
AruSeito authored Feb 7, 2024
2 parents 412e4c5 + b3bf635 commit 932b5f8
Show file tree
Hide file tree
Showing 70 changed files with 2,646 additions and 1,980 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-all-in-one-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
ILLA_MUI_LICENSE: ${{ secrets.ILLA_MUI_LICENSE }}
ILLA_BASE_PATH: /build

jobs:
build:
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/build-cname-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Deploy cname image to k8s

on:
push:
branches:
- main
- beta
- develop

env:
ILLA_GOOGLE_MAP_KEY: ${{ secrets.ILLA_GOOGLE_MAP_KEY }}
ILLA_MIXPANEL_API_KEY: ${{ secrets.ILLA_MIXPANEL_API_KEY }}
ILLA_MUI_LICENSE: ${{ secrets.ILLA_MUI_LICENSE }}
ILLA_SENTRY_AUTH_TOKEN: ${{ secrets.ILLA_SENTRY_AUTH_TOKEN }}
DO_CLUSTER: ${{ secrets.DO_CLUSTER }}
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
DOCKER_PWD: ${{ secrets.DOCKER_PWD }}
ILLA_BASE_PATH: /builder

jobs:
build:
name: Build website
runs-on: ubuntu-latest
environment:
name:
${{ (github.ref == 'refs/heads/main') && 'production' || (github.ref ==
'refs/heads/develop') && 'test' || (github.ref == 'refs/heads/beta') &&
'beta' }}
env:
ILLA_API_BASE_URL: ${{ vars.ILLA_API_BASE_URL }}
ILLA_APP_ENV: ${{ vars.ILLA_APP_ENV }}
ILLA_BUILDER_URL: ${{ vars.ILLA_BUILDER_URL }}
ILLA_CLOUD_URL: ${{ vars.ILLA_CLOUD_URL }}
ILLA_MARKET_URL: ${{ vars.ILLA_MARKET_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-node@v3
with:
node-version: 18.12.1

- uses: pnpm/action-setup@v2
with:
version: 8.7.0

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DO_TOKEN }}

- name: Install kubectl
run: |
sudo snap install kubectl --classic
- name: Setup kubectl
run: |
doctl kubernetes cluster kubeconfig save $DO_CLUSTER
kubectl version
- name: Build website
run: |
echo "Building for $GITHUB_REF_NAME branch,ILLA APP ENV is $ILLA_APP_ENV"
pnpm build-cloud
- name: Build Docker
run: |
docker build --cache-from=illa-builder-cname-frontend -f Dockerfile -t illa-builder-cname-frontend .
- name: Push application Docker image
run: |
docker login -u $DOCKER_LOGIN -p $DOCKER_PWD
docker tag illa-builder-cname-frontend "illasoft/illa-builder-cname-frontend:$GITHUB_REF_NAME"
docker push "illasoft/illa-builder-cname-frontend:$GITHUB_REF_NAME"
- uses: actions/checkout@v4
with:
repository: illacloud/k8s-application-do
token: ${{ secrets.ILLA_BOT_TOKEN }}
path: k8s-application-do

- name: Deploy to Kubernetes
run: |
cd k8s-application-do/namespace-$ILLA_APP_ENV
kubectl apply -f ./illa-builder-cname-frontend/ -n $ILLA_APP_ENV
kubectl -n $ILLA_APP_ENV rollout restart deployment illa-builder-cname-frontend
3 changes: 1 addition & 2 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
<br>
<p align="center">
<a href="https://cloud.illacloud.com?utm_source=github&utm_medium=readme&utm_campaign=github-readme">
<img width="800" alt="GitHub - Readme - jp" src="https://github.com/illacloud/illa-builder/assets/112603073/bbeaaa07-f8e8-45ae-9aaf-6dde05b7926c">
<img width="800" alt="GitHub - Readme - jp" src="https://github.com/illacloud/illa-builder/assets/112603073/f3e7105a-b50d-461b-b3b7-a031c43d9465">
</a>
</p>


[![Discord](https://img.shields.io/badge/chat-Discord-7289DA?logo=discord)](https://discord.gg/illacloud)
[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?logo=x&logoColor=white)](https://twitter.com/illa_cloud)
[![Discussions](https://img.shields.io/badge/discussions-GitHub-333333?logo=github)](https://github.com/orgs/illacloud/discussions)
Expand Down
2 changes: 1 addition & 1 deletion README-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<br>
<p align="center">
<a href="https://cloud.illacloud.com?utm_source=github&utm_medium=readme&utm_campaign=github-readme">
<img width="800" alt="GitHub - Readme - jp" src="https://github.com/illacloud/illa-builder/assets/112603073/4c9b27c1-b3c4-4c55-99c4-4e3cb529d236">
<img width="800" alt="GitHub - Readme - jp" src="https://github.com/illacloud/illa-builder/assets/112603073/1a4b64ac-1384-4eaf-9b3c-9b0b278b40fe">
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion README-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<br>
<p align="center">
<a href="https://cloud.illacloud.com?utm_source=github&utm_medium=readme&utm_campaign=github-readme">
<img width="800" alt="GitHub - Readme - jp" src="https://github.com/illacloud/illa-builder/assets/112603073/797f4934-3bf2-4b91-8877-e370e5fda142">
<img width="800" alt="GitHub - Readme - jp" src="https://github.com/illacloud/illa-builder/assets/112603073/eeb65cb6-e307-4f16-9a7a-2fcb9d3a37a3">
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ English | <a href="https://github.com/illacloud/illa-builder/blob/beta/README-CN
<br>
<p align="center">
<a href="https://cloud.illacloud.com?utm_source=github&utm_medium=readme&utm_campaign=github-readme">
<img width="800" alt="Github(1)" src="https://github.com/illacloud/illa-builder/assets/112603073/37e2cc1b-efeb-4a95-9719-76022ac49191">
<img width="800" alt="Github(1)" src="https://github.com/illacloud/illa-builder/assets/112603073/fdc4c02b-e412-4c41-8240-8077d4447ebc">
</a>
</p>

Expand Down
76 changes: 72 additions & 4 deletions apps/builder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link href="/src/assets/favicon.ico" rel="icon" type="image/svg+xml" />

<link href="/favicon.png" rel="icon" type="image/svg+xml" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1"
Expand All @@ -19,9 +20,76 @@
/>
<link href="/public/font-family/Fira-code/fira_code.css" rel="stylesheet" />
<link href="/public/font-family/Inter/inter.css" rel="stylesheet" />
<title>
ILLA Builder - An open-source low-code Platform for Developers.
</title>
<title>Loading...</title>
<script>
function createFavicon() {
const newFavicon = document.createElement("link")
newFavicon.rel = "icon"
document.getElementsByTagName("head")[0].appendChild(newFavicon)
return newFavicon
}

function setFavicon(faviconHref) {
const linkElements = document.getElementsByTagName("link")

const faviconElements = []

for (let i = 0; i < linkElements.length; i++) {
const link = linkElements[i]
if (link.rel.toLowerCase() === "icon") {
faviconElements.push(link)
}
}

if (faviconElements.length === 0) {
const element = createFavicon()
element.href = faviconHref
} else {
faviconElements.forEach((faviconElement) => {
faviconElement.href = faviconHref
})
}
}

async function validateCustomDomain() {
const origin = location.origin
if (origin !== "%ILLA_BUILDER_URL%") {
window.customDomain = location.host
try {
const response = await fetch(
`https://%ILLA_API_BASE_URL%/supervisor/api/v1/domain/validate`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ customDomain: location.host }),
},
)
const data = await response.json()
window.currentTeamIdentifier = data.teamIdentifier
if (!data.customDomainAvaliable) {
const redirectURL = window.location.href.replace(
`https://${window.location.host}/cloud`,
"%ILLA_CLOUD_URL%",
)
window.location.href = `%ILLA_CLOUD_URL%/redirect-expired?redirectURL=${redirectURL}`
return
}
if (data.favicon) {
setFavicon(data.favicon)
} else {
setFavicon("/ILLAFavicon.ico")
}
} catch {
setFavicon("/ILLAFavicon.ico")
}
} else {
setFavicon("/ILLAFavicon.ico")
}
}
validateCustomDomain()
</script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"author": "ILLA Cloud <[email protected]>",
"license": "Apache-2.0",
"version": "4.4.12",
"version": "4.5.0",
"scripts": {
"dev": "vite --strictPort --force",
"build-cloud": "NODE_OPTIONS=--max-old-space-size=12288 vite build --mode cloud",
Expand Down
Binary file added apps/builder/public/ILLAFavicon.ico
Binary file not shown.
Binary file added apps/builder/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions apps/builder/src/components/Guide/GuideCreateApp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
MixpanelTrackProvider,
} from "@illa-public/mixpanel-utils"
import { ComponentTreeNode, Resource } from "@illa-public/public-types"
import { getAuthToken } from "@illa-public/utils"
import { getAuthToken, getILLABuilderURL } from "@illa-public/utils"
import { AnimatePresence } from "framer-motion"
import { FC, useCallback, useState } from "react"
import { useTranslation } from "react-i18next"
Expand Down Expand Up @@ -57,7 +57,7 @@ const GuideCreateApp: FC = () => {
try {
const resp = await fetchForkApp(appID)
window.open(
`${import.meta.env.ILLA_BUILDER_URL}/${teamIdentifier}/app/${
`${getILLABuilderURL(window.customDomain)}/${teamIdentifier}/app/${
resp.data.appId
}?token=${getAuthToken()}`,
"_blank",
Expand Down Expand Up @@ -87,7 +87,7 @@ const GuideCreateApp: FC = () => {
})
await fetchBatchCreateAction(teamID, resp.data.appId, actionsInfo)
window.open(
`${import.meta.env.ILLA_BUILDER_URL}/${teamIdentifier}/app/${
`${getILLABuilderURL(window.customDomain)}/${teamIdentifier}/app/${
resp.data.appId
}?token=${getAuthToken()}`,
"_blank",
Expand Down
8 changes: 8 additions & 0 deletions apps/builder/src/hooks/utils/fixComponentsUtils/chart.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ComponentTreeNode } from "@illa-public/public-types"

export const fixedChartComponent = (component: ComponentTreeNode) => {
return {
...component,
type: "CHART_WIDGET",
}
}
19 changes: 19 additions & 0 deletions apps/builder/src/hooks/utils/fixComponentsUtils/container.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ComponentTreeNode } from "@illa-public/public-types"

export const fixedContainerComponent = (component: ComponentTreeNode) => {
let linkedWidget
if (component.props) {
linkedWidget =
component.props.linkWidgetDisplayName !== undefined &&
typeof component.props.linkWidgetDisplayName === "string"
? [component.props.linkWidgetDisplayName]
: component.props.linkWidgetDisplayName
}
return {
...component,
props: {
...component.props,
linkWidgetDisplayName: linkedWidget,
},
}
}
18 changes: 18 additions & 0 deletions apps/builder/src/hooks/utils/fixComponentsUtils/dataGrid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ComponentTreeNode } from "@illa-public/public-types"

export const fixedDataGridComponent = (component: ComponentTreeNode) => {
let fixedEnablePagination = true
if (component.props) {
fixedEnablePagination =
component.props.enablePagination !== undefined
? component.props.enablePagination
: component.props.overflowMethod === "PAGINATION"
}
return {
...component,
props: {
...component.props,
enablePagination: fixedEnablePagination,
},
}
}
18 changes: 18 additions & 0 deletions apps/builder/src/hooks/utils/fixComponentsUtils/image.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ComponentTreeNode } from "@illa-public/public-types"

export const fixedImageComponent = (component: ComponentTreeNode) => {
let fixedDynamicHeight = "auto"
if (component.props) {
fixedDynamicHeight =
component.props.dynamicHeight !== undefined
? component.props.dynamicHeight
: fixedDynamicHeight
}
return {
...component,
props: {
...component.props,
dynamicHeight: fixedDynamicHeight,
},
}
}
14 changes: 14 additions & 0 deletions apps/builder/src/hooks/utils/fixComponentsUtils/likeInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ComponentTreeNode } from "@illa-public/public-types"

export const fixedLikeInputComponentDefaultValue = (
component: ComponentTreeNode,
) => {
return {
...component,
props: {
...component.props,
value: "",
defaultValue: component.props?.defaultValue || "",
},
}
}
19 changes: 19 additions & 0 deletions apps/builder/src/hooks/utils/fixComponentsUtils/list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ComponentTreeNode } from "@illa-public/public-types"

export const fixedListComponent = (component: ComponentTreeNode) => {
let fixedEnablePagination = true
if (component.props) {
fixedEnablePagination =
component.props.enablePagination !== undefined
? component.props.enablePagination
: component.props.overflowMethod === "PAGINATION"
}
return {
...component,
props: {
...component.props,
enablePagination: fixedEnablePagination,
backgroundColor: "#ffffffbf",
},
}
}
Loading

0 comments on commit 932b5f8

Please sign in to comment.