From ba0aabcfc30595e63511fbe46a31e59096bb8a0c Mon Sep 17 00:00:00 2001 From: Siyuan Ling Date: Mon, 12 Feb 2024 20:08:37 +0800 Subject: [PATCH 1/2] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...static-web-apps-polite-smoke-01a2a4f00.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml diff --git a/.github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml b/.github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml new file mode 100644 index 00000000000..9436ee1a576 --- /dev/null +++ b/.github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml @@ -0,0 +1,46 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - main + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + lfs: false + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_SMOKE_01A2A4F00 }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/" # App source code path + api_location: "" # Api source code path - optional + output_location: "" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_SMOKE_01A2A4F00 }} + action: "close" From e2b1a5f15da9e1900b42da9f3e4c232294b9e9b8 Mon Sep 17 00:00:00 2001 From: Siyuan Ling Date: Mon, 12 Feb 2024 20:31:15 +0800 Subject: [PATCH 2/2] update --- .../workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml | 2 +- app/components/chat.tsx | 2 ++ package.json | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml b/.github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml index 9436ee1a576..71d389b804d 100644 --- a/.github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml +++ b/.github/workflows/azure-static-web-apps-polite-smoke-01a2a4f00.yml @@ -30,7 +30,7 @@ jobs: # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "/" # App source code path api_location: "" # Api source code path - optional - output_location: "" # Built app content directory - optional + output_location: "build" # Built app content directory - optional ###### End of Repository/Build Configurations ###### close_pull_request_job: diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 39abdd97b24..347acaaaf10 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -783,6 +783,7 @@ function _Chat() { }; const onRightClick = (e: any, message: ChatMessage) => { // copy to clipboard + /* Disable right click copy as it is disturbing. if (selectOrCopy(e.currentTarget, message.content)) { if (userInput.length === 0) { setUserInput(message.content); @@ -790,6 +791,7 @@ function _Chat() { e.preventDefault(); } + */ }; const deleteMessage = (msgId?: string) => { diff --git a/package.json b/package.json index b31d6a901a0..03a8b69c8c7 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "nextchat", "private": false, "license": "mit", + "engines": { + "node": "18.17.1" + }, "scripts": { "dev": "next dev", "build": "cross-env BUILD_MODE=standalone next build",