From a200ef3e2608e752fed5711e9e7477eac52a8015 Mon Sep 17 00:00:00 2001 From: Colart Lloyd <55253106+Lloydcol@users.noreply.github.com> Date: Fri, 3 May 2024 10:54:36 +0200 Subject: [PATCH 1/9] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...static-web-apps-lively-beach-094e7a303.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml diff --git a/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml b/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml new file mode 100644 index 00000000..0a1fbc0b --- /dev/null +++ b/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.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_LIVELY_BEACH_094E7A303 }} + 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: "/src/conference-ia/" # App source code path + api_location: "" # Api source code path - optional + output_location: "src/conference-ia/dist" # 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_LIVELY_BEACH_094E7A303 }} + action: "close" From 00e2ff46d6e8670b3903f3e317bb5d5caadc0f69 Mon Sep 17 00:00:00 2001 From: Colart Lloyd <55253106+Lloydcol@users.noreply.github.com> Date: Fri, 3 May 2024 11:00:11 +0200 Subject: [PATCH 2/9] Update azure-static-web-apps-lively-beach-094e7a303.yml --- .../azure-static-web-apps-lively-beach-094e7a303.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml b/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml index 0a1fbc0b..b9c824d8 100644 --- a/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml +++ b/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml @@ -1,13 +1,10 @@ -name: Azure Static Web Apps CI/CD +name: Azure Static Web Apps CI/CD Test Lloyd on: push: branches: - main - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - main + workflow_dispatch: jobs: build_and_deploy_job: @@ -30,7 +27,7 @@ jobs: # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "/src/conference-ia/" # App source code path api_location: "" # Api source code path - optional - output_location: "src/conference-ia/dist" # Built app content directory - optional + output_location: "/src/conference-ia/dist/" # Built app content directory - optional ###### End of Repository/Build Configurations ###### close_pull_request_job: From 8a07ba462f9546eab250fcfe0d038f9e7a304d79 Mon Sep 17 00:00:00 2001 From: Thomas Laurent <87614789+thomaslrt05@users.noreply.github.com> Date: Fri, 3 May 2024 11:29:41 +0200 Subject: [PATCH 3/9] Update azure-static-web-apps-lively-beach-094e7a303.yml --- .../azure-static-web-apps-lively-beach-094e7a303.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml b/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml index b9c824d8..6d8630e9 100644 --- a/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml +++ b/.github/workflows/azure-static-web-apps-lively-beach-094e7a303.yml @@ -25,9 +25,9 @@ jobs: 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: "/src/conference-ia/" # App source code path + app_location: "/src/conference-ia" # App source code path api_location: "" # Api source code path - optional - output_location: "/src/conference-ia/dist/" # Built app content directory - optional + output_location: "dist" # Built app content directory - optional ###### End of Repository/Build Configurations ###### close_pull_request_job: From 096bb0f4b30925889f78d4e36c3916cd96ff7d7c Mon Sep 17 00:00:00 2001 From: Colart Lloyd <55253106+Lloydcol@users.noreply.github.com> Date: Fri, 3 May 2024 11:36:52 +0200 Subject: [PATCH 4/9] Update azure-static-web-apps-black-rock-04b9de903.yml --- .../workflows/azure-static-web-apps-black-rock-04b9de903.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-black-rock-04b9de903.yml b/.github/workflows/azure-static-web-apps-black-rock-04b9de903.yml index a09c2c66..3794b9cc 100644 --- a/.github/workflows/azure-static-web-apps-black-rock-04b9de903.yml +++ b/.github/workflows/azure-static-web-apps-black-rock-04b9de903.yml @@ -4,6 +4,7 @@ on: push: branches: -main + workflow_dispatch: jobs: build_and_deploy_job: @@ -26,9 +27,9 @@ jobs: 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: "/src/conference-ia/" # App source code path + app_location: "/src/conference-ia" # App source code path api_location: "" # Api source code path - optional - output_location: "/src/conference-ia/dist" # Built app content directory - optional + output_location: "dist" # Built app content directory - optional ###### End of Repository/Build Configurations ###### close_pull_request_job: From 7ff7e73616b5afaceb6332ce81da526ce518aa24 Mon Sep 17 00:00:00 2001 From: Colart Lloyd <55253106+Lloydcol@users.noreply.github.com> Date: Fri, 3 May 2024 11:40:53 +0200 Subject: [PATCH 5/9] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...ic-web-apps-wonderful-island-04d9a0e03.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.yml diff --git a/.github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.yml b/.github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.yml new file mode 100644 index 00000000..340f7193 --- /dev/null +++ b/.github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.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_WONDERFUL_ISLAND_04D9A0E03 }} + 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: "/src/conference-ia/" # App source code path + api_location: "" # Api source code path - optional + output_location: "dist" # 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_WONDERFUL_ISLAND_04D9A0E03 }} + action: "close" From af7c965d967ca1b18582892a67ef104d49fe8ba9 Mon Sep 17 00:00:00 2001 From: Thomas Laurent <87614789+thomaslrt05@users.noreply.github.com> Date: Fri, 3 May 2024 13:43:19 +0200 Subject: [PATCH 6/9] Update azure-static-web-apps-wonderful-island-04d9a0e03.yml --- .../azure-static-web-apps-wonderful-island-04d9a0e03.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.yml b/.github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.yml index 340f7193..db79bedd 100644 --- a/.github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.yml +++ b/.github/workflows/azure-static-web-apps-wonderful-island-04d9a0e03.yml @@ -1,13 +1,10 @@ -name: Azure Static Web Apps CI/CD +name: Azure Static Web Apps CI/CD - Client Conference IA on: push: branches: - main - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - main + workflow_dispatch : jobs: build_and_deploy_job: @@ -24,6 +21,8 @@ jobs: uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WONDERFUL_ISLAND_04D9A0E03 }} + VITE_COG_SVC_REGION: ${{ secrets.SPEECH_REGION }} + VITE_COG_SVC_SUB_KEY: ${{ secrets.SPEECH_KEY }} 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. ###### From 5bcc773ec4189de784b9a4a56a3ccbf3dd8596e6 Mon Sep 17 00:00:00 2001 From: thomaslrt05 Date: Fri, 3 May 2024 14:07:29 +0200 Subject: [PATCH 7/9] update site --- .../src/Components/CreateConference.tsx | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/src/conference-ia/src/Components/CreateConference.tsx b/src/conference-ia/src/Components/CreateConference.tsx index 07e8fbe3..2aa64a34 100644 --- a/src/conference-ia/src/Components/CreateConference.tsx +++ b/src/conference-ia/src/Components/CreateConference.tsx @@ -3,10 +3,40 @@ import { Link } from 'react-router-dom'; const CreateConference: React.FC = () => { const [title, setTitle] = useState(''); - const [isLoading] = useState(false); - const [message] = useState(''); + const [isLoading, setIsLoading] = useState(false); + const [message, setMessage] = useState(''); - // eslint-disable-next-line @typescript-eslint/no-unused-vars + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + + if (!title || !title.trim()) { + setMessage('Vous devez écrire un contexte.'); + return; + } + + setIsLoading(true); + setMessage('Création en cours...'); + + try { + const response = await fetch('https://api-generateconference.azurewebsites.net/Conference/CreateConference', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ Prompt: title }) + }); + + if (response.ok) { + setMessage('La conférence a été créée.'); + } else { + setMessage('La création de la conférence a échoué.'); + } + } catch (error) { + setMessage('Une erreur est survenue lors de la création de la conférence.'); + } finally { + setIsLoading(false); + } + }; return (
@@ -24,6 +54,7 @@ const CreateConference: React.FC = () => { />