Compare commits

..
Author SHA1 Message Date
stumpylog b27c21b91d Fne, annotate chat synthesizer llm as LLM 2026-11-23 14:18:25 -08:00
stumpylog 9cf8346fc4 Enhancement: Answer chat questions from all retrieved chunks in one LLM call
The chat response synthesizer packed the retrieved chunks using the embedding
chunk size as its limit, so nothing merged and each question took 3 to 6
sequential LLM calls. Use the configured context size as the limit instead,
so the chunks share one prompt.

If the server rejects the larger prompt with a 400, log a warning naming
PAPERLESS_AI_LLM_CONTEXT_SIZE and retry once with the embedding chunk size,
as before. The retry only happens before anything has streamed.
2026-11-23 14:18:25 -08:00
stumpylog 7947bb128e Ensures all the resources are closed even in odd cases and not just by gc 2026-11-23 14:16:35 -08:00
stumpylog 8787f70991 Fix: stream AI chat natively async so a disconnect cancels the LLM request
The chat answer was a sync generator wrapped for ASGI, pulling each chunk
through sync_to_async(next). A client disconnect cancelled the response
task, but the worker thread waiting on the LLM could not be interrupted,
so the upstream request kept generating the whole answer for nobody.

Make stream_chat_with_documents an async generator. All the blocking setup
(ORM queries, the index read lock and its thread-bound sqlite connection,
the query embedding, building the LLM client) moves into one sync
_prepare_chat called once through sync_to_async, which also hands the DB
connection back before the answer streams. The answer then streams through
llama-index's asynthesize over the pinned async httpx clients, so a
disconnect cancels the LLM request directly. The view returns the async
generator as is, replacing the sync-to-async wrapper.

The async pinned transport resolved hostnames with a blocking getaddrinfo
on the event loop, which would stall the whole worker on slow DNS now that
chat uses it in the web server. Resolve in a thread instead, and add the
async counterparts of the existing transport tests.
2026-11-22 14:18:58 -08:00
shamoon f722730db7 mb-5 2026-11-22 13:21:40 -08:00
Trenton H 8866538369 Chore(deps): bump packages with open security advisories (#14810)
Clears the Dependabot alerts for twisted, autobahn, pyasn1, tornado and oauthlib.
2026-11-22 13:11:09 -08:00
Trenton H 245e819cb5 Chore: Bumps nltk to 3.10.4 to clear its 14 Dependabot alerts (#14811) 2026-11-22 10:42:18 -08:00
Trenton H 40fed2c70f Bumps psycopg-c to 3.3.8 (#14764) 2026-11-22 10:06:36 -08:00
shamoon 40598db447 Fix/tweak: include other loopbacks in default ALLOWED_HOSTS (#14846) 2026-11-22 09:27:53 -08:00
GitHub Actions d1e574ff8f Auto translate strings 2026-11-22 16:51:28 +00:00
shamoon 94ee54e4a6 Enhancement: nested tag 'split' display (#14843) 2026-11-22 08:49:24 -08:00
shamoon 51499afa5a Feature: What's new (in-app release notes) (#14835) 2026-11-22 16:48:54 +00:00
Trenton H d00da2b2ee Chore: bump jbig2enc to 0.32 (#14758) 2026-11-22 08:41:39 -08:00
Trenton H 4973be8499 Fix: Add socket timeout options for broker and celery during status API (#14824) 2026-11-19 07:20:11 -08:00
shamoon 14252054a1 Fix/tweak: update form inputs while typing (#14821) 2026-11-18 16:28:02 -08:00
github-actions[bot]andshamoon bcfdfcaa29 Documentation: Add v3.5.1 changelog (#14814)
* Changelog v3.5.1 - GHA

* Modify changelog for paperless-ngx version 3.5.1

Updated changelog to reflect changes in version 3.5.1.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-11-17 21:52:43 -08:00
shamoon 35b0439195 Bump version to 3.5.1 2026-11-17 21:05:28 -08:00
github-actions[bot]andCrowdin Bot f21f6b9795 New Crowdin translations by GitHub Action (#14798)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-11-18 04:15:05 +00:00
Trenton H 7977093e83 Chore: restrict uv lock environments to supported architectures (#14759)
* Chore: restrict uv lock environments to supported architectures

Limit the lock to Linux x86_64, Linux aarch64 and macOS arm64. Locked
versions are unchanged; only the unused wheel entries are removed.

* Chore: restrict uv lock environments to CPython

Add platform_python_implementation == 'CPython' to each supported
environment so the lock only resolves for interpreters we actually run on.
Basically PyPy was never supported anyway
2026-11-17 21:16:40 +00:00
shamoon 237521ec4b Fix: skip dont use set_actor if audit log disabled (#14808) 2026-11-17 21:02:16 +00:00
GitHub Actions 0596579d4b Auto translate strings 2026-11-17 20:49:24 +00:00
shamoon a22579e311 Tweak: adjust chat timing for streaming (#14805) 2026-11-17 20:47:55 +00:00
Trenton H 199d1a88e9 Fix: stream AI chat answers under ASGI (#14803) 2026-11-17 20:47:55 +00:00
GitHub Actions f68c093097 Auto translate strings 2026-11-17 11:38:40 +00:00
shamoon b5d6009e15 Tweak/fix: retain bulk edit selection after queuing operation (#14797) 2026-11-17 03:37:03 -08:00
github-actions[bot] c3fa454ffa Changelog v3.5.0 - GHA (#14792)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-16 19:48:40 -08:00
shamoon bfd0d7fe36 Bump version to 3.5.0 2026-11-16 19:20:01 -08:00
github-actions[bot]andCrowdin Bot 48c7a11195 New Crowdin translations by GitHub Action (#14761)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-11-17 03:11:47 +00:00
GitHub Actions 9ba98d1cb3 Auto translate strings 2026-11-17 00:25:18 +00:00
shamoon de75249e51 Chorehancement: move all bulk operations to async hand-off (#14773) 2026-11-17 00:23:44 +00:00
GitHub Actions 28bb63824f Auto translate strings 2026-11-16 15:29:38 +00:00
Trenton H 64bf7f8457 Fix: use a constant password mask and consolidate the no-change check (#14784)
Return a constant 10 character mask instead.

Move ObfuscatedPasswordField into paperless/fields.py so core no longer
imports it from paperless_mail, and add is_obfuscated_password() to
replace the five checks
2026-11-16 15:28:13 +00:00
Trenton H c177c13acf Fix: use a PostgreSQL-compatible regex for scheduled workflow filename filters (#14783)
* Fix: use a PostgreSQL-compatible regex for scheduled workflow filename filters

* Tests for the translation layer
2026-11-16 06:42:34 -08:00
193 changed files with 30251 additions and 14649 deletions

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH
# Can be workflow provided, defaults set for manual building
ARG JBIG2ENC_VERSION=0.30
ARG JBIG2ENC_VERSION=0.32
# Set Python environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
+1 -1
View File
@@ -99,7 +99,7 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH
# Can be workflow provided, defaults set for manual building
ARG JBIG2ENC_VERSION=0.30
ARG JBIG2ENC_VERSION=0.32
# Set Python environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
+7 -7
View File
@@ -285,14 +285,14 @@ The API supports various bulk-editing operations which are executed asynchronous
### Documents
Document bulk operations return `{"result":"OK","task_id":"…"}` when queued.
Check `/api/tasks/?task_id={uuid}` for the outcome, including any follow-up processing,
deletion, or recovery. Failed operations may leave partial changes applied.
Document bulk operations, including the dedicated document action endpoints, return
`{"result":"OK","task_id":"…"}` when queued. Use `/api/tasks/?task_id={uuid}`
to check the task outcome. Actions that create or reprocess files may start further
consumption or reprocessing tasks and completion of the bulk task means those tasks
were scheduled, not that their file processing has finished.
For operations with child tasks, `result_data` includes `succeeded_count` and
`failed_count` (task counts). Merges report skipped inputs in `failed_document_ids`.
The `/api/documents/bulk_edit/` endpoint accepts:
For bulk operations on documents, use the endpoint `/api/documents/bulk_edit/` which accepts
a json payload of the format:
```json
{
+116
View File
@@ -1,5 +1,121 @@
# Changelog
## paperless-ngx 3.5.1
### Changes
- Tweak: adjust chat timing for streaming [@shamoon](https://github.com/shamoon) ([#14805](https://github.com/paperless-ngx/paperless-ngx/pull/14805))
### Bug Fixes
- Fix: dont use set\_actor if audit log disabled in tasks [@shamoon](https://github.com/shamoon) ([#14808](https://github.com/paperless-ngx/paperless-ngx/pull/14808))
- Fix: stream AI chat answers under ASGI [@stumpylog](https://github.com/stumpylog) ([#14803](https://github.com/paperless-ngx/paperless-ngx/pull/14803))
- Tweak/fix: retain bulk edit selection after queuing operation [@shamoon](https://github.com/shamoon) ([#14797](https://github.com/paperless-ngx/paperless-ngx/pull/14797))
### All App Changes
<details>
<summary>4 changes</summary>
- Fix: dont use set\_actor if audit log disabled in tasks [@shamoon](https://github.com/shamoon) ([#14808](https://github.com/paperless-ngx/paperless-ngx/pull/14808))
- Tweak: adjust chat timing for streaming [@shamoon](https://github.com/shamoon) ([#14805](https://github.com/paperless-ngx/paperless-ngx/pull/14805))
- Fix: stream AI chat answers under ASGI [@stumpylog](https://github.com/stumpylog) ([#14803](https://github.com/paperless-ngx/paperless-ngx/pull/14803))
- Tweak/fix: retain bulk edit selection after queuing operation [@shamoon](https://github.com/shamoon) ([#14797](https://github.com/paperless-ngx/paperless-ngx/pull/14797))
</details>
## paperless-ngx 3.5.0
### Features / Enhancements
- Chorehancement: move all bulk operations to async hand-off [@shamoon](https://github.com/shamoon) ([#14773](https://github.com/paperless-ngx/paperless-ngx/pull/14773))
- Enhancement: render document notes as markdown [@zwif](https://github.com/zwif) ([#14626](https://github.com/paperless-ngx/paperless-ngx/pull/14626))
- Feature: manual workflow trigger [@shamoon](https://github.com/shamoon) ([#14704](https://github.com/paperless-ngx/paperless-ngx/pull/14704))
- Enhancement: make bulk metadata operations run async [@shamoon](https://github.com/shamoon) ([#14711](https://github.com/paperless-ngx/paperless-ngx/pull/14711))
- Fixhancement: add automatic clearing of sessions [@shamoon](https://github.com/shamoon) ([#14722](https://github.com/paperless-ngx/paperless-ngx/pull/14722))
- Tweak: chat reference tweaks [@shamoon](https://github.com/shamoon) ([#14723](https://github.com/paperless-ngx/paperless-ngx/pull/14723))
- Fixhancement: rework saved view widget queue processing to expected [@shamoon](https://github.com/shamoon) ([#14699](https://github.com/paperless-ngx/paperless-ngx/pull/14699))
### Bug Fixes
- Fix: use a constant password mask and consolidate the no-change check [@stumpylog](https://github.com/stumpylog) ([#14784](https://github.com/paperless-ngx/paperless-ngx/pull/14784))
- Fix: use a PostgreSQL-compatible regex for scheduled workflow filename filters [@stumpylog](https://github.com/stumpylog) ([#14783](https://github.com/paperless-ngx/paperless-ngx/pull/14783))
- Fix: get users for saved view create dialog [@shamoon](https://github.com/shamoon) ([#14769](https://github.com/paperless-ngx/paperless-ngx/pull/14769))
- Fix: Allow AI chat filters over more than 32700 documents [@stumpylog](https://github.com/stumpylog) ([#14754](https://github.com/paperless-ngx/paperless-ngx/pull/14754))
- Fix: Enforce CRLF when writing an email message to the file [@stumpylog](https://github.com/stumpylog) ([#14745](https://github.com/paperless-ngx/paperless-ngx/pull/14745))
- Fix: restore image without archive version thumbnail generation [@shamoon](https://github.com/shamoon) ([#14741](https://github.com/paperless-ngx/paperless-ngx/pull/14741))
- Fix: Blacklist certain OCR user arguments that paperless itself uses [@stumpylog](https://github.com/stumpylog) ([#14734](https://github.com/paperless-ngx/paperless-ngx/pull/14734))
- Fix: remove redundant ui task text filters [@shamoon](https://github.com/shamoon) ([#14736](https://github.com/paperless-ngx/paperless-ngx/pull/14736))
- Fix: fix allowed\_hosts default [@shamoon](https://github.com/shamoon) ([#14735](https://github.com/paperless-ngx/paperless-ngx/pull/14735))
- Fixhancement: add automatic clearing of sessions [@shamoon](https://github.com/shamoon) ([#14722](https://github.com/paperless-ngx/paperless-ngx/pull/14722))
- Fix: two dropdown-related UI fixes [@shamoon](https://github.com/shamoon) ([#14717](https://github.com/paperless-ngx/paperless-ngx/pull/14717))
- Fix: use filtered documents for statistics ASN max [@shamoon](https://github.com/shamoon) ([#14710](https://github.com/paperless-ngx/paperless-ngx/pull/14710))
- Fix: make config view permissions consistent [@shamoon](https://github.com/shamoon) ([#14709](https://github.com/paperless-ngx/paperless-ngx/pull/14709))
- Fix: release the LLM index read lock before streaming the chat answer [@stumpylog](https://github.com/stumpylog) ([#14674](https://github.com/paperless-ngx/paperless-ngx/pull/14674))
- Fix: retrieve once per document chat question [@stumpylog](https://github.com/stumpylog) ([#14673](https://github.com/paperless-ngx/paperless-ngx/pull/14673))
- Fixhancement: rework saved view widget queue processing to expected [@shamoon](https://github.com/shamoon) ([#14699](https://github.com/paperless-ngx/paperless-ngx/pull/14699))
- Fix: apply PDF/A conversion once for mail archives [@shamoon](https://github.com/shamoon) ([#14698](https://github.com/paperless-ngx/paperless-ngx/pull/14698))
- Fix default MFA trusted AMR setting [@shamoon](https://github.com/shamoon) ([#14693](https://github.com/paperless-ngx/paperless-ngx/pull/14693))
- Fix: check descendant tag permissions on delete [@shamoon](https://github.com/shamoon) ([#14687](https://github.com/paperless-ngx/paperless-ngx/pull/14687))
- Fix: lock rows for first-user signup [@shamoon](https://github.com/shamoon) ([#14688](https://github.com/paperless-ngx/paperless-ngx/pull/14688))
- Fix: prevent ID badge wrapping under title on mobile [@shamoon](https://github.com/shamoon) ([#14682](https://github.com/paperless-ngx/paperless-ngx/pull/14682))
### Maintenance
- Chore(deps): Bump the actions group across 1 directory with 17 updates @[dependabot[bot]](https://github.com/apps/dependabot) ([#14691](https://github.com/paperless-ngx/paperless-ngx/pull/14691))
### Dependencies
<details>
<summary>4 changes</summary>
- Chore(deps): Bump the pre-commit-dependencies group with 4 updates @[dependabot[bot]](https://github.com/apps/dependabot) ([#14636](https://github.com/paperless-ngx/paperless-ngx/pull/14636))
- Chore(deps): Bump the actions group across 1 directory with 17 updates @[dependabot[bot]](https://github.com/apps/dependabot) ([#14691](https://github.com/paperless-ngx/paperless-ngx/pull/14691))
- docker(deps): bump astral-sh/uv from 0.13.5-python3.14-trixie-slim to 0.13.7-python3.14-trixie-slim @[dependabot[bot]](https://github.com/apps/dependabot) ([#14635](https://github.com/paperless-ngx/paperless-ngx/pull/14635))
- chore(deps): bump django-allauth to 65.21.1 [@stumpylog](https://github.com/stumpylog) ([#14672](https://github.com/paperless-ngx/paperless-ngx/pull/14672))
</details>
### All App Changes
<details>
<summary>32 changes</summary>
- Chorehancement: move all bulk operations to async hand-off [@shamoon](https://github.com/shamoon) ([#14773](https://github.com/paperless-ngx/paperless-ngx/pull/14773))
- Fix: use a constant password mask and consolidate the no-change check [@stumpylog](https://github.com/stumpylog) ([#14784](https://github.com/paperless-ngx/paperless-ngx/pull/14784))
- Fix: use a PostgreSQL-compatible regex for scheduled workflow filename filters [@stumpylog](https://github.com/stumpylog) ([#14783](https://github.com/paperless-ngx/paperless-ngx/pull/14783))
- Fix: get users for saved view create dialog [@shamoon](https://github.com/shamoon) ([#14769](https://github.com/paperless-ngx/paperless-ngx/pull/14769))
- Enhancement: render document notes as markdown [@zwif](https://github.com/zwif) ([#14626](https://github.com/paperless-ngx/paperless-ngx/pull/14626))
- Feature: manual workflow trigger [@shamoon](https://github.com/shamoon) ([#14704](https://github.com/paperless-ngx/paperless-ngx/pull/14704))
- Fix: Allow AI chat filters over more than 32700 documents [@stumpylog](https://github.com/stumpylog) ([#14754](https://github.com/paperless-ngx/paperless-ngx/pull/14754))
- Fix: Enforce CRLF when writing an email message to the file [@stumpylog](https://github.com/stumpylog) ([#14745](https://github.com/paperless-ngx/paperless-ngx/pull/14745))
- Enhancement: make bulk metadata operations run async [@shamoon](https://github.com/shamoon) ([#14711](https://github.com/paperless-ngx/paperless-ngx/pull/14711))
- Performance: load a cached Hugging Face embedding model without contacting the Hub [@stumpylog](https://github.com/stumpylog) ([#14728](https://github.com/paperless-ngx/paperless-ngx/pull/14728))
- Fix: restore image without archive version thumbnail generation [@shamoon](https://github.com/shamoon) ([#14741](https://github.com/paperless-ngx/paperless-ngx/pull/14741))
- Fix: Blacklist certain OCR user arguments that paperless itself uses [@stumpylog](https://github.com/stumpylog) ([#14734](https://github.com/paperless-ngx/paperless-ngx/pull/14734))
- Fix: remove redundant ui task text filters [@shamoon](https://github.com/shamoon) ([#14736](https://github.com/paperless-ngx/paperless-ngx/pull/14736))
- Fix: fix allowed\_hosts default [@shamoon](https://github.com/shamoon) ([#14735](https://github.com/paperless-ngx/paperless-ngx/pull/14735))
- Fixhancement: add automatic clearing of sessions [@shamoon](https://github.com/shamoon) ([#14722](https://github.com/paperless-ngx/paperless-ngx/pull/14722))
- Tweak: chat reference tweaks [@shamoon](https://github.com/shamoon) ([#14723](https://github.com/paperless-ngx/paperless-ngx/pull/14723))
- Fix: two dropdown-related UI fixes [@shamoon](https://github.com/shamoon) ([#14717](https://github.com/paperless-ngx/paperless-ngx/pull/14717))
- Fix: use filtered documents for statistics ASN max [@shamoon](https://github.com/shamoon) ([#14710](https://github.com/paperless-ngx/paperless-ngx/pull/14710))
- Fix: make config view permissions consistent [@shamoon](https://github.com/shamoon) ([#14709](https://github.com/paperless-ngx/paperless-ngx/pull/14709))
- Performance: stop embedding every document ID in selection\_data queries [@stumpylog](https://github.com/stumpylog) ([#14597](https://github.com/paperless-ngx/paperless-ngx/pull/14597))
- Performance: replace django-treenode with adjacency-list tags [@shamoon](https://github.com/shamoon) ([#14612](https://github.com/paperless-ngx/paperless-ngx/pull/14612))
- Performance: use small vec0 chunks and larger pages for the LLM index [@stumpylog](https://github.com/stumpylog) ([#14678](https://github.com/paperless-ngx/paperless-ngx/pull/14678))
- Fix: release the LLM index read lock before streaming the chat answer [@stumpylog](https://github.com/stumpylog) ([#14674](https://github.com/paperless-ngx/paperless-ngx/pull/14674))
- Fix: retrieve once per document chat question [@stumpylog](https://github.com/stumpylog) ([#14673](https://github.com/paperless-ngx/paperless-ngx/pull/14673))
- Fixhancement: rework saved view widget queue processing to expected [@shamoon](https://github.com/shamoon) ([#14699](https://github.com/paperless-ngx/paperless-ngx/pull/14699))
- Fix: apply PDF/A conversion once for mail archives [@shamoon](https://github.com/shamoon) ([#14698](https://github.com/paperless-ngx/paperless-ngx/pull/14698))
- Fix default MFA trusted AMR setting [@shamoon](https://github.com/shamoon) ([#14693](https://github.com/paperless-ngx/paperless-ngx/pull/14693))
- Fix: check descendant tag permissions on delete [@shamoon](https://github.com/shamoon) ([#14687](https://github.com/paperless-ngx/paperless-ngx/pull/14687))
- Fix: lock rows for first-user signup [@shamoon](https://github.com/shamoon) ([#14688](https://github.com/paperless-ngx/paperless-ngx/pull/14688))
- Fix: prevent ID badge wrapping under title on mobile [@shamoon](https://github.com/shamoon) ([#14682](https://github.com/paperless-ngx/paperless-ngx/pull/14682))
- chore(deps): bump django-allauth to 65.21.1 [@stumpylog](https://github.com/stumpylog) ([#14672](https://github.com/paperless-ngx/paperless-ngx/pull/14672))
- chore(deps): bump dev tooling [@stumpylog](https://github.com/stumpylog) ([#14671](https://github.com/paperless-ngx/paperless-ngx/pull/14671))
</details>
## paperless-ngx 3.4.2
### Bug Fixes
+3 -3
View File
@@ -510,9 +510,9 @@ You can read more about this in [the Django project's documentation](https://doc
- With neither setting configured, Paperless accepts any host.
- With only `PAPERLESS_URL` set, Paperless accepts the hostname from that URL
and `localhost` (used by the Docker health check).
- `PAPERLESS_ALLOWED_HOSTS` adds hosts to `localhost` and the hostname from
`PAPERLESS_URL`, if set. A blank list adds no hosts.
and the loopback hosts `localhost`, `127.0.0.1`, and `[::1]`.
- `PAPERLESS_ALLOWED_HOSTS` adds hosts to those loopback hosts and the hostname
from `PAPERLESS_URL`, if set. A blank list adds no hosts.
- With `PAPERLESS_ALLOWED_HOSTS=*`, Paperless accepts any host, even when
`PAPERLESS_URL` is set.
+10 -9
View File
@@ -1,6 +1,6 @@
[project]
name = "paperless-ngx"
version = "3.4.2"
version = "3.5.1"
description = """\
A community-supported supercharged document management system: scan, index and archive all your physical documents\
"""
@@ -86,9 +86,9 @@ mariadb = [
"mysqlclient>=2.2.7,<2.4",
]
postgres = [
"psycopg[c,pool]==3.3.4",
"psycopg[c,pool]==3.3.8",
# Direct dependency for proper resolution of the pre-built wheels
"psycopg-c==3.3.4",
"psycopg-c==3.3.8",
"psycopg-pool==3.3.3",
]
webserver = [
@@ -151,17 +151,18 @@ typing = [
required-version = ">=0.9.0"
prerelease = "disallow"
environments = [
"sys_platform == 'darwin'",
"sys_platform == 'linux'",
"sys_platform == 'darwin' and platform_machine == 'arm64' and platform_python_implementation == 'CPython'",
"sys_platform == 'linux' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython'",
"sys_platform == 'linux' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython'",
]
package = false
[tool.uv.sources]
# Markers are chosen to select these almost exclusively when building the Docker image
psycopg-c = [
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.12'" },
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.12'" },
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.14'" },
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.14'" },
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.12'" },
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.12'" },
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.14'" },
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.14'" },
]
torch = [
{ index = "pytorch-cpu" },
+792 -389
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "paperless-ngx-ui",
"version": "3.4.2",
"version": "3.5.1",
"scripts": {
"preinstall": "npx only-allow pnpm",
"ng": "ng",
@@ -227,6 +227,12 @@
</div>
</div>
<div class="row">
<div class="col">
<pngx-input-check i18n-title title="Show nested tags with their parents" i18n-hint hint="Child tags are shown together with their parent tags, instead of separately." formControlName="tagsShowHierarchy"></pngx-input-check>
</div>
</div>
<h5 class="mt-3" i18n>Document editing</h5>
<div class="row">
<div class="col">
@@ -305,7 +305,7 @@ describe('SettingsComponent', () => {
expect(toastErrorSpy).toHaveBeenCalled()
expect(storeSpy).toHaveBeenCalled()
expect(appearanceSettingsSpy).not.toHaveBeenCalled()
expect(setSpy).toHaveBeenCalledTimes(33)
expect(setSpy).toHaveBeenCalledTimes(34)
expect(setSpy).toHaveBeenCalledWith(SETTINGS_KEYS.SIDEBAR_HIDDEN_ITEMS, [
HideableSidebarItemID.Workflows,
])
@@ -163,6 +163,7 @@ export class SettingsComponent
bulkEditConfirmationDialogs: new FormControl(null),
bulkEditApplyOnClose: new FormControl(null),
documentListItemPerPage: new FormControl(null),
tagsShowHierarchy: new FormControl(null),
slimSidebarEnabled: new FormControl(null),
sidebarHiddenItems: new FormControl<HideableSidebarItemID[]>([]),
darkModeUseSystem: new FormControl(null),
@@ -342,6 +343,7 @@ export class SettingsComponent
bulkEditApplyOnClose: this.settings.get(
SETTINGS_KEYS.BULK_EDIT_APPLY_ON_CLOSE
),
tagsShowHierarchy: this.settings.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY),
documentListItemPerPage: this.settings.get(
SETTINGS_KEYS.DOCUMENT_LIST_SIZE
),
@@ -607,6 +609,10 @@ export class SettingsComponent
SETTINGS_KEYS.DEFAULT_PERMS_EDIT_GROUPS,
this.settingsForm.value.defaultPermsEditGroups
)
this.settings.set(
SETTINGS_KEYS.TAGS_SHOW_HIERARCHY,
this.settingsForm.value.tagsShowHierarchy
)
this.settings.set(
SETTINGS_KEYS.DOCUMENT_EDITING_REMOVE_INBOX_TAGS,
this.settingsForm.value.documentEditingRemoveInboxTags
@@ -361,8 +361,9 @@
</a>
</li>
}
<li class="nav-item mt-2 position-relative" [class.d-none]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation) && !settingsService.organizingSidebarItems()" tourAnchor="tour.outro">
<a class="text-muted small d-flex align-items-center flex-wrap text-decoration-none nav-anchor" [class.opacity-50]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation)" [class.pe-5]="settingsService.organizingSidebarItems() && !slimSidebarEnabled && !slimSidebarAnimating()"
<li class="nav-item mt-2 position-relative" [class.d-none]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation) && !settingsService.organizingSidebarItems()"
[class.d-md-block]="slimSidebarEnabled && settingsService.unseenReleasesSince()" tourAnchor="tour.outro">
<a class="text-muted small d-flex align-items-center flex-wrap text-decoration-none nav-anchor" [class.d-md-none]="slimSidebarEnabled && settingsService.unseenReleasesSince()" [class.opacity-50]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation)" [class.pe-5]="settingsService.organizingSidebarItems() && !slimSidebarEnabled && !slimSidebarAnimating()"
target="_blank" rel="noopener noreferrer" href="https://docs.paperless-ngx.com" ngbPopover="Documentation"
i18n-ngbPopover [disablePopover]="!slimSidebarPopoversEnabled" placement="end" container="body"
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
@@ -371,23 +372,35 @@
@if (settingsService.organizingSidebarItems()) {
<pngx-input-switch class="position-absolute top-50 end-0 translate-middle-y me-1" [class.d-none]="slimSidebarEnabled || slimSidebarAnimating()" [compact]="true" title="Documentation" i18n-title [ngModel]="!settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation)" (ngModelChange)="toggleSidebarItem(HideableSidebarItemID.Documentation, $event)"></pngx-input-switch>
}
@if (slimSidebarEnabled && settingsService.unseenReleasesSince()) {
<button type="button" class="btn btn-link border-0 w-100 text-muted small d-none d-md-flex align-items-center nav-anchor position-relative" (click)="showReleaseNotes()"
aria-label="See what's new in this version" i18n-aria-label
ngbPopover="What's new" i18n-ngbPopover placement="end" container="body"
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
<pngx-bs-icon class="d-flex" name="info-circle"></pngx-bs-icon>
<div class="position-absolute top-0 start-50 ms-1 p-1 bg-success rounded-circle"></div>
</button>
}
</li>
<li class="nav-item" [class.visually-hidden]="slimSidebarEnabled">
<div class="text-muted small d-flex align-items-center flex-wrap nav-label">
<div class="me-2">
<a class="text-muted text-decoration-none" target="_blank" rel="noopener noreferrer"
href="https://github.com/paperless-ngx/paperless-ngx" ngbPopover="GitHub" i18n-ngbPopover
[disablePopover]="!slimSidebarPopoversEnabled" placement="end" container="body"
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
<button type="button" class="bg-transparent border-0 p-0 text-muted" (click)="showReleaseNotes()" title="See what's new in this version" i18n-title>
{{ versionString }}
</a>
</button>
@if (settingsService.unseenReleasesSince()) {
<div class="btn-group ms-2 align-baseline">
<button type="button" class="btn btn-whats-new rounded-start-pill smaller py-1 px-2 fw-bold lh-sm" (click)="showReleaseNotes()"
title="See what's new in this version" i18n-title i18n>New</button>
<button type="button" class="btn btn-whats-new rounded-end-pill smaller py-1 px-1 lh-sm d-flex align-items-center" (click)="dismissReleaseNotes()"
title="Dismiss" i18n-title aria-label="Dismiss" i18n-aria-label>
<pngx-bs-icon name="x" class="d-flex" width="1em" height="1em"></pngx-bs-icon>
</button>
</div>
}
</div>
@if (!settingsService.updateCheckingIsSet || appRemoteVersion()) {
<div class="version-check d-flex align-items-center">
<ng-template #updateAvailablePopContent>
<span class="small">Paperless-ngx {{ appRemoteVersion().version }} <ng-container i18n>is
available.</ng-container><br /><ng-container i18n>Click to view.</ng-container></span>
</ng-template>
<ng-template #updateCheckingNotEnabledPopContent>
<p class="small mb-2">
<ng-container i18n>Paperless-ngx can automatically check for updates</ng-container>
@@ -404,15 +417,13 @@
</ng-template>
@if (settingsService.updateCheckingIsSet) {
@if (appRemoteVersion().update_available) {
<a class="small text-decoration-none" target="_blank" rel="noopener noreferrer"
href="https://github.com/paperless-ngx/paperless-ngx/releases"
[ngbPopover]="updateAvailablePopContent" popoverClass="shadow" triggers="mouseenter:mouseleave"
container="body">
<button type="button" class="bg-transparent border-0 p-0 small text-primary" (click)="showAvailableReleaseNotes()"
title="Paperless-ngx {{ appRemoteVersion().version }} is available" i18n-title>
<pngx-bs-icon width="1.2em" height="1.2em" name="info-circle" class="me-1"></pngx-bs-icon>
@if (appRemoteVersion()?.update_available) {
<ng-container i18n>Update available</ng-container>
}
</a>
</button>
}
} @else {
<a *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.UISettings }" class="small text-decoration-none" routerLink="/settings" fragment="update-checking" aria-label="Configure update checking" i18n-aria-label
@@ -700,3 +700,15 @@ main {
.smaller {
font-size: 0.75rem;
}
// From active / hover of sidebar nav links
.btn-whats-new {
--bs-btn-color: var(--bs-primary);
--bs-btn-bg: color-mix(in srgb, var(--bs-primary) 13%, transparent);
--bs-btn-border-width: 0;
--bs-btn-font-weight: 600;
--bs-btn-hover-color: var(--bs-primary);
--bs-btn-hover-bg: color-mix(in srgb, var(--bs-primary) 20%, transparent);
--bs-btn-active-color: var(--bs-primary);
--bs-btn-active-bg: color-mix(in srgb, var(--bs-primary) 20%, transparent);
}
@@ -42,6 +42,7 @@ import { environment } from 'src/environments/environment'
import { ProfileEditDialogComponent } from '../common/profile-edit-dialog/profile-edit-dialog.component'
import { UploadStatusTrayComponent } from '../common/upload-status-tray/upload-status-tray.component'
import { DocumentDetailComponent } from '../document-detail/document-detail.component'
import { ReleaseNotesDialogComponent } from '../common/release-notes-dialog/release-notes-dialog.component'
import { AppFrameComponent } from './app-frame.component'
import { GlobalSearchComponent } from './global-search/global-search.component'
@@ -695,6 +696,131 @@ describe('AppFrameComponent', () => {
expect(maybeRefreshSpy).toHaveBeenCalled()
})
it('should show new release pill and mark releases seen on click', () => {
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
fixture.detectChanges()
const pill = fixture.debugElement
.queryAll(By.css('button'))
.find((b) => b.nativeElement.textContent.trim() === 'New')
expect(pill).toBeTruthy()
pill.nativeElement.click()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}ui_settings/`
)
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
'3.5.1'
)
req.flush({ success: true })
fixture.detectChanges()
expect(
fixture.debugElement
.queryAll(By.css('button'))
.find((b) => b.nativeElement.textContent.trim() === 'New')
).toBeUndefined()
})
it('should dismiss new release pill without opening release notes', () => {
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
fixture.detectChanges()
const modalSpy = jest.spyOn(modalService, 'open')
fixture.debugElement
.query(By.css('button[aria-label="Dismiss"]'))
.nativeElement.click()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}ui_settings/`
)
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
'3.5.1'
)
req.flush({ success: true })
fixture.detectChanges()
expect(modalSpy).not.toHaveBeenCalled()
expect(
fixture.debugElement.query(By.css('button[aria-label="Dismiss"]'))
).toBeNull()
})
it('should open current release notes from the version without marking seen', () => {
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.5.1')
fixture.detectChanges()
const modalSpy = jest.spyOn(modalService, 'open')
const versionButton = fixture.debugElement
.queryAll(By.css('button'))
.find((b) => b.nativeElement.textContent.includes('3.5.1'))
versionButton.nativeElement.click()
expect(modalSpy).toHaveBeenCalledWith(
ReleaseNotesDialogComponent,
expect.anything()
)
httpTestingController.expectNone(`${environment.apiBaseUrl}ui_settings/`)
})
it('should open available release notes from update available', () => {
jest
.spyOn(remoteVersionService, 'checkForUpdates')
.mockReturnValue(of({ version: '3.6.0', update_available: true }))
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
settingsService.set(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED, true)
component.ngOnInit()
fixture.detectChanges()
const modalSpy = jest.spyOn(modalService, 'open')
const saveSpy = jest.spyOn(settingsService, 'markReleasesSeen')
const updateButton = fixture.debugElement
.queryAll(By.css('button'))
.find((b) => b.nativeElement.textContent.includes('Update available'))
expect(updateButton.nativeElement.title).toEqual(
'Paperless-ngx 3.6.0 is available'
)
updateButton.nativeElement.click()
const dialog = modalSpy.mock.results[0].value
.componentInstance as ReleaseNotesDialogComponent
expect(dialog.since()).toEqual('3.5.1')
expect(dialog.until()).toEqual('3.6.0')
expect(saveSpy).not.toHaveBeenCalled()
})
it('should save update checking chosen in the release notes dialog', () => {
const setUpdateCheckingSpy = jest
.spyOn(component, 'setUpdateChecking')
.mockImplementation(() => {})
const modalSpy = jest.spyOn(modalService, 'open')
component.showReleaseNotes()
const dialog = modalSpy.mock.results[0].value
.componentInstance as ReleaseNotesDialogComponent
dialog.updateCheckingChosen.emit(true)
expect(setUpdateCheckingSpy).toHaveBeenCalledWith(true)
})
it('should show new release dot instead of documentation in slim sidebar', () => {
settingsService.set(SETTINGS_KEYS.SLIM_SIDEBAR, true)
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
fixture.detectChanges()
const whatsNew = fixture.debugElement.query(
By.css('button[aria-label="See what\'s new in this version"]')
).nativeElement
const docs = fixture.debugElement.query(
By.css('a[href="https://docs.paperless-ngx.com"].nav-anchor')
).nativeElement
expect(docs.classList).toContain('d-md-none')
// both share one li so the tour anchor points at whichever is shown
expect(whatsNew.closest('li')).toBe(docs.closest('li'))
})
it('should show tasks badge for needs-attention tasks', () => {
jest
.spyOn(tasksService, 'needsAttentionTasksCount', 'get')
@@ -68,6 +68,7 @@ import { SwitchComponent } from '../common/input/switch/switch.component'
import { BrandMarkComponent } from '../common/logo/brand-mark/brand-mark.component'
import { LogoComponent } from '../common/logo/logo.component'
import { ProfileEditDialogComponent } from '../common/profile-edit-dialog/profile-edit-dialog.component'
import { ReleaseNotesDialogComponent } from '../common/release-notes-dialog/release-notes-dialog.component'
import { UploadStatusTrayComponent } from '../common/upload-status-tray/upload-status-tray.component'
import { DocumentDetailComponent } from '../document-detail/document-detail.component'
import { ComponentWithPermissions } from '../with-permissions/with-permissions.component'
@@ -186,7 +187,9 @@ export class AppFrameComponent
)
.subscribe((result) => {
this.documentList.reload(null, false)
this.documentList.reduceSelectionToFilter()
if (!this.documentList.allSelected) {
this.documentList.reduceSelectionToFilter()
}
// maybe someday we can optimize to only refresh affected documents
this.openDocumentsService.getOpenDocuments().forEach((doc) => {
this.openDocumentsService.refreshDocument(doc.id)
@@ -549,6 +552,44 @@ export class AppFrameComponent
})
}
private openReleaseNotes(
since: string | null,
until: string | null = null
): void {
const modal = this.modalService.open(ReleaseNotesDialogComponent, {
size: 'lg',
scrollable: true,
})
modal.componentInstance.load(since, until)
modal.componentInstance.updateCheckingChosen.subscribe((enable: boolean) =>
this.setUpdateChecking(enable)
)
}
showReleaseNotes() {
const since = this.settingsService.unseenReleasesSince()
this.openReleaseNotes(since)
if (since) {
this.dismissReleaseNotes()
}
}
/** Mark the running version's release notes seen, hiding "New" */
dismissReleaseNotes() {
this.settingsService
.markReleasesSeen()
.pipe(first())
.subscribe({ error: () => {} })
}
/** Notes for releases newer than the running version, not yet installed */
showAvailableReleaseNotes() {
this.openReleaseNotes(
this.settingsService.get(SETTINGS_KEYS.VERSION),
this.appRemoteVersion()?.version
)
}
setUpdateChecking(enable: boolean) {
this.settingsService.set(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED, enable)
this.settingsService
@@ -188,6 +188,62 @@ describe('ChatComponent', () => {
expect(component.loading()).toBe(false)
})
it('should reveal a complete answer within one second', () => {
component.input.set('Hello')
component.sendMessage()
const answer = 'A'.repeat(660)
mockStream$.next(answer)
mockStream$.complete()
expect(component.messages()[1].content.length).toBeGreaterThan(0)
expect(component.messages()[1].content.length).toBeLessThan(answer.length)
expect(component.loading()).toBe(true)
jest.advanceTimersByTime(800)
expect(component.messages()[1].content).toBe(answer)
expect(component.loading()).toBe(false)
})
it('should give a long answer more time to reveal', () => {
component.input.set('Hello')
component.sendMessage()
const answer = 'A'.repeat(3000)
mockStream$.next(answer)
mockStream$.complete()
jest.advanceTimersByTime(800)
expect(component.messages()[1].content.length).toBeLessThan(answer.length)
expect(component.loading()).toBe(true)
jest.advanceTimersByTime(2500)
expect(component.messages()[1].content).toBe(answer)
expect(component.loading()).toBe(false)
})
it('should reveal fast incoming chunks without making them pop in', () => {
component.input.set('Hello')
component.sendMessage()
let answer = ''
for (let i = 0; i < 20; i++) {
answer += 'A'.repeat(100)
const visibleBefore = component.messages()[1].content.length
mockStream$.next(answer)
jest.advanceTimersByTime(10)
expect(
component.messages()[1].content.length - visibleBefore
).toBeLessThan(100)
}
expect(component.messages()[1].content.length).toBeLessThan(answer.length)
mockStream$.complete()
jest.advanceTimersByTime(5200)
expect(component.messages()[1].content).toBe(answer)
expect(component.loading()).toBe(false)
})
it('should show a slow response message while waiting', () => {
component.input.set('Hello')
component.sendMessage()
@@ -21,6 +21,9 @@ import {
import { pngxPopperOptions } from 'src/app/utils/popper-options'
const SLOW_RESPONSE_DELAY_MS = 8000
const TYPEWRITER_MIN_DURATION_MS = 750
const TYPEWRITER_MAX_DURATION_MS = 3000
const TYPEWRITER_INTERVAL_MS = 16
@Component({
selector: 'pngx-chat',
@@ -73,6 +76,7 @@ export class ChatComponent implements OnInit {
private typewriterBuffer: string[] = []
private typewriterActive = false
private typewriterTimeout: ReturnType<typeof setTimeout>
private typewriterDeadline = 0
private streamSubscription: Subscription
private streamingMessage: ChatMessage
private streamFinished = false
@@ -134,7 +138,7 @@ export class ChatComponent implements OnInit {
if (nextResponse.content.length < lastVisibleContent.length) {
this.resetTypewriter(assistantMessage, nextResponse.content)
lastVisibleContent = nextResponse.content
} else {
} else if (nextResponse.content.length > lastVisibleContent.length) {
const visibleDelta = nextResponse.content.substring(
lastVisibleContent.length
)
@@ -214,6 +218,12 @@ export class ChatComponent implements OnInit {
if (!chunk) return
this.typewriterBuffer.push(...chunk.split(''))
// Longer bursts need more time to remain readable as the chat scrolls.
const revealDuration = Math.min(
TYPEWRITER_MAX_DURATION_MS,
Math.max(TYPEWRITER_MIN_DURATION_MS, this.typewriterBuffer.length)
)
this.typewriterDeadline = Date.now() + revealDuration
if (!this.typewriterActive) {
this.typewriterActive = true
@@ -222,19 +232,29 @@ export class ChatComponent implements OnInit {
}
playTypewriter(message: ChatMessage): void {
if (this.typewriterBuffer.length === 0) {
this.typewriterActive = false
if (this.streamFinished) this.finishStreaming(message)
return
}
const nextChar = this.typewriterBuffer.shift()
message.content += nextChar
// Spread the queued text across the updates left before the deadline
const remainingUpdates = Math.max(
1,
Math.ceil((this.typewriterDeadline - Date.now()) / TYPEWRITER_INTERVAL_MS)
)
const charactersToShow = Math.ceil(
this.typewriterBuffer.length / remainingUpdates
)
message.content += this.typewriterBuffer
.splice(0, charactersToShow)
.join('')
this.notifyMessagesChanged()
this.scrollToBottom()
// 10ms per character
this.typewriterTimeout = setTimeout(() => this.playTypewriter(message), 10)
if (this.typewriterBuffer.length === 0) {
this.typewriterActive = false
if (this.streamFinished) this.finishStreaming(message)
} else {
this.typewriterTimeout = setTimeout(
() => this.playTypewriter(message),
TYPEWRITER_INTERVAL_MS
)
}
}
private notifyMessagesChanged(): void {
@@ -87,6 +87,7 @@ import folderFill from 'bootstrap-icons/icons/folder-fill.svg'
import folder from 'bootstrap-icons/icons/folder.svg'
import funnel from 'bootstrap-icons/icons/funnel.svg'
import gear from 'bootstrap-icons/icons/gear.svg'
import github from 'bootstrap-icons/icons/github.svg'
import globe2 from 'bootstrap-icons/icons/globe2.svg'
import google from 'bootstrap-icons/icons/google.svg'
import grid from 'bootstrap-icons/icons/grid.svg'
@@ -249,6 +250,7 @@ export const icons: Record<string, string> = {
folderFill,
funnel,
gear,
github,
globe2,
google,
grid,
@@ -0,0 +1,90 @@
import { provideHttpClient } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { Component } from '@angular/core'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormControl, ReactiveFormsModule } from '@angular/forms'
import { NumberComponent } from './number/number.component'
import { TextComponent } from './text/text.component'
import { TextAreaComponent } from './textarea/textarea.component'
import { UrlComponent } from './url/url.component'
@Component({
imports: [
ReactiveFormsModule,
TextComponent,
NumberComponent,
TextAreaComponent,
UrlComponent,
],
template: `
<pngx-input-text [formControl]="control" />
<pngx-input-number [formControl]="control" [showAdd]="false" />
<pngx-input-textarea [formControl]="control" />
<pngx-input-url [formControl]="control" />
`,
})
class InputEventsHostComponent {
control = new FormControl<string | number | null>(null)
}
describe.each([
['text', 'pngx-input-text input', 'Edited text', 'Edited text'],
['number', 'pngx-input-number input', '42', 42],
['textarea', 'pngx-input-textarea textarea', 'Edited\ntext', 'Edited\ntext'],
['url', 'pngx-input-url input', 'https://example.com', 'https://example.com'],
])(
'%s input events',
(_type, selector: string, text: string, value: string | number) => {
let fixture: ComponentFixture<InputEventsHostComponent>
let control: FormControl<string | number | null>
let input: HTMLInputElement | HTMLTextAreaElement
beforeEach(() => {
TestBed.configureTestingModule({
imports: [InputEventsHostComponent],
providers: [provideHttpClient(), provideHttpClientTesting()],
})
fixture = TestBed.createComponent(InputEventsHostComponent)
control = fixture.componentInstance.control
})
async function render() {
fixture.detectChanges()
await fixture.whenStable()
input = fixture.nativeElement.querySelector(selector)
}
it('updates the form while typing and marks it touched only on blur', async () => {
await render()
const changed = jest.fn()
control.valueChanges.subscribe(changed)
input.value = text
input.dispatchEvent(new Event('input'))
expect(control.value).toBe(value)
expect(control.dirty).toBe(true)
expect(control.touched).toBe(false)
input.dispatchEvent(new Event('change'))
input.dispatchEvent(new Event('blur'))
expect(control.touched).toBe(true)
expect(changed).toHaveBeenCalledTimes(1)
})
it('honors an explicit updateOn blur strategy', async () => {
control = new FormControl<string | number | null>(null, {
updateOn: 'blur',
})
fixture.componentInstance.control = control
await render()
input.value = text
input.dispatchEvent(new Event('input'))
expect(control.value).toBeNull()
expect(control.pristine).toBe(true)
input.dispatchEvent(new Event('blur'))
expect(control.value).toBe(value)
expect(control.dirty).toBe(true)
expect(control.touched).toBe(true)
})
}
)
@@ -12,7 +12,7 @@
</div>
<div class="position-relative" [class.col-md-9]="horizontal">
<div class="input-group" [class.is-invalid]="error">
<input #inputField type="number" class="form-control" [step]="step" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [class.is-invalid]="error" [disabled]="disabled">
<input #inputField type="number" class="form-control" [step]="step" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [class.is-invalid]="error" [disabled]="disabled">
@if (showAdd) {
<button class="btn btn-outline-secondary" type="button" id="button-addon1" (click)="nextAsn()" [disabled]="disabled">+1</button>
}
@@ -17,16 +17,21 @@
[searchFn]="searchFn"
addTagText="Add tag"
i18n-addTagText
[keyDownFn]="onKeyDown"
(add)="onAdd($event)"
(change)="onChange(value)">
<ng-template ng-label-tmp let-item="item">
<button class="tag-wrap btn p-0 d-flex align-items-center" (click)="removeTag(item.id)" (mousedown)="$event.stopImmediatePropagation()" type="button" title="Remove tag" i18n-title>
<pngx-bs-icon name="x" style="margin-inline-end: 1px;"></pngx-bs-icon>
@if (item.id && tags) {
<pngx-tag style="background-color: none;" [tag]="getTag(item.id)"></pngx-tag>
}
</button>
@if (isImplied(item.id)) {
<span class="implied-tag"></span>
} @else {
<button class="tag-wrap btn p-0 d-flex align-items-center mw-100" (click)="removeBadge(item.id)" (mousedown)="$event.stopImmediatePropagation()" type="button" title="Remove tag" i18n-title>
<pngx-bs-icon name="x" style="margin-inline-end: 1px;"></pngx-bs-icon>
@if (item.id && tags) {
<pngx-tag class="mw-100 overflow-hidden" [tag]="getTag(item.id)" [split]="preserveHierarchy" (click)="removeTag(item.id); $event.stopPropagation()" (parentClick)="removeTag($event)"></pngx-tag>
}
</button>
}
</ng-template>
<ng-template ng-option-tmp let-item="item" let-index="index" let-search="searchTerm">
<div class="tag-option-row d-flex align-items-center" [class.w-auto]="!getTag(item.id)?.parent">
@@ -7,6 +7,21 @@
font-size: 1rem;
}
// ancestors of another selected tag render inside that tag's badge
::ng-deep .paperless-input-tags .ng-value:has(> .implied-tag) {
display: none !important;
}
// let a long (nowrap) split badge shrink to the field instead of widening it
ng-select,
::ng-deep .paperless-input-tags .ng-value-container {
min-width: 0 !important;
}
::ng-deep .paperless-input-tags .ng-value {
max-width: 100%;
}
.paperless-input-select.disabled {
.input-group {
cursor: not-allowed;
@@ -278,4 +278,59 @@ describe('TagsComponent', () => {
component.tags = [lone]
expect(component.getParentChain(5)).toEqual([])
})
describe('hierarchy', () => {
const root: Tag = { id: 1, name: 'root' }
const mid: Tag = { id: 2, name: 'mid', parent: 1 }
const leaf: Tag = { id: 3, name: 'leaf', parent: 2 }
const other: Tag = { id: 4, name: 'other' }
beforeEach(() => {
component.tags = [root, mid, leaf, other]
component.value = [3, 2, 1, 4]
})
it('should treat ancestors of another selected tag as implied', () => {
expect([1, 2, 3, 4].map((id) => component.isImplied(id))).toEqual([
true,
true,
false,
false,
])
component.preserveHierarchy = false
expect(component.isImplied(1)).toBe(false)
})
it('should remove a whole badge, keeping ancestors other tags still need', () => {
component.removeBadge(3)
expect(component.value).toEqual([4])
const sibling: Tag = { id: 5, name: 'sibling', parent: 1 }
component.tags = [root, mid, leaf, other, sibling]
component.value = [3, 2, 1, 5, 4]
component.removeBadge(3)
expect(component.value).toEqual([1, 5, 4])
})
it('should remove only the tag itself from a badge when hierarchy is not shown', () => {
component.preserveHierarchy = false
component.removeBadge(3)
expect(component.value).toEqual([2, 1, 4])
})
it('should remove the last visible tag on backspace, not a hidden ancestor', () => {
const backspace = new KeyboardEvent('keydown', { key: 'Backspace' })
expect(component.onKeyDown(backspace)).toBe(false)
expect(component.value).toEqual([3, 2, 1])
expect(component.onKeyDown(backspace)).toBe(false)
expect(component.value).toEqual([2, 1])
// nothing hidden: leave it to ng-select
component.value = [4]
expect(component.onKeyDown(backspace)).toBe(true)
expect(
component.onKeyDown(new KeyboardEvent('keydown', { key: 'a' }))
).toBe(true)
})
})
})
@@ -21,7 +21,13 @@ import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select'
import { first, firstValueFrom, tap } from 'rxjs'
import { BootstrapIconComponent } from 'src/app/components/common/bootstrap-icon/bootstrap-icon.component'
import { Tag } from 'src/app/data/tag'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { TagService } from 'src/app/services/rest/tag.service'
import { SettingsService } from 'src/app/services/settings.service'
import {
collapseImpliedAncestors,
getTagAncestors,
} from 'src/app/utils/collapse-tags'
import { matchesSearchText } from 'src/app/utils/text-search'
import { EditDialogMode } from '../../edit-dialog/edit-dialog.component'
import { TagEditDialogComponent } from '../../edit-dialog/tag-edit-dialog/tag-edit-dialog.component'
@@ -50,6 +56,7 @@ import { TagComponent } from '../../tag/tag.component'
export class TagsComponent implements OnInit, ControlValueAccessor {
private tagService = inject(TagService)
private modalService = inject(NgbModal)
private readonly settingsService = inject(SettingsService)
private readonly changeDetector = inject(ChangeDetectorRef)
constructor() {
@@ -131,6 +138,33 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
term
)
/**
* Selected tags that are ancestors of another selected tag which are shown
* as segments of their descendant's badge.
*/
isImplied(id: number): boolean {
if (!this.showsHierarchy || !this.tags || !this.value) return false
return !collapseImpliedAncestors(this.value, this.tagsById).includes(id)
}
private get showsHierarchy(): boolean {
return (
this.preserveHierarchy &&
!!this.settingsService.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY)
)
}
/**
* Remove the last visible tag (in case its actually a hidden ancestor)
*/
readonly onKeyDown = (event: KeyboardEvent): boolean => {
if (event.key !== 'Backspace' || this.select?.searchTerm) return true
const visible = this.value?.filter((id) => !this.isImplied(id)) ?? []
if (visible.length === (this.value?.length ?? 0)) return true
this.removeTag(visible.at(-1))
return false
}
getTag(id: number) {
if (this.tags) {
return this.tags.find((tag) => tag.id == id)
@@ -139,6 +173,26 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
}
}
/**
* Remove a whole badge i.e. the tag plus any ancestors that no other selected
* tag still needs.
*/
removeBadge(tagID: number) {
if (this.disabled) return
if (!this.showsHierarchy) return this.removeTag(tagID)
const ancestors = new Set(this.getParentChain(tagID).map((t) => t.id))
const needed = new Set(
this.value
.filter((id) => id !== tagID && !ancestors.has(id))
.flatMap((id) => this.getParentChain(id).map((t) => t.id))
)
this.value = this.value.filter(
(id) => id !== tagID && (!ancestors.has(id) || needed.has(id))
)
this.onChange(this.value)
}
removeTag(tagID: number) {
if (this.disabled) return
@@ -235,18 +289,17 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
}
getParentChain(id: number): Tag[] {
// Returns ancestors from root → immediate parent for a tag id
const chain: Tag[] = []
let current = this.getTag(id)
const guard = new Set<number>()
while (current?.parent) {
if (guard.has(current.parent)) break
guard.add(current.parent)
const parent = this.getTag(current.parent)
if (!parent) break
chain.unshift(parent)
current = parent
return getTagAncestors(id, this.tagsById)
}
private tagsByIdSource: Tag[]
private tagsByIdCache: Map<number, Tag>
private get tagsById(): Map<number, Tag> {
if (this.tagsByIdSource !== this.tags) {
this.tagsByIdSource = this.tags
this.tagsByIdCache = new Map(this.tags?.map((t) => [t.id, t]))
}
return chain
return this.tagsByIdCache
}
}
@@ -11,7 +11,7 @@
}
</div>
<div class="position-relative" [class.col-md-9]="horizontal">
<input #inputField type="text" class="form-control" [class.is-invalid]="error" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [disabled]="disabled" [autocomplete]="autocomplete" [placeholder]="placeholder">
<input #inputField type="text" class="form-control" [class.is-invalid]="error" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [disabled]="disabled" [autocomplete]="autocomplete" [placeholder]="placeholder">
@if (hint) {
<small class="form-text text-muted" [innerHTML]="hint"></small>
}
@@ -18,7 +18,8 @@
[class.font-monospace]="monospace"
[(ngModel)]="value"
[ngModelOptions]="{standalone: true}"
(change)="onChange(value)"
(ngModelChange)="onChange($event)"
(blur)="onTouched()"
[disabled]="disabled"
[placeholder]="placeholder"
rows="4">
@@ -10,7 +10,7 @@
</div>
<div [class.col-md-9]="horizontal">
<div class="input-group" [class.is-invalid]="error">
<input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [disabled]="disabled">
<input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [disabled]="disabled">
<a class="btn btn-outline-secondary rounded-end" title="Open link" i18n-title [href]="value" target="_blank">
<pngx-bs-icon width="1.2em" height="1.2em" name="box-arrow-up-right"></pngx-bs-icon>
</a>
@@ -0,0 +1,92 @@
<div class="modal-header">
<div>
@if (until()) {
<h4 class="modal-title" i18n>Paperless-ngx {{ until() }} is available</h4>
<p class="text-muted small mb-0" i18n>You are running {{ version }}</p>
} @else {
<h4 class="modal-title" i18n>What's new in Paperless-ngx</h4>
@if (since()) {
<p class="text-muted small mb-0" i18n>Updated from {{ since() }} to {{ version }}</p>
}
}
</div>
<div class="d-flex align-items-center gap-3 ms-auto">
<div class="btn-group btn-group-sm" role="group">
<a tabindex="-1" class="btn btn-dark border-dark-subtle d-flex align-items-center" [href]="repoUrl" target="_blank" rel="noopener noreferrer"
title="Star Paperless-ngx on GitHub" i18n-title>
<pngx-bs-icon name="github" class="me-1 d-flex" width="12" height="12"></pngx-bs-icon><span class="small" i18n>Star</span>
</a>
@if (stars() !== null) {
<a tabindex="-1" class="btn btn-dark border-dark-subtle d-flex align-items-center" [href]="repoUrl + '/stargazers'" target="_blank" rel="noopener noreferrer"
title="Stargazers" i18n-title>
<span class="small">{{ stars() | number }}</span>
</a>
}
</div>
<button type="button" class="btn-close m-0" aria-label="Close" i18n-aria-label (click)="close()"></button>
</div>
</div>
<div class="modal-body">
@if (!updateCheckingEnabled()) {
@if (!updateCheckingIsSet() && canChangeUpdateChecking) {
<p class="mb-2" i18n>Paperless-ngx can automatically check for updates and show release notes here, fetched from GitHub.</p>
<div class="btn-group btn-group-sm">
<button type="button" class="btn btn-outline-primary" (click)="setUpdateChecking(true)" i18n>Enable</button>
<button type="button" class="btn btn-outline-secondary" (click)="setUpdateChecking(false)" i18n>Disable</button>
</div>
} @else {
<p class="mb-0" i18n>Release notes are fetched from GitHub when update checking is enabled.</p>
<ng-container *ngTemplateOutlet="githubLink"></ng-container>
}
} @else if (loading()) {
<div class="d-flex align-items-center gap-2 text-muted">
<output class="spinner-border spinner-border-sm"></output>
<ng-container i18n>Loading release notes...</ng-container>
</div>
} @else if (!releases()?.length) {
<p class="mb-0" i18n>Release notes could not be loaded.</p>
<ng-container *ngTemplateOutlet="githubLink"></ng-container>
} @else {
@for (release of releases(); track release.version) {
<section class="release-notes" [class.border-top]="!$first" [class.pt-3]="!$first" [class.mt-3]="!$first">
<div class="d-flex align-items-baseline gap-2 mb-2">
<h5 class="mb-0">{{ release.version }}</h5>
<a class="d-flex flex-row align-items-center text-secondary btn-link" [href]="release.html_url" target="_blank" rel="noopener noreferrer"
title="View on GitHub" i18n-title>
@if (release.published_at) {
<span class="text-muted small me-2">{{ release.published_at | customDate }}</span>
}
<pngx-bs-icon name="box-arrow-up-right" class="mt-n1" width=".7rem"></pngx-bs-icon>
</a>
</div>
<div class="release-notes-body" [innerHTML]="release.body_html"></div>
</section>
}
}
</div>
<div class="modal-footer justify-content-between">
<div class="d-flex flex-wrap gap-3 small">
<a class="link-secondary text-decoration-none d-flex align-items-center" [href]="releasesUrl" target="_blank" rel="noopener noreferrer">
<pngx-bs-icon name="clock-history" class="me-1"></pngx-bs-icon><ng-container i18n>All releases</ng-container>
</a>
<a class="link-secondary text-decoration-none d-flex align-items-center" [href]="discussionsUrl" target="_blank" rel="noopener noreferrer">
<pngx-bs-icon name="chat-left-text" class="me-1"></pngx-bs-icon><ng-container i18n>Need support? Ask in Discussions</ng-container>
</a>
</div>
<div class="d-flex gap-3">
<button type="button" class="btn btn-outline-secondary" (click)="close()" i18n>Close</button>
@if (until()) {
<a class="btn btn-primary d-flex align-items-center" [href]="updatingDocsUrl" target="_blank" rel="noopener noreferrer">
<ng-container i18n>How to update</ng-container>
<pngx-bs-icon name="box-arrow-up-right" class="ms-2" width=".8rem"></pngx-bs-icon>
</a>
}
</div>
</div>
<ng-template #githubLink>
<a class="small" [href]="releaseUrl" target="_blank" rel="noopener noreferrer">
<ng-container i18n>View on GitHub</ng-container>
<pngx-bs-icon name="box-arrow-up-right" class="ms-1"></pngx-bs-icon>
</a>
</ng-template>
@@ -0,0 +1,77 @@
// Styles for GitHub-rendered release notes (body_html)
:host ::ng-deep .release-notes-body {
// Repeats the version heading
> h2:first-child {
display: none;
}
// Section labels e.g. "Bug Fixes"
> h3 {
color: var(--bs-secondary-color);
font-size: 0.875rem;
font-weight: 600;
margin-top: 1rem;
margin-bottom: 0.375rem;
}
ul {
padding-left: 1.25rem;
margin-bottom: 0.75rem;
}
li {
margin-bottom: 0.25rem;
&::marker {
color: var(--bs-secondary-color);
}
}
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
a.user-mention {
color: var(--bs-secondary-color);
}
details {
margin-bottom: 0.75rem;
> summary {
color: var(--bs-secondary-color);
font-size: 0.875rem;
cursor: pointer;
margin-bottom: 0.375rem;
}
}
// Keep the link underline off code, where it hides underscores
// e.g. PAPERLESS_ALLOWED_HOSTS
a code {
display: inline-block;
}
// GitHub alerts, e.g. > [!NOTE]
.markdown-alert {
background-color: color-mix(in srgb, var(--bs-primary) 8%, transparent);
border-left: 0.25rem solid var(--bs-primary);
border-radius: var(--bs-border-radius);
padding: 0.75rem 1rem;
margin-bottom: 1rem;
> :last-child {
margin-bottom: 0;
}
}
.markdown-alert-title {
color: var(--bs-primary);
font-weight: 600;
margin-bottom: 0.25rem;
}
}
@@ -0,0 +1,210 @@
import { DatePipe } from '@angular/common'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
import {
HttpTestingController,
provideHttpClientTesting,
} from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { PermissionsService } from 'src/app/services/permissions.service'
import { SettingsService } from 'src/app/services/settings.service'
import { environment } from 'src/environments/environment'
import {
prepareReleaseHtml,
ReleaseNotesDialogComponent,
} from './release-notes-dialog.component'
describe('ReleaseNotesDialogComponent', () => {
let component: ReleaseNotesDialogComponent
let fixture: ComponentFixture<ReleaseNotesDialogComponent>
let httpTestingController: HttpTestingController
let settingsService: SettingsService
function create(updateCheckingEnabled?: boolean, canChangeSettings = true) {
settingsService = TestBed.inject(SettingsService)
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
if (updateCheckingEnabled !== undefined) {
settingsService.set(
SETTINGS_KEYS.UPDATE_CHECKING_ENABLED,
updateCheckingEnabled
)
}
jest
.spyOn(TestBed.inject(PermissionsService), 'currentUserCan')
.mockReturnValue(canChangeSettings)
fixture = TestBed.createComponent(ReleaseNotesDialogComponent)
component = fixture.componentInstance
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ReleaseNotesDialogComponent],
providers: [
DatePipe,
NgbActiveModal,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
})
httpTestingController = TestBed.inject(HttpTestingController)
})
afterEach(() => {
httpTestingController.verify()
})
it('should load and render release notes since a version', () => {
create(true)
component.load('3.4.2')
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}release_notes/?since=3.4.2`
)
req.flush({
version: '3.5.1',
releases: [
{
version: '3.5.1',
name: 'Paperless-ngx v3.5.1',
body_html:
'<h2>paperless-ngx 3.5.1</h2><h3>Bug Fixes</h3><ul><li>Fix: a thing</li></ul>' +
'<h3>All App Changes</h3><details><summary>1 change</summary><ul><li>Fix: a thing</li></ul></details>',
html_url: '',
published_at: '2026-11-18T05:22:01Z',
},
],
})
fixture.detectChanges()
const text = fixture.nativeElement.textContent
expect(text).toContain('Updated from 3.4.2 to 3.5.1')
expect(text).toContain('Bug Fixes')
expect(
fixture.nativeElement.querySelector('.modal-footer a.btn-primary')
).toBeNull()
expect(
fixture.nativeElement.querySelector('.release-notes-body details summary')
.textContent
).toEqual('1 change')
})
it('should load release notes for an available update', () => {
create(true)
component.load('3.5.1', '3.6.0')
httpTestingController
.expectOne(
`${environment.apiBaseUrl}release_notes/?since=3.5.1&until=3.6.0`
)
.flush({ version: '3.5.1', releases: [] })
fixture.detectChanges()
const text = fixture.nativeElement.textContent
expect(text).toContain('Paperless-ngx 3.6.0 is available')
expect(text).toContain('You are running 3.5.1')
expect(component.releaseUrl).toEqual(
'https://github.com/paperless-ngx/paperless-ngx/releases/tag/v3.6.0'
)
expect(
fixture.nativeElement
.querySelector('.modal-footer a.btn-primary')
.getAttribute('href')
).toEqual('https://docs.paperless-ngx.com/administration/#updating')
})
it('should open release note links safely and drop svg icons', () => {
const html = prepareReleaseHtml(
'<div class="markdown-alert"><p class="markdown-alert-title"><svg><path d="M0"></path></svg>Note</p></div>' +
'<p><a href="https://github.com/paperless-ngx/paperless-ngx/pull/1" data-hovercard-type="pull_request">#1</a></p>'
)
const doc = new DOMParser().parseFromString(html, 'text/html')
expect(doc.querySelector('svg')).toBeNull()
expect(doc.querySelector('.markdown-alert-title').textContent).toEqual(
'Note'
)
const link = doc.querySelector('a')
expect(link.getAttribute('target')).toEqual('_blank')
expect(link.getAttribute('rel')).toEqual('noopener noreferrer nofollow')
expect(link.hasAttribute('data-hovercard-type')).toBe(false)
})
it('should show a message if release notes could not be loaded', () => {
create(true)
component.load(null)
httpTestingController
.expectOne(`${environment.apiBaseUrl}release_notes/`)
.flush('error', { status: 500, statusText: 'error' })
fixture.detectChanges()
expect(fixture.nativeElement.textContent).toContain(
'Release notes could not be loaded'
)
})
it('should not fetch release notes if update checking is disabled', () => {
create(false)
component.load('3.4.2')
fixture.detectChanges()
httpTestingController.expectNone(`${environment.apiBaseUrl}release_notes/`)
expect(fixture.nativeElement.textContent).toContain(
'when update checking is enabled'
)
expect(component.releaseUrl).toEqual(
'https://github.com/paperless-ngx/paperless-ngx/releases/tag/v3.5.1'
)
})
it('should offer to enable update checking if never chosen', () => {
create()
const chosen = jest.fn()
component.updateCheckingChosen.subscribe(chosen)
component.load('3.4.2')
fixture.detectChanges()
const enable = Array.from(
fixture.nativeElement.querySelectorAll('.modal-body button')
).find((b: HTMLButtonElement) => b.textContent.trim() === 'Enable') as
HTMLButtonElement | undefined
expect(enable).toBeTruthy()
httpTestingController.expectNone(`${environment.apiBaseUrl}release_notes/`)
enable.click()
expect(chosen).toHaveBeenCalledWith(true)
httpTestingController
.expectOne(`${environment.apiBaseUrl}release_notes/?since=3.4.2`)
.flush({ version: '3.5.1', releases: [] })
})
it('should show the disabled message after choosing disable', () => {
create()
const chosen = jest.fn()
component.updateCheckingChosen.subscribe(chosen)
component.load(null)
component.setUpdateChecking(false)
fixture.detectChanges()
expect(chosen).toHaveBeenCalledWith(false)
httpTestingController.expectNone(`${environment.apiBaseUrl}release_notes/`)
expect(fixture.nativeElement.textContent).toContain(
'when update checking is enabled'
)
})
it('should not offer to enable update checking without permission', () => {
create(undefined, false)
component.load(null)
fixture.detectChanges()
expect(fixture.nativeElement.textContent).not.toContain('Enable')
expect(fixture.nativeElement.textContent).toContain(
'when update checking is enabled'
)
})
it('should support close', () => {
create(false)
const closeSpy = jest.spyOn(component.activeModal, 'close')
component.close()
expect(closeSpy).toHaveBeenCalled()
})
})
@@ -0,0 +1,131 @@
import { DecimalPipe, NgTemplateOutlet } from '@angular/common'
import { Component, inject, output, signal } from '@angular/core'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { first } from 'rxjs'
import { BootstrapIconComponent } from 'src/app/components/common/bootstrap-icon/bootstrap-icon.component'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import {
PermissionAction,
PermissionsService,
PermissionType,
} from 'src/app/services/permissions.service'
import {
AppRelease,
RemoteVersionService,
} from 'src/app/services/rest/remote-version.service'
import { SettingsService } from 'src/app/services/settings.service'
const REPO_URL = 'https://github.com/paperless-ngx/paperless-ngx'
const RELEASES_URL = `${REPO_URL}/releases`
const DISCUSSIONS_URL = `${REPO_URL}/discussions/new/choose`
const UPDATING_DOCS_URL =
'https://docs.paperless-ngx.com/administration/#updating'
/**
* Tweak GitHub release HTML: open links in a new tab, add no referrer etc,
* drop inline svgs and GH `data-*` attributes. Angular sanitizes all of this anyway.
*/
export function prepareReleaseHtml(html: string): string {
const doc = new DOMParser().parseFromString(html, 'text/html')
doc.querySelectorAll('svg').forEach((svg) => svg.remove())
doc.body.querySelectorAll('*').forEach((el) => {
for (const attr of Array.from(el.attributes)) {
if (attr.name.startsWith('data-')) el.removeAttribute(attr.name)
}
})
doc.querySelectorAll('a').forEach((a) => {
a.setAttribute('target', '_blank')
a.setAttribute('rel', 'noopener noreferrer nofollow')
})
return doc.body.innerHTML
}
@Component({
selector: 'pngx-release-notes-dialog',
templateUrl: './release-notes-dialog.component.html',
styleUrls: ['./release-notes-dialog.component.scss'],
imports: [
BootstrapIconComponent,
CustomDatePipe,
NgTemplateOutlet,
DecimalPipe,
],
})
export class ReleaseNotesDialogComponent {
readonly activeModal = inject(NgbActiveModal)
private readonly remoteVersionService = inject(RemoteVersionService)
private readonly settingsService = inject(SettingsService)
private readonly permissionsService = inject(PermissionsService)
readonly since = signal<string | null>(null)
readonly until = signal<string | null>(null)
readonly releases = signal<AppRelease[] | null>(null)
readonly stars = signal<number | null>(null)
readonly loading = signal(false)
readonly version: string = this.settingsService.get(SETTINGS_KEYS.VERSION)
readonly updateCheckingEnabled = signal<boolean>(
this.settingsService.get(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED)
)
readonly updateCheckingIsSet = signal(
this.settingsService.updateCheckingIsSet
)
readonly canChangeUpdateChecking = this.permissionsService.currentUserCan(
PermissionAction.Change,
PermissionType.UISettings
)
readonly updateCheckingChosen = output<boolean>()
readonly repoUrl = REPO_URL
readonly releasesUrl = RELEASES_URL
readonly discussionsUrl = DISCUSSIONS_URL
readonly updatingDocsUrl = UPDATING_DOCS_URL
get releaseUrl(): string {
const version = this.until() ?? this.version
return version ? `${RELEASES_URL}/tag/v${version}` : RELEASES_URL
}
/**
* Load notes for releases after `since` up to `until` (default: the
* running version), or just the `until` version's notes if `since` is null.
*/
load(since: string | null, until: string | null = null): void {
this.since.set(since)
this.until.set(until)
if (!this.updateCheckingEnabled()) return
this.loading.set(true)
this.remoteVersionService
.getReleaseNotes(since ?? undefined, until ?? undefined)
.pipe(first())
.subscribe({
next: (notes) => {
this.releases.set(
notes.releases.map((release) => ({
...release,
body_html: prepareReleaseHtml(release.body_html),
}))
)
this.stars.set(notes.stars ?? null)
this.loading.set(false)
},
error: () => {
this.releases.set([])
this.loading.set(false)
},
})
}
setUpdateChecking(enable: boolean): void {
this.updateCheckingIsSet.set(true)
this.updateCheckingEnabled.set(enable)
this.updateCheckingChosen.emit(enable)
if (enable) this.load(this.since(), this.until())
}
close(): void {
this.activeModal.close()
}
}
@@ -1,13 +1,18 @@
@if (tag()) {
@if (showParents() && tag().parent) {
<pngx-tag [tagID]="tag().parent" [clickable]="clickable()" [linkTitle]="linkTitle()"></pngx-tag>
&nbsp;&gt;&nbsp;
}
@if (!clickable()) {
<span class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</span>
}
@if (clickable()) {
<a [title]="linkTitle()" class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</a>
@if (ancestorSegments.length) {
<span #pill class="split-pill d-inline-flex mw-100" [title]="path()" (mouseleave)="setFocus(pill, null)">
@for (ancestor of ancestorSegments; track ancestor.id; let first = $first) {
<span #segment class="badge split-parent" [class.rounded-end-0]="first" [class.rounded-0]="!first" [style.background]="ancestor.color" [style.color]="ancestor.text_color" (mouseenter)="setFocus(pill, segment)" (click)="onParentClick($event, ancestor.id)">{{ancestor.name}}</span>
}
<span #leaf class="badge rounded-start-0 split-child" [style.background]="tag().color" [style.color]="tag().text_color" (mouseenter)="setFocus(pill, leaf)">{{tag().name}}</span>
</span>
} @else {
@if (!clickable()) {
<span class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</span>
}
@if (clickable()) {
<a [title]="linkTitle()" class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</a>
}
}
} @else if (loading) {
<span class="placeholder-glow">
@@ -11,3 +11,46 @@ a, span {
opacity: .5;
font-style: italic;
}
.split-parent,
.split-child {
overflow: hidden;
white-space: nowrap;
transition: color .2s ease;
}
.split-parent {
min-width: 1.5em;
max-width: 10em;
padding-inline: .4em;
text-overflow: clip;
&:nth-last-child(2) { flex-shrink: 1e12; }
&:nth-last-child(3) { flex-shrink: 1e18; }
&:nth-last-child(4) { flex-shrink: 1e24; }
&:nth-last-child(5) { flex-shrink: 1e30; }
&.collapsed {
color: transparent !important;
}
}
.split-child {
flex-shrink: 1e6;
min-width: 2em;
max-width: 20em; // nowrap, so very long names would otherwise widen e.g. table columns
text-overflow: ellipsis;
}
// Hovered segment gets priority, other parents can shrink to a sliver
.split-pill {
> .split-parent.focused,
> .split-child.focused {
flex-shrink: 1;
text-overflow: ellipsis;
}
&:has(> .focused) > .split-parent:not(.focused) {
min-width: 0;
}
}
@@ -6,6 +6,7 @@ import { of } from 'rxjs'
import { Tag } from 'src/app/data/tag'
import { PermissionsService } from 'src/app/services/permissions.service'
import { TagService } from 'src/app/services/rest/tag.service'
import { SettingsService } from 'src/app/services/settings.service'
import { TagComponent } from './tag.component'
const tag: Tag = {
@@ -69,4 +70,88 @@ describe('TagComponent', () => {
expect(getCachedSpy).toHaveBeenCalledWith(1)
expect(component.tag()).toEqual(tag)
})
describe('split badge', () => {
const root: Tag = { id: 1, name: 'Root', color: '#000000' }
const mid: Tag = { id: 2, name: 'Mid', color: '#111111', parent: 1 }
const leaf: Tag = { id: 3, name: 'Leaf', color: '#222222', parent: 2 }
const segments = (): HTMLElement[] =>
fixture.debugElement
.queryAll(By.css('.split-pill > .badge'))
.map((d) => d.nativeElement)
beforeEach(() => {
jest.spyOn(permissionsService, 'currentUserCan').mockReturnValue(true)
jest.spyOn(tagService, 'getCached').mockReturnValue(of(leaf))
jest
.spyOn(tagService, 'listAll')
.mockReturnValue(
of({ count: 3, all: [1, 2, 3], results: [root, mid, leaf] })
)
fixture.componentRef.setInput('tagID', 3)
fixture.componentRef.setInput('split', true)
fixture.detectChanges()
})
it('should render ancestors as segments with the full path as title', () => {
expect(segments().map((s) => s.textContent.trim())).toEqual([
'Root',
'Mid',
'Leaf',
])
expect(
fixture.debugElement.query(By.css('.split-pill')).nativeElement.title
).toEqual('Root › Mid › Leaf')
})
it('should render a plain badge when the setting is off', () => {
jest.spyOn(TestBed.inject(SettingsService), 'get').mockReturnValue(false)
fixture.componentRef.setInput('split', false)
fixture.detectChanges()
fixture.componentRef.setInput('split', true)
fixture.detectChanges()
expect(fixture.debugElement.query(By.css('.split-pill'))).toBeNull()
expect(component.ancestorSegments).toEqual([])
})
it('should emit the ancestor id when an ancestor segment is clicked', () => {
const emitSpy = jest.spyOn(component.parentClick, 'emit')
const event = new MouseEvent('click', { bubbles: true })
const stopSpy = jest.spyOn(event, 'stopImmediatePropagation')
segments()[1].dispatchEvent(event)
expect(emitSpy).toHaveBeenCalledWith(2)
expect(stopSpy).toHaveBeenCalled()
})
it('should focus the hovered segment and animate width changes', () => {
const [rootSeg, midSeg, leafSeg] = segments()
const pill = rootSeg.parentElement
// before / after widths per segment, as measured by setFocus
const widths = new Map<HTMLElement, number[]>([
[rootSeg, [20, 4]],
[midSeg, [20, 60]],
[leafSeg, [40, 40]],
])
const animate = jest.fn()
for (const [seg, [before, after]] of widths) {
seg.getAnimations = jest.fn(() => [])
seg.animate = animate
jest
.spyOn(seg, 'getBoundingClientRect')
.mockReturnValueOnce({ width: before } as DOMRect)
.mockReturnValueOnce({ width: after } as DOMRect)
}
midSeg.dispatchEvent(new MouseEvent('mouseenter'))
expect(midSeg.classList).toContain('focused')
expect(rootSeg.classList).not.toContain('focused')
// only the segments whose width changed are animated
expect(animate).toHaveBeenCalledTimes(2)
pill.dispatchEvent(new MouseEvent('mouseleave'))
expect(segments().some((s) => s.classList.contains('focused'))).toBe(
false
)
})
})
})
@@ -1,11 +1,27 @@
import { Component, effect, inject, input, model } from '@angular/core'
import {
Component,
computed,
effect,
inject,
input,
model,
output,
signal,
} from '@angular/core'
import { Tag } from 'src/app/data/tag'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import {
PermissionAction,
PermissionsService,
PermissionType,
} from 'src/app/services/permissions.service'
import { TagService } from 'src/app/services/rest/tag.service'
import { SettingsService } from 'src/app/services/settings.service'
import { getTagAncestors } from 'src/app/utils/collapse-tags'
const FOCUS_ANIMATION_MS = 200
// matches the .split-parent min-width in tag.component.scss
const COLLAPSE_BELOW_EM = 1.5
@Component({
selector: 'pngx-tag',
@@ -13,8 +29,9 @@ import { TagService } from 'src/app/services/rest/tag.service'
styleUrls: ['./tag.component.scss'],
})
export class TagComponent {
private permissionsService = inject(PermissionsService)
private tagService = inject(TagService)
private readonly permissionsService = inject(PermissionsService)
private readonly tagService = inject(TagService)
private readonly settingsService = inject(SettingsService)
readonly tag = model<Tag>(null)
readonly tagID = input<number>(undefined)
@@ -23,27 +40,101 @@ export class TagComponent {
transform: (value: boolean | string) =>
value === '' || value === true || value === 'true',
})
readonly showParents = input(false)
readonly split = input(false)
readonly parentClick = output<number>()
private readonly ancestors = signal<Tag[]>([])
public get ancestorSegments(): Tag[] {
return this.split() &&
this.settingsService.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY)
? this.ancestors()
: []
}
public readonly path = computed(() =>
[...this.ancestors(), this.tag()]
.filter(Boolean)
.map((t) => t.name)
.join(' › ')
)
constructor() {
effect(() => {
const tagID = this.tagID()
if (tagID) {
if (
this.permissionsService.currentUserCan(
PermissionAction.View,
PermissionType.Tag
)
) {
this.tagService.getCached(tagID).subscribe((tag) => {
this.tag.set(tag)
})
}
if (tagID && this.canViewTags) {
this.tagService.getCached(tagID).subscribe((tag) => {
this.tag.set(tag)
})
}
})
// ancestors for split badges, from either tagID or a passed-in tag
effect(() => {
const id = this.tagID() || this.tag()?.id
if (!this.split() || !id || !this.canViewTags) {
this.ancestors.set([])
return
}
this.tagService.listAll().subscribe((tags) => {
this.ancestors.set(
getTagAncestors(
id,
new Map<number, Tag>(tags.results.map((t) => [t.id, t]))
)
)
})
})
}
private get canViewTags(): boolean {
return this.permissionsService.currentUserCan(
PermissionAction.View,
PermissionType.Tag
)
}
public get loading(): boolean {
return this.tagService.loading
}
/**
* Gives the hovered segment priority (.focused class, see scss)
* and animates each from old width to new
*/
setFocus(segment: HTMLElement, focused: HTMLElement | null) {
const segments = Array.from(segment.children) as HTMLElement[]
const before = segments.map((s) => s.getBoundingClientRect().width)
for (const segment of segments) {
segment.getAnimations().forEach((a) => a.cancel())
segment.classList.toggle('focused', segment === focused)
}
const after = segments.map((s) => s.getBoundingClientRect().width)
segments.forEach((segment, i) => {
const em = Number.parseFloat(getComputedStyle(segment).fontSize)
segment.classList.toggle(
'collapsed',
!!focused &&
segment.classList.contains('split-parent') &&
after[i] < COLLAPSE_BELOW_EM * em
)
if (Math.abs(after[i] - before[i]) < 0.5) return
segment.animate(
[
{ flex: `0 0 ${before[i]}px`, minWidth: 0 },
{ flex: `0 0 ${after[i]}px`, minWidth: 0 },
],
{ duration: FOCUS_ANIMATION_MS, easing: 'ease' }
)
})
}
onParentClick(event: MouseEvent, id: number) {
event.preventDefault()
event.stopImmediatePropagation()
this.parentClick.emit(id)
}
}
@@ -76,8 +76,8 @@
}
}
@case (DisplayField.TAGS) {
@for (tagID of doc.tags; track tagID) {
<pngx-tag [tagID]="tagID" class="ms-1 fs-6" (click)="clickTag(tagID, $event)" [clickable]="true" linkTitle="Filter by tag" i18n-title></pngx-tag>
@for (tagID of doc.tags | collapseTags | async; track tagID) {
<pngx-tag [tagID]="tagID" [split]="true" class="ms-1 fs-6" (click)="clickTag(tagID, $event)" (parentClick)="clickTag($event)" [clickable]="true" linkTitle="Filter by tag" i18n-title></pngx-tag>
}
}
@case (DisplayField.DOCUMENT_TYPE) {
@@ -38,6 +38,7 @@ import {
} from 'src/app/data/filter-rule-type'
import { SavedView } from 'src/app/data/saved-view'
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
@@ -75,6 +76,7 @@ import { WidgetFrameComponent } from '../widget-frame/widget-frame.component'
DocumentTypeNamePipe,
StoragePathNamePipe,
AsyncPipe,
CollapseTagsPipe,
DocumentTitlePipe,
CustomDatePipe,
NgClass,
@@ -497,7 +497,7 @@
(loadError)="onError($event)"
(afterLoadComplete)="pdfPreviewLoaded($event)">
</pngx-pdf-viewer>
<div class="preview-controls position-absolute bottom-0 start-50 translate-middle-x z-1 mb-3 d-flex gap-2 p-1 bg-body border rounded shadow">
<div class="preview-controls position-absolute bottom-0 start-50 translate-middle-x z-1 mb-5 d-flex gap-2 p-1 bg-body border rounded shadow">
@if (previewNumPages()) {
<div class="input-group input-group-sm w-auto flex-nowrap">
<input class="form-control flex-grow-0 w-auto" type="number" min="1" [max]="previewNumPages()" [ngModelOptions]="{standalone: true}" [ngModel]="previewCurrentPage()" (ngModelChange)="previewCurrentPage.set($event)" aria-label="Page" i18n-aria-label />
@@ -390,14 +390,12 @@ describe('DocumentDetailComponent', () => {
expect(component.documentForm.get('title').value).toEqual('Foo Bar')
})
it('should update title before doc change if was not updated via debounce', () => {
it('should update the title form value without waiting for debounce or blur', () => {
jest.useFakeTimers()
initNormally()
component.titleInput.value = 'Foo Bar'
component.titleInput.inputField.nativeElement.dispatchEvent(
new Event('change')
)
jest.advanceTimersByTime(1000)
const input = component.titleInput.inputField.nativeElement
input.value = 'Foo Bar'
input.dispatchEvent(new Event('input'))
expect(component.documentForm.get('title').value).toEqual('Foo Bar')
})
@@ -718,7 +718,6 @@ describe('BulkEditorComponent', () => {
'Workflow will run on the selected documents in the background.'
)
expect(toast.mock.calls.at(-1)[0].actionName).toBeUndefined()
expect(documentListViewService.selected.size).toBe(0)
httpTestingController.match(
`${environment.apiBaseUrl}documents/?page=1&page_size=50&ordering=-created&truncate_content=true&include_selection_data=true`
) // list reload
@@ -1293,7 +1292,7 @@ describe('BulkEditorComponent', () => {
)
req.flush({ result: 'OK', task_id: 'delete-2' })
// ids aren't known when all matching documents are selected, so no undo
expect(trackSpy).toHaveBeenLastCalledWith('delete-2', 0, null)
expect(trackSpy).toHaveBeenLastCalledWith('delete-2', 2, null)
httpTestingController.match(
`${environment.apiBaseUrl}documents/?page=1&page_size=50&ordering=-created&truncate_content=true&include_selection_data=true`
) // list reload
@@ -1492,7 +1491,6 @@ describe('BulkEditorComponent', () => {
httpTestingController.match(
`${environment.apiBaseUrl}documents/?page=1&page_size=100000&fields=id`
) // listAllFilteredIds
expect(documentListViewService.selected.size).toEqual(0)
// Test with archiveFallback enabled
modal.componentInstance.deleteOriginals.set(false)
@@ -1514,7 +1512,6 @@ describe('BulkEditorComponent', () => {
httpTestingController.match(
`${environment.apiBaseUrl}documents/?page=1&page_size=100000&fields=id`
) // listAllFilteredIds
expect(documentListViewService.selected.size).toEqual(0)
})
it('should support merging documents as versions', () => {
@@ -1562,7 +1559,6 @@ describe('BulkEditorComponent', () => {
httpTestingController.match(
`${environment.apiBaseUrl}documents/?page=1&page_size=100000&fields=id`
)
expect(documentListViewService.selected.size).toEqual(0)
jest.advanceTimersByTime(400)
expect(toastSpy).toHaveBeenCalledWith(
expect.objectContaining({
@@ -1717,7 +1713,6 @@ describe('BulkEditorComponent', () => {
expect(notification.actionName).toBeUndefined()
}
expect(reload).not.toHaveBeenCalled()
expect(documentListViewService.selected.size).toBe(0)
expect(documentListViewService.allSelected).toBe(false)
TestBed.inject(TaskNotificationService).complete({
task_id: 'queued-operation',
@@ -329,7 +329,6 @@ export class BulkEditorComponent
.subscribe({
next: () => {
modal.close()
this.list.selectNone()
this.toastService.showInfo(
$localize`Workflow will run on the selected documents in the background.`
)
@@ -366,7 +365,6 @@ export class BulkEditorComponent
) {
const bulk = this.getSelectionSize() > 1
modal?.close()
this.list.selectNone()
if (onQueued) {
onQueued(taskId)
} else {
@@ -36,8 +36,8 @@
{{document().title | documentTitle}}
}
@if (displayFields().includes(DisplayField.TAGS)) {
@for (tagID of document().tags; track tagID) {
<pngx-tag [tagID]="tagID" linkTitle="Filter by tag" i18n-linkTitle class="ms-1" (click)="clickTag.emit(tagID);$event.stopPropagation()" [clickable]="clickTag.observers.length"></pngx-tag>
@for (tagID of document().tags | collapseTags | async; track tagID) {
<pngx-tag [tagID]="tagID" [split]="true" linkTitle="Filter by tag" i18n-linkTitle class="ms-1" (click)="clickTag.emit(tagID);$event.stopPropagation()" (parentClick)="clickTag.emit($event)" [clickable]="clickTag.observers.length"></pngx-tag>
}
}
} @else {
@@ -20,6 +20,7 @@ import {
Document,
} from 'src/app/data/document'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
@@ -45,6 +46,7 @@ import { LoadingComponentWithPermissions } from '../../loading-component/loading
TagComponent,
CustomFieldDisplayComponent,
AsyncPipe,
CollapseTagsPipe,
NgOptimizedImage,
UsernamePipe,
CorrespondentNamePipe,
@@ -19,11 +19,12 @@
}
@if (document() && displayFields().includes(DisplayField.TAGS)) {
<div class="tags d-flex flex-column text-end position-absolute me-1 fs-6" [class.tags-no-wrap]="document().tags.length > 3">
@for (tagID of tagIDs; track tagID) {
<pngx-tag [tagID]="tagID" (click)="clickTag.emit(tagID);$event.stopPropagation()" [clickable]="true" linkTitle="Toggle tag filter" i18n-linkTitle></pngx-tag>
@let visibleTagIDs = document().tags | collapseTags | async;
<div class="tags d-flex flex-column text-end position-absolute me-1 fs-6" [class.tags-no-wrap]="visibleTagIDs?.length > 3">
@for (tagID of getTagIDs(visibleTagIDs); track tagID) {
<pngx-tag [tagID]="tagID" [split]="true" (click)="clickTag.emit(tagID);$event.stopPropagation()" (parentClick)="clickTag.emit($event)" [clickable]="true" linkTitle="Toggle tag filter" i18n-linkTitle></pngx-tag>
}
@if (moreTags) {
@if (getMoreTags(visibleTagIDs); as moreTags) {
<div>
<span class="badge text-dark">+ {{moreTags}}</span>
</div>
@@ -103,7 +103,8 @@ a {
line-height: 1;
&.tags-no-wrap {
::ng-deep .badge {
// split-pill parents clip to a stub instead (see TagComponent)
::ng-deep .badge:not(.split-parent) {
display: inline-block;
max-width: 100%;
white-space: nowrap;
@@ -4,6 +4,9 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { By } from '@angular/platform-browser'
import { RouterTestingModule } from '@angular/router/testing'
import { of } from 'rxjs'
import { PermissionsService } from 'src/app/services/permissions.service'
import { TagService } from 'src/app/services/rest/tag.service'
import { TagComponent } from '../../common/tag/tag.component'
import { DocumentCardSmallComponent } from './document-card-small.component'
@@ -97,8 +100,36 @@ describe('DocumentCardSmallComponent', () => {
).toHaveLength(6)
})
it('should hide parent tags implied by a child and count pills for the hidden tag counter', () => {
jest
.spyOn(TestBed.inject(PermissionsService), 'currentUserCan')
.mockReturnValue(true)
jest.spyOn(TestBed.inject(TagService), 'listAll').mockReturnValue(
of({
count: 8,
all: [1, 2, 3, 4, 5, 6, 7, 8],
results: [
{ id: 1, name: 'Parent' },
{ id: 2, name: 'Child', parent: 1 },
...[3, 4, 5, 6, 7, 8].map((id) => ({ id, name: `Tag ${id}` })),
],
})
)
fixture.componentRef.setInput('document', {
...component.document(),
tags: [1, 2, 3, 4, 5, 6, 7, 8],
})
fixture.detectChanges()
const tags = fixture.debugElement.queryAll(By.directive(TagComponent))
expect(tags.map((t) => t.componentInstance.tagID())).toEqual([
2, 3, 4, 5, 6,
])
expect(fixture.nativeElement.textContent).toContain('+ 2')
})
it('should clear hidden tag counter when tag count falls below the limit', () => {
expect(component.moreTags).toEqual(3)
expect(component.getMoreTags(component.document().tags)).toEqual(3)
fixture.componentRef.setInput('document', {
...component.document(),
@@ -106,7 +137,7 @@ describe('DocumentCardSmallComponent', () => {
})
fixture.detectChanges()
expect(component.moreTags).toBeNull()
expect(component.getMoreTags(component.document().tags)).toBeNull()
expect(fixture.nativeElement.textContent).not.toContain('+ 3')
})
@@ -20,6 +20,7 @@ import {
Document,
} from 'src/app/data/document'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
@@ -45,6 +46,7 @@ import { LoadingComponentWithPermissions } from '../../loading-component/loading
TagComponent,
CustomFieldDisplayComponent,
AsyncPipe,
CollapseTagsPipe,
NgOptimizedImage,
UsernamePipe,
CorrespondentNamePipe,
@@ -90,12 +92,13 @@ export class DocumentCardSmallComponent
@Output()
clickStoragePath = new EventEmitter<number>()
get moreTags(): number {
const document = this.document()
const limit = document?.notes.length > 0 ? 6 : 7
return document?.tags.length > limit
? document.tags.length - (limit - 1)
: null
private get tagLimit(): number {
return this.document()?.notes.length > 0 ? 6 : 7
}
getMoreTags(tagIDs: number[]): number {
const limit = this.tagLimit
return tagIDs?.length > limit ? tagIDs.length - (limit - 1) : null
}
@ViewChild('popupPreview') popupPreview: PreviewPopupComponent
@@ -116,14 +119,9 @@ export class DocumentCardSmallComponent
return this.documentService.getDownloadUrl(this.document().id)
}
get tagIDs() {
const document = this.document()
const limit = document.notes.length > 0 ? 6 : 7
if (document.tags.length > limit) {
return document.tags.slice(0, limit - 1)
} else {
return document.tags
}
getTagIDs(tagIDs: number[]): number[] {
const limit = this.tagLimit
return tagIDs?.length > limit ? tagIDs.slice(0, limit - 1) : tagIDs
}
mouseLeaveCard() {
@@ -335,8 +335,8 @@
<a routerLink="/documents/{{d.id}}" title="Edit document" i18n-title style="overflow-wrap: anywhere;">{{d.title | documentTitle}}</a>
}
@if (activeDisplayFields.includes(DisplayField.TAGS)) {
@for (tagID of d.tags; track tagID) {
<pngx-tag [tagID]="tagID" class="ms-1 fs-6" clickable="true" linkTitle="Filter by tag" i18n-linkTitle (click)="clickTag(tagID);$event.stopPropagation()"></pngx-tag>
@for (tagID of d.tags | collapseTags | async; track tagID) {
<pngx-tag [tagID]="tagID" [split]="true" class="ms-1 fs-6" clickable="true" linkTitle="Filter by tag" i18n-linkTitle (click)="clickTag(tagID);$event.stopPropagation()" (parentClick)="clickTag($event)"></pngx-tag>
}
}
</td>
@@ -39,6 +39,7 @@ import {
SortableDirective,
SortEvent,
} from 'src/app/directives/sortable.directive'
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
@@ -96,6 +97,7 @@ import { SaveViewConfigDialogComponent } from './save-view-config-dialog/save-vi
StoragePathNamePipe,
BootstrapIconComponent,
AsyncPipe,
CollapseTagsPipe,
FormsModule,
ReactiveFormsModule,
NgTemplateOutlet,
+12
View File
@@ -75,6 +75,7 @@ export const SETTINGS_KEYS = {
UPDATE_CHECKING_ENABLED: 'general-settings:update-checking:enabled',
UPDATE_CHECKING_BACKEND_SETTING:
'general-settings:update-checking:backend-setting',
WHATS_NEW_LAST_SEEN_VERSION: 'general-settings:whats-new:last-seen-version',
SAVED_VIEWS_WARN_ON_UNSAVED_CHANGE:
'general-settings:saved-views:warn-on-unsaved-change',
DASHBOARD_VIEWS_VISIBLE_IDS:
@@ -94,6 +95,7 @@ export const SETTINGS_KEYS = {
DEFAULT_PERMS_VIEW_GROUPS: 'general-settings:permissions:default-view-groups',
DEFAULT_PERMS_EDIT_USERS: 'general-settings:permissions:default-edit-users',
DEFAULT_PERMS_EDIT_GROUPS: 'general-settings:permissions:default-edit-groups',
TAGS_SHOW_HIERARCHY: 'general-settings:tags:show-hierarchy',
DOCUMENT_EDITING_REMOVE_INBOX_TAGS:
'general-settings:document-editing:remove-inbox-tags',
DOCUMENT_EDITING_OVERLAY_THUMBNAIL:
@@ -223,6 +225,11 @@ export const SETTINGS: UiSetting[] = [
type: 'string',
default: '',
},
{
key: SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION,
type: 'string',
default: '',
},
{
key: SETTINGS_KEYS.SAVED_VIEWS_WARN_ON_UNSAVED_CHANGE,
type: 'boolean',
@@ -305,6 +312,11 @@ export const SETTINGS: UiSetting[] = [
type: 'string',
default: '',
},
{
key: SETTINGS_KEYS.TAGS_SHOW_HIERARCHY,
type: 'boolean',
default: true,
},
{
key: SETTINGS_KEYS.DOCUMENT_EDITING_REMOVE_INBOX_TAGS,
type: 'boolean',
@@ -0,0 +1,67 @@
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { TestBed } from '@angular/core/testing'
import { firstValueFrom, of, throwError } from 'rxjs'
import { Tag } from '../data/tag'
import { PermissionsService } from '../services/permissions.service'
import { TagService } from '../services/rest/tag.service'
import { SettingsService } from '../services/settings.service'
import { CollapseTagsPipe } from './collapse-tags.pipe'
const tags: Tag[] = [
{ id: 1, name: 'Parent' },
{ id: 2, name: 'Child', parent: 1 },
{ id: 3, name: 'Other' },
]
describe('CollapseTagsPipe', () => {
let pipe: CollapseTagsPipe
let tagService: TagService
let settingsService: SettingsService
let permissionsService: PermissionsService
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
CollapseTagsPipe,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
})
pipe = TestBed.inject(CollapseTagsPipe)
tagService = TestBed.inject(TagService)
settingsService = TestBed.inject(SettingsService)
permissionsService = TestBed.inject(PermissionsService)
jest.spyOn(permissionsService, 'currentUserCan').mockReturnValue(true)
jest.spyOn(settingsService, 'get').mockReturnValue(true)
jest
.spyOn(tagService, 'listAll')
.mockReturnValue(of({ count: 3, all: [1, 2, 3], results: tags }))
})
it('should drop parents implied by a selected child', async () => {
expect(await firstValueFrom(pipe.transform([1, 2, 3]))).toEqual([2, 3])
})
it('should pass ids through when hierarchy display is off or not permitted', async () => {
jest.spyOn(settingsService, 'get').mockReturnValue(false)
expect(await firstValueFrom(pipe.transform([1, 2]))).toEqual([1, 2])
jest.spyOn(settingsService, 'get').mockReturnValue(true)
jest.spyOn(permissionsService, 'currentUserCan').mockReturnValue(false)
expect(await firstValueFrom(pipe.transform([1, 2]))).toEqual([1, 2])
expect(tagService.listAll).not.toHaveBeenCalled()
})
it('should handle empty input', async () => {
expect(await firstValueFrom(pipe.transform(null))).toEqual([])
expect(await firstValueFrom(pipe.transform([]))).toEqual([])
})
it('should fall back to the original ids if tags fail to load', async () => {
jest
.spyOn(tagService, 'listAll')
.mockReturnValue(throwError(() => new Error('failed')))
expect(await firstValueFrom(pipe.transform([1, 2]))).toEqual([1, 2])
})
})
@@ -0,0 +1,47 @@
import { inject, Pipe, PipeTransform } from '@angular/core'
import { catchError, map, Observable, of } from 'rxjs'
import { Tag } from '../data/tag'
import { SETTINGS_KEYS } from '../data/ui-settings'
import {
PermissionAction,
PermissionsService,
PermissionType,
} from '../services/permissions.service'
import { TagService } from '../services/rest/tag.service'
import { SettingsService } from '../services/settings.service'
import { collapseImpliedAncestors } from '../utils/collapse-tags'
/**
* Drops tag IDs whose descendant is also in the list for when the child's
* Tag badge already shows its parent.
*/
@Pipe({
name: 'collapseTags',
})
export class CollapseTagsPipe implements PipeTransform {
private readonly permissionsService = inject(PermissionsService)
private readonly tagService = inject(TagService)
private readonly settingsService = inject(SettingsService)
transform(ids: number[]): Observable<number[]> {
if (
!ids?.length ||
!this.settingsService.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY) ||
!this.permissionsService.currentUserCan(
PermissionAction.View,
PermissionType.Tag
)
) {
return of(ids ?? [])
}
return this.tagService.listAll().pipe(
map((tags) =>
collapseImpliedAncestors(
ids,
new Map<number, Tag>(tags.results.map((t) => [t.id, t]))
)
),
catchError(() => of(ids))
)
}
}
@@ -40,4 +40,28 @@ describe('RemoteVersionService', () => {
)
expect(req.request.method).toEqual('GET')
})
it('should call release notes endpoint without since', () => {
subscription = service.getReleaseNotes().subscribe()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}release_notes/`
)
expect(req.request.method).toEqual('GET')
expect(req.request.params.has('since')).toBe(false)
})
it('should pass since to release notes endpoint', () => {
subscription = service.getReleaseNotes('3.4.2').subscribe()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}release_notes/?since=3.4.2`
)
expect(req.request.method).toEqual('GET')
})
it('should pass until to release notes endpoint', () => {
subscription = service.getReleaseNotes('3.5.1', '3.6.0').subscribe()
httpTestingController.expectOne(
`${environment.apiBaseUrl}release_notes/?since=3.5.1&until=3.6.0`
)
})
})
@@ -1,4 +1,4 @@
import { HttpClient } from '@angular/common/http'
import { HttpClient, HttpParams } from '@angular/common/http'
import { Injectable, inject } from '@angular/core'
import { Observable } from 'rxjs'
import { environment } from 'src/environments/environment'
@@ -8,6 +8,20 @@ export interface AppRemoteVersion {
update_available: boolean
}
export interface AppRelease {
version: string
name: string
body_html: string
html_url: string
published_at: string
}
export interface AppReleaseNotes {
version: string
releases: AppRelease[]
stars: number | null
}
@Injectable({
providedIn: 'root',
})
@@ -19,4 +33,21 @@ export class RemoteVersionService {
`${environment.apiBaseUrl}remote_version/`
)
}
public getReleaseNotes(
since?: string,
until?: string
): Observable<AppReleaseNotes> {
let params = new HttpParams()
if (since) {
params = params.set('since', since)
}
if (until) {
params = params.set('until', until)
}
return this.http.get<AppReleaseNotes>(
`${environment.apiBaseUrl}release_notes/`,
{ params }
)
}
}
@@ -398,6 +398,60 @@ describe('SettingsService', () => {
expect(req.request.method).toEqual('POST')
})
it('seeds last seen version on first load', () => {
const settings = {
...ui_settings,
user: { ...ui_settings.user, is_superuser: true },
settings: {
...ui_settings.settings,
documentListSize: 50,
update_checking: { enabled: false, backend_setting: 'default' },
},
}
settings.settings['version'] = '3.5.1'
httpTestingController
.expectOne(`${environment.apiBaseUrl}ui_settings/`)
.flush(settings)
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}ui_settings/`
)
expect(req.request.method).toEqual('POST')
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
'3.5.1'
)
expect(settingsService.unseenReleasesSince()).toBeNull()
})
it('reports unseen releases and marks them seen', () => {
const settings = {
...ui_settings,
user: { ...ui_settings.user, is_superuser: true },
settings: {
...ui_settings.settings,
documentListSize: 50,
update_checking: { enabled: false, backend_setting: 'default' },
},
}
settings.settings['version'] = '3.5.1'
settings.settings['whats_new'] = { last_seen_version: '3.4.2' }
httpTestingController
.expectOne(`${environment.apiBaseUrl}ui_settings/`)
.flush(settings)
httpTestingController.expectNone(`${environment.apiBaseUrl}ui_settings/`)
expect(settingsService.unseenReleasesSince()).toEqual('3.4.2')
subscription = settingsService.markReleasesSeen().subscribe()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}ui_settings/`
)
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
'3.5.1'
)
expect(settingsService.unseenReleasesSince()).toBeNull()
})
it('updates settings on complete tour', () => {
let req = httpTestingController.expectOne(
`${environment.apiBaseUrl}ui_settings/`
@@ -20,6 +20,7 @@ import {
hexToHsl,
} from 'src/app/utils/color'
import { DEFAULT_APP_TITLE, environment } from 'src/environments/environment'
import { compareVersions } from 'src/app/utils/version'
import { DEFAULT_DISPLAY_FIELDS, DisplayField } from '../data/document'
import { RemoteOCRModeConfig } from '../data/paperless-config'
import { SavedView } from '../data/saved-view'
@@ -327,6 +328,18 @@ export class SettingsService {
SETTINGS_KEYS.SIDEBAR_HIDDEN_ITEMS
)
/**
* The last version the user saw release notes for, if the running
* version is newer, or null.
*/
readonly unseenReleasesSince = computed<string | null>(() => {
this.settingsVersion()
const currentVersion = this.get(SETTINGS_KEYS.VERSION)
const lastSeen = this.get(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION)
if (!currentVersion || !lastSeen) return null
return compareVersions(currentVersion, lastSeen) > 0 ? lastSeen : null
})
readonly allDisplayFields = signal<Array<{ id: DisplayField; name: string }>>(
DEFAULT_DISPLAY_FIELDS
)
@@ -384,6 +397,7 @@ export class SettingsService {
uisettings.permissions,
this.currentUser()
)
this.maybeSeedLastSeenVersion()
this.initializeDisplayFields()
})
@@ -713,6 +727,34 @@ export class SettingsService {
return this.settingIsSet(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED)
}
/**
* Record the baseline version for "what's new" tracking.
*/
private maybeSeedLastSeenVersion() {
const currentVersion = this.get(SETTINGS_KEYS.VERSION)
if (
!currentVersion ||
this.get(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION) ||
!this.permissionsService.currentUserCan(
PermissionAction.Change,
PermissionType.UISettings
)
)
return
this.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, currentVersion)
this.storeSettings()
.pipe(first())
.subscribe({ error: () => {} })
}
public markReleasesSeen(): Observable<any> {
this.set(
SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION,
this.get(SETTINGS_KEYS.VERSION)
)
return this.storeSettings()
}
/**
* Offering remote OCR as a choice only makes sense when an engine
* is configured but is not already handling every document.
@@ -0,0 +1,47 @@
import { Tag } from '../data/tag'
import { collapseImpliedAncestors, getTagAncestors } from './collapse-tags'
const tags: Tag[] = [
{ id: 1, name: 'Finance' },
{ id: 2, name: 'Account', parent: 1 },
{ id: 3, name: 'Mortgage', parent: 2 },
{ id: 4, name: 'Taxes', parent: 1 },
{ id: 5, name: 'Inbox' },
]
const tagsById = new Map(tags.map((t) => [t.id, t]))
describe('collapseImpliedAncestors', () => {
it('drops ancestors that are implied by a descendant in the list', () => {
expect(collapseImpliedAncestors([1, 2, 3, 4, 5], tagsById)).toEqual([
3, 4, 5,
])
})
it('keeps a parent with none of its children present', () => {
expect(collapseImpliedAncestors([1, 5], tagsById)).toEqual([1, 5])
})
it('keeps unknown (private) ids and handles empty input', () => {
expect(collapseImpliedAncestors([99, 2], tagsById)).toEqual([99, 2])
expect(collapseImpliedAncestors([], tagsById)).toEqual([])
expect(collapseImpliedAncestors(null, tagsById)).toEqual([])
})
})
describe('getTagAncestors', () => {
it('returns ancestors root first', () => {
expect(getTagAncestors(3, tagsById).map((t) => t.id)).toEqual([1, 2])
expect(getTagAncestors(5, tagsById)).toEqual([])
})
it('stops at a parent that is not visible or forms a cycle', () => {
const hidden = new Map<number, Tag>([[6, { id: 6, name: 'x', parent: 99 }]])
expect(getTagAncestors(6, hidden)).toEqual([])
const cyclic = new Map<number, Tag>([
[7, { id: 7, name: 'a', parent: 8 }],
[8, { id: 8, name: 'b', parent: 7 }],
])
expect(getTagAncestors(7, cyclic).map((t) => t.id)).toEqual([7, 8])
})
})
+43
View File
@@ -0,0 +1,43 @@
import { Tag } from '../data/tag'
/**
* Collapses implied ancestor tags from a list of tag IDs such that if a tag's
* ancestor is also present in the list, the ancestor is removed. For example
* [Finance, Account, Mortgage] -> [Mortgage]
*/
export function collapseImpliedAncestors(
ids: number[],
tagsById: Map<number, Tag>
): number[] {
if (!ids?.length) return ids ?? []
const present = new Set(ids)
const implied = new Set<number>()
for (const id of ids) {
const seen = new Set<number>()
let parentId = tagsById.get(id)?.parent
while (parentId && !seen.has(parentId)) {
seen.add(parentId)
if (present.has(parentId)) implied.add(parentId)
parentId = tagsById.get(parentId)?.parent
}
}
return ids.filter((id) => !implied.has(id))
}
/**
* Returns an array of ancestor tags for the given tag ID, starting from the
* root and ending with the immediate parent.
*/
export function getTagAncestors(id: number, tagsById: Map<number, Tag>): Tag[] {
const chain: Tag[] = []
const seen = new Set<number>()
let parentId = tagsById.get(id)?.parent
while (parentId && !seen.has(parentId)) {
seen.add(parentId)
const parent = tagsById.get(parentId)
if (!parent) break
chain.unshift(parent)
parentId = parent.parent
}
return chain
}
+11
View File
@@ -0,0 +1,11 @@
import { compareVersions } from './version'
describe('compareVersions', () => {
it('should compare versions numerically', () => {
expect(compareVersions('3.5.1', '3.5.0')).toBeGreaterThan(0)
expect(compareVersions('3.10.0', '3.9.9')).toBeGreaterThan(0)
expect(compareVersions('3.4.2', '3.5.0')).toBeLessThan(0)
expect(compareVersions('3.5.0', '3.5.0')).toEqual(0)
expect(compareVersions('3.5', '3.5.0')).toEqual(0)
})
})
+13
View File
@@ -0,0 +1,13 @@
/**
* Compare two X.Y.Z version strings numerically.
* Returns a positive number if a > b, negative if a < b, 0 if equal.
*/
export function compareVersions(a: string, b: string): number {
const partsA = a.split('.').map((p) => Number.parseInt(p, 10) || 0)
const partsB = b.split('.').map((p) => Number.parseInt(p, 10) || 0)
for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
const diff = (partsA[i] ?? 0) - (partsB[i] ?? 0)
if (diff !== 0) return diff
}
return 0
}
+1 -1
View File
@@ -8,7 +8,7 @@ export const environment = {
apiVersion: '10', // match src/paperless/settings.py
appTitle: DEFAULT_APP_TITLE,
tag: 'prod',
version: '3.4.2',
version: '3.5.1',
webSocketHost: window.location.host,
webSocketProtocol: window.location.protocol == 'https:' ? 'wss:' : 'ws:',
webSocketBaseUrl: base_url.pathname + 'ws/',
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Loaded 100 of 193 files, more files were not shown because too many files have changed in this diff. Show more