mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-28 04:39:16 +00:00
Compare commits
42 Commits
refactoring
...
v1.12.0
| Author | SHA1 | Date | |
|---|---|---|---|
| f57fbf2d35 | |||
| 920f4558fc | |||
| 9df901b9d6 | |||
| c09c440631 | |||
| cd7ce77074 | |||
| 6d3c26419d | |||
| 9dbc38984e | |||
| 1bd5a294e4 | |||
| 4d98ed4977 | |||
| bf32c073c6 | |||
| 4f2c4bfaf9 | |||
| dacf705329 | |||
| 8296738347 | |||
| 04be495351 | |||
| 43185605eb | |||
| cf3fb208e2 | |||
| 4ca230eb12 | |||
| 4b5e0cb2a3 | |||
| 45f374610f | |||
| b419a2bfd2 | |||
| ee8d96bee7 | |||
| c65ff2d75d | |||
| ea1c90d8ca | |||
| 3e963e3e6d | |||
| 82769128a1 | |||
| 05f4ce6b2e | |||
| 508984ecfa | |||
| a05507f73d | |||
| a27def119c | |||
| fce94f38ce | |||
| 83bd9c5ce3 | |||
| bfbfade99a | |||
| 16daf7b8d3 | |||
| fcad79d662 | |||
| 2424ce17ec | |||
| 4715905334 | |||
| 7c05aedcfe | |||
| 7347fc7c86 | |||
| ada7d9a666 | |||
| 0cb3fb8e3c | |||
| dcb788b57b | |||
| 73bcb9d598 |
@@ -12,6 +12,9 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_USER: 1001:127
|
DOCKER_USER: 1001:127
|
||||||
DOCKER_CONTAINER_REGISTRY_HOSTNAME: docker.io
|
DOCKER_CONTAINER_REGISTRY_HOSTNAME: docker.io
|
||||||
@@ -20,6 +23,8 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-push-backend:
|
build-and-push-backend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
@@ -43,12 +48,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
# -
|
-
|
||||||
# name: Run trivy scan
|
name: Run trivy scan
|
||||||
# uses: numerique-gouv/action-trivy-cache@main
|
uses: numerique-gouv/action-trivy-cache@main
|
||||||
# with:
|
with:
|
||||||
# docker-build-args: '--target backend-production -f Dockerfile'
|
docker-build-args: '--target backend-production -f Dockerfile'
|
||||||
# docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-backend:${{ github.sha }}'
|
docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-backend:${{ github.sha }}'
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -63,6 +68,8 @@ jobs:
|
|||||||
|
|
||||||
build-and-push-frontend-generic:
|
build-and-push-frontend-generic:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
@@ -86,12 +93,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
# -
|
-
|
||||||
# name: Run trivy scan
|
name: Run trivy scan
|
||||||
# uses: numerique-gouv/action-trivy-cache@main
|
uses: numerique-gouv/action-trivy-cache@main
|
||||||
# with:
|
with:
|
||||||
# docker-build-args: '-f src/frontend/Dockerfile --target frontend-production'
|
docker-build-args: '-f src/frontend/Dockerfile --target frontend-production'
|
||||||
# docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend:${{ github.sha }}'
|
docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend:${{ github.sha }}'
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -107,6 +114,8 @@ jobs:
|
|||||||
|
|
||||||
build-and-push-frontend-dinum:
|
build-and-push-frontend-dinum:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
@@ -130,12 +139,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
# -
|
-
|
||||||
# name: Run trivy scan
|
name: Run trivy scan
|
||||||
# uses: numerique-gouv/action-trivy-cache@main
|
uses: numerique-gouv/action-trivy-cache@main
|
||||||
# with:
|
with:
|
||||||
# docker-build-args: '-f docker/dinum-frontend/Dockerfile --target frontend-production'
|
docker-build-args: '-f docker/dinum-frontend/Dockerfile --target frontend-production'
|
||||||
# docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend-dinum:${{ github.sha }}'
|
docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend-dinum:${{ github.sha }}'
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -151,6 +160,8 @@ jobs:
|
|||||||
|
|
||||||
build-and-push-summary:
|
build-and-push-summary:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
@@ -174,13 +185,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
# -
|
-
|
||||||
# name: Run trivy scan
|
name: Run trivy scan
|
||||||
# uses: numerique-gouv/action-trivy-cache@main
|
uses: numerique-gouv/action-trivy-cache@main
|
||||||
# continue-on-error: true
|
continue-on-error: true
|
||||||
# with:
|
with:
|
||||||
# docker-build-args: '-f src/summary/Dockerfile --target production'
|
docker-build-args: '-f src/summary/Dockerfile --target production'
|
||||||
# docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-summary:${{ github.sha }}'
|
docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-summary:${{ github.sha }}'
|
||||||
docker-context: './src/summary'
|
docker-context: './src/summary'
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
@@ -197,6 +208,8 @@ jobs:
|
|||||||
|
|
||||||
build-and-push-agents:
|
build-and-push-agents:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
@@ -220,14 +233,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
# -
|
-
|
||||||
# name: Run trivy scan
|
name: Run trivy scan
|
||||||
# uses: numerique-gouv/action-trivy-cache@main
|
uses: numerique-gouv/action-trivy-cache@main
|
||||||
# continue-on-error: true
|
continue-on-error: true
|
||||||
# with:
|
with:
|
||||||
# docker-build-args: '-f src/agents/Dockerfile --target production'
|
docker-build-args: '-f src/agents/Dockerfile --target production'
|
||||||
# docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-agents:${{ github.sha }}'
|
docker-image-name: '${{ env.DOCKER_CONTAINER_REGISTRY_HOSTNAME }}/${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-agents:${{ github.sha }}'
|
||||||
# docker-context: './src/agents'
|
docker-context: './src/agents'
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -242,6 +255,8 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
notify-argocd:
|
notify-argocd:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
needs:
|
needs:
|
||||||
- build-and-push-frontend-generic
|
- build-and-push-frontend-generic
|
||||||
- build-and-push-frontend-dinum
|
- build-and-push-frontend-dinum
|
||||||
|
|||||||
@@ -297,6 +297,46 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: uv run pytest -n 2
|
run: uv run pytest -n 2
|
||||||
|
|
||||||
|
test-summary:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: src/summary
|
||||||
|
|
||||||
|
env:
|
||||||
|
APP_API_TOKEN: "test-api-token"
|
||||||
|
AWS_STORAGE_BUCKET_NAME: "http://meet-media-storage"
|
||||||
|
AWS_S3_ENDPOINT_URL: "minio:9000"
|
||||||
|
AWS_S3_ACCESS_KEY_ID: "meet"
|
||||||
|
AWS_S3_SECRET_ACCESS_KEY: "password"
|
||||||
|
WHISPERX_BASE_URL: "https://configure-your-url.com"
|
||||||
|
WHISPERX_ASR_MODEL: "large-v2"
|
||||||
|
WHISPERX_API_KEY: "test-whisperx-secret"
|
||||||
|
WHISPERX_DEFAULT_LANGUAGE: "fr"
|
||||||
|
LLM_BASE_URL: "https://configure-your-url.com"
|
||||||
|
LLM_API_KEY: "test-llm-secret"
|
||||||
|
LLM_MODEL: "test-llm-model"
|
||||||
|
WEBHOOK_API_TOKEN: "test-webhook-secret"
|
||||||
|
WEBHOOK_URL: "https://configure-your-url.com"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Install Python
|
||||||
|
uses: actions/setup-python@v6
|
||||||
|
with:
|
||||||
|
python-version: "3.13"
|
||||||
|
cache: "pip"
|
||||||
|
|
||||||
|
- name: Install development dependencies
|
||||||
|
run: pip install --user .[dev]
|
||||||
|
|
||||||
|
- name: Run summary tests
|
||||||
|
run: ~/.local/bin/pytest
|
||||||
|
|
||||||
lint-front:
|
lint-front:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
+34
-2
@@ -8,6 +8,32 @@ and this project adheres to
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.12.0] - 2026-03-24
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- ♻️(backend) configurable SESSION_ENGINE #1038 #1154
|
||||||
|
- ♿️(frontend) fix sidepanel accessibility aria-label #1182
|
||||||
|
- ♿️(frontend) fix more tools heading hierarchy #1181
|
||||||
|
- ♿️(fronted) improve button descriptions for More tools actions #1184
|
||||||
|
- 💄(spinner) enforce spinner height #1183
|
||||||
|
- 💄(custom-background) add upload indicator with preview #1183
|
||||||
|
- ♿️(backend) improve logo accessibility in recording email notification #1092
|
||||||
|
- ♿️(summary) improve accessibility of transcription download link #1187
|
||||||
|
- 💄(frontend) show OS-specific shortcut in participant tile hint #1193
|
||||||
|
- ⬆️(frontend) bump flatted from 3.3.1 to 3.4.2 in /src/frontend #1188
|
||||||
|
- ⬆️️️(frontend) bump undici from 6.23.0 to 6.24.1 in /src/frontend
|
||||||
|
- ⬆️️️(frontend) bump hono from 4.12.2 to 4.12.7 in /src/frontend
|
||||||
|
- ⬆️️️(frontend) bump dompurify from 3.3.1 to 3.3.2 in /src/frontend
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 🐛(frontend) disable personal custom background while deleting #1183
|
||||||
|
- 🐛(frontend) auto-select new custom background when not logged in #1183
|
||||||
|
- 🐛(frontend) fix device selection not applying during conference #1156
|
||||||
|
|
||||||
|
## [1.11.0] - 2026-03-19
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- ✨(helm) support celery with our Django backend #1124
|
- ✨(helm) support celery with our Django backend #1124
|
||||||
@@ -15,19 +41,24 @@ and this project adheres to
|
|||||||
- ✨(backend) add authenticated user rate throttling on request-entry #1129
|
- ✨(backend) add authenticated user rate throttling on request-entry #1129
|
||||||
- ✨(backend) expose `is_active` field for Application in Django admin #1133
|
- ✨(backend) expose `is_active` field for Application in Django admin #1133
|
||||||
- ✨(file-upload) disable by default & limit count by user #1141
|
- ✨(file-upload) disable by default & limit count by user #1141
|
||||||
|
- ✨(frontend) custom background #1067
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- ♿️(frontend) Caption text size setting for accessibility #1062
|
- ♿️(frontend) Caption text size setting for accessibility #1062
|
||||||
- ♿️(frontend) sync html lang attribute with i18n for screen readers #1111
|
- ♿️(frontend) sync html lang attribute with i18n for screen readers #1111
|
||||||
- ♿️(frontend) improve MoreLink a11y and UX on home page #1112
|
- ♿️(frontend) improve MoreLink a11y and UX on home page #1112
|
||||||
- ♿(frontend) improve chat toast a11y for screen readers #1109
|
- ♿️(frontend) improve chat toast a11y for screen readers #1109
|
||||||
- ♿(frontend) improve ui and aria labels for help article links #1108
|
- ♿️(frontend) improve ui and aria labels for help article links #1108
|
||||||
- 🌐(frontend) improve German translation #1125
|
- 🌐(frontend) improve German translation #1125
|
||||||
- 🔨(python-env) migrate meet main app to UV #1120
|
- 🔨(python-env) migrate meet main app to UV #1120
|
||||||
- ♻️(backend) align Application model field with `is_active` convention #1133
|
- ♻️(backend) align Application model field with `is_active` convention #1133
|
||||||
- 🔐(backend) avoids revealing the inactive status of an application #1135
|
- 🔐(backend) avoids revealing the inactive status of an application #1135
|
||||||
- ⚡️(helm) reduce initialDelaySeconds and add periods seconds #1139
|
- ⚡️(helm) reduce initialDelaySeconds and add periods seconds #1139
|
||||||
|
- 🔒️(backend) avoid information exposure through exception messages #1144
|
||||||
|
- ⬆️(dependencies) update PyJWT to v2.12.0 [SECURITY] #1151
|
||||||
|
- 📌(agents) unpin OpenSSL and related dependencies #1167
|
||||||
|
- ♿️(frontend) add caption font and background color customization #1122
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
@@ -35,6 +66,7 @@ and this project adheres to
|
|||||||
- 🩹(backend) add page_size to pagination for room endpoints #1131
|
- 🩹(backend) add page_size to pagination for room endpoints #1131
|
||||||
- 🐛(backend) refactor lobby throttling to use participant id #1129
|
- 🐛(backend) refactor lobby throttling to use participant id #1129
|
||||||
- 🩹(backend) ignore non-recording uploads in storage webhook handler #1142
|
- 🩹(backend) ignore non-recording uploads in storage webhook handler #1142
|
||||||
|
- 🐛(frontend) fix dimension mismatch in BackgroundCustomProcessor #1116
|
||||||
|
|
||||||
## [1.10.0] - 2026-03-05
|
## [1.10.0] - 2026-03-05
|
||||||
|
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ lint-pylint: ## lint back-end python sources with pylint only on changed files f
|
|||||||
|
|
||||||
test: ## run project tests
|
test: ## run project tests
|
||||||
@$(MAKE) test-back-parallel
|
@$(MAKE) test-back-parallel
|
||||||
|
@$(MAKE) test-summary
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
|
||||||
test-back: ## run back-end tests
|
test-back: ## run back-end tests
|
||||||
@@ -203,6 +204,11 @@ test-back-parallel: ## run all back-end tests in parallel
|
|||||||
bin/pytest -n auto $${args:-${1}}
|
bin/pytest -n auto $${args:-${1}}
|
||||||
.PHONY: test-back-parallel
|
.PHONY: test-back-parallel
|
||||||
|
|
||||||
|
test-summary: ## run summary tests
|
||||||
|
@args="$(filter-out $@,$(MAKECMDGOALS))" && \
|
||||||
|
bin/pytest-summary $${args:-${1}}
|
||||||
|
.PHONY: test-summary
|
||||||
|
|
||||||
makemigrations: ## run django makemigrations for the Meet project.
|
makemigrations: ## run django makemigrations for the Meet project.
|
||||||
@echo "$(BOLD)Running makemigrations$(RESET)"
|
@echo "$(BOLD)Running makemigrations$(RESET)"
|
||||||
@$(COMPOSE) up -d postgresql
|
@$(COMPOSE) up -d postgresql
|
||||||
|
|||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")/_config.sh"
|
||||||
|
|
||||||
|
_dc_run \
|
||||||
|
app-summary-dev \
|
||||||
|
python -m pytest "$@"
|
||||||
@@ -61,11 +61,10 @@ services:
|
|||||||
`docker compose up -d`
|
`docker compose up -d`
|
||||||
```
|
```
|
||||||
|
|
||||||
Your keycloak instance is now available on https://doc.yourdomain.tld
|
Your keycloak instance is now available on https://id.yourdomain.tld
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
> Version of the images are set to latest, you should pin it to the desired version to avoid unwanted upgrades when pulling latest image. You can find available versions on [Keycloak registry](https://quay.io/repository/keycloak/keycloak?tab=tags).
|
> Version of the images are set to latest, you should pin it to the desired version to avoid unwanted upgrades when pulling latest image. You can find available versions on [Keycloak registry](https://quay.io/repository/keycloak/keycloak?tab=tags).
|
||||||
```
|
|
||||||
|
|
||||||
## Creating an OIDC Client for Meet Application
|
## Creating an OIDC Client for Meet Application
|
||||||
|
|
||||||
@@ -76,7 +75,7 @@ Your keycloak instance is now available on https://doc.yourdomain.tld
|
|||||||
3. Enter the name of the realm - `meet`.
|
3. Enter the name of the realm - `meet`.
|
||||||
4. Click "Create".
|
4. Click "Create".
|
||||||
|
|
||||||
#### Step 2: Create a New Client
|
### Step 2: Create a New Client
|
||||||
|
|
||||||
1. Navigate to the "Clients" tab.
|
1. Navigate to the "Clients" tab.
|
||||||
2. Click on the "Create client" button.
|
2. Click on the "Create client" button.
|
||||||
@@ -86,7 +85,7 @@ Your keycloak instance is now available on https://doc.yourdomain.tld
|
|||||||
1. Set the "Web Origins" to the URL of your meet application - e.g. `https://meet.example.com`.
|
1. Set the "Web Origins" to the URL of your meet application - e.g. `https://meet.example.com`.
|
||||||
1. Click "Save".
|
1. Click "Save".
|
||||||
|
|
||||||
#### Step 3: Get Client Credentials
|
### Step 3: Get Client Credentials
|
||||||
|
|
||||||
1. Go to the "Credentials" tab.
|
1. Go to the "Credentials" tab.
|
||||||
2. Copy the client ID (`meet` in this example) and the client secret.
|
2. Copy the client ID (`meet` in this example) and the client secret.
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ paths:
|
|||||||
'403':
|
'403':
|
||||||
$ref: '#/components/responses/ForbiddenError'
|
$ref: '#/components/responses/ForbiddenError'
|
||||||
|
|
||||||
|
/rooms/:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- Rooms
|
- Rooms
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ paths:
|
|||||||
'403':
|
'403':
|
||||||
$ref: '#/components/responses/ForbiddenError'
|
$ref: '#/components/responses/ForbiddenError'
|
||||||
|
|
||||||
|
/rooms/:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- Rooms
|
- Rooms
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ AWS_S3_DOMAIN_REPLACE=http://localhost:9000
|
|||||||
AWS_S3_ENDPOINT_URL=http://minio:9000
|
AWS_S3_ENDPOINT_URL=http://minio:9000
|
||||||
AWS_S3_ACCESS_KEY_ID=meet
|
AWS_S3_ACCESS_KEY_ID=meet
|
||||||
AWS_S3_SECRET_ACCESS_KEY=password
|
AWS_S3_SECRET_ACCESS_KEY=password
|
||||||
MEDIA_BASE_URL=http://localhost:8083
|
MEDIA_BASE_URL=http://localhost:3000
|
||||||
FILE_UPLOAD_ENABLED=True
|
FILE_UPLOAD_ENABLED=True
|
||||||
|
|
||||||
# OIDC
|
# OIDC
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ FROM python:3.13-slim AS base
|
|||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
libglib2.0-0 \
|
libglib2.0-0 \
|
||||||
libgobject-2.0-0 \
|
libgobject-2.0-0 \
|
||||||
"openssl=3.5.4-1~deb13u2" \
|
|
||||||
"libssl3t64=3.5.4-1~deb13u2" \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "agents"
|
name = "agents"
|
||||||
version = "1.10.0"
|
version = "1.12.0"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"livekit-agents==1.3.10",
|
"livekit-agents==1.3.10",
|
||||||
|
|||||||
@@ -488,9 +488,7 @@ class RoomViewSet(
|
|||||||
if status_code == drf_status.HTTP_500_INTERNAL_SERVER_ERROR:
|
if status_code == drf_status.HTTP_500_INTERNAL_SERVER_ERROR:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
return drf_response.Response(
|
return drf_response.Response({"status": "error"}, status=status_code)
|
||||||
{"status": "error", "message": str(e)}, status=status_code
|
|
||||||
)
|
|
||||||
|
|
||||||
@decorators.action(
|
@decorators.action(
|
||||||
detail=False,
|
detail=False,
|
||||||
@@ -757,10 +755,10 @@ class RecordingViewSet(
|
|||||||
recording_id = parser.get_recording_id(request.data)
|
recording_id = parser.get_recording_id(request.data)
|
||||||
|
|
||||||
except ParsingEventDataError as e:
|
except ParsingEventDataError as e:
|
||||||
raise drf_exceptions.PermissionDenied(f"Invalid request data: {e}") from e
|
raise drf_exceptions.PermissionDenied("Invalid request data.") from e
|
||||||
|
|
||||||
except InvalidBucketError as e:
|
except InvalidBucketError as e:
|
||||||
raise drf_exceptions.PermissionDenied("Invalid bucket specified") from e
|
raise drf_exceptions.PermissionDenied("Invalid bucket specified.") from e
|
||||||
|
|
||||||
except InvalidFilepathError:
|
except InvalidFilepathError:
|
||||||
return drf_response.Response(
|
return drf_response.Response(
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ FILE_EXT_REGEX = r"[a-zA-Z0-9]{1,10}"
|
|||||||
|
|
||||||
# pylint: disable=line-too-long
|
# pylint: disable=line-too-long
|
||||||
RECORDING_STORAGE_URL_PATTERN = re.compile(
|
RECORDING_STORAGE_URL_PATTERN = re.compile(
|
||||||
f"{settings.MEDIA_URL:s}{settings.RECORDING_OUTPUT_FOLDER}/(?P<recording_id>{UUID_REGEX:s}).(?P<extension>{FILE_EXT_REGEX:s})"
|
rf"{settings.MEDIA_URL:s}{settings.RECORDING_OUTPUT_FOLDER}/(?P<recording_id>{UUID_REGEX:s})\.(?P<extension>{FILE_EXT_REGEX:s})"
|
||||||
)
|
)
|
||||||
|
|
||||||
MEDIA_STORAGE_URL_PATTERN = re.compile(
|
MEDIA_STORAGE_URL_PATTERN = re.compile(
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def test_save_recording_parsing_error(recording_settings, mock_get_parser, clien
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == 403
|
assert response.status_code == 403
|
||||||
assert response.json() == {"detail": "Invalid request data: Error message"}
|
assert response.json() == {"detail": "Invalid request data."}
|
||||||
|
|
||||||
|
|
||||||
def test_save_recording_bucket_error(recording_settings, mock_get_parser, client):
|
def test_save_recording_bucket_error(recording_settings, mock_get_parser, client):
|
||||||
@@ -112,7 +112,7 @@ def test_save_recording_bucket_error(recording_settings, mock_get_parser, client
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == 403
|
assert response.status_code == 403
|
||||||
assert response.json() == {"detail": "Invalid bucket specified"}
|
assert response.json() == {"detail": "Invalid bucket specified."}
|
||||||
|
|
||||||
|
|
||||||
def test_save_recording_filetype_error(recording_settings, mock_get_parser):
|
def test_save_recording_filetype_error(recording_settings, mock_get_parser):
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ def test_missing_auth_header(client, serialized_event_data, mock_livekit_config)
|
|||||||
assert response.status_code == 401
|
assert response.status_code == 401
|
||||||
assert response.json() == {
|
assert response.json() == {
|
||||||
"status": "error",
|
"status": "error",
|
||||||
"message": "Authorization header missing",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -91,7 +90,7 @@ def test_invalid_payload(client, auth_token, mock_livekit_config):
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == 400
|
assert response.status_code == 400
|
||||||
assert response.json() == {"status": "error", "message": "Invalid webhook payload"}
|
assert response.json() == {"status": "error"}
|
||||||
|
|
||||||
|
|
||||||
def test_unknown_event_type(client, mock_livekit_config):
|
def test_unknown_event_type(client, mock_livekit_config):
|
||||||
@@ -116,7 +115,6 @@ def test_unknown_event_type(client, mock_livekit_config):
|
|||||||
assert response.status_code == 422
|
assert response.status_code == 422
|
||||||
assert response.json() == {
|
assert response.json() == {
|
||||||
"status": "error",
|
"status": "error",
|
||||||
"message": "Unknown webhook type: unknown_event_type",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -452,7 +452,11 @@ class Base(Configuration):
|
|||||||
CELERY_BROKER_TRANSPORT_OPTIONS = values.DictValue({}, environ_prefix=None)
|
CELERY_BROKER_TRANSPORT_OPTIONS = values.DictValue({}, environ_prefix=None)
|
||||||
|
|
||||||
# Session
|
# Session
|
||||||
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
|
SESSION_ENGINE = values.Value(
|
||||||
|
default="django.contrib.sessions.backends.cache",
|
||||||
|
environ_name="SESSION_ENGINE",
|
||||||
|
environ_prefix=None,
|
||||||
|
)
|
||||||
SESSION_CACHE_ALIAS = "default"
|
SESSION_CACHE_ALIAS = "default"
|
||||||
SESSION_COOKIE_AGE = values.PositiveIntegerValue(
|
SESSION_COOKIE_AGE = values.PositiveIntegerValue(
|
||||||
default=60 * 60 * 12, environ_name="SESSION_COOKIE_AGE", environ_prefix=None
|
default=60 * 60 * 12, environ_name="SESSION_COOKIE_AGE", environ_prefix=None
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ build-backend = "uv_build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "meet"
|
name = "meet"
|
||||||
version = "1.10.0"
|
version = "1.12.0"
|
||||||
authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }]
|
authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }]
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
@@ -52,7 +52,7 @@ dependencies = [
|
|||||||
"nested-multipart-parser==1.6.0",
|
"nested-multipart-parser==1.6.0",
|
||||||
"psycopg[binary]==3.3.2",
|
"psycopg[binary]==3.3.2",
|
||||||
"pydantic==2.12.4",
|
"pydantic==2.12.4",
|
||||||
"PyJWT==2.11.0",
|
"PyJWT==2.12.0",
|
||||||
"python-frontmatter==1.1.0",
|
"python-frontmatter==1.1.0",
|
||||||
"python-magic==0.4.27",
|
"python-magic==0.4.27",
|
||||||
"requests==2.32.5",
|
"requests==2.32.5",
|
||||||
@@ -90,6 +90,11 @@ dev = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.uv.build-backend]
|
[tool.uv.build-backend]
|
||||||
|
module-name = [
|
||||||
|
"core",
|
||||||
|
"demo",
|
||||||
|
"meet"
|
||||||
|
]
|
||||||
module-root = ""
|
module-root = ""
|
||||||
source-exclude = [
|
source-exclude = [
|
||||||
"**/tests/**",
|
"**/tests/**",
|
||||||
|
|||||||
Generated
+5
-5
@@ -1157,7 +1157,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "meet"
|
name = "meet"
|
||||||
version = "1.10.0"
|
version = "1.12.0"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "aiohttp" },
|
{ name = "aiohttp" },
|
||||||
@@ -1251,7 +1251,7 @@ requires-dist = [
|
|||||||
{ name = "nested-multipart-parser", specifier = "==1.6.0" },
|
{ name = "nested-multipart-parser", specifier = "==1.6.0" },
|
||||||
{ name = "psycopg", extras = ["binary"], specifier = "==3.3.2" },
|
{ name = "psycopg", extras = ["binary"], specifier = "==3.3.2" },
|
||||||
{ name = "pydantic", specifier = "==2.12.4" },
|
{ name = "pydantic", specifier = "==2.12.4" },
|
||||||
{ name = "pyjwt", specifier = "==2.11.0" },
|
{ name = "pyjwt", specifier = "==2.12.0" },
|
||||||
{ name = "python-frontmatter", specifier = "==1.1.0" },
|
{ name = "python-frontmatter", specifier = "==1.1.0" },
|
||||||
{ name = "python-magic", specifier = "==0.4.27" },
|
{ name = "python-magic", specifier = "==0.4.27" },
|
||||||
{ name = "redis", specifier = "==5.2.1" },
|
{ name = "redis", specifier = "==5.2.1" },
|
||||||
@@ -1754,11 +1754,11 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyjwt"
|
name = "pyjwt"
|
||||||
version = "2.11.0"
|
version = "2.12.0"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/5c/5a/b46fa56bf322901eee5b0454a34343cdbdae202cd421775a8ee4e42fd519/pyjwt-2.11.0.tar.gz", hash = "sha256:35f95c1f0fbe5d5ba6e43f00271c275f7a1a4db1dab27bf708073b75318ea623", size = 98019, upload-time = "2026-01-30T19:59:55.694Z" }
|
sdist = { url = "https://files.pythonhosted.org/packages/a8/10/e8192be5f38f3e8e7e046716de4cae33d56fd5ae08927a823bb916be36c1/pyjwt-2.12.0.tar.gz", hash = "sha256:2f62390b667cd8257de560b850bb5a883102a388829274147f1d724453f8fb02", size = 102511, upload-time = "2026-03-12T17:15:30.831Z" }
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/6f/01/c26ce75ba460d5cd503da9e13b21a33804d38c2165dec7b716d06b13010c/pyjwt-2.11.0-py3-none-any.whl", hash = "sha256:94a6bde30eb5c8e04fee991062b534071fd1439ef58d2adc9ccb823e7bcd0469", size = 28224, upload-time = "2026-01-30T19:59:54.539Z" },
|
{ url = "https://files.pythonhosted.org/packages/15/70/70f895f404d363d291dcf62c12c85fdd47619ad9674ac0f53364d035925a/pyjwt-2.12.0-py3-none-any.whl", hash = "sha256:9bb459d1bdd0387967d287f5656bf7ec2b9a26645d1961628cda1764e087fd6e", size = 29700, upload-time = "2026-03-12T17:15:29.257Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
Generated
+19
-15
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "meet",
|
"name": "meet",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "meet",
|
"name": "meet",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource-variable/material-symbols-outlined": "5.2.34",
|
"@fontsource-variable/material-symbols-outlined": "5.2.34",
|
||||||
"@fontsource/material-icons-outlined": "5.2.6",
|
"@fontsource/material-icons-outlined": "5.2.6",
|
||||||
@@ -6269,10 +6269,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dompurify": {
|
"node_modules/dompurify": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.2.tgz",
|
||||||
"integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==",
|
"integrity": "sha512-6obghkliLdmKa56xdbLOpUZ43pAR6xFy1uOrxBaIDjT+yaRuuybLjGS9eVBoSR/UPU5fq3OXClEHLJNGvbxKpQ==",
|
||||||
"license": "(MPL-2.0 OR Apache-2.0)",
|
"license": "(MPL-2.0 OR Apache-2.0)",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@types/trusted-types": "^2.0.7"
|
"@types/trusted-types": "^2.0.7"
|
||||||
}
|
}
|
||||||
@@ -7158,10 +7161,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/flatted": {
|
"node_modules/flatted": {
|
||||||
"version": "3.3.1",
|
"version": "3.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
|
||||||
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/for-each": {
|
"node_modules/for-each": {
|
||||||
"version": "0.3.3",
|
"version": "0.3.3",
|
||||||
@@ -7628,9 +7632,9 @@
|
|||||||
"integrity": "sha512-Rf4YVNYpKjZ6ASAmibcwTNciQ5Co5Ztq6iZPEykHpkoflnD/K5ryE/rHehFsTm4NJj8nKDhbi3eKBWGogmNnkg=="
|
"integrity": "sha512-Rf4YVNYpKjZ6ASAmibcwTNciQ5Co5Ztq6iZPEykHpkoflnD/K5ryE/rHehFsTm4NJj8nKDhbi3eKBWGogmNnkg=="
|
||||||
},
|
},
|
||||||
"node_modules/hono": {
|
"node_modules/hono": {
|
||||||
"version": "4.12.2",
|
"version": "4.12.8",
|
||||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.2.tgz",
|
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.8.tgz",
|
||||||
"integrity": "sha512-gJnaDHXKDayjt8ue0n8Gs0A007yKXj4Xzb8+cNjZeYsSzzwKc0Lr+OZgYwVfB0pHfUs17EPoLvrOsEaJ9mj+Tg==",
|
"integrity": "sha512-VJCEvtrezO1IAR+kqEYnxUOoStaQPGrCmX3j4wDTNOcD1uRPFpGlwQUIW8niPuvHXaTUxeOUl5MMDGrl+tmO9A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -11107,9 +11111,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici": {
|
"node_modules/undici": {
|
||||||
"version": "6.23.0",
|
"version": "6.24.1",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-6.24.1.tgz",
|
||||||
"integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==",
|
"integrity": "sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.17"
|
"node": ">=18.17"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "meet",
|
"name": "meet",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "panda codegen && vite",
|
"dev": "panda codegen && vite",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 8.9 KiB |
@@ -15,7 +15,19 @@ export const fetchApi = async <T = Record<string, unknown>>(
|
|||||||
...options?.headers,
|
...options?.headers,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const result = await response.json()
|
|
||||||
|
let result: T
|
||||||
|
if (response.status === 204) {
|
||||||
|
result = undefined as T
|
||||||
|
} else {
|
||||||
|
const contentType = response.headers.get('content-type') ?? ''
|
||||||
|
if (!contentType.includes('application/json')) {
|
||||||
|
result = undefined as T
|
||||||
|
} else {
|
||||||
|
result = (await response.json()) as T
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new ApiError(response.status, result)
|
throw new ApiError(response.status, result)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ export const keys = {
|
|||||||
requestEntry: 'requestEntry',
|
requestEntry: 'requestEntry',
|
||||||
waitingParticipants: 'waitingParticipants',
|
waitingParticipants: 'waitingParticipants',
|
||||||
roomCreationCallback: 'roomCreationCallback',
|
roomCreationCallback: 'roomCreationCallback',
|
||||||
|
files: 'files',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ export interface ApiConfig {
|
|||||||
expiration_days?: number
|
expiration_days?: number
|
||||||
max_duration?: number
|
max_duration?: number
|
||||||
}
|
}
|
||||||
|
background_image: {
|
||||||
|
upload_is_enabled: boolean
|
||||||
|
max_size: number
|
||||||
|
max_count_by_user: number
|
||||||
|
allowed_extensions: string[]
|
||||||
|
allowed_mimetypes: string[]
|
||||||
|
}
|
||||||
subtitle: {
|
subtitle: {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import { fetchApi } from '@/api/fetchApi'
|
||||||
|
import { useMutation } from '@tanstack/react-query'
|
||||||
|
import { ApiFileItem } from '@/features/files/api/types.ts'
|
||||||
|
import { keys } from '@/api/queryKeys.ts'
|
||||||
|
import { queryClient } from '@/api/queryClient.ts'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload a file, using XHR so we can report on progress through a handler.
|
||||||
|
*
|
||||||
|
* @param url The URL to PUT the file to.
|
||||||
|
* @param file The file to upload.
|
||||||
|
* @param progressHandler A handler that receives progress updates as a single integer `0 <= x <= 100`.
|
||||||
|
*/
|
||||||
|
export const uploadFile = (
|
||||||
|
url: string,
|
||||||
|
file: File,
|
||||||
|
progressHandler: (progress: number) => void
|
||||||
|
) =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
const xhr = new XMLHttpRequest()
|
||||||
|
xhr.open('PUT', url)
|
||||||
|
xhr.setRequestHeader('X-amz-acl', 'private')
|
||||||
|
xhr.setRequestHeader('Content-Type', file.type)
|
||||||
|
|
||||||
|
xhr.addEventListener('error', reject)
|
||||||
|
xhr.addEventListener('abort', reject)
|
||||||
|
|
||||||
|
xhr.addEventListener('readystatechange', () => {
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
// Make sure to always set the progress to 100% when the upload is done.
|
||||||
|
// Because 'progress' event listener is not called when the file size is 0.
|
||||||
|
progressHandler(100)
|
||||||
|
return resolve(true)
|
||||||
|
}
|
||||||
|
reject(new Error(`Failed to perform the upload on ${url}.`))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
xhr.upload.addEventListener('progress', (progressEvent) => {
|
||||||
|
if (progressEvent.lengthComputable) {
|
||||||
|
progressHandler(
|
||||||
|
Math.floor((progressEvent.loaded / progressEvent.total) * 100)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
xhr.send(file)
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asynchronously creates a new file and uploads it to the server.
|
||||||
|
*
|
||||||
|
* @param {object} params - The parameters for the file creation and upload process.
|
||||||
|
* @param {File} params.file - The file object to be uploaded.
|
||||||
|
* @param {function} params.onProgress - A callback function that receives the upload progress as a number (0 to 100).
|
||||||
|
* @returns {Promise<ApiFileItem>} A promise that resolves when the file has been successfully uploaded and the server process is completed.
|
||||||
|
*/
|
||||||
|
export const createFile = async ({
|
||||||
|
file,
|
||||||
|
onProgress,
|
||||||
|
}: {
|
||||||
|
file: File
|
||||||
|
onProgress: (progress: number) => void
|
||||||
|
}): Promise<ApiFileItem> => {
|
||||||
|
const res = await fetchApi<ApiFileItem>(`/files/`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({ filename: file.name, type: 'background_image' }),
|
||||||
|
})
|
||||||
|
if (res.upload_state !== 'pending') {
|
||||||
|
throw new Error('State should be pending right after creation')
|
||||||
|
}
|
||||||
|
const policy = res.policy
|
||||||
|
await uploadFile(policy, file, onProgress)
|
||||||
|
const createdFile = await fetchApi<ApiFileItem>(
|
||||||
|
`/files/${res.id}/upload-ended/`,
|
||||||
|
{
|
||||||
|
method: 'POST',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// We invalidate the files query to make sure the new file is immediately available.
|
||||||
|
await queryClient.invalidateQueries({
|
||||||
|
queryKey: [keys.files],
|
||||||
|
})
|
||||||
|
return createdFile
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useCreateFile = () => {
|
||||||
|
return useMutation({
|
||||||
|
mutationFn: createFile,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { fetchApi } from '@/api/fetchApi'
|
||||||
|
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||||
|
import { keys } from '@/api/queryKeys.ts'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a file specified by its unique identifier.
|
||||||
|
*
|
||||||
|
* @param {Object} params - The parameters required for deleting the file.
|
||||||
|
* @param {string} params.fileId - The unique identifier of the file to be deleted.
|
||||||
|
* @returns {Promise<void>} A promise that resolves when the file is successfully deleted.
|
||||||
|
*/
|
||||||
|
export const deleteFile = async ({
|
||||||
|
fileId,
|
||||||
|
}: {
|
||||||
|
fileId: string
|
||||||
|
}): Promise<void> => {
|
||||||
|
await fetchApi<void>(`/files/${fileId}/`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useDeleteFile = () => {
|
||||||
|
const queryClient = useQueryClient()
|
||||||
|
|
||||||
|
return useMutation({
|
||||||
|
mutationFn: deleteFile,
|
||||||
|
onSuccess: async () => {
|
||||||
|
await queryClient.invalidateQueries({
|
||||||
|
queryKey: [keys.files],
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
import { fetchApi } from '@/api/fetchApi'
|
||||||
|
import { keepPreviousData, useQuery } from '@tanstack/react-query'
|
||||||
|
import { keys } from '@/api/queryKeys'
|
||||||
|
import {
|
||||||
|
ApiFileItem,
|
||||||
|
ApiFileType,
|
||||||
|
ApiFileUploadState,
|
||||||
|
} from '@/features/files/api/types.ts'
|
||||||
|
import { useUser } from '@/features/auth'
|
||||||
|
import { useConfig } from '@/api/useConfig.ts'
|
||||||
|
|
||||||
|
type ListFilesResponse = {
|
||||||
|
count: number
|
||||||
|
next: string | null
|
||||||
|
previous: string | null
|
||||||
|
results: ApiFileItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListFilesFilters = {
|
||||||
|
is_creator_me?: boolean
|
||||||
|
type?: ApiFileType
|
||||||
|
upload_state?: ApiFileUploadState
|
||||||
|
is_deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ListFilesParams = {
|
||||||
|
filters?: ListFilesFilters
|
||||||
|
pagination: {
|
||||||
|
page: number
|
||||||
|
pageSize: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const listMyFiles = async ({
|
||||||
|
filters = {},
|
||||||
|
pagination: { page, pageSize },
|
||||||
|
}: ListFilesParams): Promise<ListFilesResponse> => {
|
||||||
|
const query = new URLSearchParams()
|
||||||
|
query.append('page', page.toString())
|
||||||
|
query.append('page_size', pageSize.toString())
|
||||||
|
if (filters?.is_creator_me ?? true) {
|
||||||
|
query.append('is_creator_me', 'true')
|
||||||
|
}
|
||||||
|
if (filters?.type) {
|
||||||
|
query.append('type', filters.type)
|
||||||
|
}
|
||||||
|
if (filters?.upload_state) {
|
||||||
|
query.append('upload_state', filters.upload_state)
|
||||||
|
}
|
||||||
|
if (typeof filters?.is_deleted === 'boolean') {
|
||||||
|
query.append('is_deleted', filters.is_deleted ? 'true' : 'false')
|
||||||
|
}
|
||||||
|
|
||||||
|
return fetchApi<ListFilesResponse>(`/files?${query.toString()}`, {
|
||||||
|
method: 'GET',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useListMyFiles = (params: Parameters<typeof listMyFiles>[0]) => {
|
||||||
|
const { isLoggedIn } = useUser()
|
||||||
|
const { data: appConfig } = useConfig()
|
||||||
|
return useQuery({
|
||||||
|
queryKey: [keys.files, params],
|
||||||
|
queryFn: () => listMyFiles(params),
|
||||||
|
refetchOnMount: 'always',
|
||||||
|
placeholderData: keepPreviousData,
|
||||||
|
enabled:
|
||||||
|
isLoggedIn && appConfig?.background_image?.upload_is_enabled === true,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
export type ApiFileCreator = {
|
||||||
|
id: string // UUID
|
||||||
|
full_name: string | null
|
||||||
|
short_name: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ApiFileType = 'background_image'
|
||||||
|
export type ApiFileUploadState = 'pending' | 'ready'
|
||||||
|
|
||||||
|
export type ApiFileItem = {
|
||||||
|
id: string // UUID
|
||||||
|
created_at: string // ISO datetime string
|
||||||
|
updated_at: string // ISO datetime string
|
||||||
|
title: string
|
||||||
|
type: ApiFileType
|
||||||
|
creator: ApiFileCreator
|
||||||
|
deleted_at: string | null
|
||||||
|
hard_deleted_at: string | null
|
||||||
|
filename: string
|
||||||
|
upload_state: ApiFileUploadState
|
||||||
|
mimetype: string // e.g. "image/png"
|
||||||
|
size: number // file size in bytes
|
||||||
|
description: string | null
|
||||||
|
} & (
|
||||||
|
| {
|
||||||
|
upload_state: 'ready'
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
upload_state: 'pending'
|
||||||
|
policy: string
|
||||||
|
url: null
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -215,8 +215,8 @@ export const Conference = ({
|
|||||||
audio={userConfig.audioEnabled}
|
audio={userConfig.audioEnabled}
|
||||||
video={
|
video={
|
||||||
userConfig.videoEnabled && {
|
userConfig.videoEnabled && {
|
||||||
processor: BackgroundProcessorFactory.deserializeProcessor(
|
processor: BackgroundProcessorFactory.fromProcessorConfig(
|
||||||
userConfig.processorSerialized
|
userConfig.processorConfig
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ import { css } from '@/styled-system/css'
|
|||||||
import { Screen } from '@/layout/Screen'
|
import { Screen } from '@/layout/Screen'
|
||||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import {
|
import {
|
||||||
createLocalVideoTrack,
|
|
||||||
createLocalAudioTrack,
|
createLocalAudioTrack,
|
||||||
|
createLocalVideoTrack,
|
||||||
LocalAudioTrack,
|
LocalAudioTrack,
|
||||||
LocalVideoTrack,
|
LocalVideoTrack,
|
||||||
Track,
|
Track,
|
||||||
} from 'livekit-client'
|
} from 'livekit-client'
|
||||||
import { H } from '@/primitives/H'
|
import { H } from '@/primitives/H'
|
||||||
import { Field } from '@/primitives/Field'
|
import { Field } from '@/primitives/Field'
|
||||||
import { Button, Dialog, Text, Form } from '@/primitives'
|
import { Button, Dialog, Form, Text } from '@/primitives'
|
||||||
import { VStack } from '@/styled-system/jsx'
|
import { VStack } from '@/styled-system/jsx'
|
||||||
import { Heading } from 'react-aria-components'
|
import { Heading } from 'react-aria-components'
|
||||||
import { RiImageCircleAiFill } from '@remixicon/react'
|
import { RiImageCircleAiFill } from '@remixicon/react'
|
||||||
@@ -44,8 +44,7 @@ const onError = (e: Error) => console.error('ERROR', e)
|
|||||||
|
|
||||||
const Effects = ({
|
const Effects = ({
|
||||||
videoTrack,
|
videoTrack,
|
||||||
onSubmit,
|
}: Pick<EffectsConfigurationProps, 'videoTrack'>) => {
|
||||||
}: Pick<EffectsConfigurationProps, 'videoTrack' | 'onSubmit'>) => {
|
|
||||||
const { t } = useTranslation('rooms', { keyPrefix: 'join.effects' })
|
const { t } = useTranslation('rooms', { keyPrefix: 'join.effects' })
|
||||||
const [isDialogOpen, setIsDialogOpen] = useState(false)
|
const [isDialogOpen, setIsDialogOpen] = useState(false)
|
||||||
const openDialog = () => setIsDialogOpen(true)
|
const openDialog = () => setIsDialogOpen(true)
|
||||||
@@ -81,7 +80,7 @@ const Effects = ({
|
|||||||
>
|
>
|
||||||
{t('subTitle')}
|
{t('subTitle')}
|
||||||
</Text>
|
</Text>
|
||||||
<EffectsConfiguration videoTrack={videoTrack} onSubmit={onSubmit} />
|
<EffectsConfiguration videoTrack={videoTrack} />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<Button
|
<Button
|
||||||
variant="whiteCircle"
|
variant="whiteCircle"
|
||||||
@@ -111,7 +110,7 @@ export const Join = ({
|
|||||||
audioDeviceId,
|
audioDeviceId,
|
||||||
audioOutputDeviceId,
|
audioOutputDeviceId,
|
||||||
videoDeviceId,
|
videoDeviceId,
|
||||||
processorSerialized,
|
processorConfig,
|
||||||
username,
|
username,
|
||||||
},
|
},
|
||||||
saveAudioInputEnabled,
|
saveAudioInputEnabled,
|
||||||
@@ -120,7 +119,6 @@ export const Join = ({
|
|||||||
saveAudioInputDeviceId,
|
saveAudioInputDeviceId,
|
||||||
saveVideoInputDeviceId,
|
saveVideoInputDeviceId,
|
||||||
saveUsername,
|
saveUsername,
|
||||||
saveProcessorSerialized,
|
|
||||||
} = usePersistentUserChoices()
|
} = usePersistentUserChoices()
|
||||||
|
|
||||||
const initialUserChoices = useRef<LocalUserChoices | null>(null)
|
const initialUserChoices = useRef<LocalUserChoices | null>(null)
|
||||||
@@ -132,7 +130,7 @@ export const Join = ({
|
|||||||
audioDeviceId,
|
audioDeviceId,
|
||||||
audioOutputDeviceId,
|
audioOutputDeviceId,
|
||||||
videoDeviceId,
|
videoDeviceId,
|
||||||
processorSerialized,
|
processorConfig,
|
||||||
username,
|
username,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,8 +144,8 @@ export const Join = ({
|
|||||||
video: !!initialUserChoices.current &&
|
video: !!initialUserChoices.current &&
|
||||||
initialUserChoices.current?.videoEnabled && {
|
initialUserChoices.current?.videoEnabled && {
|
||||||
deviceId: initialUserChoices.current.videoDeviceId,
|
deviceId: initialUserChoices.current.videoDeviceId,
|
||||||
processor: BackgroundProcessorFactory.deserializeProcessor(
|
processor: BackgroundProcessorFactory.fromProcessorConfig(
|
||||||
initialUserChoices.current.processorSerialized
|
initialUserChoices.current.processorConfig
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -186,9 +184,7 @@ export const Join = ({
|
|||||||
const track = await createLocalVideoTrack({
|
const track = await createLocalVideoTrack({
|
||||||
deviceId: { exact: videoDeviceId },
|
deviceId: { exact: videoDeviceId },
|
||||||
processor:
|
processor:
|
||||||
BackgroundProcessorFactory.deserializeProcessor(
|
BackgroundProcessorFactory.fromProcessorConfig(processorConfig),
|
||||||
processorSerialized
|
|
||||||
),
|
|
||||||
})
|
})
|
||||||
setDynamicVideoTrack(track)
|
setDynamicVideoTrack(track)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -207,7 +203,7 @@ export const Join = ({
|
|||||||
}, [
|
}, [
|
||||||
videoEnabled,
|
videoEnabled,
|
||||||
videoDeviceId,
|
videoDeviceId,
|
||||||
processorSerialized,
|
processorConfig,
|
||||||
previewVideoTrack,
|
previewVideoTrack,
|
||||||
dynamicVideoTrack,
|
dynamicVideoTrack,
|
||||||
])
|
])
|
||||||
@@ -690,12 +686,7 @@ export const Join = ({
|
|||||||
zIndex: '1',
|
zIndex: '1',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Effects
|
<Effects videoTrack={videoTrack} />
|
||||||
videoTrack={videoTrack}
|
|
||||||
onSubmit={(processor) =>
|
|
||||||
saveProcessorSerialized(processor?.serialize())
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import { FullScreenShareWarning } from './FullScreenShareWarning'
|
|||||||
import { ParticipantName } from './ParticipantName'
|
import { ParticipantName } from './ParticipantName'
|
||||||
import { getParticipantName } from '@/features/rooms/utils/getParticipantName'
|
import { getParticipantName } from '@/features/rooms/utils/getParticipantName'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { getShortcutDescriptorById } from '@/features/shortcuts/catalog'
|
||||||
|
import { formatShortcutLabel } from '@/features/shortcuts/formatLabels'
|
||||||
import { KeyboardShortcutHint } from './KeyboardShortcutHint'
|
import { KeyboardShortcutHint } from './KeyboardShortcutHint'
|
||||||
|
|
||||||
export function TrackRefContextIfNeeded(
|
export function TrackRefContextIfNeeded(
|
||||||
@@ -237,7 +239,13 @@ export const ParticipantTile: (
|
|||||||
)}
|
)}
|
||||||
</ParticipantContextIfNeeded>
|
</ParticipantContextIfNeeded>
|
||||||
</TrackRefContextIfNeeded>
|
</TrackRefContextIfNeeded>
|
||||||
<KeyboardShortcutHint>{t('toolbarHint')}</KeyboardShortcutHint>
|
<KeyboardShortcutHint>
|
||||||
|
{t('toolbarHint', {
|
||||||
|
shortcut: formatShortcutLabel(
|
||||||
|
getShortcutDescriptorById('open-shortcuts')?.shortcut
|
||||||
|
),
|
||||||
|
})}
|
||||||
|
</KeyboardShortcutHint>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -149,11 +149,12 @@ export const SidePanel = () => {
|
|||||||
activeSubPanelId,
|
activeSubPanelId,
|
||||||
} = useSidePanel()
|
} = useSidePanel()
|
||||||
const { t } = useTranslation('rooms', { keyPrefix: 'sidePanel' })
|
const { t } = useTranslation('rooms', { keyPrefix: 'sidePanel' })
|
||||||
|
const title = t(`heading.${activeSubPanelId || activePanelId}`)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledSidePanel
|
<StyledSidePanel
|
||||||
title={t(`heading.${activeSubPanelId || activePanelId}`)}
|
title={title}
|
||||||
ariaLabel={t('ariaLabel')}
|
ariaLabel={t('ariaLabel', { title })}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
layoutStore.activePanelId = null
|
layoutStore.activePanelId = null
|
||||||
layoutStore.activeSubPanelId = null
|
layoutStore.activeSubPanelId = null
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const ToolButton = ({
|
|||||||
<div>
|
<div>
|
||||||
<Text
|
<Text
|
||||||
margin={false}
|
margin={false}
|
||||||
as="h3"
|
as="h2"
|
||||||
className={css({
|
className={css({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
gap: 0.25,
|
gap: 0.25,
|
||||||
|
|||||||
+16
-27
@@ -11,11 +11,7 @@ import {
|
|||||||
TIMEOUT_TICK,
|
TIMEOUT_TICK,
|
||||||
timerWorkerScript,
|
timerWorkerScript,
|
||||||
} from './TimerWorker'
|
} from './TimerWorker'
|
||||||
import {
|
import { BackgroundProcessorInterface, ProcessorConfig, ProcessorType } from '.'
|
||||||
BackgroundProcessorInterface,
|
|
||||||
BackgroundOptions,
|
|
||||||
ProcessorType,
|
|
||||||
} from '.'
|
|
||||||
|
|
||||||
const PROCESSING_WIDTH = 256
|
const PROCESSING_WIDTH = 256
|
||||||
const PROCESSING_HEIGHT = 144
|
const PROCESSING_HEIGHT = 144
|
||||||
@@ -33,7 +29,7 @@ const DEFAULT_BLUR = '10'
|
|||||||
* MediaStreamTrackProcessor.
|
* MediaStreamTrackProcessor.
|
||||||
*/
|
*/
|
||||||
export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
||||||
options: BackgroundOptions
|
options: ProcessorConfig
|
||||||
name: string
|
name: string
|
||||||
processedTrack?: MediaStreamTrack | undefined
|
processedTrack?: MediaStreamTrack | undefined
|
||||||
|
|
||||||
@@ -64,15 +60,10 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
|||||||
type: ProcessorType
|
type: ProcessorType
|
||||||
virtualBackgroundImage?: HTMLImageElement
|
virtualBackgroundImage?: HTMLImageElement
|
||||||
|
|
||||||
constructor(opts: BackgroundOptions) {
|
constructor(opts: ProcessorConfig) {
|
||||||
this.name = 'blur'
|
this.name = 'blur'
|
||||||
this.options = opts
|
this.options = opts
|
||||||
|
this.type = opts.type
|
||||||
if (this.options.blurRadius) {
|
|
||||||
this.type = ProcessorType.BLUR
|
|
||||||
} else {
|
|
||||||
this.type = ProcessorType.VIRTUAL
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static get isSupported() {
|
static get isSupported() {
|
||||||
@@ -107,6 +98,12 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_initVirtualBackgroundImage() {
|
_initVirtualBackgroundImage() {
|
||||||
|
if (this.options.type !== 'virtual') {
|
||||||
|
throw new Error(
|
||||||
|
'Virtual background is only supported for virtual background'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const needsUpdate =
|
const needsUpdate =
|
||||||
this.options.imagePath &&
|
this.options.imagePath &&
|
||||||
this.virtualBackgroundImage &&
|
this.virtualBackgroundImage &&
|
||||||
@@ -118,7 +115,7 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async update(opts: BackgroundOptions): Promise<void> {
|
async update(opts: ProcessorConfig): Promise<void> {
|
||||||
this.options = opts
|
this.options = opts
|
||||||
this._initVirtualBackgroundImage()
|
this._initVirtualBackgroundImage()
|
||||||
}
|
}
|
||||||
@@ -187,7 +184,7 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
PROCESSING_WIDTH,
|
PROCESSING_WIDTH,
|
||||||
PROCESSING_WIDTH
|
PROCESSING_HEIGHT
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,6 +209,9 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
|||||||
* TODO: future improvement with WebGL.
|
* TODO: future improvement with WebGL.
|
||||||
*/
|
*/
|
||||||
async blur() {
|
async blur() {
|
||||||
|
if (this.options.type !== 'blur') {
|
||||||
|
throw new Error('Blurring is only supported for blur background')
|
||||||
|
}
|
||||||
const mask = this.imageSegmenterResult!.categoryMask!.getAsUint8Array()
|
const mask = this.imageSegmenterResult!.categoryMask!.getAsUint8Array()
|
||||||
for (let i = 0; i < mask.length; ++i) {
|
for (let i = 0; i < mask.length; ++i) {
|
||||||
this.segmentationMask!.data[i * 4 + 3] = 255 - mask[i]
|
this.segmentationMask!.data[i * 4 + 3] = 255 - mask[i]
|
||||||
@@ -293,7 +293,7 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
|||||||
await this.sizeSource()
|
await this.sizeSource()
|
||||||
await this.segment()
|
await this.segment()
|
||||||
|
|
||||||
if (this.options.blurRadius) {
|
if (this.options.type === 'blur') {
|
||||||
await this.blur()
|
await this.blur()
|
||||||
} else {
|
} else {
|
||||||
await this.drawVirtualBackground()
|
await this.drawVirtualBackground()
|
||||||
@@ -354,15 +354,4 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface {
|
|||||||
this.timerWorker?.terminate()
|
this.timerWorker?.terminate()
|
||||||
this.imageSegmenter?.close()
|
this.imageSegmenter?.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
clone() {
|
|
||||||
return new BackgroundCustomProcessor(this.options)
|
|
||||||
}
|
|
||||||
|
|
||||||
serialize() {
|
|
||||||
return {
|
|
||||||
type: this.type,
|
|
||||||
options: this.options,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -332,15 +332,4 @@ export class FaceLandmarksProcessor implements TrackProcessor<Track.Kind> {
|
|||||||
this.timerWorker?.terminate()
|
this.timerWorker?.terminate()
|
||||||
this.faceLandmarker?.close()
|
this.faceLandmarker?.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
clone() {
|
|
||||||
return new FaceLandmarksProcessor(this.options)
|
|
||||||
}
|
|
||||||
|
|
||||||
serialize() {
|
|
||||||
return {
|
|
||||||
type: this.type,
|
|
||||||
options: this.options,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-32
@@ -1,28 +1,23 @@
|
|||||||
import { ProcessorOptions, Track } from 'livekit-client'
|
import { ProcessorOptions, Track } from 'livekit-client'
|
||||||
import {
|
import {
|
||||||
BackgroundBlur,
|
BackgroundBlur,
|
||||||
BackgroundTransformer,
|
|
||||||
ProcessorWrapper,
|
ProcessorWrapper,
|
||||||
VirtualBackground,
|
VirtualBackground,
|
||||||
} from '@livekit/track-processors'
|
} from '@livekit/track-processors'
|
||||||
import {
|
import { ProcessorConfig, BackgroundProcessorInterface, ProcessorType } from '.'
|
||||||
BackgroundOptions,
|
|
||||||
BackgroundProcessorInterface,
|
|
||||||
ProcessorType,
|
|
||||||
} from '.'
|
|
||||||
|
|
||||||
export class UnifiedBackgroundTrackProcessor implements BackgroundProcessorInterface {
|
export class UnifiedBackgroundTrackProcessor implements BackgroundProcessorInterface {
|
||||||
processor: ProcessorWrapper<BackgroundOptions>
|
processor: ProcessorWrapper<{ imagePath?: string; blurRadius?: number }>
|
||||||
opts: BackgroundOptions
|
opts: ProcessorConfig
|
||||||
processorType: ProcessorType
|
processorType: ProcessorType
|
||||||
|
|
||||||
constructor(opts: BackgroundOptions) {
|
constructor(opts: ProcessorConfig) {
|
||||||
this.opts = opts
|
this.opts = opts
|
||||||
|
|
||||||
if (opts.imagePath) {
|
if (opts.type === 'virtual') {
|
||||||
this.processorType = ProcessorType.VIRTUAL
|
this.processorType = ProcessorType.VIRTUAL
|
||||||
this.processor = VirtualBackground(opts.imagePath)
|
this.processor = VirtualBackground(opts.imagePath)
|
||||||
} else if (opts.blurRadius !== undefined) {
|
} else if (opts.type === 'blur') {
|
||||||
this.processorType = ProcessorType.BLUR
|
this.processorType = ProcessorType.BLUR
|
||||||
this.processor = BackgroundBlur(opts.blurRadius)
|
this.processor = BackgroundBlur(opts.blurRadius)
|
||||||
} else {
|
} else {
|
||||||
@@ -44,24 +39,23 @@ export class UnifiedBackgroundTrackProcessor implements BackgroundProcessorInter
|
|||||||
return this.processor.destroy()
|
return this.processor.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
async update(opts: BackgroundOptions): Promise<void> {
|
async update(opts: ProcessorConfig): Promise<void> {
|
||||||
const newProcessorType = opts.imagePath
|
this.opts = opts
|
||||||
? ProcessorType.VIRTUAL
|
|
||||||
: ProcessorType.BLUR
|
const newProcessorType =
|
||||||
|
opts.type === 'virtual' ? ProcessorType.VIRTUAL : ProcessorType.BLUR
|
||||||
|
|
||||||
let processedOpts = opts
|
|
||||||
if (newProcessorType !== this.processorType) {
|
if (newProcessorType !== this.processorType) {
|
||||||
this.processorType = newProcessorType
|
this.processorType = newProcessorType
|
||||||
if (newProcessorType === ProcessorType.VIRTUAL) {
|
if (newProcessorType === ProcessorType.VIRTUAL) {
|
||||||
this.processor.name = 'virtual-background'
|
this.processor.name = 'virtual-background'
|
||||||
processedOpts = { ...opts, blurRadius: undefined }
|
|
||||||
} else {
|
} else {
|
||||||
this.processor.name = 'background-blur'
|
this.processor.name = 'background-blur'
|
||||||
processedOpts = { ...opts, imagePath: undefined }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.processor.updateTransformerOptions(processedOpts)
|
await this.processor.updateTransformerOptions(
|
||||||
this.opts = processedOpts
|
opts as { imagePath?: string; blurRadius?: number }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
get name() {
|
get name() {
|
||||||
@@ -73,17 +67,6 @@ export class UnifiedBackgroundTrackProcessor implements BackgroundProcessorInter
|
|||||||
}
|
}
|
||||||
|
|
||||||
get options() {
|
get options() {
|
||||||
return (this.processor.transformer as BackgroundTransformer).options
|
return this.opts
|
||||||
}
|
|
||||||
|
|
||||||
clone() {
|
|
||||||
return new UnifiedBackgroundTrackProcessor(this.options || this.opts)
|
|
||||||
}
|
|
||||||
|
|
||||||
serialize() {
|
|
||||||
return {
|
|
||||||
type: this.processorType,
|
|
||||||
options: this.options,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,23 +2,7 @@ import { ProcessorWrapper } from '@livekit/track-processors'
|
|||||||
import { Track, TrackProcessor } from 'livekit-client'
|
import { Track, TrackProcessor } from 'livekit-client'
|
||||||
import { BackgroundCustomProcessor } from './BackgroundCustomProcessor'
|
import { BackgroundCustomProcessor } from './BackgroundCustomProcessor'
|
||||||
import { UnifiedBackgroundTrackProcessor } from './UnifiedBackgroundTrackProcessor'
|
import { UnifiedBackgroundTrackProcessor } from './UnifiedBackgroundTrackProcessor'
|
||||||
|
import { FaceLandmarksOptions } from './FaceLandmarksProcessor'
|
||||||
export type BackgroundOptions = {
|
|
||||||
blurRadius?: number
|
|
||||||
imagePath?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ProcessorSerialized {
|
|
||||||
type: ProcessorType
|
|
||||||
options: BackgroundOptions
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BackgroundProcessorInterface extends TrackProcessor<Track.Kind> {
|
|
||||||
update(opts: BackgroundOptions): Promise<void>
|
|
||||||
options: BackgroundOptions
|
|
||||||
clone(): BackgroundProcessorInterface
|
|
||||||
serialize(): ProcessorSerialized
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ProcessorType {
|
export enum ProcessorType {
|
||||||
BLUR = 'blur',
|
BLUR = 'blur',
|
||||||
@@ -26,6 +10,16 @@ export enum ProcessorType {
|
|||||||
FACE_LANDMARKS = 'faceLandmarks',
|
FACE_LANDMARKS = 'faceLandmarks',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ProcessorConfig =
|
||||||
|
| { type: ProcessorType.BLUR; blurRadius: number }
|
||||||
|
| { type: ProcessorType.VIRTUAL; imagePath: string; fileId?: string }
|
||||||
|
| ({ type: ProcessorType.FACE_LANDMARKS } & FaceLandmarksOptions)
|
||||||
|
|
||||||
|
export interface BackgroundProcessorInterface extends TrackProcessor<Track.Kind> {
|
||||||
|
update(opts: ProcessorConfig): Promise<void>
|
||||||
|
options: ProcessorConfig
|
||||||
|
}
|
||||||
|
|
||||||
export class BackgroundProcessorFactory {
|
export class BackgroundProcessorFactory {
|
||||||
static hasModernApiSupport() {
|
static hasModernApiSupport() {
|
||||||
return ProcessorWrapper.hasModernApiSupport
|
return ProcessorWrapper.hasModernApiSupport
|
||||||
@@ -36,28 +30,27 @@ export class BackgroundProcessorFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getProcessor(
|
static getProcessor(
|
||||||
type: ProcessorType,
|
config: ProcessorConfig
|
||||||
opts: BackgroundOptions
|
|
||||||
): BackgroundProcessorInterface | undefined {
|
): BackgroundProcessorInterface | undefined {
|
||||||
const isBlur = type === ProcessorType.BLUR
|
const isBlur = config.type === ProcessorType.BLUR
|
||||||
const isVirtual = type === ProcessorType.VIRTUAL
|
const isVirtual = config.type === ProcessorType.VIRTUAL
|
||||||
|
|
||||||
if (!isBlur && !isVirtual) return undefined
|
if (!isBlur && !isVirtual) return undefined
|
||||||
|
|
||||||
if (ProcessorWrapper.isSupported) {
|
if (ProcessorWrapper.isSupported) {
|
||||||
return new UnifiedBackgroundTrackProcessor(opts)
|
return new UnifiedBackgroundTrackProcessor(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BackgroundCustomProcessor.isSupported) {
|
if (BackgroundCustomProcessor.isSupported) {
|
||||||
return new BackgroundCustomProcessor(opts)
|
return new BackgroundCustomProcessor(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
static deserializeProcessor(data?: ProcessorSerialized) {
|
static fromProcessorConfig(data?: ProcessorConfig) {
|
||||||
if (data?.type) {
|
if (data) {
|
||||||
return BackgroundProcessorFactory.getProcessor(data?.type, data?.options)
|
return BackgroundProcessorFactory.getProcessor(data)
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ const SelectDevicePermissions = <T extends string | number>({
|
|||||||
iconComponent={iconComponent}
|
iconComponent={iconComponent}
|
||||||
placeholder={items.length === 0 ? t('loading') : t('select')}
|
placeholder={items.length === 0 ? t('loading') : t('select')}
|
||||||
selectedKey={selectedKey}
|
selectedKey={selectedKey}
|
||||||
onSelectionChange={(key) => {
|
onSelectionChange={async (key) => {
|
||||||
if (key === selectedKey) return
|
if (key === selectedKey) return
|
||||||
|
await setActiveMediaDevice(key as string)
|
||||||
onSubmit?.(key as string)
|
onSubmit?.(key as string)
|
||||||
setActiveMediaDevice(key as string)
|
|
||||||
}}
|
}}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
|||||||
+2
-2
@@ -82,8 +82,8 @@ export const VideoDeviceControl = ({
|
|||||||
*
|
*
|
||||||
* See https://github.com/numerique-gouv/meet/pull/309#issuecomment-2622404121
|
* See https://github.com/numerique-gouv/meet/pull/309#issuecomment-2622404121
|
||||||
*/
|
*/
|
||||||
const processor = BackgroundProcessorFactory.deserializeProcessor(
|
const processor = BackgroundProcessorFactory.fromProcessorConfig(
|
||||||
userChoices.processorSerialized
|
userChoices.processorConfig
|
||||||
)
|
)
|
||||||
|
|
||||||
const toggle = trackProps.toggle as (
|
const toggle = trackProps.toggle as (
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ import { useLocalParticipant } from '@livekit/components-react'
|
|||||||
import { LocalVideoTrack } from 'livekit-client'
|
import { LocalVideoTrack } from 'livekit-client'
|
||||||
import { css } from '@/styled-system/css'
|
import { css } from '@/styled-system/css'
|
||||||
import { EffectsConfiguration } from './EffectsConfiguration'
|
import { EffectsConfiguration } from './EffectsConfiguration'
|
||||||
import { usePersistentUserChoices } from '../../hooks/usePersistentUserChoices'
|
|
||||||
import { useCanPublishTrack } from '@/features/rooms/livekit/hooks/useCanPublishTrack'
|
import { useCanPublishTrack } from '@/features/rooms/livekit/hooks/useCanPublishTrack'
|
||||||
import { TrackSource } from '@livekit/protocol'
|
import { TrackSource } from '@livekit/protocol'
|
||||||
|
|
||||||
export const Effects = () => {
|
export const Effects = () => {
|
||||||
const { cameraTrack } = useLocalParticipant()
|
const { cameraTrack } = useLocalParticipant()
|
||||||
const localCameraTrack = cameraTrack?.track as LocalVideoTrack
|
const localCameraTrack = cameraTrack?.track as LocalVideoTrack
|
||||||
const { saveProcessorSerialized } = usePersistentUserChoices()
|
|
||||||
|
|
||||||
const canPublishCamera = useCanPublishTrack(TrackSource.CAMERA)
|
const canPublishCamera = useCanPublishTrack(TrackSource.CAMERA)
|
||||||
|
|
||||||
@@ -24,9 +22,6 @@ export const Effects = () => {
|
|||||||
isDisabled={!canPublishCamera}
|
isDisabled={!canPublishCamera}
|
||||||
videoTrack={localCameraTrack}
|
videoTrack={localCameraTrack}
|
||||||
layout="vertical"
|
layout="vertical"
|
||||||
onSubmit={(processor) =>
|
|
||||||
saveProcessorSerialized(processor?.serialize())
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
+705
-251
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@ export const FunnyEffects = ({
|
|||||||
showFrench: false,
|
showFrench: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return processor.serialize().options
|
return { ...processor.options }
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = getOptions()
|
const options = getOptions()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useSnapshot } from 'valtio'
|
import { useSnapshot } from 'valtio'
|
||||||
import { userChoicesStore } from '@/stores/userChoices'
|
import { userChoicesStore } from '@/stores/userChoices'
|
||||||
import type { VideoResolution } from '@/stores/userChoices'
|
import type { VideoResolution } from '@/stores/userChoices'
|
||||||
import { ProcessorSerialized } from '@/features/rooms/livekit/components/blur'
|
import { ProcessorConfig } from '@/features/rooms/livekit/components/blur'
|
||||||
import type { VideoQuality } from 'livekit-client'
|
import type { VideoQuality } from 'livekit-client'
|
||||||
|
|
||||||
export function usePersistentUserChoices() {
|
export function usePersistentUserChoices() {
|
||||||
@@ -36,10 +36,8 @@ export function usePersistentUserChoices() {
|
|||||||
saveNoiseReductionEnabled: (enabled: boolean) => {
|
saveNoiseReductionEnabled: (enabled: boolean) => {
|
||||||
userChoicesStore.noiseReductionEnabled = enabled
|
userChoicesStore.noiseReductionEnabled = enabled
|
||||||
},
|
},
|
||||||
saveProcessorSerialized: (
|
saveProcessorConfig: (processorConfig: ProcessorConfig | undefined) => {
|
||||||
processorSerialized: ProcessorSerialized | undefined
|
userChoicesStore.processorConfig = processorConfig
|
||||||
) => {
|
|
||||||
userChoicesStore.processorSerialized = processorSerialized
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const VideoTab = ({ id }: VideoTabProps) => {
|
|||||||
const {
|
const {
|
||||||
userChoices: {
|
userChoices: {
|
||||||
videoDeviceId,
|
videoDeviceId,
|
||||||
processorSerialized,
|
processorConfig,
|
||||||
videoPublishResolution,
|
videoPublishResolution,
|
||||||
videoSubscribeQuality,
|
videoSubscribeQuality,
|
||||||
},
|
},
|
||||||
@@ -78,7 +78,7 @@ export const VideoTab = ({ id }: VideoTabProps) => {
|
|||||||
resolution: VideoPresets[key].resolution,
|
resolution: VideoPresets[key].resolution,
|
||||||
deviceId: { exact: videoDeviceId },
|
deviceId: { exact: videoDeviceId },
|
||||||
processor:
|
processor:
|
||||||
BackgroundProcessorFactory.deserializeProcessor(processorSerialized),
|
BackgroundProcessorFactory.fromProcessorConfig(processorConfig),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ import { useSnapshot } from 'valtio'
|
|||||||
import {
|
import {
|
||||||
accessibilityStore,
|
accessibilityStore,
|
||||||
type CaptionTextSize,
|
type CaptionTextSize,
|
||||||
|
type CaptionColor,
|
||||||
CAPTION_TEXT_SIZE_OPTIONS,
|
CAPTION_TEXT_SIZE_OPTIONS,
|
||||||
|
CAPTION_COLOR_OPTIONS,
|
||||||
} from '@/stores/accessibility'
|
} from '@/stores/accessibility'
|
||||||
|
import { useAreSubtitlesAvailable } from '../hooks/useAreSubtitlesAvailable'
|
||||||
|
|
||||||
export const CaptionsSettings = () => {
|
export const CaptionsSettings = () => {
|
||||||
const { t } = useTranslation('settings', {
|
const { t } = useTranslation('settings', {
|
||||||
@@ -24,6 +27,27 @@ export const CaptionsSettings = () => {
|
|||||||
[t]
|
[t]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const captionFontColorItems = useMemo(
|
||||||
|
() =>
|
||||||
|
CAPTION_COLOR_OPTIONS.map((color) => ({
|
||||||
|
value: color,
|
||||||
|
label: t(`fontColor.options.${color}`),
|
||||||
|
})),
|
||||||
|
[t]
|
||||||
|
)
|
||||||
|
|
||||||
|
const captionBackgroundColorItems = useMemo(
|
||||||
|
() =>
|
||||||
|
CAPTION_COLOR_OPTIONS.map((color) => ({
|
||||||
|
value: color,
|
||||||
|
label: t(`backgroundColor.options.${color}`),
|
||||||
|
})),
|
||||||
|
[t]
|
||||||
|
)
|
||||||
|
|
||||||
|
const areSubtitlesAvailable = useAreSubtitlesAvailable()
|
||||||
|
if (!areSubtitlesAvailable) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li>
|
<li>
|
||||||
<H
|
<H
|
||||||
@@ -34,16 +58,44 @@ export const CaptionsSettings = () => {
|
|||||||
>
|
>
|
||||||
{t('heading')}
|
{t('heading')}
|
||||||
</H>
|
</H>
|
||||||
<Field
|
<div
|
||||||
type="select"
|
className={css({
|
||||||
label={t('textSize.label')}
|
display: 'flex',
|
||||||
items={captionTextSizeItems}
|
flexDirection: 'column',
|
||||||
selectedKey={snap.captionTextSize}
|
gap: '0.75rem',
|
||||||
onSelectionChange={(key) => {
|
})}
|
||||||
accessibilityStore.captionTextSize = key as CaptionTextSize
|
>
|
||||||
}}
|
<Field
|
||||||
wrapperProps={{ noMargin: true, fullWidth: true }}
|
type="select"
|
||||||
/>
|
label={t('textSize.label')}
|
||||||
|
items={captionTextSizeItems}
|
||||||
|
selectedKey={snap.captionTextSize}
|
||||||
|
onSelectionChange={(key) => {
|
||||||
|
accessibilityStore.captionTextSize = key as CaptionTextSize
|
||||||
|
}}
|
||||||
|
wrapperProps={{ noMargin: true, fullWidth: true }}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
type="select"
|
||||||
|
label={t('fontColor.label')}
|
||||||
|
items={captionFontColorItems}
|
||||||
|
selectedKey={snap.captionFontColor}
|
||||||
|
onSelectionChange={(key) => {
|
||||||
|
accessibilityStore.captionFontColor = key as CaptionColor
|
||||||
|
}}
|
||||||
|
wrapperProps={{ noMargin: true, fullWidth: true }}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
type="select"
|
||||||
|
label={t('backgroundColor.label')}
|
||||||
|
items={captionBackgroundColorItems}
|
||||||
|
selectedKey={snap.captionBackgroundColor}
|
||||||
|
onSelectionChange={(key) => {
|
||||||
|
accessibilityStore.captionBackgroundColor = key as CaptionColor
|
||||||
|
}}
|
||||||
|
wrapperProps={{ noMargin: true, fullWidth: true }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import { useSnapshot } from 'valtio'
|
|||||||
import {
|
import {
|
||||||
accessibilityStore,
|
accessibilityStore,
|
||||||
CAPTION_TEXT_SIZE_OPTIONS,
|
CAPTION_TEXT_SIZE_OPTIONS,
|
||||||
|
CAPTION_FONT_COLOR_VALUES,
|
||||||
|
CAPTION_BACKGROUND_COLOR_VALUES,
|
||||||
type CaptionTextSize,
|
type CaptionTextSize,
|
||||||
} from '@/stores/accessibility'
|
} from '@/stores/accessibility'
|
||||||
|
|
||||||
@@ -92,10 +94,14 @@ const useTranscriptionState = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Transcription = ({ row }: { row: TranscriptionRow }) => {
|
const Transcription = ({ row }: { row: TranscriptionRow }) => {
|
||||||
const { captionTextSize } = useSnapshot(accessibilityStore)
|
const { captionTextSize, captionFontColor, captionBackgroundColor } =
|
||||||
|
useSnapshot(accessibilityStore)
|
||||||
const participantColor = getParticipantColor(row.participant)
|
const participantColor = getParticipantColor(row.participant)
|
||||||
const participantName = getParticipantName(row.participant)
|
const participantName = getParticipantName(row.participant)
|
||||||
const { fontSize, lineHeight } = CAPTION_FONT_SIZES[captionTextSize]
|
const { fontSize, lineHeight } = CAPTION_FONT_SIZES[captionTextSize]
|
||||||
|
const fontColor = CAPTION_FONT_COLOR_VALUES[captionFontColor]
|
||||||
|
const backgroundColor =
|
||||||
|
CAPTION_BACKGROUND_COLOR_VALUES[captionBackgroundColor]
|
||||||
|
|
||||||
const getDisplayText = (row: TranscriptionRow): string => {
|
const getDisplayText = (row: TranscriptionRow): string => {
|
||||||
return row.segments
|
return row.segments
|
||||||
@@ -128,9 +134,9 @@ const Transcription = ({ row }: { row: TranscriptionRow }) => {
|
|||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className={css({
|
className={css({
|
||||||
color: 'white',
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
})}
|
})}
|
||||||
|
style={{ color: fontColor }}
|
||||||
>
|
>
|
||||||
<Text variant="h3" margin={false}>
|
<Text variant="h3" margin={false}>
|
||||||
{participantName}
|
{participantName}
|
||||||
@@ -138,8 +144,10 @@ const Transcription = ({ row }: { row: TranscriptionRow }) => {
|
|||||||
<p
|
<p
|
||||||
className={css({
|
className={css({
|
||||||
fontWeight: '400',
|
fontWeight: '400',
|
||||||
|
borderRadius: '4px',
|
||||||
|
padding: '0.125rem 0.25rem',
|
||||||
})}
|
})}
|
||||||
style={{ fontSize, lineHeight }}
|
style={{ fontSize, lineHeight, backgroundColor }}
|
||||||
>
|
>
|
||||||
{displayText}
|
{displayText}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -273,17 +273,40 @@
|
|||||||
"title": "Virtueller Hintergrund",
|
"title": "Virtueller Hintergrund",
|
||||||
"selectedLabel": "Hintergrund angewendet:",
|
"selectedLabel": "Hintergrund angewendet:",
|
||||||
"apply": "Ersetze deinen Hintergrund:",
|
"apply": "Ersetze deinen Hintergrund:",
|
||||||
"descriptions": {
|
"personal": {
|
||||||
"0": "Gerilltes Holzmöbel",
|
"title": "Meine Hintergründe",
|
||||||
"1": "Besprechungsraum",
|
"selectFileTooltip": "Wähle ein Bild aus, das als persönlicher Hintergrund verwendet werden soll",
|
||||||
"2": "Loft mit schwarzer Glaswand",
|
"notLoggedInWarning": "Du bist nicht angemeldet, der persönliche Hintergrund wird nicht von einem Meeting zum anderen gespeichert.",
|
||||||
"3": "Esszimmer",
|
"warningUploadDisabled": "Persönliche Hintergründe werden derzeit nicht von einem Meeting zum anderen gespeichert.",
|
||||||
"4": "Holzregale",
|
"uploadLimitReached": "Du kannst keine weiteren persönlichen Hintergründe hinzufügen.",
|
||||||
"5": "Holztreppe",
|
"uploadInProgress": "Datei wird hochgeladen…",
|
||||||
"6": "Graue Bibliothek",
|
"errors": {
|
||||||
"7": "Kaffeetheke"
|
"close": "Schließen",
|
||||||
|
"file_too_large": {
|
||||||
|
"title": "Datei zu groß",
|
||||||
|
"description": "Die Datei ist zu groß. Bitte wähle eine Datei mit weniger als {{maxSize, number}} MB."
|
||||||
|
},
|
||||||
|
"invalid_file_type": {
|
||||||
|
"title": "Ungültiger Dateityp",
|
||||||
|
"description": "Der Dateityp wird nicht unterstützt. Bitte wähle eine {{allowedExtension}}-Datei."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"presets": {
|
||||||
|
"title": "Vorschläge",
|
||||||
|
"descriptions": {
|
||||||
|
"0": "Gerilltes Holzmöbel",
|
||||||
|
"1": "Besprechungsraum",
|
||||||
|
"2": "Loft mit schwarzer Glaswand",
|
||||||
|
"3": "Esszimmer",
|
||||||
|
"4": "Holzregale",
|
||||||
|
"5": "Holztreppe",
|
||||||
|
"6": "Graue Bibliothek",
|
||||||
|
"7": "Kaffeetheke"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"faceLandmarks": {
|
"faceLandmarks": {
|
||||||
"title": "Visuelle Effekte",
|
"title": "Visuelle Effekte",
|
||||||
"glasses": {
|
"glasses": {
|
||||||
@@ -297,7 +320,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sidePanel": {
|
"sidePanel": {
|
||||||
"ariaLabel": "Seitenleiste",
|
"ariaLabel": "Seitenleiste - {{title}}",
|
||||||
"backToTools": "Zurück zu den Meeting-Tools",
|
"backToTools": "Zurück zu den Meeting-Tools",
|
||||||
"heading": {
|
"heading": {
|
||||||
"participants": "Teilnehmende",
|
"participants": "Teilnehmende",
|
||||||
@@ -332,11 +355,11 @@
|
|||||||
"tools": {
|
"tools": {
|
||||||
"transcript": {
|
"transcript": {
|
||||||
"title": "Transkribieren",
|
"title": "Transkribieren",
|
||||||
"body": "Das Gespräch aufzeichnen."
|
"body": "Wandelt Meetings in Text um."
|
||||||
},
|
},
|
||||||
"screenRecording": {
|
"screenRecording": {
|
||||||
"title": "Aufzeichnen",
|
"title": "Aufnehmen",
|
||||||
"body": "Das Meeting aufzeichnen."
|
"body": "Speichert Meetings als Video."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -597,7 +620,7 @@
|
|||||||
},
|
},
|
||||||
"participantTileFocus": {
|
"participantTileFocus": {
|
||||||
"containerLabel": "Optionen für {{name}}",
|
"containerLabel": "Optionen für {{name}}",
|
||||||
"toolbarHint": "Ctrl+Shift+/: Direkt auf die Tastenkürzel zugreifen.",
|
"toolbarHint": "{{shortcut}}: Direkt auf die Tastenkürzel zugreifen.",
|
||||||
"pin": {
|
"pin": {
|
||||||
"enable": "Anheften",
|
"enable": "Anheften",
|
||||||
"disable": "Lösen"
|
"disable": "Lösen"
|
||||||
|
|||||||
@@ -126,6 +126,34 @@
|
|||||||
"medium": "Mittel",
|
"medium": "Mittel",
|
||||||
"large": "Groß"
|
"large": "Groß"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"fontColor": {
|
||||||
|
"label": "Schriftfarbe",
|
||||||
|
"options": {
|
||||||
|
"default": "Standard",
|
||||||
|
"white": "Weiß",
|
||||||
|
"black": "Schwarz",
|
||||||
|
"blue": "Blau",
|
||||||
|
"green": "Grün",
|
||||||
|
"red": "Rot",
|
||||||
|
"yellow": "Gelb",
|
||||||
|
"cyan": "Cyan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"backgroundColor": {
|
||||||
|
"label": "Hintergrundfarbe",
|
||||||
|
"options": {
|
||||||
|
"default": "Standard",
|
||||||
|
"white": "Weiß",
|
||||||
|
"black": "Schwarz",
|
||||||
|
"blue": "Blau",
|
||||||
|
"green": "Grün",
|
||||||
|
"red": "Rot",
|
||||||
|
"yellow": "Gelb",
|
||||||
|
"cyan": "Cyan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -270,18 +270,40 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"virtual": {
|
"virtual": {
|
||||||
"title": "Virtual background",
|
"title": "Virtual backgrounds",
|
||||||
"selectedLabel": "Background applied:",
|
"selectedLabel": "Background applied:",
|
||||||
"apply": "Replace your background:",
|
"apply": "Replace your background:",
|
||||||
"descriptions": {
|
"personal": {
|
||||||
"0": "Fluted wooden furniture",
|
"title": "My backgrounds",
|
||||||
"1": "Meeting room",
|
"selectFileTooltip": "Select an image file to use as a personal background",
|
||||||
"2": "Loft with black glass partition",
|
"notLoggedInWarning": "You are not logged-in, personal backgrounds won't be saved from one meeting to the other.",
|
||||||
"3": "Dining room",
|
"warningUploadDisabled": "Personal backgrounds are currently not saved from one meeting to the other.",
|
||||||
"4": "Wooden shelves",
|
"uploadLimitReached": "You cannot upload more personal backgrounds.",
|
||||||
"5": "Wooden staircase",
|
"uploadInProgress": "Image is being uploaded…",
|
||||||
"6": "Gray library",
|
"errors": {
|
||||||
"7": "Coffee counter"
|
"close": "Close",
|
||||||
|
"file_too_large": {
|
||||||
|
"title": "File too large",
|
||||||
|
"description": "The file is too large. Please choose a file smaller than {{maxSize, number}} MB."
|
||||||
|
},
|
||||||
|
"invalid_file_type": {
|
||||||
|
"title": "Invalid file type",
|
||||||
|
"description": "The file type is not supported. Please choose a {{allowedExtension, list(type: 'disjunction')}} file."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"presets": {
|
||||||
|
"title": "Suggestions",
|
||||||
|
"descriptions": {
|
||||||
|
"0": "Fluted wooden furniture",
|
||||||
|
"1": "Meeting room",
|
||||||
|
"2": "Loft with black glass partition",
|
||||||
|
"3": "Dining room",
|
||||||
|
"4": "Wooden shelves",
|
||||||
|
"5": "Wooden staircase",
|
||||||
|
"6": "Gray library",
|
||||||
|
"7": "Coffee counter"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"faceLandmarks": {
|
"faceLandmarks": {
|
||||||
@@ -297,7 +319,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sidePanel": {
|
"sidePanel": {
|
||||||
"ariaLabel": "Sidepanel",
|
"ariaLabel": "Sidepanel - {{title}}",
|
||||||
"backToTools": "Back to meeting tools",
|
"backToTools": "Back to meeting tools",
|
||||||
"heading": {
|
"heading": {
|
||||||
"participants": "Participants",
|
"participants": "Participants",
|
||||||
@@ -332,11 +354,11 @@
|
|||||||
"tools": {
|
"tools": {
|
||||||
"transcript": {
|
"transcript": {
|
||||||
"title": "Transcribe",
|
"title": "Transcribe",
|
||||||
"body": "Record the conversation."
|
"body": "Turn meetings into text."
|
||||||
},
|
},
|
||||||
"screenRecording": {
|
"screenRecording": {
|
||||||
"title": "Record",
|
"title": "Record",
|
||||||
"body": "Record the meeting."
|
"body": "Save meetings as video."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -597,7 +619,7 @@
|
|||||||
},
|
},
|
||||||
"participantTileFocus": {
|
"participantTileFocus": {
|
||||||
"containerLabel": "Options for {{name}}",
|
"containerLabel": "Options for {{name}}",
|
||||||
"toolbarHint": "Ctrl+Shift+/: access shortcuts directly.",
|
"toolbarHint": "{{shortcut}}: access shortcuts directly.",
|
||||||
"pin": {
|
"pin": {
|
||||||
"enable": "Pin",
|
"enable": "Pin",
|
||||||
"disable": "Unpin"
|
"disable": "Unpin"
|
||||||
|
|||||||
@@ -126,6 +126,34 @@
|
|||||||
"medium": "Medium",
|
"medium": "Medium",
|
||||||
"large": "Large"
|
"large": "Large"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"fontColor": {
|
||||||
|
"label": "Font color",
|
||||||
|
"options": {
|
||||||
|
"default": "Default",
|
||||||
|
"white": "White",
|
||||||
|
"black": "Black",
|
||||||
|
"blue": "Blue",
|
||||||
|
"green": "Green",
|
||||||
|
"red": "Red",
|
||||||
|
"yellow": "Yellow",
|
||||||
|
"cyan": "Cyan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"backgroundColor": {
|
||||||
|
"label": "Background color",
|
||||||
|
"options": {
|
||||||
|
"default": "Default",
|
||||||
|
"white": "White",
|
||||||
|
"black": "Black",
|
||||||
|
"blue": "Blue",
|
||||||
|
"green": "Green",
|
||||||
|
"red": "Red",
|
||||||
|
"yellow": "Yellow",
|
||||||
|
"cyan": "Cyan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -270,18 +270,40 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"virtual": {
|
"virtual": {
|
||||||
"title": "Arrière-plan virtuel",
|
"title": "Arrière-plans virtuels",
|
||||||
"selectedLabel": "Arrière-plan appliqué :",
|
"selectedLabel": "Arrière-plan appliqué :",
|
||||||
"apply": "Remplacer votre arrière plan :",
|
"apply": "Remplacer votre arrière plan :",
|
||||||
"descriptions": {
|
"personal": {
|
||||||
"0": "Meuble cannelé en bois",
|
"title": "Mes arrière-plans",
|
||||||
"1": "Salle de réunion",
|
"selectFileTooltip": "Sélectionnez une image à utiliser comme arrière-plan",
|
||||||
"2": "Loft avec verrière noire",
|
"notLoggedInWarning": "Vous n'êtes pas connecté, l'arrière-plan personnel ne sera pas sauvegardé d'une réunion à l'autre.",
|
||||||
"3": "Salle à manger",
|
"warningUploadDisabled": "Les arrière-plans personnels ne sont actuellement pas sauvegardés d'une réunion à l'autre.",
|
||||||
"4": "Étagères en bois",
|
"uploadLimitReached": "Vous ne pouvez pas ajouter plus d'arrière-plans personnels.",
|
||||||
"5": "Escalier en bois",
|
"uploadInProgress": "Image en cours d'envoi…",
|
||||||
"6": "Bibliothèque grise",
|
"errors": {
|
||||||
"7": "Comptoir de café"
|
"close": "Fermer",
|
||||||
|
"file_too_large": {
|
||||||
|
"title": "Fichier trop volumineux",
|
||||||
|
"description": "Le fichier est trop volumineux. Veuillez choisir un fichier de moins de {{maxSize, number}} Mo."
|
||||||
|
},
|
||||||
|
"invalid_file_type": {
|
||||||
|
"title": "Type de fichier non valide",
|
||||||
|
"description": "Le type de fichier n'est pas pris en charge. Veuillez choisir un fichier {{allowedExtension}}."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"presets": {
|
||||||
|
"title": "Suggestions",
|
||||||
|
"descriptions": {
|
||||||
|
"0": "Meuble cannelé en bois",
|
||||||
|
"1": "Salle de réunion",
|
||||||
|
"2": "Loft avec verrière noire",
|
||||||
|
"3": "Salle à manger",
|
||||||
|
"4": "Étagères en bois",
|
||||||
|
"5": "Escalier en bois",
|
||||||
|
"6": "Bibliothèque grise",
|
||||||
|
"7": "Comptoir de café"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"faceLandmarks": {
|
"faceLandmarks": {
|
||||||
@@ -297,7 +319,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sidePanel": {
|
"sidePanel": {
|
||||||
"ariaLabel": "Panneau latéral",
|
"ariaLabel": "Panneau latéral - {{title}}",
|
||||||
"backToTools": "Retour aux outils de réunion",
|
"backToTools": "Retour aux outils de réunion",
|
||||||
"heading": {
|
"heading": {
|
||||||
"participants": "Participants",
|
"participants": "Participants",
|
||||||
@@ -332,11 +354,11 @@
|
|||||||
"tools": {
|
"tools": {
|
||||||
"transcript": {
|
"transcript": {
|
||||||
"title": "Transcrire",
|
"title": "Transcrire",
|
||||||
"body": "Enregistrer la conversation."
|
"body": "Transcrire la réunion."
|
||||||
},
|
},
|
||||||
"screenRecording": {
|
"screenRecording": {
|
||||||
"title": "Enregistrer",
|
"title": "Enregistrer",
|
||||||
"body": "Enregistrer la réunion."
|
"body": "Enregistrer la réunion en vidéo."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -597,7 +619,7 @@
|
|||||||
},
|
},
|
||||||
"participantTileFocus": {
|
"participantTileFocus": {
|
||||||
"containerLabel": "Options pour {{name}}",
|
"containerLabel": "Options pour {{name}}",
|
||||||
"toolbarHint": "Ctrl+Shift+/ : accéder directement aux raccourcis.",
|
"toolbarHint": "{{shortcut}} : accéder directement aux raccourcis.",
|
||||||
"pin": {
|
"pin": {
|
||||||
"enable": "Épingler",
|
"enable": "Épingler",
|
||||||
"disable": "Annuler l'épinglage"
|
"disable": "Annuler l'épinglage"
|
||||||
|
|||||||
@@ -126,6 +126,34 @@
|
|||||||
"medium": "Moyen",
|
"medium": "Moyen",
|
||||||
"large": "Grand"
|
"large": "Grand"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"fontColor": {
|
||||||
|
"label": "Couleur du texte",
|
||||||
|
"options": {
|
||||||
|
"default": "Par défaut",
|
||||||
|
"white": "Blanc",
|
||||||
|
"black": "Noir",
|
||||||
|
"blue": "Bleu",
|
||||||
|
"green": "Vert",
|
||||||
|
"red": "Rouge",
|
||||||
|
"yellow": "Jaune",
|
||||||
|
"cyan": "Cyan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"backgroundColor": {
|
||||||
|
"label": "Couleur de fond",
|
||||||
|
"options": {
|
||||||
|
"default": "Par défaut",
|
||||||
|
"white": "Blanc",
|
||||||
|
"black": "Noir",
|
||||||
|
"blue": "Bleu",
|
||||||
|
"green": "Vert",
|
||||||
|
"red": "Rouge",
|
||||||
|
"yellow": "Jaune",
|
||||||
|
"cyan": "Cyan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -273,15 +273,37 @@
|
|||||||
"title": "Virtuele achtergrond",
|
"title": "Virtuele achtergrond",
|
||||||
"selectedLabel": "Achtergrond toegepast:",
|
"selectedLabel": "Achtergrond toegepast:",
|
||||||
"apply": "Vervang je achtergrond:",
|
"apply": "Vervang je achtergrond:",
|
||||||
"descriptions": {
|
"personal": {
|
||||||
"0": "Geprofileerd houten meubel",
|
"title": "Mijn achtergronden",
|
||||||
"1": "Vergaderruimte",
|
"selectFileTooltip": "Selecteer een afbeeldingsbestand om te gebruiken als persoonlijke achtergrond",
|
||||||
"2": "Loft met zwarte glaswand",
|
"notLoggedInWarning": "U bent niet ingelogd, persoonlijke achtergronden worden niet opgeslagen van de ene vergadering naar de andere.",
|
||||||
"3": "Eetkamer",
|
"warningUploadDisabled": "Persoonlijke achtergronden worden momenteel niet opgeslagen van de ene vergadering naar de andere.",
|
||||||
"4": "Houten planken",
|
"uploadLimitReached": "U kunt geen persoonlijke achtergronden meer uploaden.",
|
||||||
"5": "Houten trap",
|
"uploadInProgress": "Afbeelding wordt geüpload…",
|
||||||
"6": "Grijze bibliotheek",
|
"errors": {
|
||||||
"7": "Koffiebar"
|
"close": "Sluiten",
|
||||||
|
"file_too_large": {
|
||||||
|
"title": "Bestand te groot",
|
||||||
|
"description": "Het bestand is te groot. Kies een bestand kleiner dan {{maxSize, number}} MB."
|
||||||
|
},
|
||||||
|
"invalid_file_type": {
|
||||||
|
"title": "Ongeldig bestandstype",
|
||||||
|
"description": "Het bestandstype wordt niet ondersteund. Kies een {{allowedExtension, list(type: 'disjunction')}} bestand."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"presets": {
|
||||||
|
"title": "Suggesties",
|
||||||
|
"descriptions": {
|
||||||
|
"0": "Geprofileerd houten meubel",
|
||||||
|
"1": "Vergaderruimte",
|
||||||
|
"2": "Loft met zwarte glaswand",
|
||||||
|
"3": "Eetkamer",
|
||||||
|
"4": "Houten planken",
|
||||||
|
"5": "Houten trap",
|
||||||
|
"6": "Grijze bibliotheek",
|
||||||
|
"7": "Koffiebar"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"faceLandmarks": {
|
"faceLandmarks": {
|
||||||
@@ -297,7 +319,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sidePanel": {
|
"sidePanel": {
|
||||||
"ariaLabel": "Zijbalk",
|
"ariaLabel": "Zijbalk - {{title}}",
|
||||||
"backToTools": "Terug naar vergadertools",
|
"backToTools": "Terug naar vergadertools",
|
||||||
"heading": {
|
"heading": {
|
||||||
"participants": "Deelnemers",
|
"participants": "Deelnemers",
|
||||||
@@ -332,11 +354,11 @@
|
|||||||
"tools": {
|
"tools": {
|
||||||
"transcript": {
|
"transcript": {
|
||||||
"title": "Transcriberen",
|
"title": "Transcriberen",
|
||||||
"body": "Het gesprek opnemen."
|
"body": "Zet vergaderingen om in tekst."
|
||||||
},
|
},
|
||||||
"screenRecording": {
|
"screenRecording": {
|
||||||
"title": "Opnemen",
|
"title": "Opnemen",
|
||||||
"body": "De vergadering opnemen."
|
"body": "Sla vergaderingen op als video."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -597,7 +619,7 @@
|
|||||||
},
|
},
|
||||||
"participantTileFocus": {
|
"participantTileFocus": {
|
||||||
"containerLabel": "Opties voor {{name}}",
|
"containerLabel": "Opties voor {{name}}",
|
||||||
"toolbarHint": "Ctrl+Shift+/: direct toegang tot de sneltoetsen.",
|
"toolbarHint": "{{shortcut}}: direct toegang tot de sneltoetsen.",
|
||||||
"pin": {
|
"pin": {
|
||||||
"enable": "Pinnen",
|
"enable": "Pinnen",
|
||||||
"disable": "Losmaken"
|
"disable": "Losmaken"
|
||||||
|
|||||||
@@ -126,6 +126,34 @@
|
|||||||
"medium": "Gemiddeld",
|
"medium": "Gemiddeld",
|
||||||
"large": "Groot"
|
"large": "Groot"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"fontColor": {
|
||||||
|
"label": "Tekstkleur",
|
||||||
|
"options": {
|
||||||
|
"default": "Standaard",
|
||||||
|
"white": "Wit",
|
||||||
|
"black": "Zwart",
|
||||||
|
"blue": "Blauw",
|
||||||
|
"green": "Groen",
|
||||||
|
"red": "Rood",
|
||||||
|
"yellow": "Geel",
|
||||||
|
"cyan": "Cyaan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"backgroundColor": {
|
||||||
|
"label": "Achtergrondkleur",
|
||||||
|
"options": {
|
||||||
|
"default": "Standaard",
|
||||||
|
"white": "Wit",
|
||||||
|
"black": "Zwart",
|
||||||
|
"blue": "Blauw",
|
||||||
|
"green": "Groen",
|
||||||
|
"red": "Rood",
|
||||||
|
"yellow": "Geel",
|
||||||
|
"cyan": "Cyaan",
|
||||||
|
"magenta": "Magenta"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,7 +20,11 @@ export const Spinner = ({
|
|||||||
const r = 14 - strokeWidth
|
const r = 14 - strokeWidth
|
||||||
const c = 2 * r * Math.PI
|
const c = 2 * r * Math.PI
|
||||||
return (
|
return (
|
||||||
<ProgressBar aria-label="Loading..." value={30}>
|
<ProgressBar
|
||||||
|
aria-label="Loading..."
|
||||||
|
value={30}
|
||||||
|
style={{ height: size, width: size }}
|
||||||
|
>
|
||||||
{({ percentage }) => (
|
{({ percentage }) => (
|
||||||
<div
|
<div
|
||||||
className={css({
|
className={css({
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ export const text = cva({
|
|||||||
textStyle: 'body',
|
textStyle: 'body',
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
|
bodyXsMedium: {
|
||||||
|
textStyle: 'body',
|
||||||
|
fontWeight: 'medium',
|
||||||
|
},
|
||||||
body: {
|
body: {
|
||||||
textStyle: 'body',
|
textStyle: 'body',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,14 +10,65 @@ export const CAPTION_TEXT_SIZE_OPTIONS: CaptionTextSize[] = [
|
|||||||
'large',
|
'large',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export type CaptionColor =
|
||||||
|
| 'default'
|
||||||
|
| 'white'
|
||||||
|
| 'black'
|
||||||
|
| 'blue'
|
||||||
|
| 'green'
|
||||||
|
| 'red'
|
||||||
|
| 'yellow'
|
||||||
|
| 'cyan'
|
||||||
|
| 'magenta'
|
||||||
|
|
||||||
|
export const CAPTION_COLOR_OPTIONS: CaptionColor[] = [
|
||||||
|
'default',
|
||||||
|
'white',
|
||||||
|
'black',
|
||||||
|
'blue',
|
||||||
|
'green',
|
||||||
|
'red',
|
||||||
|
'yellow',
|
||||||
|
'cyan',
|
||||||
|
'magenta',
|
||||||
|
]
|
||||||
|
|
||||||
|
export const CAPTION_FONT_COLOR_VALUES: Record<CaptionColor, string> = {
|
||||||
|
default: '#FFFFFF',
|
||||||
|
white: '#FFFFFF',
|
||||||
|
black: '#000000',
|
||||||
|
blue: '#0000FF',
|
||||||
|
green: '#00FF00',
|
||||||
|
red: '#FF0000',
|
||||||
|
yellow: '#FFFF00',
|
||||||
|
cyan: '#00FFFF',
|
||||||
|
magenta: '#FF00FF',
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CAPTION_BACKGROUND_COLOR_VALUES: Record<CaptionColor, string> = {
|
||||||
|
default: 'rgba(0, 0, 0, 0.75)',
|
||||||
|
black: 'rgba(0, 0, 0, 0.75)',
|
||||||
|
white: 'rgba(255, 255, 255, 0.75)',
|
||||||
|
blue: 'rgba(0, 0, 255, 0.75)',
|
||||||
|
green: 'rgba(0, 255, 0, 0.75)',
|
||||||
|
red: 'rgba(255, 0, 0, 0.75)',
|
||||||
|
yellow: 'rgba(255, 255, 0, 0.75)',
|
||||||
|
cyan: 'rgba(0, 255, 255, 0.75)',
|
||||||
|
magenta: 'rgba(255, 0, 255, 0.75)',
|
||||||
|
}
|
||||||
|
|
||||||
type AccessibilityState = {
|
type AccessibilityState = {
|
||||||
announceReactions: boolean
|
announceReactions: boolean
|
||||||
captionTextSize: CaptionTextSize
|
captionTextSize: CaptionTextSize
|
||||||
|
captionFontColor: CaptionColor
|
||||||
|
captionBackgroundColor: CaptionColor
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_STATE: AccessibilityState = {
|
const DEFAULT_STATE: AccessibilityState = {
|
||||||
announceReactions: false,
|
announceReactions: false,
|
||||||
captionTextSize: 'medium',
|
captionTextSize: 'medium',
|
||||||
|
captionFontColor: 'default',
|
||||||
|
captionBackgroundColor: 'default',
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAccessibilityState(): AccessibilityState {
|
function getAccessibilityState(): AccessibilityState {
|
||||||
@@ -25,10 +76,21 @@ function getAccessibilityState(): AccessibilityState {
|
|||||||
const stored = localStorage.getItem(STORAGE_KEYS.ACCESSIBILITY)
|
const stored = localStorage.getItem(STORAGE_KEYS.ACCESSIBILITY)
|
||||||
if (stored) {
|
if (stored) {
|
||||||
const parsed = JSON.parse(stored)
|
const parsed = JSON.parse(stored)
|
||||||
const validCaptionSizes = CAPTION_TEXT_SIZE_OPTIONS
|
const captionTextSize = CAPTION_TEXT_SIZE_OPTIONS.includes(
|
||||||
const captionTextSize = validCaptionSizes.includes(parsed.captionTextSize)
|
parsed.captionTextSize
|
||||||
|
)
|
||||||
? parsed.captionTextSize
|
? parsed.captionTextSize
|
||||||
: DEFAULT_STATE.captionTextSize
|
: DEFAULT_STATE.captionTextSize
|
||||||
|
const captionFontColor = CAPTION_COLOR_OPTIONS.includes(
|
||||||
|
parsed.captionFontColor
|
||||||
|
)
|
||||||
|
? parsed.captionFontColor
|
||||||
|
: DEFAULT_STATE.captionFontColor
|
||||||
|
const captionBackgroundColor = CAPTION_COLOR_OPTIONS.includes(
|
||||||
|
parsed.captionBackgroundColor
|
||||||
|
)
|
||||||
|
? parsed.captionBackgroundColor
|
||||||
|
: DEFAULT_STATE.captionBackgroundColor
|
||||||
return {
|
return {
|
||||||
...DEFAULT_STATE,
|
...DEFAULT_STATE,
|
||||||
...parsed,
|
...parsed,
|
||||||
@@ -37,6 +99,8 @@ function getAccessibilityState(): AccessibilityState {
|
|||||||
? parsed.announceReactions
|
? parsed.announceReactions
|
||||||
: DEFAULT_STATE.announceReactions,
|
: DEFAULT_STATE.announceReactions,
|
||||||
captionTextSize,
|
captionTextSize,
|
||||||
|
captionFontColor,
|
||||||
|
captionBackgroundColor,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
import { proxy, subscribe } from 'valtio'
|
import { proxy, subscribe } from 'valtio'
|
||||||
import { ProcessorSerialized } from '@/features/rooms/livekit/components/blur'
|
import {
|
||||||
|
ProcessorConfig,
|
||||||
|
ProcessorType,
|
||||||
|
} from '@/features/rooms/livekit/components/blur'
|
||||||
import {
|
import {
|
||||||
loadUserChoices,
|
loadUserChoices,
|
||||||
saveUserChoices,
|
|
||||||
LocalUserChoices as LocalUserChoicesLK,
|
LocalUserChoices as LocalUserChoicesLK,
|
||||||
|
saveUserChoices,
|
||||||
} from '@livekit/components-core'
|
} from '@livekit/components-core'
|
||||||
import { VideoQuality } from 'livekit-client'
|
import { VideoQuality } from 'livekit-client'
|
||||||
|
|
||||||
export type VideoResolution = 'h720' | 'h360' | 'h180'
|
export type VideoResolution = 'h720' | 'h360' | 'h180'
|
||||||
|
|
||||||
export type LocalUserChoices = LocalUserChoicesLK & {
|
export type LocalUserChoices = LocalUserChoicesLK & {
|
||||||
processorSerialized?: ProcessorSerialized
|
processorConfig?: ProcessorConfig
|
||||||
noiseReductionEnabled?: boolean
|
noiseReductionEnabled?: boolean
|
||||||
audioOutputDeviceId?: string
|
audioOutputDeviceId?: string
|
||||||
videoPublishResolution?: VideoResolution
|
videoPublishResolution?: VideoResolution
|
||||||
@@ -28,7 +31,33 @@ function getUserChoicesState(): LocalUserChoices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const userChoicesStore = proxy<LocalUserChoices>(getUserChoicesState())
|
export const userChoicesStore = proxy<LocalUserChoices>(getUserChoicesState())
|
||||||
|
|
||||||
subscribe(userChoicesStore, () => {
|
subscribe(userChoicesStore, () => {
|
||||||
saveUserChoices(userChoicesStore, false)
|
saveUserChoices(userChoicesStore, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// we run some logic on store loading to check if the processor config is still valid
|
||||||
|
if (userChoicesStore.processorConfig?.type === ProcessorType.VIRTUAL) {
|
||||||
|
if (userChoicesStore.processorConfig.imagePath.startsWith('blob:')) {
|
||||||
|
// this happens when a not authenticated user had changed their background image
|
||||||
|
// we restore clear the processor config to avoid displaying a black screen.
|
||||||
|
userChoicesStore.processorConfig = undefined
|
||||||
|
} else if (userChoicesStore.processorConfig.fileId) {
|
||||||
|
// Checking if the image is still available / accessible
|
||||||
|
await fetch(userChoicesStore.processorConfig.imagePath, {
|
||||||
|
// We bypass the cache to ensure we have access
|
||||||
|
cache: 'reload',
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
// if we cannot fetch the image (likely a 401 from the backend because
|
||||||
|
// the user is not logged in anymore, etc.),
|
||||||
|
// we clear the processor config to avoid displaying a black screen.
|
||||||
|
// This can happen when the user logs out for instance, etc.
|
||||||
|
if (!response.ok) {
|
||||||
|
userChoicesStore.processorConfig = undefined
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
userChoicesStore.processorConfig = undefined
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -95,3 +95,14 @@ html:has(.lk-video-conference) {
|
|||||||
U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
|
U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
|
||||||
U+2212, U+2215, U+FEFF, U+FFFD;
|
U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hoverGroup .hoverGroupChild {
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hoverGroup:hover .hoverGroupChild,
|
||||||
|
.hoverGroup:focus-within .hoverGroupChild {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,14 @@ export default defineConfig(({ mode }) => {
|
|||||||
port: parseInt(env.VITE_PORT) || 3000,
|
port: parseInt(env.VITE_PORT) || 3000,
|
||||||
host: env.VITE_HOST ?? 'localhost',
|
host: env.VITE_HOST ?? 'localhost',
|
||||||
allowedHosts: ['.nip.io'],
|
allowedHosts: ['.nip.io'],
|
||||||
|
// In a local dev setup, we proxy the media server ourselves to avoid CORS issues
|
||||||
|
proxy: {
|
||||||
|
'/media': {
|
||||||
|
target: 'http://localhost:8083',
|
||||||
|
changeOrigin: true,
|
||||||
|
secure: false
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
align="center"
|
align="center"
|
||||||
src="{{logo_img}}"
|
src="{{logo_img}}"
|
||||||
width="320px"
|
width="320px"
|
||||||
alt="{%trans 'Logo email' %}"
|
alt="{%trans 'Logo email' %} {{brandname}}"
|
||||||
/>
|
/>
|
||||||
</mj-column>
|
</mj-column>
|
||||||
</mj-section>
|
</mj-section>
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "mail_mjml",
|
"name": "mail_mjml",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mail_mjml",
|
"name": "mail_mjml",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@html-to/text-cli": "0.5.4",
|
"@html-to/text-cli": "0.5.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mail_mjml",
|
"name": "mail_mjml",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"description": "An util to generate html and text django's templates from mjml templates",
|
"description": "An util to generate html and text django's templates from mjml templates",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "sdk",
|
"name": "sdk",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sdk",
|
"name": "sdk",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"./library",
|
"./library",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sdk",
|
"name": "sdk",
|
||||||
"version": "1.10.0",
|
"version": "1.12.0",
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "summary"
|
name = "summary"
|
||||||
version = "1.10.0"
|
version = "1.12.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastapi[standard]>=0.105.0",
|
"fastapi[standard]>=0.105.0",
|
||||||
"uvicorn>=0.24.0",
|
"uvicorn>=0.24.0",
|
||||||
@@ -21,8 +21,16 @@ dependencies = [
|
|||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
"ruff==0.14.4",
|
"ruff==0.14.4",
|
||||||
|
"pytest==9.0.2",
|
||||||
|
"responses>=0.25.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
markers = [
|
||||||
|
"api: Test the API",
|
||||||
|
]
|
||||||
|
testpaths = ["tests"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools>=61.0"]
|
requires = ["setuptools>=61.0"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
@@ -49,6 +57,7 @@ select = [
|
|||||||
"T20", # flake8-print
|
"T20", # flake8-print
|
||||||
"W", # pycodestyle warning
|
"W", # pycodestyle warning
|
||||||
]
|
]
|
||||||
|
ignore= ["PLR2004"]
|
||||||
|
|
||||||
[tool.ruff.lint.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
"tests/*" = [
|
"tests/*" = [
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ Einige Punkte, die wir Ihnen empfehlen zu überprüfen:
|
|||||||
|
|
||||||
""",
|
""",
|
||||||
download_header_template=(
|
download_header_template=(
|
||||||
"\n*Laden Sie Ihre Aufnahme herunter, "
|
"\n*[Laden Sie hier Ihre Aufnahme herunter (externer Link)]({download_link})*\n"
|
||||||
"indem Sie [diesem Link folgen]({download_link})*\n"
|
|
||||||
),
|
),
|
||||||
hallucination_replacement_text="[Text konnte nicht transkribiert werden]",
|
hallucination_replacement_text="[Text konnte nicht transkribiert werden]",
|
||||||
document_default_title="Transkription",
|
document_default_title="Transkription",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ A few things we recommend you check:
|
|||||||
|
|
||||||
""",
|
""",
|
||||||
download_header_template=(
|
download_header_template=(
|
||||||
"\n*Download your recording by [following this link]({download_link})*\n"
|
"\n*[Download your recording (external link)]({download_link})*\n"
|
||||||
),
|
),
|
||||||
hallucination_replacement_text="[Unable to transcribe text]",
|
hallucination_replacement_text="[Unable to transcribe text]",
|
||||||
document_default_title="Transcription",
|
document_default_title="Transcription",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Quelques points que nous vous conseillons de vérifier :
|
|||||||
|
|
||||||
""",
|
""",
|
||||||
download_header_template=(
|
download_header_template=(
|
||||||
"\n*Télécharger votre enregistrement en [suivant ce lien]({download_link})*\n"
|
"\n*[Télécharger votre enregistrement (lien externe)]({download_link})*\n"
|
||||||
),
|
),
|
||||||
hallucination_replacement_text="[Texte impossible à transcrire]",
|
hallucination_replacement_text="[Texte impossible à transcrire]",
|
||||||
document_default_title="Transcription",
|
document_default_title="Transcription",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Een paar punten die wij u aanraden te controleren:
|
|||||||
|
|
||||||
""",
|
""",
|
||||||
download_header_template=(
|
download_header_template=(
|
||||||
"\n*Download uw opname door [deze link te volgen]({download_link})*\n"
|
"\n*[Download hier je opname (externe link)]({download_link})*\n"
|
||||||
),
|
),
|
||||||
hallucination_replacement_text="[Tekst kon niet worden getranscribeerd]",
|
hallucination_replacement_text="[Tekst kon niet worden getranscribeerd]",
|
||||||
document_default_title="Transcriptie",
|
document_default_title="Transcriptie",
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
"""Tests for the summary service."""
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
"""Tests for the API summary service."""
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
"""Integration tests for the health check endpoints."""
|
||||||
|
|
||||||
|
|
||||||
|
class TestHeartbeat:
|
||||||
|
"""Tests for the /__heartbeat__ endpoint."""
|
||||||
|
|
||||||
|
def test_returns_200(self, client):
|
||||||
|
"""The heartbeat endpoint responds with 200 OK without a token."""
|
||||||
|
response = client.get("/__heartbeat__")
|
||||||
|
|
||||||
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
|
||||||
|
class TestLBHeartbeat:
|
||||||
|
"""Tests for the /__lbheartbeat__ endpoint."""
|
||||||
|
|
||||||
|
def test_returns_200(self, client):
|
||||||
|
"""The load-balancer heartbeat endpoint responds with 200 OK without a token."""
|
||||||
|
response = client.get("/__lbheartbeat__")
|
||||||
|
|
||||||
|
assert response.status_code == 200
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
"""Integration tests for the API tasks endpoints."""
|
||||||
|
|
||||||
|
# tests/unit/test_api_tasks.py
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
|
||||||
|
class TestTasks:
|
||||||
|
"""Tests for the /tasks endpoint."""
|
||||||
|
|
||||||
|
@patch(
|
||||||
|
"summary.api.route.tasks.process_audio_transcribe_summarize_v2.apply_async",
|
||||||
|
return_value=MagicMock(id="task-id-abc"),
|
||||||
|
)
|
||||||
|
@patch("summary.api.route.tasks.time.time", return_value=1735725600.0)
|
||||||
|
def test_create_task_returns_task_id(self, mock_time, mock_apply_async, client):
|
||||||
|
"""POST /tasks/ with valid payload returns id and dispatches Celery task."""
|
||||||
|
response = client.post(
|
||||||
|
"api/v1/tasks/",
|
||||||
|
headers={"Authorization": "Bearer test-api-token"},
|
||||||
|
json={
|
||||||
|
"owner_id": "owner-123",
|
||||||
|
"filename": "recording.mp4",
|
||||||
|
"email": "user@example.com",
|
||||||
|
"sub": "sub-123",
|
||||||
|
"room": "room-abc",
|
||||||
|
"recording_date": "2026-01-01",
|
||||||
|
"recording_time": "10:00:00",
|
||||||
|
"language": None,
|
||||||
|
"download_link": "http://example.com/file.mp4",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert response.json() == {"id": "task-id-abc", "message": "Task created"}
|
||||||
|
|
||||||
|
args = mock_apply_async.call_args.kwargs["args"]
|
||||||
|
assert args == [
|
||||||
|
"owner-123", # owner_id
|
||||||
|
"recording.mp4", # filename
|
||||||
|
"user@example.com", # email
|
||||||
|
"sub-123", # sub
|
||||||
|
1735725600.0, # frozen time
|
||||||
|
"room-abc", # room
|
||||||
|
"2026-01-01", # recording_date
|
||||||
|
"10:00:00", # recording_time
|
||||||
|
None, # language
|
||||||
|
"http://example.com/file.mp4", # download_link
|
||||||
|
None, # context_language
|
||||||
|
]
|
||||||
|
|
||||||
|
def test_create_task_invalid_language(self, client):
|
||||||
|
"""POST /tasks/ with an unsupported language returns 422."""
|
||||||
|
payload = {"language": "klingon"}
|
||||||
|
response = client.post(
|
||||||
|
"/api/v1/tasks/",
|
||||||
|
headers={"Authorization": "Bearer test-api-token"},
|
||||||
|
json=payload,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert response.status_code == 422
|
||||||
|
|
||||||
|
@patch(
|
||||||
|
"summary.api.route.tasks.AsyncResult",
|
||||||
|
return_value=MagicMock(status="PENDING"),
|
||||||
|
)
|
||||||
|
def test_get_task_status_pending(self, mock_result, client):
|
||||||
|
"""GET /tasks/{id} returns PENDING status when the task has not started yet."""
|
||||||
|
response = client.get(
|
||||||
|
"/api/v1/tasks/task-id-abc",
|
||||||
|
headers={"Authorization": "Bearer test-api-token"},
|
||||||
|
)
|
||||||
|
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert response.json() == {"id": "task-id-abc", "status": "PENDING"}
|
||||||
|
|
||||||
|
@patch(
|
||||||
|
"summary.api.route.tasks.AsyncResult",
|
||||||
|
return_value=MagicMock(status="SUCCESS"),
|
||||||
|
)
|
||||||
|
def test_get_task_status_success(self, mock_result, client):
|
||||||
|
"""GET /tasks/{id} returns SUCCESS status when the task has completed."""
|
||||||
|
response = client.get(
|
||||||
|
"/api/v1/tasks/task-id-abc",
|
||||||
|
headers={"Authorization": "Bearer test-api-token"},
|
||||||
|
)
|
||||||
|
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert response.json()["status"] == "SUCCESS"
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
"""Integration test configuration. Provides shared fixtures."""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from fastapi.testclient import TestClient
|
||||||
|
from pydantic import SecretStr
|
||||||
|
|
||||||
|
from summary.core.config import Settings, get_settings
|
||||||
|
from summary.main import app
|
||||||
|
|
||||||
|
|
||||||
|
def get_settings_override():
|
||||||
|
"""Return settings for tests."""
|
||||||
|
return Settings(
|
||||||
|
app_api_token=SecretStr("test-api-token"),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def client():
|
||||||
|
"""Provide a FastAPI TestClient for tests."""
|
||||||
|
client = TestClient(app)
|
||||||
|
app.dependency_overrides[get_settings] = get_settings_override
|
||||||
|
|
||||||
|
return client
|
||||||
Reference in New Issue
Block a user