mirror of
https://github.com/suitenumerique/docs.git
synced 2026-05-07 15:43:01 +02:00
Compare commits
1 Commits
fix/cve-mi
...
add/clean-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c96c3c1775 |
78
.github/workflows/docker-hub.yml
vendored
78
.github/workflows/docker-hub.yml
vendored
@@ -5,13 +5,13 @@ on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- 'main'
|
||||
tags:
|
||||
- "v*"
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
- "ci/trivy-fails"
|
||||
- 'main'
|
||||
- 'ci/trivy-fails'
|
||||
|
||||
env:
|
||||
DOCKER_USER: 1001:127
|
||||
@@ -20,34 +20,40 @@ jobs:
|
||||
build-and-push-backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
-
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: lasuite/impress-backend
|
||||
- name: Login to DockerHub
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview')
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
- name: Run trivy scan
|
||||
-
|
||||
name: Run trivy scan
|
||||
uses: numerique-gouv/action-trivy-cache@main
|
||||
with:
|
||||
docker-build-args: "--target backend-production -f Dockerfile"
|
||||
docker-image-name: "docker.io/lasuite/impress-backend:${{ github.sha }}"
|
||||
- name: Build and push
|
||||
docker-build-args: '--target backend-production -f Dockerfile'
|
||||
docker-image-name: 'docker.io/lasuite/impress-backend:${{ github.sha }}'
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
target: backend-production
|
||||
build-args: DOCKER_USER=${{ env.DOCKER_USER }}
|
||||
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
|
||||
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Cleanup Docker after build
|
||||
-
|
||||
name: Cleanup Docker after build
|
||||
if: always()
|
||||
run: |
|
||||
docker system prune -af
|
||||
@@ -56,37 +62,43 @@ jobs:
|
||||
build-and-push-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
-
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: lasuite/impress-frontend
|
||||
- name: Login to DockerHub
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview')
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
- name: Run trivy scan
|
||||
-
|
||||
name: Run trivy scan
|
||||
uses: numerique-gouv/action-trivy-cache@main
|
||||
with:
|
||||
docker-build-args: "-f src/frontend/Dockerfile --target frontend-production"
|
||||
docker-image-name: "docker.io/lasuite/impress-frontend:${{ github.sha }}"
|
||||
- name: Build and push
|
||||
docker-build-args: '-f src/frontend/Dockerfile --target frontend-production'
|
||||
docker-image-name: 'docker.io/lasuite/impress-frontend:${{ github.sha }}'
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./src/frontend/Dockerfile
|
||||
target: frontend-production
|
||||
build-args: |
|
||||
DOCKER_USER=${{ env.DOCKER_USER }}
|
||||
DOCKER_USER=${{ env.DOCKER_USER }}:-1000
|
||||
PUBLISH_AS_MIT=false
|
||||
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Cleanup Docker after build
|
||||
-
|
||||
name: Cleanup Docker after build
|
||||
if: always()
|
||||
run: |
|
||||
docker system prune -af
|
||||
@@ -95,22 +107,27 @@ jobs:
|
||||
build-and-push-y-provider:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
-
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: lasuite/impress-y-provider
|
||||
- name: Login to DockerHub
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview')
|
||||
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin
|
||||
- name: Run trivy scan
|
||||
-
|
||||
name: Run trivy scan
|
||||
uses: numerique-gouv/action-trivy-cache@main
|
||||
with:
|
||||
docker-build-args: "-f src/frontend/servers/y-provider/Dockerfile --target y-provider"
|
||||
docker-image-name: "docker.io/lasuite/impress-y-provider:${{ github.sha }}"
|
||||
- name: Build and push
|
||||
docker-build-args: '-f src/frontend/servers/y-provider/Dockerfile --target y-provider'
|
||||
docker-image-name: 'docker.io/lasuite/impress-y-provider:${{ github.sha }}'
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
@@ -120,7 +137,8 @@ jobs:
|
||||
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Cleanup Docker after build
|
||||
-
|
||||
name: Cleanup Docker after build
|
||||
if: always()
|
||||
run: |
|
||||
docker system prune -af
|
||||
|
||||
142
.github/workflows/ghcr.yml
vendored
142
.github/workflows/ghcr.yml
vendored
@@ -1,142 +0,0 @@
|
||||
name: Build and Push to GHCR
|
||||
run-name: Build and Push to GHCR
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
DOCKER_USER: 1001:127
|
||||
REGISTRY: ghcr.io
|
||||
|
||||
jobs:
|
||||
build-and-push-backend:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.repository.fork == true
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ github.repository }}/backend
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
target: backend-production
|
||||
build-args: DOCKER_USER=${{ env.DOCKER_USER }}
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Cleanup Docker after build
|
||||
if: always()
|
||||
run: |
|
||||
docker system prune -af
|
||||
docker volume prune -f
|
||||
|
||||
build-and-push-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.repository.fork == true
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ github.repository }}/frontend
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./src/frontend/Dockerfile
|
||||
target: frontend-production
|
||||
build-args: |
|
||||
DOCKER_USER=${{ env.DOCKER_USER }}
|
||||
PUBLISH_AS_MIT=false
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Cleanup Docker after build
|
||||
if: always()
|
||||
run: |
|
||||
docker system prune -af
|
||||
docker volume prune -f
|
||||
|
||||
build-and-push-y-provider:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.repository.fork == true
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ github.repository }}/y-provider
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./src/frontend/servers/y-provider/Dockerfile
|
||||
target: y-provider
|
||||
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Cleanup Docker after build
|
||||
if: always()
|
||||
run: |
|
||||
docker system prune -af
|
||||
docker volume prune -f
|
||||
15
CHANGELOG.md
15
CHANGELOG.md
@@ -8,29 +8,18 @@ and this project adheres to
|
||||
|
||||
### Added
|
||||
|
||||
- ✨(tracking) add UTM parameters to shared document links
|
||||
- ✨(frontend) add floating bar with leftpanel collapse button #1876
|
||||
- ✨(frontend) Can print a doc #1832
|
||||
- ✨(backend) manage reconciliation requests for user accounts #1878
|
||||
- 👷(CI) add GHCR workflow for forked repo testing #1851
|
||||
- ✨(backend) add management command to reset a Document #1882
|
||||
|
||||
### Changed
|
||||
|
||||
- ♿️(frontend) prevent dates from being focusable #1855
|
||||
- ♿️(frontend) Focus main container after navigation #1854
|
||||
- 💄(frontend) align colors and logo with ui-kit v2 #1869
|
||||
- 🚸(backend) sort user search results by proximity with the active user #1802
|
||||
- 🚸(oidc) ignore case when fallback on email #1880
|
||||
- 🚸(backend) sort user search results by proximity with the active user #1802
|
||||
|
||||
### Fixed
|
||||
|
||||
- 🐛(frontend) fix broadcast store sync #1846
|
||||
- 🐛(helm) use celery resources instead of backend resources
|
||||
- 🐛(helm) reverse liveness and readiness for backend deployment
|
||||
|
||||
### Security
|
||||
|
||||
- 🔒️(secu) fix CVE-2026-26996 with minimatch #1900
|
||||
|
||||
## [v4.5.0] - 2026-01-28
|
||||
|
||||
|
||||
150
src/backend/core/management/commands/clean_document.py
Normal file
150
src/backend/core/management/commands/clean_document.py
Normal file
@@ -0,0 +1,150 @@
|
||||
"""Clean a document by resetting it (keeping its title) and deleting all descendants."""
|
||||
|
||||
import logging
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.files.storage import default_storage
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.db import transaction
|
||||
from django.db.models import Q
|
||||
|
||||
from botocore.exceptions import ClientError
|
||||
|
||||
from core.choices import LinkReachChoices, LinkRoleChoices, RoleChoices
|
||||
from core.models import Document, DocumentAccess, Invitation, Thread
|
||||
|
||||
logger = logging.getLogger("impress.commands.clean_document")
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Reset a document (keeping its title) and delete all its descendants."""
|
||||
|
||||
help = __doc__
|
||||
|
||||
def add_arguments(self, parser):
|
||||
"""Define command arguments."""
|
||||
parser.add_argument(
|
||||
"document_id",
|
||||
type=str,
|
||||
help="UUID of the document to clean",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-f",
|
||||
"--force",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Force command execution despite DEBUG is set to False",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-t",
|
||||
"--title",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Update the document title to this value",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--link_reach",
|
||||
type=str,
|
||||
default=LinkReachChoices.RESTRICTED,
|
||||
choices=LinkReachChoices,
|
||||
help="Update the link_reach to this value",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--link_role",
|
||||
type=str,
|
||||
default=LinkRoleChoices.READER,
|
||||
choices=LinkRoleChoices,
|
||||
help="update the link_role to this value",
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
"""Execute the clean_document command."""
|
||||
if not settings.DEBUG and not options["force"]:
|
||||
raise CommandError(
|
||||
"This command is not meant to be used in production environment "
|
||||
"except you know what you are doing, if so use --force parameter"
|
||||
)
|
||||
|
||||
document_id = options["document_id"]
|
||||
|
||||
try:
|
||||
document = Document.objects.get(pk=document_id)
|
||||
except (Document.DoesNotExist, ValueError) as err:
|
||||
raise CommandError(f"Document {document_id} does not exist.") from err
|
||||
|
||||
descendants = list(document.get_descendants())
|
||||
descendant_ids = [doc.id for doc in descendants]
|
||||
all_documents = [document, *descendants]
|
||||
|
||||
# Collect all attachment keys before the transaction clears them
|
||||
all_attachment_keys = []
|
||||
for doc in all_documents:
|
||||
all_attachment_keys.extend(doc.attachments)
|
||||
|
||||
self.stdout.write(
|
||||
f"Cleaning document {document_id} and deleting "
|
||||
f"{len(descendants)} descendant(s)..."
|
||||
)
|
||||
|
||||
with transaction.atomic():
|
||||
# Clean accesses and invitations on the root document
|
||||
access_count, _ = DocumentAccess.objects.filter(
|
||||
Q(document_id=document.id) & ~Q(role=RoleChoices.OWNER)
|
||||
).delete()
|
||||
self.stdout.write(f"Deleted {access_count} access(es) on root document.")
|
||||
|
||||
invitation_count, _ = Invitation.objects.filter(
|
||||
document_id=document.id
|
||||
).delete()
|
||||
self.stdout.write(
|
||||
f"Deleted {invitation_count} invitation(s) on root document."
|
||||
)
|
||||
|
||||
thread_count, _ = Thread.objects.filter(document_id=document.id).delete()
|
||||
self.stdout.write(f"Deleted {thread_count} thread(s) on root document.")
|
||||
|
||||
# Reset root document fields
|
||||
update_fields = {
|
||||
"excerpt": None,
|
||||
"link_reach": options["link_reach"],
|
||||
"link_role": options["link_role"],
|
||||
"attachments": [],
|
||||
}
|
||||
if options["title"] is not None:
|
||||
update_fields["title"] = options["title"]
|
||||
Document.objects.filter(id=document.id).update(**update_fields)
|
||||
|
||||
if options["title"] is not None:
|
||||
self.stdout.write(
|
||||
f'Reset fields on root document (title set to "{options["title"]}").'
|
||||
)
|
||||
else:
|
||||
self.stdout.write("Reset fields on root document (title kept).")
|
||||
|
||||
# Delete all descendants (cascades accesses and invitations)
|
||||
if descendants:
|
||||
deleted_count, _ = Document.objects.filter(
|
||||
id__in=descendant_ids
|
||||
).delete()
|
||||
self.stdout.write(f"Deleted {deleted_count} descendant(s).")
|
||||
|
||||
# Delete S3 content outside the transaction (S3 is not transactional)
|
||||
s3_client = default_storage.connection.meta.client
|
||||
bucket = default_storage.bucket_name
|
||||
|
||||
for doc in all_documents:
|
||||
try:
|
||||
s3_client.delete_object(Bucket=bucket, Key=doc.file_key)
|
||||
except ClientError:
|
||||
logger.warning("Failed to delete S3 file for document %s", doc.id)
|
||||
|
||||
self.stdout.write(f"Deleted S3 content for {len(all_documents)} document(s).")
|
||||
|
||||
for key in all_attachment_keys:
|
||||
try:
|
||||
s3_client.delete_object(Bucket=bucket, Key=key)
|
||||
except ClientError:
|
||||
logger.warning("Failed to delete S3 attachment %s", key)
|
||||
|
||||
self.stdout.write(f"Deleted {len(all_attachment_keys)} attachment(s) from S3.")
|
||||
self.stdout.write("Done.")
|
||||
@@ -118,11 +118,11 @@ class UserManager(auth_models.UserManager):
|
||||
|
||||
if settings.OIDC_FALLBACK_TO_EMAIL_FOR_IDENTIFICATION:
|
||||
try:
|
||||
return self.get(email__iexact=email)
|
||||
return self.get(email=email)
|
||||
except self.model.DoesNotExist:
|
||||
pass
|
||||
elif (
|
||||
self.filter(email__iexact=email).exists()
|
||||
self.filter(email=email).exists()
|
||||
and not settings.OIDC_ALLOW_DUPLICATE_EMAILS
|
||||
):
|
||||
raise DuplicateEmailError(
|
||||
@@ -1260,7 +1260,7 @@ class Document(MP_Node, BaseModel):
|
||||
"brandname": settings.EMAIL_BRAND_NAME,
|
||||
"document": self,
|
||||
"domain": domain,
|
||||
"link": f"{domain}/docs/{self.id}/?utm_source=docssharelink&utm_campaign={self.id}",
|
||||
"link": f"{domain}/docs/{self.id}/",
|
||||
"link_label": self.title or str(_("Untitled Document")),
|
||||
"button_label": _("Open"),
|
||||
"logo_img": settings.EMAIL_LOGO_IMG,
|
||||
@@ -1905,7 +1905,7 @@ class Invitation(BaseModel):
|
||||
|
||||
# Check if an identity already exists for the provided email
|
||||
if (
|
||||
User.objects.filter(email__iexact=self.email).exists()
|
||||
User.objects.filter(email=self.email).exists()
|
||||
and not settings.OIDC_ALLOW_DUPLICATE_EMAILS
|
||||
):
|
||||
raise ValidationError(
|
||||
|
||||
@@ -68,30 +68,6 @@ def test_authentication_getter_existing_user_via_email(
|
||||
assert user == db_user
|
||||
|
||||
|
||||
def test_authentication_getter_existing_user_via_email_case_insensitive(
|
||||
django_assert_num_queries, monkeypatch
|
||||
):
|
||||
"""
|
||||
If an existing user doesn't match the sub but matches the email with different case,
|
||||
the user should be returned (case-insensitive email matching).
|
||||
"""
|
||||
|
||||
klass = OIDCAuthenticationBackend()
|
||||
db_user = UserFactory(email="john.doe@example.com")
|
||||
|
||||
def get_userinfo_mocked(*args):
|
||||
return {"sub": "123", "email": "JOHN.DOE@EXAMPLE.COM"}
|
||||
|
||||
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
|
||||
|
||||
with django_assert_num_queries(4): # user by sub, user by mail, update sub
|
||||
user = klass.get_or_create_user(
|
||||
access_token="test-token", id_token=None, payload=None
|
||||
)
|
||||
|
||||
assert user == db_user
|
||||
|
||||
|
||||
def test_authentication_getter_email_none(monkeypatch):
|
||||
"""
|
||||
If no user is found with the sub and no email is provided, a new user should be created.
|
||||
@@ -181,39 +157,6 @@ def test_authentication_getter_existing_user_no_fallback_to_email_no_duplicate(
|
||||
assert models.User.objects.count() == 1
|
||||
|
||||
|
||||
def test_authentication_getter_existing_user_no_fallback_to_email_no_duplicate_case_insensitive(
|
||||
settings, monkeypatch
|
||||
):
|
||||
"""
|
||||
When the "OIDC_FALLBACK_TO_EMAIL_FOR_IDENTIFICATION" setting is set to False,
|
||||
the system should detect duplicate emails even with different case.
|
||||
"""
|
||||
|
||||
klass = OIDCAuthenticationBackend()
|
||||
_db_user = UserFactory(email="john.doe@example.com")
|
||||
|
||||
# Set the setting to False
|
||||
settings.OIDC_FALLBACK_TO_EMAIL_FOR_IDENTIFICATION = False
|
||||
settings.OIDC_ALLOW_DUPLICATE_EMAILS = False
|
||||
|
||||
def get_userinfo_mocked(*args):
|
||||
return {"sub": "123", "email": "JOHN.DOE@EXAMPLE.COM"}
|
||||
|
||||
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
|
||||
|
||||
with pytest.raises(
|
||||
SuspiciousOperation,
|
||||
match=(
|
||||
"We couldn't find a user with this sub but the email is already associated "
|
||||
"with a registered user."
|
||||
),
|
||||
):
|
||||
klass.get_or_create_user(access_token="test-token", id_token=None, payload=None)
|
||||
|
||||
# Since the sub doesn't match, it should not create a new user
|
||||
assert models.User.objects.count() == 1
|
||||
|
||||
|
||||
def test_authentication_getter_existing_user_with_email(
|
||||
django_assert_num_queries, monkeypatch
|
||||
):
|
||||
|
||||
313
src/backend/core/tests/commands/test_clean_document.py
Normal file
313
src/backend/core/tests/commands/test_clean_document.py
Normal file
@@ -0,0 +1,313 @@
|
||||
"""Unit tests for the `clean_document` management command."""
|
||||
|
||||
import random
|
||||
from unittest import mock
|
||||
from uuid import uuid4
|
||||
|
||||
from django.core.management import CommandError, call_command
|
||||
|
||||
import pytest
|
||||
from botocore.exceptions import ClientError
|
||||
|
||||
from core import choices, factories, models
|
||||
from core.choices import LinkReachChoices, LinkRoleChoices
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
|
||||
|
||||
def test_clean_document_with_descendants(settings):
|
||||
"""The command should reset the root (keeping title) and delete descendants."""
|
||||
settings.DEBUG = True
|
||||
|
||||
# Create a root document with subdocuments
|
||||
root = factories.DocumentFactory(
|
||||
title="Root",
|
||||
link_reach=LinkReachChoices.PUBLIC,
|
||||
link_role=LinkRoleChoices.EDITOR,
|
||||
)
|
||||
child = factories.DocumentFactory(
|
||||
parent=root,
|
||||
title="Child",
|
||||
link_reach=LinkReachChoices.AUTHENTICATED,
|
||||
link_role=LinkRoleChoices.EDITOR,
|
||||
)
|
||||
grandchild = factories.DocumentFactory(
|
||||
parent=child,
|
||||
title="Grandchild",
|
||||
)
|
||||
|
||||
# Create accesses and invitations
|
||||
factories.UserDocumentAccessFactory.create_batch(
|
||||
5,
|
||||
document=root,
|
||||
role=random.choice(
|
||||
[
|
||||
role
|
||||
for role in choices.RoleChoices
|
||||
if role not in choices.PRIVILEGED_ROLES
|
||||
],
|
||||
),
|
||||
)
|
||||
# One owner role
|
||||
factories.UserDocumentAccessFactory(document=root, role=choices.RoleChoices.OWNER)
|
||||
factories.UserDocumentAccessFactory(document=child)
|
||||
factories.InvitationFactory(document=root)
|
||||
factories.InvitationFactory(document=child)
|
||||
factories.ThreadFactory.create_batch(5, document=root)
|
||||
|
||||
assert models.Invitation.objects.filter(document=root).exists()
|
||||
assert models.Thread.objects.filter(document=root).exists()
|
||||
assert models.DocumentAccess.objects.filter(document=root).exists()
|
||||
|
||||
with mock.patch(
|
||||
"core.management.commands.clean_document.default_storage"
|
||||
) as mock_storage:
|
||||
call_command("clean_document", str(root.id), "--force")
|
||||
|
||||
# Root document should still exist with title kept and other fields reset
|
||||
root.refresh_from_db()
|
||||
assert root.title == "Root"
|
||||
assert root.excerpt is None
|
||||
assert root.link_reach == LinkReachChoices.RESTRICTED
|
||||
assert root.link_role == LinkRoleChoices.READER
|
||||
assert root.attachments == []
|
||||
|
||||
# Accesses and invitations on root should be deleted. Only owner should be kept
|
||||
keeping_accesses = list(models.DocumentAccess.objects.filter(document=root))
|
||||
assert len(keeping_accesses) == 1
|
||||
assert keeping_accesses[0].role == models.RoleChoices.OWNER
|
||||
assert not models.Invitation.objects.filter(document=root).exists()
|
||||
assert not models.Thread.objects.filter(document=root).exists()
|
||||
|
||||
# Descendants should be deleted entirely
|
||||
assert not models.Document.objects.filter(id__in=[child.id, grandchild.id]).exists()
|
||||
|
||||
# Root should have no descendants
|
||||
root.refresh_from_db()
|
||||
assert root.get_descendants().count() == 0
|
||||
|
||||
# S3 delete should have been called for document files + attachments
|
||||
delete_calls = mock_storage.connection.meta.client.delete_object.call_args_list
|
||||
assert len(delete_calls) == 3
|
||||
|
||||
|
||||
def test_clean_document_invalid_uuid(settings):
|
||||
"""The command should raise an error for a non-existent document."""
|
||||
settings.DEBUG = True
|
||||
|
||||
fake_id = str(uuid4())
|
||||
with pytest.raises(CommandError, match=f"Document {fake_id} does not exist."):
|
||||
call_command("clean_document", fake_id, "--force")
|
||||
|
||||
|
||||
def test_clean_document_no_force_in_production(settings):
|
||||
"""The command should require --force when DEBUG is False."""
|
||||
settings.DEBUG = False
|
||||
|
||||
doc = factories.DocumentFactory()
|
||||
with pytest.raises(CommandError, match="not meant to be used in production"):
|
||||
call_command("clean_document", str(doc.id))
|
||||
|
||||
|
||||
def test_clean_document_single_document(settings):
|
||||
"""The command should work on a single document without children."""
|
||||
settings.DEBUG = True
|
||||
|
||||
doc = factories.DocumentFactory(
|
||||
title="Single",
|
||||
link_reach=LinkReachChoices.PUBLIC,
|
||||
link_role=LinkRoleChoices.EDITOR,
|
||||
)
|
||||
factories.UserDocumentAccessFactory.create_batch(
|
||||
5,
|
||||
document=doc,
|
||||
role=random.choice(
|
||||
[
|
||||
role
|
||||
for role in choices.RoleChoices
|
||||
if role not in choices.PRIVILEGED_ROLES
|
||||
],
|
||||
),
|
||||
)
|
||||
# One owner role
|
||||
factories.UserDocumentAccessFactory(document=doc, role=choices.RoleChoices.OWNER)
|
||||
factories.ThreadFactory.create_batch(5, document=doc)
|
||||
factories.InvitationFactory(document=doc)
|
||||
|
||||
with mock.patch(
|
||||
"core.management.commands.clean_document.default_storage"
|
||||
) as mock_storage:
|
||||
call_command("clean_document", str(doc.id), "--force")
|
||||
|
||||
# Accesses and invitations on root should be deleted. Only owner should be kept
|
||||
keeping_accesses = list(models.DocumentAccess.objects.filter(document=doc))
|
||||
assert len(keeping_accesses) == 1
|
||||
assert keeping_accesses[0].role == models.RoleChoices.OWNER
|
||||
assert not models.Invitation.objects.filter(document=doc).exists()
|
||||
assert not models.Thread.objects.filter(document=doc).exists()
|
||||
|
||||
doc.refresh_from_db()
|
||||
assert doc.title == "Single"
|
||||
assert doc.excerpt is None
|
||||
assert doc.link_reach == LinkReachChoices.RESTRICTED
|
||||
assert doc.link_role == LinkRoleChoices.READER
|
||||
assert doc.attachments == []
|
||||
|
||||
mock_storage.connection.meta.client.delete_object.assert_called_once()
|
||||
|
||||
|
||||
def test_clean_document_with_title_option(settings):
|
||||
"""The --title option should update the document title."""
|
||||
settings.DEBUG = True
|
||||
|
||||
doc = factories.DocumentFactory(
|
||||
title="Old Title",
|
||||
link_reach=LinkReachChoices.PUBLIC,
|
||||
link_role=LinkRoleChoices.EDITOR,
|
||||
)
|
||||
|
||||
with mock.patch("core.management.commands.clean_document.default_storage"):
|
||||
call_command("clean_document", str(doc.id), "--force", "--title", "New Title")
|
||||
|
||||
doc.refresh_from_db()
|
||||
assert doc.title == "New Title"
|
||||
assert doc.excerpt is None
|
||||
assert doc.link_reach == LinkReachChoices.RESTRICTED
|
||||
assert doc.link_role == LinkRoleChoices.READER
|
||||
assert doc.attachments == []
|
||||
|
||||
|
||||
def test_clean_document_deletes_attachments_from_s3(settings):
|
||||
"""The command should delete attachment files from S3."""
|
||||
settings.DEBUG = True
|
||||
|
||||
root = factories.DocumentFactory(
|
||||
attachments=["root-id/attachments/file1.png", "root-id/attachments/file2.pdf"],
|
||||
)
|
||||
child = factories.DocumentFactory(
|
||||
parent=root,
|
||||
attachments=["child-id/attachments/file3.png"],
|
||||
)
|
||||
|
||||
with mock.patch(
|
||||
"core.management.commands.clean_document.default_storage"
|
||||
) as mock_storage:
|
||||
call_command("clean_document", str(root.id), "--force")
|
||||
|
||||
delete_calls = mock_storage.connection.meta.client.delete_object.call_args_list
|
||||
deleted_keys = [call.kwargs["Key"] for call in delete_calls]
|
||||
|
||||
# Document files (root + child)
|
||||
assert root.file_key in deleted_keys
|
||||
assert child.file_key in deleted_keys
|
||||
|
||||
# Attachment files
|
||||
assert "root-id/attachments/file1.png" in deleted_keys
|
||||
assert "root-id/attachments/file2.pdf" in deleted_keys
|
||||
assert "child-id/attachments/file3.png" in deleted_keys
|
||||
|
||||
assert len(delete_calls) == 5
|
||||
|
||||
|
||||
def test_clean_document_s3_errors_do_not_stop_command(settings):
|
||||
"""S3 deletion errors should be logged but not stop the command."""
|
||||
settings.DEBUG = True
|
||||
|
||||
doc = factories.DocumentFactory(
|
||||
attachments=["doc-id/attachments/file1.png"],
|
||||
)
|
||||
|
||||
with mock.patch(
|
||||
"core.management.commands.clean_document.default_storage"
|
||||
) as mock_storage:
|
||||
mock_storage.connection.meta.client.delete_object.side_effect = ClientError(
|
||||
{"Error": {"Code": "500", "Message": "Internal Error"}},
|
||||
"DeleteObject",
|
||||
)
|
||||
# Command should complete without raising
|
||||
call_command("clean_document", str(doc.id), "--force")
|
||||
|
||||
|
||||
def test_clean_document_with_options(settings):
|
||||
"""Run the command using optional argument link_reach and link_role."""
|
||||
|
||||
settings.DEBUG = True
|
||||
|
||||
# Create a root document with subdocuments
|
||||
root = factories.DocumentFactory(
|
||||
title="Root",
|
||||
link_reach=LinkReachChoices.PUBLIC,
|
||||
link_role=LinkRoleChoices.READER,
|
||||
)
|
||||
child = factories.DocumentFactory(
|
||||
parent=root,
|
||||
title="Child",
|
||||
link_reach=LinkReachChoices.AUTHENTICATED,
|
||||
link_role=LinkRoleChoices.EDITOR,
|
||||
)
|
||||
grandchild = factories.DocumentFactory(
|
||||
parent=child,
|
||||
title="Grandchild",
|
||||
)
|
||||
|
||||
# Create accesses and invitations
|
||||
factories.UserDocumentAccessFactory.create_batch(
|
||||
5,
|
||||
document=root,
|
||||
role=random.choice(
|
||||
[
|
||||
role
|
||||
for role in choices.RoleChoices
|
||||
if role not in choices.PRIVILEGED_ROLES
|
||||
],
|
||||
),
|
||||
)
|
||||
# One owner role
|
||||
factories.UserDocumentAccessFactory(document=root, role=choices.RoleChoices.OWNER)
|
||||
factories.UserDocumentAccessFactory(document=child)
|
||||
factories.InvitationFactory(document=root)
|
||||
factories.InvitationFactory(document=child)
|
||||
factories.ThreadFactory.create_batch(5, document=root)
|
||||
|
||||
assert models.Invitation.objects.filter(document=root).exists()
|
||||
assert models.Thread.objects.filter(document=root).exists()
|
||||
assert models.DocumentAccess.objects.filter(document=root).exists()
|
||||
|
||||
with mock.patch(
|
||||
"core.management.commands.clean_document.default_storage"
|
||||
) as mock_storage:
|
||||
call_command(
|
||||
"clean_document",
|
||||
str(root.id),
|
||||
"--force",
|
||||
"--link_reach",
|
||||
"public",
|
||||
"--link_role",
|
||||
"editor",
|
||||
)
|
||||
|
||||
# Root document should still exist with title kept and other fields reset
|
||||
root.refresh_from_db()
|
||||
assert root.title == "Root"
|
||||
assert root.excerpt is None
|
||||
assert root.link_reach == LinkReachChoices.PUBLIC
|
||||
assert root.link_role == LinkRoleChoices.EDITOR
|
||||
assert root.attachments == []
|
||||
|
||||
# Accesses and invitations on root should be deleted. Only owner should be kept
|
||||
keeping_accesses = list(models.DocumentAccess.objects.filter(document=root))
|
||||
assert len(keeping_accesses) == 1
|
||||
assert keeping_accesses[0].role == models.RoleChoices.OWNER
|
||||
assert not models.Invitation.objects.filter(document=root).exists()
|
||||
assert not models.Thread.objects.filter(document=root).exists()
|
||||
|
||||
# Descendants should be deleted entirely
|
||||
assert not models.Document.objects.filter(id__in=[child.id, grandchild.id]).exists()
|
||||
|
||||
# Root should have no descendants
|
||||
root.refresh_from_db()
|
||||
assert root.get_descendants().count() == 0
|
||||
|
||||
# S3 delete should have been called for document files + attachments
|
||||
delete_calls = mock_storage.connection.meta.client.delete_object.call_args_list
|
||||
assert len(delete_calls) == 3
|
||||
@@ -596,38 +596,6 @@ def test_api_document_invitations_create_cannot_invite_existing_users():
|
||||
}
|
||||
|
||||
|
||||
def test_api_item_invitations_create_cannot_invite_existing_users_case_insensitive():
|
||||
"""
|
||||
It should not be possible to invite already existing users, even with different email case.
|
||||
"""
|
||||
user = factories.UserFactory()
|
||||
document = factories.DocumentFactory(users=[(user, "owner")])
|
||||
existing_user = factories.UserFactory()
|
||||
|
||||
# Build an invitation to the email of an existing identity with different case
|
||||
invitation_values = {
|
||||
"email": existing_user.email.upper(),
|
||||
"role": random.choice(models.RoleChoices.values),
|
||||
}
|
||||
|
||||
client = APIClient()
|
||||
client.force_login(user)
|
||||
|
||||
client = APIClient()
|
||||
client.force_login(user)
|
||||
|
||||
response = client.post(
|
||||
f"/api/v1.0/documents/{document.id!s}/invitations/",
|
||||
invitation_values,
|
||||
format="json",
|
||||
)
|
||||
|
||||
assert response.status_code == 400
|
||||
assert response.json() == {
|
||||
"email": ["This email is already associated to a registered user."]
|
||||
}
|
||||
|
||||
|
||||
def test_api_document_invitations_create_lower_email():
|
||||
"""
|
||||
No matter the case, the email should be converted to lowercase.
|
||||
|
||||
@@ -1021,10 +1021,7 @@ def test_models_documents__email_invitation__success():
|
||||
f"Test Sender (sender@example.com) invited you with the role "editor" "
|
||||
f"on the following document: {document.title}" in email_content
|
||||
)
|
||||
assert (
|
||||
f"docs/{document.id}/?utm_source=docssharelink&utm_campaign={document.id}"
|
||||
in email_content
|
||||
)
|
||||
assert f"docs/{document.id}/" in email_content
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -1054,18 +1051,10 @@ def test_models_documents__email_invitation__url_app_param(email_url_app):
|
||||
|
||||
# Determine expected domain
|
||||
if email_url_app:
|
||||
expected_url = (
|
||||
f"https://test-example.com/docs/{document.id}/"
|
||||
f"?utm_source=docssharelink&utm_campaign={document.id}"
|
||||
)
|
||||
assert expected_url in email_content
|
||||
assert f"https://test-example.com/docs/{document.id}/" in email_content
|
||||
else:
|
||||
# Default Site domain is example.com
|
||||
expected_url = (
|
||||
f"example.com/docs/{document.id}/"
|
||||
f"?utm_source=docssharelink&utm_campaign={document.id}"
|
||||
)
|
||||
assert expected_url in email_content
|
||||
assert f"example.com/docs/{document.id}/" in email_content
|
||||
|
||||
|
||||
def test_models_documents__email_invitation__success_empty_title():
|
||||
@@ -1096,10 +1085,7 @@ def test_models_documents__email_invitation__success_empty_title():
|
||||
"Test Sender (sender@example.com) invited you with the role "editor" "
|
||||
"on the following document: Untitled Document" in email_content
|
||||
)
|
||||
assert (
|
||||
f"docs/{document.id}/?utm_source=docssharelink&utm_campaign={document.id}"
|
||||
in email_content
|
||||
)
|
||||
assert f"docs/{document.id}/" in email_content
|
||||
|
||||
|
||||
def test_models_documents__email_invitation__success_fr():
|
||||
@@ -1134,10 +1120,7 @@ def test_models_documents__email_invitation__success_fr():
|
||||
f"Test Sender2 (sender2@example.com) vous a invité avec le rôle "propriétaire" "
|
||||
f"sur le document suivant : {document.title}" in email_content
|
||||
)
|
||||
assert (
|
||||
f"docs/{document.id}/?utm_source=docssharelink&utm_campaign={document.id}"
|
||||
in email_content
|
||||
)
|
||||
assert f"docs/{document.id}/" in email_content
|
||||
|
||||
|
||||
@mock.patch(
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"default": {
|
||||
"logo": {
|
||||
"src": "/assets/icon-docs.svg",
|
||||
"width": "54px",
|
||||
"alt": "Docs Logo",
|
||||
"style": { "width": "54px", "height": "auto" },
|
||||
"withTitle": true
|
||||
},
|
||||
"externalLinks": [
|
||||
@@ -125,38 +125,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"with-proconnect": false,
|
||||
"icon-banner": {
|
||||
"src": "/assets/icon-docs.svg",
|
||||
"style": {
|
||||
"width": "64px",
|
||||
"height": "auto"
|
||||
},
|
||||
"alt": ""
|
||||
}
|
||||
},
|
||||
"header": {
|
||||
"logo": {},
|
||||
"icon": {
|
||||
"src": "/assets/icon-docs.svg",
|
||||
"style": {
|
||||
"width": "32px",
|
||||
"height": "auto"
|
||||
},
|
||||
"alt": "",
|
||||
"withTitle": true
|
||||
}
|
||||
},
|
||||
"favicon": {
|
||||
"light": {
|
||||
"href": "/assets/favicon-light.png",
|
||||
"type": "image/png"
|
||||
},
|
||||
"dark": {
|
||||
"href": "/assets/favicon-dark.png",
|
||||
"type": "image/png"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,10 +192,10 @@ endobj
|
||||
(react-pdf)
|
||||
endobj
|
||||
55 0 obj
|
||||
(D:20260210135720Z)
|
||||
(D:20260128100716Z)
|
||||
endobj
|
||||
56 0 obj
|
||||
(chromium-4728-0-doc-export-override-content)
|
||||
(chromium-8039-0-doc-export-override-content)
|
||||
endobj
|
||||
52 0 obj
|
||||
<<
|
||||
@@ -216,7 +216,7 @@ endobj
|
||||
58 0 obj
|
||||
<<
|
||||
/Type /FontDescriptor
|
||||
/FontName /XWNEXS+Inter18pt-Regular
|
||||
/FontName /FDAZSC+Inter18pt-Regular
|
||||
/Flags 4
|
||||
/FontBBox [-742.1875 -323.242187 2579.589844 1109.375]
|
||||
/ItalicAngle 0
|
||||
@@ -232,7 +232,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /CIDFontType2
|
||||
/BaseFont /XWNEXS+Inter18pt-Regular
|
||||
/BaseFont /FDAZSC+Inter18pt-Regular
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (Identity)
|
||||
@@ -247,7 +247,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /Type0
|
||||
/BaseFont /XWNEXS+Inter18pt-Regular
|
||||
/BaseFont /FDAZSC+Inter18pt-Regular
|
||||
/Encoding /Identity-H
|
||||
/DescendantFonts [59 0 R]
|
||||
/ToUnicode 60 0 R
|
||||
@@ -256,7 +256,7 @@ endobj
|
||||
62 0 obj
|
||||
<<
|
||||
/Type /FontDescriptor
|
||||
/FontName /QGXPNV+Inter18pt-Bold
|
||||
/FontName /UEJHFC+Inter18pt-Bold
|
||||
/Flags 4
|
||||
/FontBBox [-790.527344 -334.472656 2580.566406 1114.746094]
|
||||
/ItalicAngle 0
|
||||
@@ -272,7 +272,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /CIDFontType2
|
||||
/BaseFont /QGXPNV+Inter18pt-Bold
|
||||
/BaseFont /UEJHFC+Inter18pt-Bold
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (Identity)
|
||||
@@ -287,7 +287,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /Type0
|
||||
/BaseFont /QGXPNV+Inter18pt-Bold
|
||||
/BaseFont /UEJHFC+Inter18pt-Bold
|
||||
/Encoding /Identity-H
|
||||
/DescendantFonts [63 0 R]
|
||||
/ToUnicode 64 0 R
|
||||
@@ -296,7 +296,7 @@ endobj
|
||||
66 0 obj
|
||||
<<
|
||||
/Type /FontDescriptor
|
||||
/FontName /SLYFFZ+Inter18pt-Italic
|
||||
/FontName /EUMTON+Inter18pt-Italic
|
||||
/Flags 68
|
||||
/FontBBox [-747.558594 -323.242187 2595.703125 1109.375]
|
||||
/ItalicAngle -9.398804
|
||||
@@ -312,7 +312,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /CIDFontType2
|
||||
/BaseFont /SLYFFZ+Inter18pt-Italic
|
||||
/BaseFont /EUMTON+Inter18pt-Italic
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (Identity)
|
||||
@@ -327,7 +327,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /Type0
|
||||
/BaseFont /SLYFFZ+Inter18pt-Italic
|
||||
/BaseFont /EUMTON+Inter18pt-Italic
|
||||
/Encoding /Identity-H
|
||||
/DescendantFonts [67 0 R]
|
||||
/ToUnicode 68 0 R
|
||||
@@ -336,7 +336,7 @@ endobj
|
||||
70 0 obj
|
||||
<<
|
||||
/Type /FontDescriptor
|
||||
/FontName /GPERZO+GeistMono-Regular
|
||||
/FontName /HIJACG+GeistMono-Regular
|
||||
/Flags 5
|
||||
/FontBBox [-1738 -247 654 1012]
|
||||
/ItalicAngle 0
|
||||
@@ -352,7 +352,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /CIDFontType2
|
||||
/BaseFont /GPERZO+GeistMono-Regular
|
||||
/BaseFont /HIJACG+GeistMono-Regular
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (Identity)
|
||||
@@ -367,7 +367,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /Type0
|
||||
/BaseFont /GPERZO+GeistMono-Regular
|
||||
/BaseFont /HIJACG+GeistMono-Regular
|
||||
/Encoding /Identity-H
|
||||
/DescendantFonts [71 0 R]
|
||||
/ToUnicode 72 0 R
|
||||
@@ -376,7 +376,7 @@ endobj
|
||||
74 0 obj
|
||||
<<
|
||||
/Type /FontDescriptor
|
||||
/FontName /CNJFYA+Inter18pt-BoldItalic
|
||||
/FontName /IKVFNP+Inter18pt-BoldItalic
|
||||
/Flags 68
|
||||
/FontBBox [-795.898437 -334.472656 2596.191406 1114.746094]
|
||||
/ItalicAngle -9.398804
|
||||
@@ -392,7 +392,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /CIDFontType2
|
||||
/BaseFont /CNJFYA+Inter18pt-BoldItalic
|
||||
/BaseFont /IKVFNP+Inter18pt-BoldItalic
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (Identity)
|
||||
@@ -407,7 +407,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /Type0
|
||||
/BaseFont /CNJFYA+Inter18pt-BoldItalic
|
||||
/BaseFont /IKVFNP+Inter18pt-BoldItalic
|
||||
/Encoding /Identity-H
|
||||
/DescendantFonts [75 0 R]
|
||||
/ToUnicode 76 0 R
|
||||
@@ -1403,7 +1403,7 @@ trailer
|
||||
/Size 87
|
||||
/Root 3 0 R
|
||||
/Info 52 0 R
|
||||
/ID [<4d0627755c809232c991979db9766911> <4d0627755c809232c991979db9766911>]
|
||||
/ID [<2f4ec8da7e87471807031f721b6c9ac2> <2f4ec8da7e87471807031f721b6c9ac2>]
|
||||
>>
|
||||
startxref
|
||||
101726
|
||||
|
||||
@@ -140,6 +140,26 @@ test.describe('Config', () => {
|
||||
).toBeAttached();
|
||||
});
|
||||
|
||||
test('it checks theme_customization.translations config', async ({
|
||||
page,
|
||||
}) => {
|
||||
await overrideConfig(page, {
|
||||
theme_customization: {
|
||||
translations: {
|
||||
en: {
|
||||
translation: {
|
||||
Docs: 'MyCustomDocs',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page.getByText('MyCustomDocs')).toBeAttached();
|
||||
});
|
||||
|
||||
test('it checks the config api is called', async ({ page }) => {
|
||||
const responsePromise = page.waitForResponse(
|
||||
(response) =>
|
||||
@@ -152,7 +172,11 @@ test.describe('Config', () => {
|
||||
expect(response.ok()).toBeTruthy();
|
||||
|
||||
const json = (await response.json()) as typeof CONFIG;
|
||||
expect(json).toStrictEqual(CONFIG);
|
||||
const { theme_customization, ...configApi } = json;
|
||||
expect(theme_customization).toBeDefined();
|
||||
const { theme_customization: _, ...CONFIG_LEFT } = CONFIG;
|
||||
|
||||
expect(configApi).toStrictEqual(CONFIG_LEFT);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -162,24 +186,14 @@ test.describe('Config: Not logged', () => {
|
||||
test('it checks that theme is configured from config endpoint', async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto('/');
|
||||
|
||||
await expect(
|
||||
page.getByText('Collaborative writing, Simplified.'),
|
||||
).toHaveCSS('font-family', /Roboto/i, {
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
await overrideConfig(page, {
|
||||
FRONTEND_THEME: 'dsfr',
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
|
||||
await expect(
|
||||
page.getByText('Collaborative writing, Simplified.'),
|
||||
).toHaveCSS('font-family', /Marianne/i, {
|
||||
timeout: 10000,
|
||||
});
|
||||
const header = page.locator('header').first();
|
||||
// alt 'Gouvernement Logo' comes from the theme
|
||||
await expect(header.getByAltText('Gouvernement Logo')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@ test.describe('Doc Comments', () => {
|
||||
// We add a comment with the first user
|
||||
const editor = await writeInEditor({ page, text: 'Hello World' });
|
||||
await editor.getByText('Hello').selectText();
|
||||
await page.getByRole('button', { name: 'Comment', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Comment' }).click();
|
||||
|
||||
const thread = page.locator('.bn-thread');
|
||||
await thread.getByRole('paragraph').first().fill('This is a comment');
|
||||
@@ -124,7 +124,7 @@ test.describe('Doc Comments', () => {
|
||||
// Checks add react reaction
|
||||
const editor = await writeInEditor({ page, text: 'Hello' });
|
||||
await editor.getByText('Hello').selectText();
|
||||
await page.getByRole('button', { name: 'Comment', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Comment' }).click();
|
||||
|
||||
const thread = page.locator('.bn-thread');
|
||||
await thread.getByRole('paragraph').first().fill('This is a comment');
|
||||
@@ -191,7 +191,7 @@ test.describe('Doc Comments', () => {
|
||||
|
||||
/* Delete the last comment remove the thread */
|
||||
await editor.getByText('Hello').selectText();
|
||||
await page.getByRole('button', { name: 'Comment', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Comment' }).click();
|
||||
|
||||
await thread.getByRole('paragraph').first().fill('This is a new comment');
|
||||
await thread.locator('[data-test="save"]').click();
|
||||
@@ -249,9 +249,7 @@ test.describe('Doc Comments', () => {
|
||||
editor.getByText('Hello, I can edit the document'),
|
||||
).toBeVisible();
|
||||
await otherEditor.getByText('Hello').selectText();
|
||||
await otherPage
|
||||
.getByRole('button', { name: 'Comment', exact: true })
|
||||
.click();
|
||||
await otherPage.getByRole('button', { name: 'Comment' }).click();
|
||||
const otherThread = otherPage.locator('.bn-thread');
|
||||
await otherThread
|
||||
.getByRole('paragraph')
|
||||
@@ -282,7 +280,7 @@ test.describe('Doc Comments', () => {
|
||||
await expect(otherThread).toBeHidden();
|
||||
await otherEditor.getByText('Hello').selectText();
|
||||
await expect(
|
||||
otherPage.getByRole('button', { name: 'Comment', exact: true }),
|
||||
otherPage.getByRole('button', { name: 'Comment' }),
|
||||
).toBeHidden();
|
||||
|
||||
await otherPage.reload();
|
||||
@@ -336,7 +334,7 @@ test.describe('Doc Comments', () => {
|
||||
// We add a comment in the first document
|
||||
const editor1 = await writeInEditor({ page, text: 'Document One' });
|
||||
await editor1.getByText('Document One').selectText();
|
||||
await page.getByRole('button', { name: 'Comment', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Comment' }).click();
|
||||
|
||||
const thread1 = page.locator('.bn-thread');
|
||||
await thread1.getByRole('paragraph').first().fill('Comment in Doc One');
|
||||
@@ -390,7 +388,7 @@ test.describe('Doc Comments mobile', () => {
|
||||
// Checks add react reaction
|
||||
const editor = await writeInEditor({ page, text: 'Hello' });
|
||||
await editor.getByText('Hello').selectText();
|
||||
await page.getByRole('button', { name: 'Comment', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Comment' }).click();
|
||||
|
||||
const thread = page.locator('.bn-thread');
|
||||
await thread.getByRole('paragraph').first().fill('This is a comment');
|
||||
|
||||
@@ -410,7 +410,7 @@ test.describe('Doc Editor', () => {
|
||||
const editor = page.locator('.ProseMirror');
|
||||
await editor.getByText('Hello').selectText();
|
||||
|
||||
await page.getByRole('button', { name: 'AI', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'AI' }).click();
|
||||
|
||||
await expect(
|
||||
page.getByRole('menuitem', { name: 'Use as prompt' }),
|
||||
@@ -494,13 +494,11 @@ test.describe('Doc Editor', () => {
|
||||
await editor.getByText('Hello').selectText();
|
||||
|
||||
if (!ai_transform && !ai_translate) {
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'AI', exact: true }),
|
||||
).toBeHidden();
|
||||
await expect(page.getByRole('button', { name: 'AI' })).toBeHidden();
|
||||
return;
|
||||
}
|
||||
|
||||
await page.getByRole('button', { name: 'AI', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'AI' }).click();
|
||||
|
||||
if (ai_transform) {
|
||||
await expect(
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
mockedDocument,
|
||||
verifyDocName,
|
||||
} from './utils-common';
|
||||
import { writeInEditor } from './utils-editor';
|
||||
import {
|
||||
connectOtherUserToDoc,
|
||||
mockedAccesses,
|
||||
@@ -21,43 +20,6 @@ test.beforeEach(async ({ page }) => {
|
||||
});
|
||||
|
||||
test.describe('Doc Header', () => {
|
||||
test('toggles panel collapse from floating bar button', async ({
|
||||
page,
|
||||
browserName,
|
||||
}) => {
|
||||
const [docTitle] = await createDoc(
|
||||
page,
|
||||
'doc-floating-bar',
|
||||
browserName,
|
||||
1,
|
||||
);
|
||||
|
||||
const collapseButton = page.getByTestId('floating-bar-toggle-left-panel');
|
||||
await expect(collapseButton).toBeVisible();
|
||||
|
||||
// Panel open
|
||||
await expect(collapseButton).toHaveAttribute('aria-expanded', 'true');
|
||||
await expect(collapseButton.getByText(docTitle)).toBeHidden();
|
||||
|
||||
// Collapse panel
|
||||
await collapseButton.click();
|
||||
await expect(collapseButton).toHaveAttribute('aria-expanded', 'false');
|
||||
await expect(collapseButton.getByText(docTitle)).toBeHidden();
|
||||
|
||||
// When the title is not visible in the viewport, the button should show the title
|
||||
const editor = await writeInEditor({ page, text: 'Lorem ipsum' });
|
||||
for (let i = 0; i < 25; i++) {
|
||||
await editor.press('Enter');
|
||||
}
|
||||
await writeInEditor({ page, text: 'Lorem ipsum 2' });
|
||||
await expect(collapseButton.getByText(docTitle)).toBeVisible();
|
||||
|
||||
// Expand panel and check the title is hidden again
|
||||
await collapseButton.click();
|
||||
await expect(collapseButton).toHaveAttribute('aria-expanded', 'true');
|
||||
await expect(collapseButton.getByText(docTitle)).toBeHidden();
|
||||
});
|
||||
|
||||
test('it checks the element are correctly displayed', async ({
|
||||
page,
|
||||
browserName,
|
||||
|
||||
@@ -56,13 +56,14 @@ test.describe('Footer', () => {
|
||||
|
||||
test('checks the footer is correctly overrided', async ({ page }) => {
|
||||
await overrideConfig(page, {
|
||||
FRONTEND_THEME: 'dsfr',
|
||||
theme_customization: {
|
||||
footer: {
|
||||
default: {
|
||||
logo: {
|
||||
src: '/assets/logo-gouv.svg',
|
||||
width: '220px',
|
||||
alt: 'Gouvernement Logo',
|
||||
style: { width: '220px', height: 'auto' },
|
||||
},
|
||||
externalLinks: [
|
||||
{
|
||||
|
||||
@@ -34,15 +34,10 @@ test.describe('Header', () => {
|
||||
FRONTEND_THEME: 'dsfr',
|
||||
theme_customization: {
|
||||
header: {
|
||||
icon: {
|
||||
src: '/assets/icon-docs-v2.svg',
|
||||
style: {
|
||||
width: '100px',
|
||||
height: 'auto',
|
||||
},
|
||||
alt: '',
|
||||
withTitle: false,
|
||||
'data-testid': 'custom-testid-docs',
|
||||
logo: {
|
||||
src: '/assets/logo-gouv.svg',
|
||||
width: '220px',
|
||||
alt: 'Gouvernement Logo',
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -51,11 +46,19 @@ test.describe('Header', () => {
|
||||
|
||||
const header = page.locator('header').first();
|
||||
|
||||
await expect(header.getByTestId('custom-testid-docs')).toHaveAttribute(
|
||||
'src',
|
||||
'/assets/icon-docs-v2.svg',
|
||||
await expect(header.getByTestId('header-icon-docs')).toBeVisible();
|
||||
await expect(header.locator('h1').getByText('Docs')).toHaveCSS(
|
||||
'font-family',
|
||||
/Marianne/i,
|
||||
);
|
||||
await expect(header.locator('h1')).toBeHidden();
|
||||
|
||||
await expect(
|
||||
header.getByRole('button', {
|
||||
name: 'Logout',
|
||||
}),
|
||||
).toBeVisible();
|
||||
|
||||
await expect(header.getByText('English')).toBeVisible();
|
||||
});
|
||||
|
||||
test('checks a custom waffle', async ({ page }) => {
|
||||
@@ -143,6 +146,32 @@ test.describe('Header', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Header mobile', () => {
|
||||
test.use({ viewport: { width: 500, height: 1200 } });
|
||||
|
||||
test('it checks the header when mobile with DSFR theme', async ({ page }) => {
|
||||
await overrideConfig(page, {
|
||||
FRONTEND_THEME: 'dsfr',
|
||||
theme_customization: {
|
||||
header: {
|
||||
logo: {
|
||||
src: '/assets/logo-gouv.svg',
|
||||
width: '220px',
|
||||
alt: 'Gouvernement Logo',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
|
||||
const header = page.locator('header').first();
|
||||
|
||||
await expect(header.getByLabel('Open the header menu')).toBeVisible();
|
||||
await expect(header.getByTestId('header-icon-docs')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Header: Log out', () => {
|
||||
test.use({ storageState: { cookies: [], origins: [] } });
|
||||
|
||||
|
||||
@@ -91,44 +91,21 @@ test.describe('Home page', () => {
|
||||
],
|
||||
},
|
||||
},
|
||||
header: {
|
||||
logo: {
|
||||
src: '/assets/logo-gouv.svg',
|
||||
alt: 'Gouvernement Logo',
|
||||
style: { width: '110px', height: 'auto' },
|
||||
},
|
||||
icon: {
|
||||
src: '/assets/icon-docs-v2.svg',
|
||||
style: {
|
||||
width: '100px',
|
||||
height: 'auto',
|
||||
},
|
||||
alt: '',
|
||||
withTitle: false,
|
||||
},
|
||||
},
|
||||
home: {
|
||||
'with-proconnect': true,
|
||||
'icon-banner': {
|
||||
src: '/assets/icon-docs.svg',
|
||||
style: {
|
||||
width: '64px',
|
||||
height: 'auto',
|
||||
},
|
||||
alt: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await page.goto('/docs/');
|
||||
|
||||
// Wait for the page to be fully loaded and responsive store to be initialized
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
|
||||
// Wait a bit more for the responsive store to be initialized
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Check header content
|
||||
const header = page.locator('header').first();
|
||||
const footer = page.locator('footer').first();
|
||||
await expect(header).toBeVisible({
|
||||
timeout: 10000,
|
||||
});
|
||||
await expect(header).toBeVisible();
|
||||
|
||||
// Check for language picker - it should be visible on desktop
|
||||
// Use a more flexible selector that works with both Header and HomeHeader
|
||||
@@ -141,6 +118,7 @@ test.describe('Home page', () => {
|
||||
header.getByRole('img', { name: 'Gouvernement Logo' }),
|
||||
).toBeVisible();
|
||||
await expect(header.getByTestId('header-icon-docs')).toBeVisible();
|
||||
await expect(header.getByRole('heading', { name: 'Docs' })).toBeVisible();
|
||||
|
||||
// Check the titles
|
||||
const h2 = page.locator('h2');
|
||||
|
||||
@@ -13,32 +13,6 @@ test.describe('Language', () => {
|
||||
await page.goto('/');
|
||||
});
|
||||
|
||||
test('it checks theme_customization.translations config', async ({
|
||||
page,
|
||||
}) => {
|
||||
await overrideConfig(page, {
|
||||
theme_customization: {
|
||||
translations: {
|
||||
en: {
|
||||
translation: {
|
||||
Docs: 'MyCustomDocs',
|
||||
},
|
||||
},
|
||||
},
|
||||
header: {
|
||||
logo: {},
|
||||
icon: {
|
||||
withTitle: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page.getByText('MyCustomDocs')).toBeAttached();
|
||||
});
|
||||
|
||||
test('checks language switching', async ({ page }) => {
|
||||
const header = page.locator('header').first();
|
||||
const languagePicker = header.locator('.--docs--language-picker-text');
|
||||
|
||||
@@ -3,8 +3,6 @@ import path from 'path';
|
||||
|
||||
import { Locator, Page, TestInfo, expect } from '@playwright/test';
|
||||
|
||||
import theme_customization from '../../../../../backend/impress/configuration/theme/default.json';
|
||||
|
||||
export type BrowserName = 'chromium' | 'firefox' | 'webkit';
|
||||
export const BROWSERS: BrowserName[] = ['chromium', 'webkit', 'firefox'];
|
||||
|
||||
@@ -34,7 +32,7 @@ export const CONFIG = {
|
||||
POSTHOG_KEY: {},
|
||||
SENTRY_DSN: null,
|
||||
TRASHBIN_CUTOFF_DAYS: 30,
|
||||
theme_customization,
|
||||
theme_customization: {},
|
||||
} as const;
|
||||
|
||||
export const overrideConfig = async (
|
||||
|
||||
@@ -19,6 +19,24 @@ const themeWhiteLabelLight = getUIKitThemesFromGlobals(whiteLabelGlobals, {
|
||||
'2xs': '0.375rem',
|
||||
},
|
||||
},
|
||||
components: {
|
||||
logo: {
|
||||
src: '',
|
||||
alt: '',
|
||||
widthHeader: '',
|
||||
widthFooter: '',
|
||||
},
|
||||
'home-proconnect': false,
|
||||
icon: {
|
||||
src: '/assets/icon-docs.svg',
|
||||
width: '32px',
|
||||
height: 'auto',
|
||||
},
|
||||
favicon: {
|
||||
'png-light': '/assets/favicon-light.png',
|
||||
'png-dark': '/assets/favicon-dark.png',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -38,6 +56,25 @@ const themesDSFRLight = getUIKitThemesFromGlobals(dsfrGlobals, {
|
||||
},
|
||||
},
|
||||
},
|
||||
components: {
|
||||
logo: {
|
||||
src: '/assets/logo-gouv.svg',
|
||||
widthHeader: '110px',
|
||||
widthFooter: '220px',
|
||||
alt: 'Gouvernement Logo',
|
||||
},
|
||||
'home-proconnect': true,
|
||||
icon: {
|
||||
src: '/assets/icon-docs-dsfr.svg',
|
||||
width: '32px',
|
||||
height: 'auto',
|
||||
},
|
||||
favicon: {
|
||||
ico: '/assets/favicon-dsfr.ico',
|
||||
'png-light': '/assets/favicon-dsfr.png',
|
||||
'png-dark': '/assets/favicon-dark-dsfr.png',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,34 +0,0 @@
|
||||
<svg
|
||||
width="100"
|
||||
height="40"
|
||||
viewBox="0 0 100 40"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M25.6305 32.8312C26.7983 32.5038 27.9166 31.9062 28.6505 30.8503C29.3749 29.8163 29.5789 28.5047 29.5789 27.2425V8.75099C29.5789 8.42358 29.5611 8.09557 29.5216 7.77148C30.1016 7.99961 30.5486 8.37658 30.8626 8.90239C31.2331 9.50024 31.4184 10.2876 31.4184 11.2643V30.0464C31.4184 31.3684 31.0942 32.3578 30.4458 33.0146C29.7974 33.6714 28.8207 33.9998 27.5155 33.9998H20.4209C20.5889 33.9704 20.7574 33.9401 20.9262 33.909C22.4067 33.6444 23.9713 33.2854 25.6185 32.8346L25.6305 32.8312Z"
|
||||
fill="#C83F49"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M8.58203 29.655V10.8477C8.58203 9.70251 8.88938 8.83519 9.50408 8.24575C10.1272 7.65631 10.9524 7.33212 11.9797 7.27318C13.4954 7.18055 14.9311 7.05425 16.2868 6.89425C17.6425 6.72584 18.9393 6.53217 20.1771 6.31324C21.4234 6.0943 22.6359 5.85011 23.8148 5.58065C25.0274 5.29435 25.9578 5.4375 26.6062 6.0101C27.2546 6.58269 27.5788 7.49632 27.5788 8.75099V27.2425C27.5788 28.3456 27.3893 29.1666 27.0104 29.7055C26.6315 30.2529 25.9915 30.6528 25.0905 30.9054C23.4906 31.3433 21.9833 31.6886 20.5687 31.9412C19.154 32.2022 17.7731 32.4001 16.4258 32.5348C15.0785 32.6696 13.6975 32.7748 12.2829 32.8506C11.1124 32.918 10.203 32.6738 9.5546 32.118C8.90622 31.5707 8.58203 30.7497 8.58203 29.655ZM13.2087 14.2624C15.0635 14.1444 16.7632 13.9631 18.3075 13.7183C18.6822 13.6572 19.0564 13.5936 19.4291 13.5276C19.8192 13.4585 20.1013 13.1186 20.1013 12.7234C20.1013 12.2115 19.638 11.8261 19.135 11.9119C18.846 11.9612 18.5555 12.0091 18.2635 12.0556C16.7346 12.2992 15.0452 12.48 13.1952 12.5977C12.9182 12.6156 12.6978 12.7019 12.5561 12.8739C12.4221 13.0366 12.3564 13.2323 12.3564 13.4553C12.3564 13.6821 12.433 13.8795 12.5857 14.0418L12.5878 14.0439C12.7534 14.2095 12.9637 14.2811 13.2087 14.2624ZM13.208 18.456C15.0631 18.338 16.763 18.1566 18.3075 17.9119C19.8588 17.6589 21.3936 17.3638 22.9112 17.0266C23.2191 16.9581 23.4498 16.8503 23.5652 16.683C23.6786 16.5221 23.7347 16.3376 23.7347 16.1332C23.7347 15.9026 23.6469 15.704 23.476 15.5426C23.2921 15.3689 23.0348 15.3284 22.7304 15.3911L22.7285 15.3915C21.2823 15.7194 19.794 16.0053 18.2635 16.2492C16.7346 16.4928 15.0452 16.6735 13.1952 16.7913C12.9182 16.8091 12.6978 16.8954 12.5561 17.0675C12.4228 17.2294 12.3564 17.4205 12.3564 17.6363C12.3564 17.8703 12.4321 18.0723 12.5856 18.2354L12.59 18.2396C12.755 18.3949 12.9632 18.4655 13.2055 18.4562L13.208 18.456ZM13.2085 22.6494C15.0634 22.5229 16.7631 22.3374 18.3075 22.0927C19.8589 21.8482 21.3934 21.5573 22.9112 21.22C23.2199 21.1514 23.4508 21.0391 23.566 20.8627C23.6783 20.7029 23.7347 20.5233 23.7347 20.3266C23.7347 20.0961 23.6469 19.8974 23.476 19.7361C23.2921 19.5623 23.0348 19.5218 22.7304 19.5845L22.729 19.5848C21.2827 19.9043 19.7942 20.1861 18.2635 20.43C16.7345 20.6736 15.045 20.8586 13.1949 20.9847C12.918 21.0026 12.6977 21.0889 12.5561 21.2609C12.4228 21.4228 12.3564 21.6139 12.3564 21.8297C12.3564 22.0637 12.4321 22.2658 12.5856 22.4289L12.59 22.433C12.755 22.5883 12.9632 22.6589 13.2055 22.6496L13.2085 22.6494ZM18.3075 26.257C16.7632 26.5018 15.0635 26.6831 13.2087 26.8012C12.9637 26.8198 12.7534 26.7482 12.5878 26.5826L12.5857 26.5805C12.433 26.4182 12.3564 26.2208 12.3564 25.9941C12.3564 25.771 12.4221 25.5753 12.5561 25.4126C12.6978 25.2406 12.9183 25.1543 13.1953 25.1364C15.0453 25.0187 16.7346 24.838 18.2635 24.5943C18.5555 24.5478 18.846 24.4999 19.135 24.4506C19.638 24.3648 20.1013 24.7503 20.1013 25.2621C20.1013 25.6573 19.8192 25.9972 19.4291 26.0663C19.0564 26.1323 18.6822 26.1959 18.3075 26.257Z"
|
||||
fill="#2845C1"
|
||||
/>
|
||||
<path
|
||||
d="M41.2 27.95C41.0895 27.95 41 27.8605 41 27.75V12.2C41 12.0895 41.0895 12 41.2 12H47.2205C48.4813 12 49.6282 12.2127 50.6611 12.638C51.6941 13.0633 52.5827 13.6482 53.3271 14.3925C54.0866 15.1216 54.6638 15.9647 55.0588 16.9217C55.4689 17.8787 55.674 18.8965 55.674 19.975C55.674 21.0535 55.4689 22.0713 55.0588 23.0283C54.6638 23.9853 54.0866 24.836 53.3271 25.5803C52.5827 26.3094 51.6941 26.8867 50.6611 27.312C49.6282 27.7373 48.4813 27.95 47.2205 27.95H41.2ZM47.2433 14.5292H44.0026C43.8922 14.5292 43.8026 14.6188 43.8026 14.7292V25.2208C43.8026 25.3312 43.8922 25.4208 44.0026 25.4208H47.2433C48.0484 25.4208 48.7851 25.2841 49.4535 25.0106C50.1371 24.722 50.7219 24.3271 51.208 23.8258C51.7093 23.3245 52.0966 22.7473 52.3701 22.0941C52.6435 21.4409 52.7802 20.7345 52.7802 19.975C52.7802 19.2155 52.6435 18.5091 52.3701 17.8559C52.0966 17.1875 51.7093 16.6103 51.208 16.1242C50.7219 15.6229 50.1371 15.2356 49.4535 14.9621C48.7851 14.6735 48.0484 14.5292 47.2433 14.5292Z"
|
||||
fill="#2845C1"
|
||||
/>
|
||||
<path
|
||||
d="M63.3939 25.6031C63.9104 25.6031 64.3889 25.5044 64.8294 25.3069C65.2699 25.0943 65.6497 24.8132 65.9687 24.4639C66.3029 24.1145 66.5611 23.7119 66.7434 23.2562C66.9257 22.7853 67.0168 22.284 67.0168 21.7524C67.0168 21.0232 66.8573 20.37 66.5383 19.7928C66.2193 19.2155 65.7864 18.7598 65.2395 18.4256C64.6927 18.0763 64.0775 17.9016 63.3939 17.9016C62.8622 17.9016 62.3686 18.0003 61.9128 18.1978C61.4723 18.3953 61.085 18.6687 60.7508 19.0181C60.4318 19.3674 60.1811 19.7776 59.9988 20.2485C59.8166 20.7194 59.7254 21.2207 59.7254 21.7524C59.7254 22.4663 59.8849 23.1195 60.2039 23.7119C60.5229 24.2892 60.9558 24.7525 61.5027 25.1019C62.0647 25.436 62.6951 25.6031 63.3939 25.6031ZM63.3711 15.5546C64.2977 15.5546 65.1408 15.7141 65.9003 16.0331C66.675 16.3521 67.3358 16.8003 67.8827 17.3775C68.4447 17.9395 68.8701 18.6003 69.1587 19.3599C69.4625 20.1042 69.6144 20.9017 69.6144 21.7524C69.6144 22.603 69.4625 23.4081 69.1587 24.1676C68.8701 24.912 68.4447 25.5728 67.8827 26.15C67.3358 26.712 66.675 27.1526 65.9003 27.4716C65.1408 27.7906 64.2977 27.9501 63.3711 27.9501C62.4445 27.9501 61.5938 27.7906 60.8191 27.4716C60.0596 27.1526 59.3988 26.712 58.8368 26.15C58.2747 25.5728 57.8418 24.912 57.538 24.1676C57.2494 23.4081 57.1051 22.603 57.1051 21.7524C57.1051 20.9017 57.2494 20.1042 57.538 19.3599C57.8418 18.6003 58.2747 17.9395 58.8368 17.3775C59.3988 16.8003 60.0596 16.3521 60.8191 16.0331C61.5938 15.7141 62.4445 15.5546 63.3711 15.5546Z"
|
||||
fill="#2845C1"
|
||||
/>
|
||||
<path
|
||||
d="M77.2852 15.5546C78.3333 15.5546 79.2675 15.7673 80.0878 16.1926C80.8611 16.5723 81.5043 17.082 82.0173 17.7219C82.086 17.8076 82.0681 17.9322 81.9806 17.9986L80.3269 19.2531C80.2346 19.3232 80.1027 19.2999 80.0326 19.2076C79.7582 18.8466 79.4045 18.548 78.9713 18.3117C78.4852 18.0383 77.9156 17.9016 77.2624 17.9016C76.7307 17.9016 76.237 18.0003 75.7813 18.1978C75.3408 18.3953 74.961 18.6687 74.642 19.0181C74.323 19.3674 74.0724 19.7776 73.8901 20.2485C73.7078 20.7042 73.6167 21.2055 73.6167 21.7524C73.6167 22.4815 73.7762 23.1423 74.0952 23.7347C74.4142 24.3119 74.8471 24.7677 75.394 25.1019C75.9408 25.436 76.5788 25.6031 77.308 25.6031C77.9308 25.6031 78.4852 25.4664 78.9713 25.193C79.4045 24.9567 79.7582 24.6581 80.0326 24.2971C80.1027 24.2048 80.2346 24.1815 80.3269 24.2516L81.979 25.5049C82.0671 25.5717 82.0845 25.6976 82.0145 25.7831C81.5019 26.4095 80.8597 26.9191 80.0878 27.3121C79.2675 27.7374 78.3333 27.9501 77.2852 27.9501C75.994 27.9501 74.8775 27.669 73.9357 27.107C72.9939 26.5298 72.2647 25.7702 71.7483 24.8284C71.247 23.8866 70.9963 22.8613 70.9963 21.7524C70.9963 20.9169 71.1406 20.127 71.4293 19.3826C71.7179 18.6383 72.1356 17.9775 72.6825 17.4003C73.2293 16.823 73.8901 16.3749 74.6648 16.0559C75.4395 15.7217 76.313 15.5546 77.2852 15.5546Z"
|
||||
fill="#2845C1"
|
||||
/>
|
||||
<path
|
||||
d="M85.9175 18.9041C85.9175 19.2687 86.0466 19.5725 86.3049 19.8156C86.5783 20.0434 86.9277 20.2409 87.353 20.408C87.7783 20.5751 88.2265 20.7574 88.6974 20.9549C89.1835 21.1371 89.6392 21.365 90.0645 21.6384C90.4898 21.8967 90.8316 22.246 91.0899 22.6866C91.3633 23.1119 91.5 23.6512 91.5 24.3044C91.5 25.0791 91.3101 25.7399 90.9304 26.2867C90.5658 26.8184 90.0797 27.2285 89.4721 27.5171C88.8644 27.8058 88.1961 27.9501 87.4669 27.9501C86.4795 27.9501 85.6213 27.7678 84.8921 27.4032C84.2203 27.0533 83.6259 26.5938 83.1088 26.0246C83.0352 25.9436 83.0442 25.8185 83.1263 25.7462L84.5297 24.5112C84.6154 24.4358 84.7464 24.4475 84.821 24.534C85.1512 24.917 85.5168 25.2354 85.9175 25.4892C86.3732 25.7778 86.8821 25.9221 87.4441 25.9221C87.9758 25.9221 88.3784 25.7854 88.6518 25.512C88.9404 25.2234 89.0847 24.874 89.0847 24.4639C89.0847 24.0841 88.948 23.7803 88.6746 23.5524C88.4163 23.3246 88.0745 23.1271 87.6492 22.96C87.2239 22.7929 86.7682 22.6182 86.2821 22.4359C85.8112 22.2384 85.363 22.003 84.9377 21.7296C84.5124 21.4561 84.163 21.1068 83.8896 20.6814C83.6313 20.2409 83.5022 19.6789 83.5022 18.9953C83.5022 18.3573 83.6693 17.78 84.0035 17.2636C84.3377 16.7319 84.801 16.3142 85.3934 16.0104C86.001 15.7065 86.6922 15.5546 87.4669 15.5546C88.3024 15.5546 89.0771 15.7369 89.7911 16.1015C90.4556 16.4338 90.9877 16.8481 91.3872 17.3444C91.4528 17.4258 91.4385 17.5439 91.359 17.6117L89.9551 18.8097C89.8666 18.8853 89.7328 18.8692 89.6595 18.7789C89.4001 18.4596 89.1022 18.19 88.7657 17.9699C88.3708 17.7117 87.9378 17.5826 87.4669 17.5826C87.1327 17.5826 86.8441 17.6433 86.6011 17.7649C86.3732 17.8864 86.1985 18.0459 86.077 18.2434C85.9707 18.4408 85.9175 18.6611 85.9175 18.9041Z"
|
||||
fill="#2845C1"
|
||||
/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 9.1 KiB |
248
src/frontend/apps/impress/public/assets/logo-pdf.svg
Normal file
248
src/frontend/apps/impress/public/assets/logo-pdf.svg
Normal file
@@ -0,0 +1,248 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 311.6 186.5"
|
||||
style="enable-background: new 0 0 311.6 186.5"
|
||||
xml:space="preserve"
|
||||
>
|
||||
<style type="text/css">
|
||||
.st0 {
|
||||
fill: #ffffff;
|
||||
}
|
||||
.st1 {
|
||||
fill: #000091;
|
||||
}
|
||||
.st2 {
|
||||
fill: #e1000f;
|
||||
}
|
||||
.st3 {
|
||||
fill: #9c9b9b;
|
||||
}
|
||||
</style>
|
||||
<g id="Fond">
|
||||
<rect x="0" class="st0" width="311.6" height="186.5" />
|
||||
</g>
|
||||
<g id="Calque_1">
|
||||
<path
|
||||
id="Devise_Républicaine_1_"
|
||||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.1,2,2.6,2,4.5c0,1.2-0.3,2.3-0.9,3.2c-0.6,0.9-1.4,1.6-2.4,2.1l6.5,9.1h-5l-5.5-8.3h-2.2v8.3H139.1z
|
||||
M145.7,74.4h-2.4v5.2h2.4c0.9,0,1.6-0.2,2.1-0.7c0.5-0.5,0.7-1.1,0.7-1.9c0-0.8-0.2-1.4-0.7-1.9C147.2,74.7,146.6,74.4,145.7,74.4
|
||||
z M158.6,91.5V70.9h5.4l9.2,14.8V70.9h4.2v20.7H172l-9.2-14.8v14.8H158.6z M183.1,91.5V70.9h12v3.6h-7.8v4.8h6.7v3.6h-6.7V88h7.8
|
||||
v3.6H183.1z M200,91.5V70.9h5.3l5,8.5l5-8.5h5.3v20.7h-4.2V76.8l-4.6,7.6h-3l-4.6-7.6v14.7H200z M226.3,91.5V70.9h12v3.6h-7.8v4.8
|
||||
h6.7v3.6h-6.7V88h7.8v3.6H226.3z M243.2,91.5V70.9h5.4l9.2,14.8V70.9h4.2v20.7h-5.4l-9.2-14.8v14.8H243.2z M265.7,74.7v-3.8h16.9
|
||||
v3.8h-6.4v16.8H272V74.7H265.7z"
|
||||
/>
|
||||
<g id="Marianne">
|
||||
<path
|
||||
id="Fond_2_"
|
||||
class="st0"
|
||||
d="M63.6,53.4c0.3-0.3,0.6-0.6,0.9-1h0c0.6-0.6,1.1-1.3,1.8-1.8c0.2-0.2,0.4-0.3,0.6-0.5
|
||||
c0.1-0.1,0.1-0.2,0.1-0.2c-0.3,0.1-0.4,0.3-0.7,0.4c-0.1,0-0.1-0.1-0.1-0.1c0.2-0.1,0.4-0.3,0.6-0.4c0,0,0,0,0,0
|
||||
c-0.1,0-0.1-0.1-0.1-0.1c-0.7-0.1-1.2,0.4-1.7,0.8c-0.1,0.1-0.2-0.1-0.3-0.1c-0.8,0.3-1.4,1-2.2,1.3v-0.1c-0.3,0.1-0.6,0.3-1,0.4
|
||||
c-0.5,0.1-0.9,0.1-1.3,0.1c-0.6,0.1-1.3,0.2-1.9,0.3c0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1,1H80c-0.2,0.1-0.1,0.4-0.3,0.4
|
||||
c-0.2-0.1-0.3,0-0.5,0.1c0.2,0.2,0.5,0.4,0.8,0.3c0.1,0,0.2,0.1,0.2,0.2c0,0,0.1,0,0.1-0.1c0.1,0,0.1,0,0.1,0.1V41
|
||||
c-0.2,0.2-0.4,0.1-0.6,0.2c0.4,0.1,0.9,0.1,1.2,0c0.3-0.1,0-0.6,0.2-0.9c-0.1,0,0-0.2-0.1-0.2c0.1-0.1,0.2-0.3,0.3-0.3
|
||||
c0.1,0,0.3-0.1,0.3-0.2c0-0.1-0.2-0.2-0.2-0.3c0.3-0.2,0.6-0.5,0.5-0.9c-0.1-0.2-0.5-0.2-0.8-0.3c-0.3-0.1-0.6,0-0.9,0.1
|
||||
c-0.3,0-0.5,0.2-0.8,0.2c-0.4,0.1-0.7,0.3-1,0.5c0.4-0.2,0.8-0.2,1.2-0.3C80.1,38.7,80.3,38.6,80.7,38.7"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 23 KiB |
@@ -27,7 +27,6 @@ export const ConfigProvider = ({ children }: PropsWithChildren) => {
|
||||
const { AnalyticsProvider } = useAnalytics();
|
||||
const { i18n } = useTranslation();
|
||||
const languageSynchronized = useRef(false);
|
||||
const favicon = conf?.theme_customization?.favicon;
|
||||
|
||||
useEffect(() => {
|
||||
if (!user || languageSynchronized.current) {
|
||||
@@ -100,25 +99,6 @@ export const ConfigProvider = ({ children }: PropsWithChildren) => {
|
||||
{conf?.FRONTEND_JS_URL && (
|
||||
<Script src={conf?.FRONTEND_JS_URL} strategy="afterInteractive" />
|
||||
)}
|
||||
{favicon?.light.href && (
|
||||
<Head>
|
||||
<link
|
||||
rel="icon"
|
||||
media="(prefers-color-scheme: light)"
|
||||
{...favicon.light}
|
||||
/>
|
||||
</Head>
|
||||
)}
|
||||
{favicon?.dark.href && (
|
||||
<Head>
|
||||
<link
|
||||
rel="icon"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
{...favicon.dark}
|
||||
/>
|
||||
</Head>
|
||||
)}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<AnalyticsProvider>{children}</AnalyticsProvider>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { Resource } from 'i18next';
|
||||
import Image from 'next/image';
|
||||
import { LinkHTMLAttributes } from 'react';
|
||||
|
||||
import { APIError, errorCauses, fetchAPI } from '@/api';
|
||||
import { Theme } from '@/cunningham/';
|
||||
@@ -9,18 +7,8 @@ import { FooterType } from '@/features/footer';
|
||||
import { HeaderType, WaffleType } from '@/features/header';
|
||||
import { PostHogConf } from '@/services';
|
||||
|
||||
type Imagetype = React.ComponentProps<typeof Image>;
|
||||
|
||||
interface ThemeCustomization {
|
||||
favicon?: {
|
||||
light: LinkHTMLAttributes<HTMLLinkElement>;
|
||||
dark: LinkHTMLAttributes<HTMLLinkElement>;
|
||||
};
|
||||
footer?: FooterType;
|
||||
home: {
|
||||
'with-proconnect'?: boolean;
|
||||
'icon-banner'?: Imagetype;
|
||||
};
|
||||
translations?: Resource;
|
||||
header?: HeaderType;
|
||||
waffle?: WaffleType;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { useCunninghamTheme } from '../useCunninghamTheme';
|
||||
|
||||
describe('<useCunninghamTheme />', () => {
|
||||
it('changing theme update tokens', () => {
|
||||
expect(
|
||||
useCunninghamTheme.getState().currentTokens.globals?.font.families.base,
|
||||
).toBe('Hanken Grotesk, Inter, Roboto Flex Variable, sans-serif');
|
||||
it('has the logo correctly set', () => {
|
||||
expect(useCunninghamTheme.getState().componentTokens.logo?.src).toBe('');
|
||||
|
||||
// Change theme
|
||||
useCunninghamTheme.getState().setTheme('dsfr');
|
||||
|
||||
expect(
|
||||
useCunninghamTheme.getState().currentTokens.globals?.font.families.base,
|
||||
).toBe('Marianne, Inter, Roboto Flex Variable, sans-serif');
|
||||
const { componentTokens } = useCunninghamTheme.getState();
|
||||
const logo = componentTokens.logo;
|
||||
expect(logo?.src).toBe('/assets/logo-gouv.svg');
|
||||
expect(logo?.widthHeader).toBe('110px');
|
||||
expect(logo?.widthFooter).toBe('220px');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -889,6 +889,16 @@
|
||||
--c--components--badge--info--color: var(
|
||||
--c--contextuals--content--semantic--info--secondary
|
||||
);
|
||||
--c--components--logo--src: ;
|
||||
--c--components--logo--alt: ;
|
||||
--c--components--logo--widthheader: ;
|
||||
--c--components--logo--widthfooter: ;
|
||||
--c--components--home-proconnect: false;
|
||||
--c--components--icon--src: /assets/icon-docs.svg;
|
||||
--c--components--icon--width: 32px;
|
||||
--c--components--icon--height: auto;
|
||||
--c--components--favicon--png-light: /assets/favicon-light.png;
|
||||
--c--components--favicon--png-dark: /assets/favicon-dark.png;
|
||||
}
|
||||
|
||||
.cunningham-theme--dark {
|
||||
@@ -2579,6 +2589,17 @@
|
||||
--c--components--badge--info--color: var(
|
||||
--c--contextuals--content--semantic--info--secondary
|
||||
);
|
||||
--c--components--logo--src: /assets/logo-gouv.svg;
|
||||
--c--components--logo--alt: gouvernement logo;
|
||||
--c--components--logo--widthHeader: 110px;
|
||||
--c--components--logo--widthFooter: 220px;
|
||||
--c--components--home-proconnect: true;
|
||||
--c--components--icon--src: /assets/icon-docs-dsfr.svg;
|
||||
--c--components--icon--width: 32px;
|
||||
--c--components--icon--height: auto;
|
||||
--c--components--favicon--png-light: /assets/favicon-dsfr.png;
|
||||
--c--components--favicon--png-dark: /assets/favicon-dark-dsfr.png;
|
||||
--c--components--favicon--ico: /assets/favicon-dsfr.ico;
|
||||
}
|
||||
|
||||
.clr-logo-1-light {
|
||||
|
||||
@@ -676,6 +676,13 @@ export const tokens = {
|
||||
warning: { 'background-color': '#F1E0D3', color: '#AD3300' },
|
||||
info: { 'background-color': '#D5E4F3', color: '#005BC0' },
|
||||
},
|
||||
logo: { src: '', alt: '', widthHeader: '', widthFooter: '' },
|
||||
'home-proconnect': false,
|
||||
icon: { src: '/assets/icon-docs.svg', width: '32px', height: 'auto' },
|
||||
favicon: {
|
||||
'png-light': '/assets/favicon-light.png',
|
||||
'png-dark': '/assets/favicon-dark.png',
|
||||
},
|
||||
},
|
||||
},
|
||||
dark: {
|
||||
@@ -1959,6 +1966,23 @@ export const tokens = {
|
||||
warning: { 'background-color': '#F1E0D3', color: '#AD3300' },
|
||||
info: { 'background-color': '#D5E4F3', color: '#005BC0' },
|
||||
},
|
||||
logo: {
|
||||
src: '/assets/logo-gouv.svg',
|
||||
alt: 'Gouvernement Logo',
|
||||
widthHeader: '110px',
|
||||
widthFooter: '220px',
|
||||
},
|
||||
'home-proconnect': true,
|
||||
icon: {
|
||||
src: '/assets/icon-docs-dsfr.svg',
|
||||
width: '32px',
|
||||
height: 'auto',
|
||||
},
|
||||
favicon: {
|
||||
'png-light': '/assets/favicon-dsfr.png',
|
||||
'png-dark': '/assets/favicon-dark-dsfr.png',
|
||||
ico: '/assets/favicon-dsfr.ico',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke="#3b82f6"
|
||||
stroke-width="2.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
|
||||
|
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 598 B |
@@ -2,7 +2,7 @@ import clsx from 'clsx';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { Box, Loading } from '@/components';
|
||||
import { DocHeader, FloatingBar } from '@/docs/doc-header/';
|
||||
import { DocHeader } from '@/docs/doc-header/';
|
||||
import {
|
||||
Doc,
|
||||
LinkReach,
|
||||
@@ -35,7 +35,6 @@ export const DocEditorContainer = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{isDesktop && <FloatingBar />}
|
||||
<Box
|
||||
$maxWidth="868px"
|
||||
$width="100%"
|
||||
|
||||
@@ -9,7 +9,7 @@ import { createReactBlockSpec } from '@blocknote/react';
|
||||
import { t } from 'i18next';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { Box, Icon, Text } from '@/components';
|
||||
import { Box, Text } from '@/components';
|
||||
import { useMediaUrl } from '@/core';
|
||||
import { isSafeUrl } from '@/utils/url';
|
||||
|
||||
@@ -126,11 +126,7 @@ const UploadLoaderBlockComponent = ({
|
||||
{block.props.type === 'warning' ? (
|
||||
<Warning />
|
||||
) : (
|
||||
<Icon
|
||||
$theme="brand"
|
||||
$layer="border"
|
||||
icon={<Loader style={{ animation: 'spin 1.5s linear infinite' }} />}
|
||||
/>
|
||||
<Loader style={{ animation: 'spin 1.5s linear infinite' }} />
|
||||
)}
|
||||
<Text>{block.props.information}</Text>
|
||||
</Box>
|
||||
|
||||
@@ -7,16 +7,17 @@ export const cssEditor = css`
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
& .bn-editor {
|
||||
color: var(--c--globals--colors--gray-700);
|
||||
}
|
||||
|
||||
/**
|
||||
* Token Mantime
|
||||
* WCAG Accessibility contrast fixes for BlockNote editor
|
||||
*/
|
||||
& > .bn-container {
|
||||
--bn-colors-editor-text: var(
|
||||
--c--contextuals--content--semantic--neutral--primary
|
||||
);
|
||||
--bn-colors-side-menu: var(
|
||||
--c--contextuals--content--semantic--neutral--tertiary
|
||||
);
|
||||
.bn-block-content[data-is-empty-and-focused][data-content-type='paragraph']
|
||||
.bn-inline-content:has(> .ProseMirror-trailingBreak:only-child)::before {
|
||||
color: #767676 !important;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,9 +97,7 @@ export const cssEditor = css`
|
||||
height: 38px;
|
||||
}
|
||||
.bn-side-menu .mantine-UnstyledButton-root svg {
|
||||
color: var(
|
||||
--c--contextuals--content--semantic--neutral--tertiary
|
||||
) !important;
|
||||
color: #767676 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,41 +158,6 @@ export const cssEditor = css`
|
||||
border: 1px solid #d3d2cf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checklist items
|
||||
*/
|
||||
.bn-block-content[data-content-type='checkListItem'] > div > input {
|
||||
appearance: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 2px solid
|
||||
var(--c--contextuals--content--semantic--neutral--tertiary);
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
align-self: center;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.bn-block-content[data-content-type='checkListItem'] > div > input:checked {
|
||||
background-color: var(--c--contextuals--content--semantic--brand--tertiary);
|
||||
border-color: var(--c--contextuals--content--semantic--brand--tertiary);
|
||||
}
|
||||
.bn-block-content[data-content-type='checkListItem']
|
||||
> div
|
||||
> input:checked::after {
|
||||
content: 'check';
|
||||
font-family: 'Material Symbols Outlined Variable', sans-serif;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
color: var(--c--contextuals--content--semantic--overlay--primary);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure consistent spacing between headings and paragraphs
|
||||
*/
|
||||
& .bn-block-outer:not(:first-child) {
|
||||
&:has(h1) {
|
||||
margin-top: 32px;
|
||||
|
||||
@@ -35,7 +35,7 @@ export const DocHeader = ({ doc }: DocHeaderProps) => {
|
||||
<>
|
||||
<Box
|
||||
$width="100%"
|
||||
$padding={{ top: isDesktop ? '0' : 'md' }}
|
||||
$padding={{ top: isDesktop ? '50px' : 'md' }}
|
||||
$gap={spacingsTokens['base']}
|
||||
aria-label={t('It is the card information about the document.')}
|
||||
className="--docs--doc-header"
|
||||
|
||||
@@ -49,7 +49,7 @@ export const DocHeaderInfo = ({ doc }: DocHeaderInfoProps) => {
|
||||
$variation="tertiary"
|
||||
$size="s"
|
||||
$weight="bold"
|
||||
$theme={isEditable ? 'neutral' : 'warning'}
|
||||
$theme={isEditable ? 'gray' : 'warning'}
|
||||
>
|
||||
{transRole(isEditable ? doc.user_role || doc.link_role : Role.READER)}
|
||||
·
|
||||
|
||||
@@ -18,8 +18,6 @@ import {
|
||||
import SimpleFileIcon from '@/features/docs/doc-management/assets/simple-document.svg';
|
||||
import { useResponsiveStore } from '@/stores';
|
||||
|
||||
export const CLASS_DOC_TITLE = '--docs--doc-title';
|
||||
|
||||
interface DocTitleProps {
|
||||
doc: Doc;
|
||||
}
|
||||
@@ -41,15 +39,13 @@ export const DocTitleText = () => {
|
||||
const { untitledDocument } = useTrans();
|
||||
|
||||
return (
|
||||
<Box className={CLASS_DOC_TITLE} $direction="row" $align="center">
|
||||
<Text
|
||||
as="h2"
|
||||
$margin={{ all: 'none', left: 'none' }}
|
||||
$size={isMobile ? 'h4' : 'h2'}
|
||||
>
|
||||
{currentDoc?.title || untitledDocument}
|
||||
</Text>
|
||||
</Box>
|
||||
<Text
|
||||
as="h2"
|
||||
$margin={{ all: 'none', left: 'none' }}
|
||||
$size={isMobile ? 'h4' : 'h2'}
|
||||
>
|
||||
{currentDoc?.title || untitledDocument}
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -69,7 +65,6 @@ const DocTitleEmojiPicker = ({ doc }: DocTitleProps) => {
|
||||
placement="top"
|
||||
>
|
||||
<Box
|
||||
className={CLASS_DOC_TITLE}
|
||||
$css={css`
|
||||
padding: 4px;
|
||||
padding-top: 3px;
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
import { useMemo } from 'react';
|
||||
import { css } from 'styled-components';
|
||||
|
||||
import { Box } from '@/components';
|
||||
import { useCunninghamTheme } from '@/cunningham/useCunninghamTheme';
|
||||
import { LeftPanelCollapseButton } from '@/features/left-panel';
|
||||
import { useResponsiveStore } from '@/stores';
|
||||
|
||||
/**
|
||||
* Sticky bar trick (desktop):
|
||||
* - MainContent has padding `base`; we extend the bar width and apply
|
||||
* matching negative margins so it aligns with the scroll area edges.
|
||||
*
|
||||
* Mobile: returns null to avoid header overlap.
|
||||
*/
|
||||
export const FloatingBar = () => {
|
||||
const { spacingsTokens } = useCunninghamTheme();
|
||||
const { isDesktop } = useResponsiveStore();
|
||||
|
||||
const FLOATING_STYLES = useMemo(() => {
|
||||
const base = spacingsTokens['base'];
|
||||
const sm = spacingsTokens['sm'];
|
||||
return css`
|
||||
position: sticky;
|
||||
top: calc(-${base});
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: calc(100% + ${base} + ${base});
|
||||
min-height: 64px;
|
||||
padding: ${sm};
|
||||
margin-left: calc(-${base});
|
||||
margin-right: calc(-${base});
|
||||
margin-top: calc(-${base});
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
isolation: isolate;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
#fff 0%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
backdrop-filter: blur(1px);
|
||||
-webkit-backdrop-filter: blur(1px);
|
||||
mask-image: linear-gradient(180deg, black 50%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
180deg,
|
||||
black 50%,
|
||||
transparent 100%
|
||||
);
|
||||
}
|
||||
|
||||
> * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
`;
|
||||
}, [spacingsTokens]);
|
||||
|
||||
if (!isDesktop) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Box
|
||||
className="--docs--floating-bar"
|
||||
data-testid="floating-bar"
|
||||
$css={FLOATING_STYLES}
|
||||
>
|
||||
<LeftPanelCollapseButton />
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from './DocHeader';
|
||||
export * from './DocTitle';
|
||||
export * from './FloatingBar';
|
||||
|
||||
@@ -11,7 +11,7 @@ export const useCopyDocLink = (docId: Doc['id']) => {
|
||||
|
||||
return useCallback(() => {
|
||||
copyToClipboard(
|
||||
`${window.location.origin}/docs/${docId}/?utm_source=docssharelink&utm_campaign=${docId}`,
|
||||
`${window.location.origin}/docs/${docId}/`,
|
||||
t('Link Copied !'),
|
||||
t('Failed to copy link'),
|
||||
);
|
||||
|
||||
@@ -180,8 +180,8 @@ export const DocVisibility = ({ doc }: DocVisibilityProps) => {
|
||||
options={linkReachOptions}
|
||||
>
|
||||
<Box
|
||||
$theme={canManage ? 'brand' : 'neutral'}
|
||||
$variation="tertiary"
|
||||
$theme={canManage ? 'brand' : 'gray'}
|
||||
$variation={canManage ? 'tertiary' : 'primary'}
|
||||
$direction="row"
|
||||
$align="center"
|
||||
$gap={spacingsTokens['3xs']}
|
||||
@@ -229,11 +229,7 @@ export const DocVisibility = ({ doc }: DocVisibilityProps) => {
|
||||
}
|
||||
label={t('Document access mode')}
|
||||
>
|
||||
<Text
|
||||
$weight="initial"
|
||||
$theme={!canManage ? 'neutral' : 'brand'}
|
||||
$variation={!canManage ? 'secondary' : 'tertiary'}
|
||||
>
|
||||
<Text $weight="initial" $theme="brand" $variation="tertiary">
|
||||
{linkModeTranslations[docLinkRole]}
|
||||
</Text>
|
||||
</DropdownMenu>
|
||||
|
||||
@@ -61,7 +61,7 @@ export const TableContent = () => {
|
||||
$width={!isOpen ? '40px' : '200px'}
|
||||
$height={!isOpen ? '40px' : 'auto'}
|
||||
$maxHeight="calc(50vh - 60px)"
|
||||
$zIndex={2000}
|
||||
$zIndex={1000}
|
||||
$align="center"
|
||||
$padding={isOpen ? 'xs' : '0'}
|
||||
$justify="center"
|
||||
|
||||
@@ -223,7 +223,7 @@ export const DocsGridItemDate = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledLink href={`/docs/${doc.id}`} tabIndex={-1}>
|
||||
<StyledLink href={`/docs/${doc.id}`}>
|
||||
<Text
|
||||
$size="xs"
|
||||
$layer="background"
|
||||
|
||||
@@ -22,7 +22,7 @@ const BlueStripe = styled.div`
|
||||
export const Footer = () => {
|
||||
const { data: config } = useConfig();
|
||||
const footerJson = config?.theme_customization?.footer;
|
||||
const { i18n } = useTranslation();
|
||||
const { i18n, t } = useTranslation();
|
||||
const resolvedLanguage = i18n.resolvedLanguage;
|
||||
const [content, setContent] = useState<ContentType>();
|
||||
|
||||
@@ -84,12 +84,14 @@ export const Footer = () => {
|
||||
{logo?.src && (
|
||||
<Image
|
||||
priority
|
||||
src={logo.src}
|
||||
alt={logo?.alt || t('Logo')}
|
||||
width={0}
|
||||
height={0}
|
||||
{...(({ withTitle: _, ...rest }) => rest)(logo)}
|
||||
style={{ width: logo?.width || 'auto', height: 'auto' }}
|
||||
/>
|
||||
)}
|
||||
{logo?.withTitle && (
|
||||
{logo.withTitle && (
|
||||
<Box $css="zoom:1.4;">
|
||||
<Title />
|
||||
</Box>
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
import Image from 'next/image';
|
||||
|
||||
type Imagetype = React.ComponentProps<typeof Image>;
|
||||
|
||||
export interface FooterType {
|
||||
default: ContentType;
|
||||
[key: string]: ContentType;
|
||||
}
|
||||
|
||||
export interface BottomInformationType {
|
||||
export interface BottomInformation {
|
||||
label: string;
|
||||
link?: LinkType;
|
||||
link?: Link;
|
||||
}
|
||||
|
||||
export interface LinkType {
|
||||
export interface Link {
|
||||
label: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
export type LogoType = Imagetype & {
|
||||
export interface Logo {
|
||||
src: string;
|
||||
width: string;
|
||||
alt: string;
|
||||
withTitle: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ContentType {
|
||||
logo?: LogoType;
|
||||
externalLinks?: LinkType[];
|
||||
legalLinks?: LinkType[];
|
||||
bottomInformation?: BottomInformationType;
|
||||
logo?: Logo;
|
||||
externalLinks?: Link[];
|
||||
legalLinks?: Link[];
|
||||
bottomInformation?: BottomInformation;
|
||||
}
|
||||
|
||||
@@ -6,22 +6,19 @@ import { useLeftPanelStore } from '@/features/left-panel';
|
||||
|
||||
export const ButtonTogglePanel = () => {
|
||||
const { t } = useTranslation();
|
||||
const { isPanelOpenMobile, togglePanel } = useLeftPanelStore();
|
||||
const { isPanelOpen, togglePanel } = useLeftPanelStore();
|
||||
|
||||
return (
|
||||
<Button
|
||||
size="medium"
|
||||
onClick={() => togglePanel()}
|
||||
aria-label={t(
|
||||
isPanelOpenMobile ? 'Close the header menu' : 'Open the header menu',
|
||||
isPanelOpen ? 'Close the header menu' : 'Open the header menu',
|
||||
)}
|
||||
aria-expanded={isPanelOpenMobile}
|
||||
aria-expanded={isPanelOpen}
|
||||
variant="tertiary"
|
||||
icon={
|
||||
<Icon
|
||||
$withThemeInherited
|
||||
iconName={isPanelOpenMobile ? 'close' : 'menu'}
|
||||
/>
|
||||
<Icon $withThemeInherited iconName={isPanelOpen ? 'close' : 'menu'} />
|
||||
}
|
||||
className="--docs--button-toggle-panel"
|
||||
data-testid="header-menu-toggle"
|
||||
|
||||
@@ -18,10 +18,11 @@ import { Waffle } from './Waffle';
|
||||
export const Header = () => {
|
||||
const { t } = useTranslation();
|
||||
const { data: config } = useConfig();
|
||||
const { spacingsTokens } = useCunninghamTheme();
|
||||
const { spacingsTokens, componentTokens } = useCunninghamTheme();
|
||||
const { isDesktop } = useResponsiveStore();
|
||||
|
||||
const icon = config?.theme_customization?.header?.icon;
|
||||
const icon =
|
||||
config?.theme_customization?.header?.icon || componentTokens.icon;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -67,16 +68,19 @@ export const Header = () => {
|
||||
$height="fit-content"
|
||||
$margin={{ top: 'auto' }}
|
||||
>
|
||||
{icon && (
|
||||
<Image
|
||||
data-testid="header-icon-docs"
|
||||
width={0}
|
||||
height={0}
|
||||
priority
|
||||
{...(({ withTitle: _, ...rest }) => rest)(icon)}
|
||||
/>
|
||||
)}
|
||||
{icon?.withTitle && <Title headingLevel="h1" aria-hidden="true" />}
|
||||
<Image
|
||||
data-testid="header-icon-docs"
|
||||
src={icon.src || ''}
|
||||
alt=""
|
||||
width={0}
|
||||
height={0}
|
||||
style={{
|
||||
width: icon.width,
|
||||
height: icon.height,
|
||||
}}
|
||||
priority
|
||||
/>
|
||||
<Title headingLevel="h1" aria-hidden="true" />
|
||||
</Box>
|
||||
</StyledLink>
|
||||
{!isDesktop ? (
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import Image from 'next/image';
|
||||
|
||||
type Imagetype = React.ComponentProps<typeof Image> & {
|
||||
withTitle: boolean;
|
||||
};
|
||||
|
||||
export interface HeaderType {
|
||||
logo?: Imagetype;
|
||||
icon?: Imagetype;
|
||||
icon?: {
|
||||
src?: string;
|
||||
width?: string;
|
||||
height?: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,11 +15,13 @@ import { getHeaderHeight } from './HomeHeader';
|
||||
|
||||
export default function HomeBanner() {
|
||||
const { t } = useTranslation();
|
||||
const { spacingsTokens } = useCunninghamTheme();
|
||||
const { componentTokens, spacingsTokens } = useCunninghamTheme();
|
||||
const { isMobile, isSmallMobile } = useResponsiveStore();
|
||||
const withProConnect = componentTokens['home-proconnect'];
|
||||
const { data: config } = useConfig();
|
||||
const withProConnect = config?.theme_customization?.home?.['with-proconnect'];
|
||||
const icon = config?.theme_customization?.home?.['icon-banner'];
|
||||
|
||||
const icon =
|
||||
config?.theme_customization?.header?.icon || componentTokens.icon;
|
||||
|
||||
return (
|
||||
<Box
|
||||
@@ -48,19 +50,18 @@ export default function HomeBanner() {
|
||||
$align="center"
|
||||
$gap={spacingsTokens['sm']}
|
||||
>
|
||||
{icon?.src && (
|
||||
<Image
|
||||
data-testid="header-icon-docs"
|
||||
width={0}
|
||||
height={0}
|
||||
style={{
|
||||
width: '64px',
|
||||
height: 'auto',
|
||||
}}
|
||||
priority
|
||||
{...icon}
|
||||
/>
|
||||
)}
|
||||
<Image
|
||||
data-testid="header-icon-docs"
|
||||
src={icon.src || ''}
|
||||
alt=""
|
||||
width={0}
|
||||
height={0}
|
||||
style={{
|
||||
width: '64px',
|
||||
height: 'auto',
|
||||
}}
|
||||
priority
|
||||
/>
|
||||
<Text
|
||||
as="h2"
|
||||
$size={!isMobile ? 'xs-alt' : '2.3rem'}
|
||||
|
||||
@@ -2,15 +2,14 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import IconDocs from '@/assets/icons/icon-docs.svg';
|
||||
import { Box, Text } from '@/components';
|
||||
import { useConfig } from '@/core/config';
|
||||
import { useCunninghamTheme } from '@/cunningham';
|
||||
import { ProConnectButton } from '@/features/auth';
|
||||
import { Title } from '@/features/header';
|
||||
import { useResponsiveStore } from '@/stores';
|
||||
|
||||
export function HomeBottom() {
|
||||
const { data: config } = useConfig();
|
||||
const withProConnect = config?.theme_customization?.home?.['with-proconnect'];
|
||||
const { componentTokens } = useCunninghamTheme();
|
||||
const withProConnect = componentTokens['home-proconnect'];
|
||||
|
||||
if (!withProConnect) {
|
||||
return null;
|
||||
|
||||
@@ -15,12 +15,13 @@ export const getHeaderHeight = (isSmallMobile: boolean) =>
|
||||
isSmallMobile ? HEADER_HEIGHT_MOBILE : HEADER_HEIGHT;
|
||||
|
||||
export const HomeHeader = () => {
|
||||
const { spacingsTokens } = useCunninghamTheme();
|
||||
const { spacingsTokens, componentTokens } = useCunninghamTheme();
|
||||
const logo = componentTokens.logo;
|
||||
const { isSmallMobile } = useResponsiveStore();
|
||||
const { data: config } = useConfig();
|
||||
|
||||
const icon = config?.theme_customization?.header?.icon;
|
||||
const logo = config?.theme_customization?.header?.logo;
|
||||
const icon =
|
||||
config?.theme_customization?.header?.icon || componentTokens.icon;
|
||||
|
||||
return (
|
||||
<Box
|
||||
@@ -48,10 +49,11 @@ export const HomeHeader = () => {
|
||||
{!isSmallMobile && logo?.src && (
|
||||
<Image
|
||||
priority
|
||||
src={logo.src}
|
||||
alt={logo.alt}
|
||||
width={0}
|
||||
height={0}
|
||||
style={{ width: logo.width, height: 'auto' }}
|
||||
{...logo}
|
||||
style={{ width: logo.widthHeader, height: 'auto' }}
|
||||
/>
|
||||
)}
|
||||
<Box
|
||||
@@ -61,20 +63,19 @@ export const HomeHeader = () => {
|
||||
$position="relative"
|
||||
$height="fit-content"
|
||||
>
|
||||
{icon && (
|
||||
<Image
|
||||
data-testid="header-icon-docs"
|
||||
width={0}
|
||||
height={0}
|
||||
style={{
|
||||
width: icon.width,
|
||||
height: icon.height,
|
||||
}}
|
||||
priority
|
||||
{...(({ withTitle: _, ...rest }) => rest)(icon)}
|
||||
/>
|
||||
)}
|
||||
{icon?.withTitle && <Title />}
|
||||
<Image
|
||||
data-testid="header-icon-docs"
|
||||
src={icon.src || ''}
|
||||
alt=""
|
||||
width={0}
|
||||
height={0}
|
||||
style={{
|
||||
width: icon.width,
|
||||
height: icon.height,
|
||||
}}
|
||||
priority
|
||||
/>
|
||||
<Title />
|
||||
</Box>
|
||||
</Box>
|
||||
{!isSmallMobile && (
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.04601 20.3381C3.04306 20.3381 2.28465 20.0812 1.77079 19.5673C1.25693 19.0597 1 18.3105 1 17.32V6.01815C1 5.02139 1.25693 4.26917 1.77079 3.7615C2.28465 3.25383 3.04306 3 4.04601 3H19.9447C20.9538 3 21.7154 3.25383 22.2292 3.7615C22.7431 4.26917 23 5.02139 23 6.01815V17.32C23 18.3105 22.7431 19.0597 22.2292 19.5673C21.7154 20.0812 20.9538 20.3381 19.9447 20.3381H4.04601ZM4.15745 18.5087H19.8425C20.2697 18.5087 20.5979 18.3972 20.8269 18.1743C21.056 17.9515 21.1705 17.614 21.1705 17.1621V6.16674C21.1705 5.72098 21.056 5.38666 20.8269 5.16378C20.5979 4.9409 20.2697 4.82946 19.8425 4.82946H4.15745C3.72407 4.82946 3.39285 4.9409 3.16378 5.16378C2.9409 5.38666 2.82946 5.72098 2.82946 6.16674V17.1621C2.82946 17.614 2.9409 17.9515 3.16378 18.1743C3.39285 18.3972 3.72407 18.5087 4.15745 18.5087ZM8.38286 18.8058V4.51372H10.1195V18.8058H8.38286ZM6.56268 8.22837H4.65893C4.49796 8.22837 4.35556 8.16646 4.23174 8.04263C4.11411 7.91881 4.0553 7.78261 4.0553 7.63402C4.0553 7.47305 4.11411 7.33376 4.23174 7.21613C4.35556 7.09849 4.49796 7.03968 4.65893 7.03968H6.56268C6.72984 7.03968 6.87224 7.09849 6.98987 7.21613C7.11369 7.33376 7.1756 7.47305 7.1756 7.63402C7.1756 7.78261 7.11369 7.91881 6.98987 8.04263C6.87224 8.16646 6.72984 8.22837 6.56268 8.22837ZM6.56268 10.7172H4.65893C4.49796 10.7172 4.35556 10.6584 4.23174 10.5407C4.11411 10.4169 4.0553 10.2745 4.0553 10.1136C4.0553 9.95877 4.11411 9.82257 4.23174 9.70494C4.35556 9.58731 4.49796 9.52849 4.65893 9.52849H6.56268C6.72984 9.52849 6.87224 9.58731 6.98987 9.70494C7.11369 9.82257 7.1756 9.95877 7.1756 10.1136C7.1756 10.2745 7.11369 10.4169 6.98987 10.5407C6.87224 10.6584 6.72984 10.7172 6.56268 10.7172ZM6.56268 13.1967H4.65893C4.49796 13.1967 4.35556 13.1379 4.23174 13.0203C4.11411 12.9026 4.0553 12.7664 4.0553 12.6117C4.0553 12.4507 4.11411 12.3114 4.23174 12.1938C4.35556 12.0761 4.49796 12.0173 4.65893 12.0173H6.56268C6.72984 12.0173 6.87224 12.0761 6.98987 12.1938C7.11369 12.3114 7.1756 12.4507 7.1756 12.6117C7.1756 12.7664 7.11369 12.9026 6.98987 13.0203C6.87224 13.1379 6.72984 13.1967 6.56268 13.1967Z" fill="#626A80"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
@@ -7,15 +7,13 @@ import { Box, Icon, StyledLink, Text } from '@/components';
|
||||
import { useCunninghamTheme } from '@/cunningham';
|
||||
import { DocDefaultFilter } from '@/docs/doc-management';
|
||||
import { useLeftPanelStore } from '@/features/left-panel';
|
||||
import { useResponsiveStore } from '@/stores';
|
||||
|
||||
export const LeftPanelTargetFilters = () => {
|
||||
const { t } = useTranslation();
|
||||
const pathname = usePathname();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
const { isDesktop } = useResponsiveStore();
|
||||
const { closePanel } = useLeftPanelStore();
|
||||
const { togglePanel } = useLeftPanelStore();
|
||||
const { colorsTokens, spacingsTokens } = useCunninghamTheme();
|
||||
|
||||
const target =
|
||||
@@ -51,10 +49,8 @@ export const LeftPanelTargetFilters = () => {
|
||||
return `${pathname}?${params.toString()}`;
|
||||
};
|
||||
|
||||
const handleFilterClick = () => {
|
||||
if (!isDesktop) {
|
||||
closePanel();
|
||||
}
|
||||
const handleClick = () => {
|
||||
togglePanel();
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -74,7 +70,9 @@ export const LeftPanelTargetFilters = () => {
|
||||
href={href}
|
||||
aria-label={query.label}
|
||||
aria-current={isActive ? 'page' : undefined}
|
||||
onClick={handleFilterClick}
|
||||
onClick={() => {
|
||||
handleClick();
|
||||
}}
|
||||
$css={css`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -26,14 +26,13 @@ export const LeftPanel = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { spacingsTokens } = useCunninghamTheme();
|
||||
const { togglePanel, isPanelOpen, isPanelOpenMobile } = useLeftPanelStore();
|
||||
const isPanelOpenState = isDesktop ? isPanelOpen : isPanelOpenMobile;
|
||||
const { togglePanel, isPanelOpen } = useLeftPanelStore();
|
||||
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => {
|
||||
togglePanel(isDesktop);
|
||||
}, [pathname, isDesktop, togglePanel]);
|
||||
togglePanel(false);
|
||||
}, [pathname, togglePanel]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -63,7 +62,7 @@ export const LeftPanel = () => {
|
||||
|
||||
{!isDesktop && (
|
||||
<>
|
||||
{isPanelOpenState && <MobileLeftPanelStyle />}
|
||||
{isPanelOpen && <MobileLeftPanelStyle />}
|
||||
<Box
|
||||
$hasTransition
|
||||
$css={css`
|
||||
@@ -72,7 +71,7 @@ export const LeftPanel = () => {
|
||||
height: calc(100dvh - 52px);
|
||||
border-right: 1px solid var(--c--globals--colors--gray-200);
|
||||
position: fixed;
|
||||
transform: translateX(${isPanelOpenState ? '0' : '-100dvw'});
|
||||
transform: translateX(${isPanelOpen ? '0' : '-100dvw'});
|
||||
background-color: var(--c--globals--colors--gray-000);
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
import { Button } from '@gouvfr-lasuite/cunningham-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { css } from 'styled-components';
|
||||
|
||||
import { Box, Text } from '@/components';
|
||||
import { useCunninghamTheme } from '@/cunningham';
|
||||
import { CLASS_DOC_TITLE } from '@/docs/doc-header/components/DocTitle';
|
||||
import { getEmojiAndTitle, useDocStore, useTrans } from '@/docs/doc-management';
|
||||
import { MAIN_LAYOUT_ID } from '@/layouts/conf';
|
||||
|
||||
import LeftPanelIcon from '../assets/left-panel.svg';
|
||||
import { useLeftPanelStore } from '../stores';
|
||||
|
||||
export const LeftPanelCollapseButton = () => {
|
||||
const { t } = useTranslation();
|
||||
const { colorsTokens } = useCunninghamTheme();
|
||||
const { isPanelOpen, togglePanel } = useLeftPanelStore();
|
||||
const { currentDoc } = useDocStore();
|
||||
const [isDocTitleVisible, setIsDocTitleVisible] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const mainContent = document.getElementById(MAIN_LAYOUT_ID);
|
||||
const docTitleEl = document.querySelector(`.${CLASS_DOC_TITLE}`);
|
||||
|
||||
if (!mainContent || !docTitleEl) {
|
||||
return;
|
||||
}
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
([entry]) => {
|
||||
setIsDocTitleVisible(entry.isIntersecting);
|
||||
},
|
||||
{
|
||||
root: mainContent,
|
||||
threshold: 0.05,
|
||||
},
|
||||
);
|
||||
|
||||
observer.observe(docTitleEl);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
setIsDocTitleVisible(true);
|
||||
};
|
||||
}, [currentDoc?.id]);
|
||||
|
||||
const { untitledDocument } = useTrans();
|
||||
|
||||
const { emoji, titleWithoutEmoji } = getEmojiAndTitle(
|
||||
currentDoc?.title ?? '',
|
||||
);
|
||||
const docTitle = titleWithoutEmoji || untitledDocument;
|
||||
const buttonTitle = emoji ? `${emoji} ${docTitle}` : docTitle;
|
||||
const shouldShowButtonTitle = !isPanelOpen && !isDocTitleVisible;
|
||||
const ariaLabel = isPanelOpen
|
||||
? t('Hide the side panel for {{title}}', { title: docTitle })
|
||||
: t('Show the side panel for {{title}}', { title: docTitle });
|
||||
|
||||
return (
|
||||
<Box
|
||||
$css={css`
|
||||
display: inline-flex;
|
||||
padding: var(--c--globals--spacings--xxxs);
|
||||
align-items: center;
|
||||
gap: var(--c--globals--spacings--xxxs);
|
||||
border-radius: var(--c--globals--spacings--xs);
|
||||
border: 1px solid var(--c--contextuals--border--surface--primary);
|
||||
background: var(--c--contextuals--background--surface--primary);
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
|
||||
`}
|
||||
>
|
||||
<Button
|
||||
size="small"
|
||||
onClick={() => togglePanel()}
|
||||
aria-label={ariaLabel}
|
||||
aria-expanded={isPanelOpen}
|
||||
color="neutral"
|
||||
variant="tertiary"
|
||||
icon={<LeftPanelIcon width={24} height={24} aria-hidden="true" />}
|
||||
data-testid="floating-bar-toggle-left-panel"
|
||||
>
|
||||
{shouldShowButtonTitle ? (
|
||||
<Text $size="sm" $weight={700} $color={colorsTokens['gray-1000']}>
|
||||
{buttonTitle}
|
||||
</Text>
|
||||
) : undefined}
|
||||
</Button>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,6 @@ import { useTranslation } from 'react-i18next';
|
||||
import { Icon } from '@/components';
|
||||
import { useCreateDoc } from '@/features/docs/doc-management';
|
||||
import { useSkeletonStore } from '@/features/skeletons';
|
||||
import { useResponsiveStore } from '@/stores';
|
||||
|
||||
import { useLeftPanelStore } from '../stores';
|
||||
|
||||
@@ -14,7 +13,6 @@ export const LeftPanelHeaderButton = () => {
|
||||
const router = useRouter();
|
||||
const { t } = useTranslation();
|
||||
const { closePanel } = useLeftPanelStore();
|
||||
const { isDesktop } = useResponsiveStore();
|
||||
const { setIsSkeletonVisible } = useSkeletonStore();
|
||||
const [isNavigating, setIsNavigating] = useState(false);
|
||||
|
||||
@@ -27,9 +25,7 @@ export const LeftPanelHeaderButton = () => {
|
||||
.then(() => {
|
||||
// The skeleton will be disabled by the [id] page once the data is loaded
|
||||
setIsNavigating(false);
|
||||
if (!isDesktop) {
|
||||
closePanel();
|
||||
}
|
||||
closePanel();
|
||||
})
|
||||
.catch(() => {
|
||||
// In case of navigation error, disable the skeleton
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
PanelResizeHandle,
|
||||
} from 'react-resizable-panels';
|
||||
|
||||
import { useLeftPanelStore } from '@/features/left-panel/stores';
|
||||
import { useResponsiveStore } from '@/stores';
|
||||
|
||||
// Convert a target pixel width to a percentage of the current viewport width.
|
||||
@@ -14,9 +13,6 @@ const pxToPercent = (px: number) => {
|
||||
return (px / window.innerWidth) * 100;
|
||||
};
|
||||
|
||||
const PANEL_TOGGLE_TRANSITION =
|
||||
'flex-grow 180ms var(--c--globals--transitions--ease-out), flex-basis 180ms var(--c--globals--transitions--ease-out)';
|
||||
|
||||
type ResizableLeftPanelProps = {
|
||||
leftPanel: React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
@@ -31,73 +27,44 @@ export const ResizableLeftPanel = ({
|
||||
maxPanelSizePx = 450,
|
||||
}: ResizableLeftPanelProps) => {
|
||||
const { isDesktop } = useResponsiveStore();
|
||||
const { isPanelOpen } = useLeftPanelStore();
|
||||
const ref = useRef<ImperativePanelHandle>(null);
|
||||
const savedWidthPxRef = useRef<number>(minPanelSizePx);
|
||||
const previousPanelOpenRef = useRef<boolean>(isPanelOpen);
|
||||
const [isToggleAnimating, setIsToggleAnimating] = useState(false);
|
||||
|
||||
const minPanelSizePercent = pxToPercent(minPanelSizePx);
|
||||
const maxPanelSizePercent = Math.min(pxToPercent(maxPanelSizePx), 40);
|
||||
|
||||
const [panelSizePercent, setPanelSizePercent] = useState(() => {
|
||||
const initialSize = pxToPercent(minPanelSizePx);
|
||||
return Math.max(
|
||||
minPanelSizePercent,
|
||||
Math.min(initialSize, maxPanelSizePercent),
|
||||
);
|
||||
});
|
||||
|
||||
// Keep pixel width constant on window resize
|
||||
useEffect(() => {
|
||||
const syncPanelState = () => {
|
||||
if (!ref.current || !isDesktop) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isPanelOpen) {
|
||||
ref.current.collapse();
|
||||
return;
|
||||
}
|
||||
|
||||
const restoredSizePercent = Math.max(
|
||||
minPanelSizePercent,
|
||||
Math.min(pxToPercent(savedWidthPxRef.current), maxPanelSizePercent),
|
||||
);
|
||||
|
||||
ref.current.expand();
|
||||
ref.current.resize(restoredSizePercent);
|
||||
};
|
||||
|
||||
const hasPanelToggleChanged = previousPanelOpenRef.current !== isPanelOpen;
|
||||
previousPanelOpenRef.current = isPanelOpen;
|
||||
|
||||
if (hasPanelToggleChanged) {
|
||||
setIsToggleAnimating(true);
|
||||
const animationFrameId = requestAnimationFrame(() => {
|
||||
syncPanelState();
|
||||
});
|
||||
const timeoutId = setTimeout(() => {
|
||||
setIsToggleAnimating(false);
|
||||
}, 180);
|
||||
|
||||
return () => {
|
||||
window.cancelAnimationFrame(animationFrameId);
|
||||
window.clearTimeout(timeoutId);
|
||||
};
|
||||
}
|
||||
|
||||
syncPanelState();
|
||||
|
||||
if (!isDesktop || !isPanelOpen) {
|
||||
if (!isDesktop) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handleResize = () => {
|
||||
syncPanelState();
|
||||
const newPercent = pxToPercent(savedWidthPxRef.current);
|
||||
setPanelSizePercent(newPercent);
|
||||
if (ref.current) {
|
||||
ref.current.resize?.(newPercent - (ref.current.getSize() || 0));
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('resize', handleResize);
|
||||
return () => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
};
|
||||
}, [isDesktop, isPanelOpen, minPanelSizePercent, maxPanelSizePercent]);
|
||||
}, [isDesktop]);
|
||||
|
||||
const handleResize = (sizePercent: number) => {
|
||||
if (isDesktop && sizePercent > 0) {
|
||||
const widthPx = (sizePercent / 100) * window.innerWidth;
|
||||
savedWidthPxRef.current = widthPx;
|
||||
}
|
||||
const widthPx = (sizePercent / 100) * window.innerWidth;
|
||||
savedWidthPxRef.current = widthPx;
|
||||
setPanelSizePercent(sizePercent);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -106,20 +73,11 @@ export const ResizableLeftPanel = ({
|
||||
ref={ref}
|
||||
className="--docs--resizable-left-panel"
|
||||
order={0}
|
||||
collapsible
|
||||
collapsedSize={0}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
transition: isToggleAnimating ? PANEL_TOGGLE_TRANSITION : 'none',
|
||||
}}
|
||||
defaultSize={
|
||||
isDesktop
|
||||
? Math.max(
|
||||
minPanelSizePercent,
|
||||
Math.min(
|
||||
pxToPercent(savedWidthPxRef.current),
|
||||
maxPanelSizePercent,
|
||||
),
|
||||
Math.min(panelSizePercent, maxPanelSizePercent),
|
||||
)
|
||||
: 0
|
||||
}
|
||||
@@ -137,17 +95,10 @@ export const ResizableLeftPanel = ({
|
||||
width: '1px',
|
||||
cursor: 'col-resize',
|
||||
}}
|
||||
disabled={!isDesktop || !isPanelOpen}
|
||||
disabled={!isDesktop}
|
||||
/>
|
||||
|
||||
<Panel
|
||||
order={1}
|
||||
style={{
|
||||
transition: isToggleAnimating ? PANEL_TOGGLE_TRANSITION : 'none',
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</Panel>
|
||||
<Panel order={1}>{children}</Panel>
|
||||
</PanelGroup>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from './LeftPanel';
|
||||
export * from './LeftPanelCollapseButton';
|
||||
export * from './ResizableLeftPanel';
|
||||
|
||||
@@ -2,30 +2,21 @@ import { create } from 'zustand';
|
||||
|
||||
interface LeftPanelState {
|
||||
isPanelOpen: boolean;
|
||||
isPanelOpenMobile: boolean;
|
||||
togglePanel: (value?: boolean) => void;
|
||||
closePanel: () => void;
|
||||
}
|
||||
|
||||
export const useLeftPanelStore = create<LeftPanelState>((set, get) => ({
|
||||
isPanelOpen: true,
|
||||
isPanelOpenMobile: false,
|
||||
isPanelOpen: false,
|
||||
togglePanel: (value?: boolean) => {
|
||||
if (value === true) {
|
||||
set({ isPanelOpen: true });
|
||||
return;
|
||||
}
|
||||
if (value === false) {
|
||||
set({ isPanelOpen: false, isPanelOpenMobile: false });
|
||||
return;
|
||||
}
|
||||
const { isPanelOpen, isPanelOpenMobile } = get();
|
||||
set({
|
||||
isPanelOpen: !isPanelOpen,
|
||||
isPanelOpenMobile: !isPanelOpenMobile,
|
||||
});
|
||||
const sanitizedValue =
|
||||
value !== undefined && typeof value === 'boolean'
|
||||
? value
|
||||
: !get().isPanelOpen;
|
||||
|
||||
set({ isPanelOpen: sanitizedValue });
|
||||
},
|
||||
closePanel: () => {
|
||||
set({ isPanelOpen: false, isPanelOpenMobile: false });
|
||||
set({ isPanelOpen: false });
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -1,29 +1,13 @@
|
||||
import { useRouter } from 'next/router';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { MAIN_LAYOUT_ID } from '@/layouts/conf';
|
||||
|
||||
export const useRouteChangeCompleteFocus = () => {
|
||||
const router = useRouter();
|
||||
const lastCompletedPathRef = useRef<string | null>(null);
|
||||
const isKeyboardNavigationRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyboardNavigation = (event: KeyboardEvent) => {
|
||||
if (['Tab', 'Enter', ' ', 'Spacebar'].includes(event.key)) {
|
||||
isKeyboardNavigationRef.current = true;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keydown', handleKeyboardNavigation);
|
||||
|
||||
const handleRouteChangeComplete = (url: string) => {
|
||||
const normalizedUrl = url.split('#')[0];
|
||||
if (lastCompletedPathRef.current === normalizedUrl) {
|
||||
return;
|
||||
}
|
||||
lastCompletedPathRef.current = normalizedUrl;
|
||||
|
||||
const handleRouteChangeComplete = () => {
|
||||
requestAnimationFrame(() => {
|
||||
const mainContent =
|
||||
document.getElementById(MAIN_LAYOUT_ID) ??
|
||||
@@ -38,13 +22,7 @@ export const useRouteChangeCompleteFocus = () => {
|
||||
'(prefers-reduced-motion: reduce)',
|
||||
).matches;
|
||||
|
||||
if (isKeyboardNavigationRef.current) {
|
||||
(mainContent as HTMLElement | null)?.focus({ preventScroll: true });
|
||||
isKeyboardNavigationRef.current = false;
|
||||
}
|
||||
if (router.pathname === '/docs/[id]') {
|
||||
return;
|
||||
}
|
||||
(mainContent as HTMLElement | null)?.focus({ preventScroll: true });
|
||||
(firstHeading ?? mainContent)?.scrollIntoView({
|
||||
behavior: prefersReducedMotion ? 'auto' : 'smooth',
|
||||
block: 'start',
|
||||
@@ -54,8 +32,7 @@ export const useRouteChangeCompleteFocus = () => {
|
||||
|
||||
router.events.on('routeChangeComplete', handleRouteChangeComplete);
|
||||
return () => {
|
||||
window.removeEventListener('keydown', handleKeyboardNavigation);
|
||||
router.events.off('routeChangeComplete', handleRouteChangeComplete);
|
||||
};
|
||||
}, [router.events, router.pathname]);
|
||||
}, [router.events]);
|
||||
};
|
||||
|
||||
@@ -120,13 +120,9 @@ const MainContent = ({
|
||||
$css={css`
|
||||
overflow-y: auto;
|
||||
overflow-x: clip;
|
||||
&:focus-visible::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border: 3px solid ${colorsTokens['brand-400']};
|
||||
pointer-events: none;
|
||||
z-index: 2001;
|
||||
&:focus-visible {
|
||||
outline: 3px solid ${colorsTokens['brand-400']};
|
||||
outline-offset: -3px;
|
||||
}
|
||||
`}
|
||||
>
|
||||
|
||||
@@ -3,6 +3,7 @@ import Head from 'next/head';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { AppProvider } from '@/core/';
|
||||
import { useCunninghamTheme } from '@/cunningham';
|
||||
import { useOffline, useSWRegister } from '@/features/service-worker/';
|
||||
import '@/i18n/initI18n';
|
||||
import { NextPageWithLayout } from '@/types/next';
|
||||
@@ -18,6 +19,8 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
|
||||
useOffline();
|
||||
const getLayout = Component.getLayout ?? ((page) => page);
|
||||
const { t } = useTranslation();
|
||||
const { componentTokens } = useCunninghamTheme();
|
||||
const favicon = componentTokens['favicon'];
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -30,6 +33,19 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
|
||||
'Docs: Your new companion to collaborate on documents efficiently, intuitively, and securely.',
|
||||
)}
|
||||
/>
|
||||
<link rel="icon" href={favicon['png-light']} type="image/png" />
|
||||
<link
|
||||
rel="icon"
|
||||
href={favicon['png-light']}
|
||||
type="image/png"
|
||||
media="(prefers-color-scheme: light)"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
href={favicon['png-dark']}
|
||||
type="image/png"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</Head>
|
||||
<AppProvider>{getLayout(<Component {...pageProps} />)}</AppProvider>
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
"@types/react": "19.2.8",
|
||||
"@types/react-dom": "19.2.3",
|
||||
"eslint": "9.39.2",
|
||||
"minimatch": "10.2.1",
|
||||
"prosemirror-view": "1.41.4",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
|
||||
@@ -8301,16 +8301,16 @@ bail@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d"
|
||||
integrity sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
balanced-match@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-2.0.0.tgz#dc70f920d78db8b858535795867bf48f820633d9"
|
||||
integrity sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==
|
||||
|
||||
balanced-match@^4.0.2:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-4.0.3.tgz#6337a2f23e0604a30481423432f99eac603599f9"
|
||||
integrity sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g==
|
||||
|
||||
bare-events@^2.7.0:
|
||||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/bare-events/-/bare-events-2.8.0.tgz#ec962fa9e2bfafd4edd444942df1ed0c7aba8e4a"
|
||||
@@ -8382,12 +8382,20 @@ boolbase@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
|
||||
integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==
|
||||
|
||||
brace-expansion@^5.0.2:
|
||||
version "5.0.2"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.2.tgz#b6c16d0791087af6c2bc463f52a8142046c06b6f"
|
||||
integrity sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.12"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843"
|
||||
integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==
|
||||
dependencies:
|
||||
balanced-match "^4.0.2"
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
brace-expansion@^2.0.1:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7"
|
||||
integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
|
||||
braces@^3.0.3, braces@~3.0.2:
|
||||
version "3.0.3"
|
||||
@@ -8841,6 +8849,11 @@ compute-scroll-into-view@^3.1.0:
|
||||
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz#02c3386ec531fb6a9881967388e53e8564f3e9aa"
|
||||
integrity sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
content-disposition@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-1.0.0.tgz#844426cb398f934caefcbb172200126bc7ceace2"
|
||||
@@ -13046,12 +13059,26 @@ minimalistic-assert@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
|
||||
integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==
|
||||
|
||||
minimatch@10.2.1, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2, minimatch@^5.0.1, minimatch@^9.0.0, minimatch@^9.0.4, minimatch@^9.0.5:
|
||||
version "10.2.1"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.2.1.tgz#9d82835834cdc85d5084dd055e9a4685fa56e5f0"
|
||||
integrity sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A==
|
||||
minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^5.0.2"
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimatch@^5.0.1:
|
||||
version "5.1.6"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96"
|
||||
integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==
|
||||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimatch@^9.0.0, minimatch@^9.0.4, minimatch@^9.0.5:
|
||||
version "9.0.5"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5"
|
||||
integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==
|
||||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
|
||||
version "1.2.8"
|
||||
|
||||
@@ -73,7 +73,7 @@ spec:
|
||||
startupProbe:
|
||||
{{- include "impress.probes.abstract" (merge .Values.backend.celery.probes.startup (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.backend.celery.resources }}
|
||||
{{- with .Values.backend.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -133,6 +133,7 @@ ingressCollaborationApi:
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/upstream-hash-by: $arg_room
|
||||
|
||||
|
||||
## @param ingressAdmin.enabled whether to enable the Ingress or not
|
||||
## @param ingressAdmin.className IngressClass to use for the Ingress
|
||||
## @param ingressAdmin.host Host for the Ingress
|
||||
@@ -143,7 +144,7 @@ ingressAdmin:
|
||||
host: impress.example.com
|
||||
path: /admin
|
||||
## @param ingressAdmin.hosts Additional host to configure for the Ingress
|
||||
hosts: []
|
||||
hosts: [ ]
|
||||
# - chart-example.local
|
||||
## @param ingressAdmin.tls.enabled Weather to enable TLS for the Ingress
|
||||
## @param ingressAdmin.tls.secretName Secret name for TLS config
|
||||
@@ -165,7 +166,7 @@ ingressMedia:
|
||||
host: impress.example.com
|
||||
path: /media/(.*)
|
||||
## @param ingressMedia.hosts Additional host to configure for the Ingress
|
||||
hosts: []
|
||||
hosts: [ ]
|
||||
# - chart-example.local
|
||||
## @param ingressMedia.tls.enabled Weather to enable TLS for the Ingress
|
||||
## @param ingressMedia.tls.secretName Secret name for TLS config
|
||||
@@ -196,9 +197,11 @@ serviceMedia:
|
||||
port: 9000
|
||||
annotations: {}
|
||||
|
||||
|
||||
## @section backend
|
||||
|
||||
backend:
|
||||
|
||||
## @param backend.command Override the backend container command
|
||||
command: []
|
||||
|
||||
@@ -228,7 +231,7 @@ backend:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
||||
- "ALL"
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
@@ -333,10 +336,10 @@ backend:
|
||||
## @param backend.probes.readiness.initialDelaySeconds [nullable] Configure timeout for backend readiness probe
|
||||
probes:
|
||||
liveness:
|
||||
path: /__lbheartbeat__
|
||||
path: /__heartbeat__
|
||||
initialDelaySeconds: 10
|
||||
readiness:
|
||||
path: /__heartbeat__
|
||||
path: /__lbheartbeat__
|
||||
initialDelaySeconds: 10
|
||||
|
||||
## @param backend.resources Resource requirements for the backend container
|
||||
@@ -378,6 +381,7 @@ backend:
|
||||
file_content: ""
|
||||
mount_path: /app/impress/configuration/theme
|
||||
|
||||
|
||||
## @param backend.celery.replicas Amount of celery replicas
|
||||
## @param backend.celery.command Override the celery container command
|
||||
## @param backend.celery.args Override the celery container args
|
||||
@@ -391,40 +395,22 @@ backend:
|
||||
celery:
|
||||
replicas: 1
|
||||
command: []
|
||||
args:
|
||||
[
|
||||
"celery",
|
||||
"-A",
|
||||
"impress.celery_app",
|
||||
"worker",
|
||||
"-l",
|
||||
"INFO",
|
||||
"-n",
|
||||
"impress@%h",
|
||||
]
|
||||
args: ["celery", "-A", "impress.celery_app", "worker", "-l", "INFO", "-n", "impress@%h"]
|
||||
resources: {}
|
||||
probes:
|
||||
liveness:
|
||||
exec:
|
||||
command:
|
||||
[
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"celery -A impress.celery_app inspect ping -d impress@$HOSTNAME",
|
||||
]
|
||||
command: ["/bin/sh", "-c", "celery -A impress.celery_app inspect ping -d impress@$HOSTNAME"]
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 5
|
||||
readiness:
|
||||
exec:
|
||||
command:
|
||||
[
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"celery -A impress.celery_app inspect ping -d impress@$HOSTNAME",
|
||||
]
|
||||
command: ["/bin/sh", "-c", "celery -A impress.celery_app inspect ping -d impress@$HOSTNAME"]
|
||||
initialDelaySeconds: 15
|
||||
timeoutSeconds: 5
|
||||
|
||||
|
||||
|
||||
## @section frontend
|
||||
|
||||
frontend:
|
||||
@@ -456,7 +442,7 @@ frontend:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
||||
- "ALL"
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
@@ -536,6 +522,7 @@ frontend:
|
||||
## @section posthog
|
||||
|
||||
posthog:
|
||||
|
||||
## @param posthog.ingress.enabled Enable or disable the ingress resource creation
|
||||
## @param posthog.ingress.className Kubernetes ingress class name to use (e.g., nginx, traefik)
|
||||
## @param posthog.ingress.host Primary hostname for the ingress resource
|
||||
@@ -550,12 +537,12 @@ posthog:
|
||||
className: null
|
||||
host: impress.example.com
|
||||
path: /
|
||||
hosts: []
|
||||
hosts: [ ]
|
||||
tls:
|
||||
enabled: true
|
||||
additional: []
|
||||
additional: [ ]
|
||||
|
||||
customBackends: []
|
||||
customBackends: [ ]
|
||||
annotations: {}
|
||||
|
||||
## @param posthog.ingressAssets.enabled Enable or disable the ingress resource creation
|
||||
@@ -572,14 +559,14 @@ posthog:
|
||||
className: null
|
||||
host: impress.example.com
|
||||
paths:
|
||||
- /static
|
||||
- /array
|
||||
hosts: []
|
||||
- /static
|
||||
- /array
|
||||
hosts: [ ]
|
||||
tls:
|
||||
enabled: true
|
||||
additional: []
|
||||
additional: [ ]
|
||||
|
||||
customBackends: []
|
||||
customBackends: [ ]
|
||||
annotations: {}
|
||||
|
||||
## @param posthog.service.type Service type (e.g. ExternalName, ClusterIP, LoadBalancer)
|
||||
@@ -602,6 +589,7 @@ posthog:
|
||||
port: 443
|
||||
annotations: {}
|
||||
|
||||
|
||||
## @section yProvider
|
||||
|
||||
yProvider:
|
||||
@@ -633,7 +621,7 @@ yProvider:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
||||
- "ALL"
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
@@ -741,7 +729,7 @@ docSpec:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
||||
- "ALL"
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
|
||||
Reference in New Issue
Block a user