Compare commits

..
Author SHA1 Message Date
shamoon 198ee6ea09 Just some stuff 2024-12-20 22:13:53 -08:00
shamoon 112b39c4de Lol this works 2024-12-20 20:09:30 -08:00
shamoon 01706dd391 Just messing around 2024-12-20 17:08:59 -08:00
435 changed files with 82096 additions and 116928 deletions
+117
View File
@@ -0,0 +1,117 @@
# Paperless NGX Development Environment
## Overview
Welcome to the Paperless NGX development environment! This setup uses VSCode DevContainers to provide a consistent and seamless development experience.
### What are DevContainers?
DevContainers are a feature in VSCode that allows you to develop within a Docker container. This ensures that your development environment is consistent across different machines and setups. By defining a containerized environment, you can eliminate the "works on my machine" problem.
### Advantages of DevContainers
- **Consistency**: Same environment for all developers.
- **Isolation**: Separate development environment from your local machine.
- **Reproducibility**: Easily recreate the environment on any machine.
- **Pre-configured Tools**: Include all necessary tools and dependencies in the container.
## DevContainer Setup
The DevContainer configuration provides up all the necessary services for Paperless NGX, including:
- Redis
- Gotenberg
- Tika
Data is stored using Docker volumes to ensure persistence across container restarts.
## Configuration Files
The setup includes debugging configurations (`launch.json`) and tasks (`tasks.json`) to help you manage and debug various parts of the project:
- **Backend Debugging:**
- `manage.py runserver`
- `manage.py document-consumer`
- `celery`
- **Maintenance Tasks:**
- Create superuser
- Run migrations
- Recreate virtual environment (`.venv` with pipenv)
- Compile frontend assets
## Getting Started
### Step 1: Running the DevContainer
To start the DevContainer:
1. Open VSCode.
2. Open the project folder.
3. Open the command palette:
- **Windows/Linux**: `Ctrl+Shift+P`
- **Mac**: `Cmd+Shift+P`
4. Type and select `Dev Containers: Rebuild and Reopen in Container`.
VSCode will build and start the DevContainer environment.
### Step 2: Initial Setup
Once the DevContainer is up and running, perform the following steps:
1. **Compile Frontend Assets**:
- Open the command palette:
- **Windows/Linux**: `Ctrl+Shift+P`
- **Mac**: `Cmd+Shift+P`
- Select `Tasks: Run Task`.
- Choose `Frontend Compile`.
2. **Run Database Migrations**:
- Open the command palette:
- **Windows/Linux**: `Ctrl+Shift+P`
- **Mac**: `Cmd+Shift+P`
- Select `Tasks: Run Task`.
- Choose `Migrate Database`.
3. **Create Superuser**:
- Open the command palette:
- **Windows/Linux**: `Ctrl+Shift+P`
- **Mac**: `Cmd+Shift+P`
- Select `Tasks: Run Task`.
- Choose `Create Superuser`.
### Debugging and Running Services
You can start and debug backend services either as debugging sessions via `launch.json` or as tasks.
#### Using `launch.json`:
1. Press `F5` or go to the **Run and Debug** view in VSCode.
2. Select the desired configuration:
- `Runserver`
- `Document Consumer`
- `Celery`
#### Using Tasks:
1. Open the command palette:
- **Windows/Linux**: `Ctrl+Shift+P`
- **Mac**: `Cmd+Shift+P`
2. Select `Tasks: Run Task`.
3. Choose the desired task:
- `Runserver`
- `Document Consumer`
- `Celery`
### Additional Maintenance Tasks
Additional tasks are available for common maintenance operations:
- **Recreate .venv**: For setting up the virtual environment using pipenv.
- **Migrate Database**: To apply database migrations.
- **Create Superuser**: To create an admin user for the application.
## Let's Get Started!
Follow the steps above to get your development environment up and running. Happy coding!
+8 -20
View File
@@ -3,26 +3,14 @@
"dockerComposeFile": "docker-compose.devcontainer.sqlite-tika.yml",
"service": "paperless-development",
"workspaceFolder": "/usr/src/paperless/paperless-ngx",
"postCreateCommand": "pipenv install --dev && pipenv run pre-commit install",
"postCreateCommand": "/bin/bash -c pre-commit install && pipenv install --dev",
"customizations": {
"vscode": {
"extensions": [
"mhutchie.git-graph",
"ms-python.python",
"ms-vscode.js-debug-nightly",
"eamodio.gitlens",
"yzhang.markdown-all-in-one"
],
"settings": {
"python.defaultInterpreterPath": "/usr/src/paperless/paperless-ngx/.venv/bin/python",
"python.pythonPath": "/usr/src/paperless/paperless-ngx/.venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
}
"extensions": [
"mhutchie.git-graph",
"ms-python.python"
]
}
},
"remoteUser": "paperless"
}
},
"remoteUser": "paperless"
}
@@ -27,7 +27,7 @@ services:
image: docker.io/library/redis:7
restart: unless-stopped
volumes:
- ./redisdata:/data
- redisdata:/data
# No ports need to be exposed; the VSCode DevContainer plugin manages them.
paperless-development:
@@ -43,16 +43,14 @@ services:
volumes:
- ..:/usr/src/paperless/paperless-ngx:delegated
- ../.devcontainer/vscode:/usr/src/paperless/paperless-ngx/.vscode:delegated # VSCode config files
- pipenv:/usr/src/paperless/paperless-ngx/.venv
- pipenv:/usr/src/paperless/paperless-ngx/.venv # Pipenv environment persisted in volume
- /usr/src/paperless/paperless-ngx/src/documents/static/frontend # Static frontend files exist only in container
- /usr/src/paperless/paperless-ngx/src/.pytest_cache
- /usr/src/paperless/paperless-ngx/.ruff_cache
- /usr/src/paperless/paperless-ngx/htmlcov
- /usr/src/paperless/paperless-ngx/.coverage
- ./data:/usr/src/paperless/paperless-ngx/data
- ./media:/usr/src/paperless/paperless-ngx/media
- ./consume:/usr/src/paperless/paperless-ngx/consume
- ~/.gitconfig:/usr/src/paperless/.gitconfig:ro
- data:/usr/src/paperless/paperless-ngx/data
- media:/usr/src/paperless/paperless-ngx/media
environment:
PAPERLESS_REDIS: redis://broker:6379
PAPERLESS_TIKA_ENABLED: 1
@@ -80,4 +78,7 @@ services:
restart: unless-stopped
volumes:
data:
media:
redisdata:
pipenv:
+24 -39
View File
@@ -2,57 +2,42 @@
"version": "0.2.0",
"configurations": [
{
"name": "Chrome: Debug Angular Frontend",
"description": "Debug the Angular Dev Frontend in Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}/src-ui",
"preLaunchTask": "Start: Frontend Angular"
},
{
"name": "Debug: Backend Server (manage.py runserver)",
"description": "Debug the Django Backend Server",
"name": "manage.py runserver",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/src/manage.py",
"args": [
"runserver"
],
"django": true,
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}/src"
},
"python": "${workspaceFolder}/.venv/bin/python"
"justMyCode": true,
"args": ["runserver"],
"django": true
},
{
"name": "Debug: Consumer Service (manage.py document_consumer)",
"description": "Debug the Consumer Service which processes files from a directory",
"name": "manage.py document_consumer",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/src/manage.py",
"args": [
"document_consumer"
],
"django": true,
"console": "integratedTerminal",
"justMyCode": true,
"args": ["document_consumer"],
"django": true
},
{
"name": "celery",
"type": "python",
"cwd": "${workspaceFolder}/src",
"request": "launch",
"module": "celery",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}/src"
},
"python": "${workspaceFolder}/.venv/bin/python"
}
],
"compounds": [
{
"name": "Debug: FullStack",
"description": "Debug run the Angular dev frontend, Django backend, and consumer service",
"configurations": [
"Chrome: Debug Angular Frontend",
"Debug: Backend Server (manage.py runserver)",
"Debug: Consumer Service (manage.py document_consumer)"
],
"preLaunchTask": "Start: Celery Worker"
},
"args": [
"-A",
"paperless",
"worker",
"-l",
"DEBUG"
]
}
]
}
+112 -199
View File
@@ -1,84 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start: Celery Worker",
"description": "Start the Celery Worker which processes background and consume tasks",
"type": "shell",
"command": "pipenv run celery --app paperless worker -l DEBUG",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/src"
},
"problemMatcher": [
{
"owner": "custom",
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "celery.*",
"endsPattern": "ready"
}
}
]
{
"label": "manage.py document_consumer",
"type": "shell",
"command": "pipenv run python manage.py document_consumer",
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src"
}
},
{
"label": "Start: Frontend Angular",
"description": "Start the Frontend Angular Dev Server",
"type": "shell",
"command": "npm start",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/src-ui"
},
"problemMatcher": [
{
"owner": "custom",
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".*",
"endsPattern": "Compiled successfully"
}
}
]
},
{
"label": "Start: Consumer Service (manage.py document_consumer)",
"description": "Start the Consumer Service which processes files from a directory",
"type": "shell",
"command": "pipenv run python manage.py document_consumer",
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src"
}
},
{
"label": "Start: Backend Server (manage.py runserver)",
"description": "Start the Backend Server which serves the Django API and the compiled Angular frontend",
"label": "manage.py runserver",
"type": "shell",
"command": "pipenv run python manage.py runserver",
"group": "build",
@@ -94,130 +37,100 @@
"options": {
"cwd": "${workspaceFolder}/src"
}
},
{
"label": "Maintenance: manage.py migrate",
"description": "Apply database migrations",
"type": "shell",
"command": "pipenv run python manage.py migrate",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src"
}
{
"label": "Maintenance: manage.py migrate",
"type": "shell",
"command": "pipenv run python manage.py migrate",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
{
"label": "Maintenance: Build Documentation",
"description": "Build the documentation with MkDocs",
"type": "shell",
"command": "pipenv run mkdocs build --config-file mkdocs.yml && pipenv run mkdocs serve",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Maintenance: manage.py createsuperuser",
"description": "Create a superuser",
"type": "shell",
"command": "pipenv run python manage.py createsuperuser",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src"
}
},
{
"label": "Maintenance: recreate .venv",
"description": "Recreate the python virtual environment and install python dependencies",
"type": "shell",
"command": "rm -R -v .venv/* || pipenv install --dev",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Maintenance: Install Frontend Dependencies",
"description": "Install frontend (npm) dependencies",
"type": "npm",
"script": "install",
"path": "src-ui",
"group": "clean",
"problemMatcher": [],
"detail": "install dependencies from package"
},
{
"description": "Clean install frontend dependencies and build the frontend for production",
"label": "Maintenance: Compile frontend for production",
"type": "shell",
"command": "npm ci && ./node_modules/.bin/ng build --configuration production",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src-ui"
}
},
{
"label": "Project Setup: Run all Init Tasks",
"description": "Runs all init tasks to setup the project including migrate the database, create a superuser and compile the frontend for production",
"dependsOrder": "sequence",
"dependsOn": [
"Maintenance: manage.py migrate",
"Maintenance: manage.py createsuperuser",
"Maintenance: Compile frontend for production"
]
},
{
"label": "Project Start: Run all Services",
"description": "Runs all services required to start the project including the Celery Worker, the Consumer Service and the Backend Server",
"dependsOn": [
"Start: Celery Worker",
"Start: Consumer Service (manage.py document_consumer)",
"Start: Backend Server (manage.py runserver)"
]
"options": {
"cwd": "${workspaceFolder}/src"
}
},
{
"label": "Maintenance: manage.py createsuperuser",
"type": "shell",
"command": "pipenv run python manage.py createsuperuser",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src"
}
},
{
"label": "compile frontend",
"type": "shell",
"command": "npm ci && ./node_modules/.bin/ng build --configuration production",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src-ui"
}
},
{
"label": "Maintenance: recreate .venv",
"type": "shell",
"command": "rm -R -v .venv/* || pipenv install --dev",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Celery Worker",
"type": "shell",
"command": "pipenv run celery --app paperless worker -l DEBUG",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"options": {
"cwd": "${workspaceFolder}/src"
}
}
]
}
}
+2 -2
View File
@@ -2,10 +2,10 @@ blank_issues_enabled: false
contact_links:
- name: 🤔 Questions and Help
url: https://github.com/paperless-ngx/paperless-ngx/discussions
about: General questions or support for using Paperless-ngx.
about: This issue tracker is not for support questions. Please refer to our Discussions.
- name: 💬 Chat
url: https://matrix.to/#/#paperlessngx:matrix.org
about: Want to discuss Paperless-ngx with others? Check out our chat.
- name: 🚀 Feature Request
url: https://github.com/paperless-ngx/paperless-ngx/discussions/new?category=feature-requests
about: Remember to search for existing feature requests and "up-vote" those that you like.
about: Remember to search for existing feature requests and "up-vote" any you like
+1 -1
View File
@@ -16,7 +16,7 @@ on:
env:
# This is the version of pipenv all the steps will use
# If changing this, change Dockerfile
DEFAULT_PIP_ENV_VERSION: "2024.4.1"
DEFAULT_PIP_ENV_VERSION: "2024.4.0"
# This is the default version of Python to use in most steps which aren't specific
DEFAULT_PYTHON_VERSION: "3.11"
-6
View File
@@ -100,9 +100,3 @@ scripts/nuke
# celery schedule file
celerybeat-schedule*
# ignore .devcontainer sub folders
/.devcontainer/consume/
/.devcontainer/data/
/.devcontainer/media/
/.devcontainer/redisdata/
+3 -3
View File
@@ -29,10 +29,10 @@ repos:
- id: check-case-conflict
- id: detect-private-key
- repo: https://github.com/codespell-project/codespell
rev: v2.4.0
rev: v2.3.0
hooks:
- id: codespell
exclude: "(^src-ui/src/locale/)|(^src-ui/e2e/)|(^src/paperless_mail/tests/samples/)"
exclude: "(^src-ui/src/locale/)|(^src-ui/e2e/)|(^src/paperless_mail/tests/samples/)|(^src/paperless_einvoice/tests/samples/)|(^src/paperless_einvoice/templates/)"
exclude_types:
- pofile
- json
@@ -51,7 +51,7 @@ repos:
- 'prettier-plugin-organize-imports@4.1.0'
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
rev: v0.8.3
hooks:
- id: ruff
- id: ruff-format
+9
View File
@@ -38,18 +38,27 @@ ignore = ["DJ001", "SIM105", "RUF012"]
[lint.per-file-ignores]
".github/scripts/*.py" = ["E501", "INP001", "SIM117"]
"docker/wait-for-redis.py" = ["INP001", "T201"]
"src/documents/barcodes.py" = ["PTH"] # TODO Enable & remove
"src/documents/classifier.py" = ["PTH"] # TODO Enable & remove
"src/documents/consumer.py" = ["PTH"] # TODO Enable & remove
"src/documents/file_handling.py" = ["PTH"] # TODO Enable & remove
"src/documents/index.py" = ["PTH"] # TODO Enable & remove
"src/documents/management/commands/decrypt_documents.py" = ["PTH"] # TODO Enable & remove
"src/documents/management/commands/document_consumer.py" = ["PTH"] # TODO Enable & remove
"src/documents/management/commands/document_exporter.py" = ["PTH"] # TODO Enable & remove
"src/documents/management/commands/document_importer.py" = ["PTH"] # TODO Enable & remove
"src/documents/migrations/0012_auto_20160305_0040.py" = ["PTH"] # TODO Enable & remove
"src/documents/migrations/0014_document_checksum.py" = ["PTH"] # TODO Enable & remove
"src/documents/migrations/1003_mime_types.py" = ["PTH"] # TODO Enable & remove
"src/documents/migrations/1012_fix_archive_files.py" = ["PTH"] # TODO Enable & remove
"src/documents/migrations/1037_webp_encrypted_thumbnail_conversion.py" = ["PTH"] # TODO Enable & remove
"src/documents/models.py" = ["SIM115", "PTH"] # TODO PTH Enable & remove
"src/documents/parsers.py" = ["PTH"] # TODO Enable & remove
"src/documents/signals/handlers.py" = ["PTH"] # TODO Enable & remove
"src/documents/tasks.py" = ["PTH"] # TODO Enable & remove
"src/documents/tests/test_api_app_config.py" = ["PTH"] # TODO Enable & remove
"src/documents/tests/test_api_bulk_download.py" = ["PTH"] # TODO Enable & remove
"src/documents/tests/test_api_documents.py" = ["PTH"] # TODO Enable & remove
"src/documents/tests/test_classifier.py" = ["PTH"] # TODO Enable & remove
"src/documents/tests/test_consumer.py" = ["PTH"] # TODO Enable & remove
"src/documents/tests/test_file_handling.py" = ["PTH"] # TODO Enable & remove
+25 -13
View File
@@ -39,7 +39,7 @@ COPY Pipfile* ./
RUN set -eux \
&& echo "Installing pipenv" \
&& python3 -m pip install --no-cache-dir --upgrade pipenv==2024.4.1 \
&& python3 -m pip install --no-cache-dir --upgrade pipenv==2024.4.0 \
&& echo "Generating requirement.txt" \
&& pipenv requirements > requirements.txt
@@ -127,21 +127,32 @@ RUN set -eux \
&& apt-get update \
&& apt-get install --yes --quiet --no-install-recommends ${RUNTIME_PACKAGES} \
&& echo "Installing pre-built updates" \
&& curl --fail --silent --no-progress-meter --show-error --location --remote-name-all --parallel --parallel-max 4 \
https://github.com/paperless-ngx/builder/releases/download/qpdf-${QPDF_VERSION}/libqpdf29_${QPDF_VERSION}-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/qpdf-${QPDF_VERSION}/qpdf_${QPDF_VERSION}-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/ghostscript-${GS_VERSION}/libgs10_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/ghostscript-${GS_VERSION}/ghostscript_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/ghostscript-${GS_VERSION}/libgs10-common_${GS_VERSION}.dfsg-1_all.deb \
https://github.com/paperless-ngx/builder/releases/download/jbig2enc-${JBIG2ENC_VERSION}/jbig2enc_${JBIG2ENC_VERSION}-1_${TARGETARCH}.deb \
&& echo "Installing qpdf ${QPDF_VERSION}" \
&& curl --fail --silent --show-error --location \
--output libqpdf29_${QPDF_VERSION}-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/qpdf-${QPDF_VERSION}/libqpdf29_${QPDF_VERSION}-1_${TARGETARCH}.deb \
&& curl --fail --silent --show-error --location \
--output qpdf_${QPDF_VERSION}-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/qpdf-${QPDF_VERSION}/qpdf_${QPDF_VERSION}-1_${TARGETARCH}.deb \
&& dpkg --install ./libqpdf29_${QPDF_VERSION}-1_${TARGETARCH}.deb \
&& dpkg --install ./qpdf_${QPDF_VERSION}-1_${TARGETARCH}.deb \
&& echo "Installing Ghostscript ${GS_VERSION}" \
&& curl --fail --silent --show-error --location \
--output libgs10_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/ghostscript-${GS_VERSION}/libgs10_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
&& curl --fail --silent --show-error --location \
--output ghostscript_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/ghostscript-${GS_VERSION}/ghostscript_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
&& curl --fail --silent --show-error --location \
--output libgs10-common_${GS_VERSION}.dfsg-1_all.deb \
https://github.com/paperless-ngx/builder/releases/download/ghostscript-${GS_VERSION}/libgs10-common_${GS_VERSION}.dfsg-1_all.deb \
&& dpkg --install ./libgs10-common_${GS_VERSION}.dfsg-1_all.deb \
&& dpkg --install ./libgs10_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
&& dpkg --install ./ghostscript_${GS_VERSION}.dfsg-1_${TARGETARCH}.deb \
&& echo "Installing jbig2enc" \
&& curl --fail --silent --show-error --location \
--output jbig2enc_${JBIG2ENC_VERSION}-1_${TARGETARCH}.deb \
https://github.com/paperless-ngx/builder/releases/download/jbig2enc-${JBIG2ENC_VERSION}/jbig2enc_${JBIG2ENC_VERSION}-1_${TARGETARCH}.deb \
&& dpkg --install ./jbig2enc_${JBIG2ENC_VERSION}-1_${TARGETARCH}.deb \
&& echo "Cleaning up image layer" \
&& rm --force --verbose *.deb \
@@ -221,11 +232,12 @@ RUN --mount=type=cache,target=/root/.cache/pip/,id=pip-cache \
&& apt-get install --yes --quiet --no-install-recommends ${BUILD_PACKAGES} \
&& python3 -m pip install --no-cache-dir --upgrade wheel \
&& echo "Installing Python requirements" \
&& curl --fail --silent --no-progress-meter --show-error --location --remote-name-all --parallel --parallel-max 4 \
https://github.com/paperless-ngx/builder/releases/download/psycopg-3.2.4/psycopg_c-3.2.4-cp312-cp312-linux_x86_64.whl \
https://github.com/paperless-ngx/builder/releases/download/psycopg-3.2.4/psycopg_c-3.2.4-cp312-cp312-linux_aarch64.whl \
https://github.com/paperless-ngx/builder/releases/download/zxing-2.3.0/zxing_cpp-2.3.0-cp312-cp312-linux_aarch64.whl \
https://github.com/paperless-ngx/builder/releases/download/zxing-2.3.0/zxing_cpp-2.3.0-cp312-cp312-linux_x86_64.whl \
&& curl --fail --silent --show-error --location \
--output psycopg_c-3.2.3-cp312-cp312-linux_x86_64.whl \
https://github.com/paperless-ngx/builder/releases/download/psycopg-3.2.3/psycopg_c-3.2.3-cp312-cp312-linux_x86_64.whl \
&& curl --fail --silent --show-error --location \
--output psycopg_c-3.2.3-cp312-cp312-linux_aarch64.whl \
https://github.com/paperless-ngx/builder/releases/download/psycopg-3.2.3/psycopg_c-3.2.3-cp312-cp312-linux_aarch64.whl \
&& python3 -m pip install --default-timeout=1000 --find-links . --requirement requirements.txt \
&& echo "Installing NLTK data" \
&& python3 -W ignore::RuntimeWarning -m nltk.downloader -d "/usr/share/nltk_data" snowball_data \
+5 -4
View File
@@ -7,7 +7,7 @@ name = "pypi"
dateparser = "~=1.2"
# WARNING: django does not use semver.
# Only patch versions are guaranteed to not introduce breaking changes.
django = "~=5.1.5"
django = "~=5.1.4"
django-allauth = {extras = ["mfa", "socialaccount"], version = "*"}
django-auditlog = "*"
django-celery-results = "*"
@@ -20,6 +20,7 @@ django-multiselectfield = "*"
django-soft-delete = "*"
djangorestframework = "~=3.15.2"
djangorestframework-guardian = "*"
drafthorse = "*"
drf-writable-nested = "*"
bleach = "*"
celery = {extras = ["redis"], version = "*"}
@@ -37,7 +38,7 @@ jinja2 = "~=3.1"
langdetect = "*"
mysqlclient = "*"
nltk = "*"
ocrmypdf = "~=16.8"
ocrmypdf = "~=16.7"
pathvalidate = "*"
pdf2image = "*"
psycopg = {version = "*", extras = ["c"]}
@@ -57,8 +58,8 @@ tqdm = "*"
uvicorn = {extras = ["standard"], version = "==0.25.0"}
watchdog = "~=6.0"
whitenoise = "~=6.8"
whoosh-reloaded = "*"
zxing-cpp = "*"
whoosh = "~=2.7"
zxing-cpp = {version = "*", platform_machine = "== 'x86_64'"}
[dev-packages]
Generated
+1738 -1670
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -55,7 +55,7 @@ A full list of [features](https://docs.paperless-ngx.com/#features) and [screens
# Getting started
The easiest way to deploy paperless is `docker compose`. The files in the [`/docker/compose` directory](https://github.com/paperless-ngx/paperless-ngx/tree/main/docker/compose) are configured to pull the image from the GitHub container registry.
The easiest way to deploy paperless is `docker compose`. The files in the [`/docker/compose` directory](https://github.com/paperless-ngx/paperless-ngx/tree/main/docker/compose) are configured to pull the image from GitHub Packages.
If you'd like to jump right in, you can configure a `docker compose` environment with our install script:
+21 -16
View File
@@ -1,17 +1,26 @@
###############################################################################
# Paperless-ngx settings #
###############################################################################
# See http://docs.paperless-ngx.com/configuration/ for all available options.
# The UID and GID of the user used to run paperless in the container. Set this
# to your UID and GID on the host so that you have write access to the
# consumption directory.
#USERMAP_UID=1000
#USERMAP_GID=1000
# See the documentation linked above for all options. A few commonly adjusted settings
# are provided below.
# Additional languages to install for text recognition, separated by a
# whitespace. Note that this is
# different from PAPERLESS_OCR_LANGUAGE (default=eng), which defines the
# language used for OCR.
# The container installs English, German, Italian, Spanish and French by
# default.
# See https://packages.debian.org/search?keywords=tesseract-ocr-&searchon=names&suite=buster
# for available languages.
#PAPERLESS_OCR_LANGUAGES=tur ces
###############################################################################
# Paperless-specific settings #
###############################################################################
# All settings defined in the paperless.conf.example can be used here. The
# Docker setup does not use the configuration file.
# A few commonly adjusted settings are provided below.
# This is required if you will be exposing Paperless-ngx on a public domain
# (if doing so please consider security measures such as reverse proxy)
@@ -21,17 +30,13 @@
# be a very long sequence of random characters. You don't need to remember it.
#PAPERLESS_SECRET_KEY=change-me
# Use this variable to set a timezone for the Paperless Docker containers. Defaults to UTC.
# Use this variable to set a timezone for the Paperless Docker containers. If not specified, defaults to UTC.
#PAPERLESS_TIME_ZONE=America/Los_Angeles
# The default language to use for OCR. Set this to the language most of your
# documents are written in.
#PAPERLESS_OCR_LANGUAGE=eng
# Additional languages to install for text recognition, separated by a whitespace.
# Note that this is different from PAPERLESS_OCR_LANGUAGE (default=eng), which defines
# the language used for OCR.
# The container installs English, German, Italian, Spanish and French by default.
# See https://packages.debian.org/search?keywords=tesseract-ocr-&searchon=names&suite=buster
# for available languages.
#PAPERLESS_OCR_LANGUAGES=tur ces
# Set if accessing paperless via a domain subpath e.g. https://domain.com/PATHPREFIX and using a reverse-proxy like traefik or nginx
#PAPERLESS_FORCE_SCRIPT_NAME=/PATHPREFIX
#PAPERLESS_STATIC_URL=/PATHPREFIX/static/ # trailing slash required
+8 -8
View File
@@ -81,8 +81,8 @@ $ docker compose down
1. If you pull the image from the docker hub, all you need to do is:
```shell-session
docker compose pull
docker compose up
$ docker compose pull
$ docker compose up
```
The Docker Compose files refer to the `latest` version, which is
@@ -91,9 +91,9 @@ $ docker compose down
1. If you built the image yourself, do the following:
```shell-session
git pull
docker compose build
docker compose up
$ git pull
$ docker compose build
$ docker compose up
```
Running `docker compose up` will also apply any new database migrations.
@@ -155,7 +155,7 @@ following:
environment before that, if you use one.
```shell-session
pip install -r requirements.txt
$ pip install -r requirements.txt
```
!!! note
@@ -168,8 +168,8 @@ following:
3. Migrate the database.
```shell-session
cd src
python3 manage.py migrate # (1)
$ cd src
$ python3 manage.py migrate # (1)
```
1. Including `sudo -Hu <paperless_user>` may be required
+8 -13
View File
@@ -308,7 +308,7 @@ Paperless provides the following variables for use within filenames:
- `{{ tag_list }}`: A comma separated list of all tags assigned to the
document.
- `{{ title }}`: The title of the document.
- `{{ created }}`: The full date (ISO 8601 format, e.g. `2024-03-14`) the document was created.
- `{{ created }}`: The full date (ISO format) the document was created.
- `{{ created_year }}`: Year created only, formatted as the year with
century.
- `{{ created_year_short }}`: Year created only, formatted as the year
@@ -476,7 +476,7 @@ a document with an ASN of 355 would be placed in `somepath/asn-201-400/asn-3xx/T
/{{ title }}
```
For a PDF document, it would result in `pdfs/Title.pdf`, but for a PNG document, the path would be `pngs/Title.png`.
For a PDF document, it would result in `pdfs/Title.pdf`, but for a PNG document, the path would be `pngs/Title.pdf`.
To use custom fields:
@@ -585,13 +585,10 @@ services:
### Case Sensitivity
The database interface does not provide a method to configure a MySQL
database to be case-sensitive. A case-**in**sensitive database prevents a user from creating a
database to be case sensitive. This would prevent a user from creating a
tag `Name` and `NAME` as they are considered the same.
However, there is a downside to turning on case sensitivity, as it also makes searches case-sensitive,
so for example a document with the title `Invoice` won't be found when searching for `invoice`.
Per Django documentation, making a database case-sensitive requires manual intervention.
Per Django documentation, to enable this requires manual intervention.
To enable case sensitive tables, you can execute the following command
against each table:
@@ -608,8 +605,6 @@ existing tables) with:
an older system may fix issues that can arise while setting up Paperless-ngx but
`utf8mb3` can cause issues with consumption (where `utf8mb4` does not).
For more information on this topic, you can refer to [this](https://code.djangoproject.com/ticket/9682) Django issue.
### Missing timezones
MySQL as well as MariaDB do not have any timezone information by default (though some
@@ -811,13 +806,13 @@ gpg --decrypt name_of_file.asc
First, enable the [PAPERLESS_ENABLE_GPG_DECRYPTOR environment variable](configuration.md#PAPERLESS_ENABLE_GPG_DECRYPTOR).
Then determine your local `gpg-agent` socket by invoking
Then determine your local `gpg-agent.extra` socket by invoking
```
gpgconf --list-dir agent-socket
gpgconf --list-dir agent-extra-socket
```
on your host. A possible output is `~/.gnupg/S.gpg-agent`.
on your host. A possible output is `~/.gnupg/S.gpg-agent.extra`.
Also find the location of your public keyring.
If using docker, you'll need to add the following volume mounts to your `docker-compose.yml` file:
@@ -826,7 +821,7 @@ If using docker, you'll need to add the following volume mounts to your `docker-
webserver:
volumes:
- /home/user/.gnupg/pubring.gpg:/usr/src/paperless/.gnupg/pubring.gpg
- <path to gpg-agent socket>:/usr/src/paperless/.gnupg/S.gpg-agent
- <path to gpg-agent.extra socket>:/usr/src/paperless/.gnupg/S.gpg-agent
```
For a 'bare-metal' installation no further configuration is necessary. If you
-18
View File
@@ -365,10 +365,6 @@ The endpoint supports the following optional form fields:
- `custom_fields`: An array of custom field ids to assign (with an empty
value) to the document.
!!! note
Sending a `Content-Length` header with correct size is mandatory.
The endpoint will immediately return HTTP 200 if the document consumption
process was started successfully, with the UUID of the consumption task
as the data. No additional status information about the consumption process
@@ -541,12 +537,6 @@ server, the following procedure should be performed:
2. Determine whether the client is compatible with this server based on
the presence/absence of these headers and their values if present.
### API Version Deprecation Policy
Older API versions are guaranteed to be supported for at least one year
after the release of a new API version. After that, support for older
API versions may be (but is not guaranteed to be) dropped.
### API Changelog
#### Version 1
@@ -579,11 +569,3 @@ Initial API version.
#### Version 6
- Moved acknowledge tasks endpoint to be under `/api/tasks/acknowledge/`.
#### Version 7
- The format of select type custom fields has changed to return the options
as an array of objects with `id` and `label` fields as opposed to a simple
list of strings. When creating or updating a custom field value of a
document for a select type custom field, the value should be the `id` of
the option whereas previously was the index of the option.
-322
View File
@@ -1,327 +1,5 @@
# Changelog
## paperless-ngx 2.14.7
### Features
- Enhancement: require totp code for obtain auth token by [@shamoon](https://github.com/shamoon) [#8936](https://github.com/paperless-ngx/paperless-ngx/pull/8936)
### Bug Fixes
- Enhancement: require totp code for obtain auth token by [@shamoon](https://github.com/shamoon) [#8936](https://github.com/paperless-ngx/paperless-ngx/pull/8936)
- Fix: reflect doc links in bulk modify custom fields by [@shamoon](https://github.com/shamoon) [#8962](https://github.com/paperless-ngx/paperless-ngx/pull/8962)
- Fix: also ensure symmetric doc link removal on bulk edit by [@shamoon](https://github.com/shamoon) [#8963](https://github.com/paperless-ngx/paperless-ngx/pull/8963)
### All App Changes
<details>
<summary>4 changes</summary>
- Chore(deps-dev): Bump ruff from 0.9.2 to 0.9.3 in the development group by @[dependabot[bot]](https://github.com/apps/dependabot) [#8928](https://github.com/paperless-ngx/paperless-ngx/pull/8928)
- Enhancement: require totp code for obtain auth token by [@shamoon](https://github.com/shamoon) [#8936](https://github.com/paperless-ngx/paperless-ngx/pull/8936)
- Fix: reflect doc links in bulk modify custom fields by [@shamoon](https://github.com/shamoon) [#8962](https://github.com/paperless-ngx/paperless-ngx/pull/8962)
- Fix: also ensure symmetric doc link removal on bulk edit by [@shamoon](https://github.com/shamoon) [#8963](https://github.com/paperless-ngx/paperless-ngx/pull/8963)
</details>
## paperless-ngx 2.14.6
### Bug Fixes
- Fix: backwards-compatible versioned API response for custom field select fields, update default API version [@shamoon](https://github.com/shamoon) ([#8912](https://github.com/paperless-ngx/paperless-ngx/pull/8912))
- Tweak: place items with 0 documents at bottom of filterable list, retain alphabetical [@shamoon](https://github.com/shamoon) ([#8924](https://github.com/paperless-ngx/paperless-ngx/pull/8924))
- Fix: set larger page size for abstract service getFew [@shamoon](https://github.com/shamoon) ([#8920](https://github.com/paperless-ngx/paperless-ngx/pull/8920))
- Fix/refactor: remove doc observables, fix username async [@shamoon](https://github.com/shamoon) ([#8908](https://github.com/paperless-ngx/paperless-ngx/pull/8908))
- Fix: include missing fields for saved view widgets [@shamoon](https://github.com/shamoon) ([#8905](https://github.com/paperless-ngx/paperless-ngx/pull/8905))
- Fix: force set document not dirty before close after save [@shamoon](https://github.com/shamoon) ([#8888](https://github.com/paperless-ngx/paperless-ngx/pull/8888))
- Fixhancement: restore search highlighting and add for built-in viewer [@shamoon](https://github.com/shamoon) ([#8885](https://github.com/paperless-ngx/paperless-ngx/pull/8885))
- Fix: resolve cpu usage due to incorrect interval use [@shamoon](https://github.com/shamoon) ([#8884](https://github.com/paperless-ngx/paperless-ngx/pull/8884))
### All App Changes
<details>
<summary>10 changes</summary>
- Fix: backwards-compatible versioned API response for custom field select fields, update default API version [@shamoon](https://github.com/shamoon) ([#8912](https://github.com/paperless-ngx/paperless-ngx/pull/8912))
- Tweak: place items with 0 documents at bottom of filterable list, retain alphabetical [@shamoon](https://github.com/shamoon) ([#8924](https://github.com/paperless-ngx/paperless-ngx/pull/8924))
- Fix: set larger page size for abstract service getFew [@shamoon](https://github.com/shamoon) ([#8920](https://github.com/paperless-ngx/paperless-ngx/pull/8920))
- Fix/refactor: remove doc observables, fix username async [@shamoon](https://github.com/shamoon) ([#8908](https://github.com/paperless-ngx/paperless-ngx/pull/8908))
- Fix: include missing fields for saved view widgets [@shamoon](https://github.com/shamoon) ([#8905](https://github.com/paperless-ngx/paperless-ngx/pull/8905))
- Chore: Upgrades dependencies and hook versions [@stumpylog](https://github.com/stumpylog) ([#8895](https://github.com/paperless-ngx/paperless-ngx/pull/8895))
- Fix: force set document not dirty before close after save [@shamoon](https://github.com/shamoon) ([#8888](https://github.com/paperless-ngx/paperless-ngx/pull/8888))
- Change: Revert dropdown sorting by doc count [@shamoon](https://github.com/shamoon) ([#8887](https://github.com/paperless-ngx/paperless-ngx/pull/8887))
- Fixhancement: restore search highlighting and add for built-in viewer [@shamoon](https://github.com/shamoon) ([#8885](https://github.com/paperless-ngx/paperless-ngx/pull/8885))
- Fix: resolve cpu usage due to incorrect interval use [@shamoon](https://github.com/shamoon) ([#8884](https://github.com/paperless-ngx/paperless-ngx/pull/8884))
</details>
## paperless-ngx 2.14.5
### Features
- Change: restrict altering and creation of superusers to superusers only [@shamoon](https://github.com/shamoon) ([#8837](https://github.com/paperless-ngx/paperless-ngx/pull/8837))
### Bug Fixes
- Fix: fix long tag visual wrapping [@shamoon](https://github.com/shamoon) ([#8833](https://github.com/paperless-ngx/paperless-ngx/pull/8833))
- Fix: Enforce classifier training ordering to prevent extra training [@stumpylog](https://github.com/stumpylog) ([#8822](https://github.com/paperless-ngx/paperless-ngx/pull/8822))
- Fix: import router module to not found component [@shamoon](https://github.com/shamoon) ([#8821](https://github.com/paperless-ngx/paperless-ngx/pull/8821))
- Fix: better reflect some mail account / rule permissions in UI [@shamoon](https://github.com/shamoon) ([#8812](https://github.com/paperless-ngx/paperless-ngx/pull/8812))
### Dependencies
- Chore(deps-dev): Bump undici from 5.28.4 to 5.28.5 in /src-ui @[dependabot[bot]](https://github.com/apps/dependabot) ([#8851](https://github.com/paperless-ngx/paperless-ngx/pull/8851))
- Chore(deps-dev): Bump the development group with 2 updates @[dependabot[bot]](https://github.com/apps/dependabot) ([#8841](https://github.com/paperless-ngx/paperless-ngx/pull/8841))
### All App Changes
<details>
<summary>9 changes</summary>
- Chore(deps-dev): Bump undici from 5.28.4 to 5.28.5 in /src-ui @[dependabot[bot]](https://github.com/apps/dependabot) ([#8851](https://github.com/paperless-ngx/paperless-ngx/pull/8851))
- Chore(deps-dev): Bump the development group with 2 updates @[dependabot[bot]](https://github.com/apps/dependabot) ([#8841](https://github.com/paperless-ngx/paperless-ngx/pull/8841))
- Chore: use simpler method for attaching files to emails [@shamoon](https://github.com/shamoon) ([#8845](https://github.com/paperless-ngx/paperless-ngx/pull/8845))
- Change: restrict altering and creation of superusers to superusers only [@shamoon](https://github.com/shamoon) ([#8837](https://github.com/paperless-ngx/paperless-ngx/pull/8837))
- Fix: fix long tag visual wrapping [@shamoon](https://github.com/shamoon) ([#8833](https://github.com/paperless-ngx/paperless-ngx/pull/8833))
- Change: allow generate auth token without a usable password [@shamoon](https://github.com/shamoon) ([#8824](https://github.com/paperless-ngx/paperless-ngx/pull/8824))
- Fix: Enforce classifier training ordering to prevent extra training [@stumpylog](https://github.com/stumpylog) ([#8822](https://github.com/paperless-ngx/paperless-ngx/pull/8822))
- Fix: import router module to not found component [@shamoon](https://github.com/shamoon) ([#8821](https://github.com/paperless-ngx/paperless-ngx/pull/8821))
- Fix: better reflect some mail account / rule permissions in UI [@shamoon](https://github.com/shamoon) ([#8812](https://github.com/paperless-ngx/paperless-ngx/pull/8812))
</details>
## paperless-ngx 2.14.4
### Features
- Enhancement: allow specifying JSON encoding for webhooks [@shamoon](https://github.com/shamoon) ([#8799](https://github.com/paperless-ngx/paperless-ngx/pull/8799))
- Change: disable API basic auth if MFA enabled [@shamoon](https://github.com/shamoon) ([#8792](https://github.com/paperless-ngx/paperless-ngx/pull/8792))
### Bug Fixes
- Fix: Include email and webhook objects in the export [@stumpylog](https://github.com/stumpylog) ([#8790](https://github.com/paperless-ngx/paperless-ngx/pull/8790))
- Fix: use MIMEBase for email attachments [@shamoon](https://github.com/shamoon) ([#8762](https://github.com/paperless-ngx/paperless-ngx/pull/8762))
- Fix: handle page out of range in mgmt lists after delete [@shamoon](https://github.com/shamoon) ([#8771](https://github.com/paperless-ngx/paperless-ngx/pull/8771))
### All App Changes
<details>
<summary>5 changes</summary>
- Enhancement: allow specifying JSON encoding for webhooks [@shamoon](https://github.com/shamoon) ([#8799](https://github.com/paperless-ngx/paperless-ngx/pull/8799))
- Change: disable API basic auth if MFA enabled [@shamoon](https://github.com/shamoon) ([#8792](https://github.com/paperless-ngx/paperless-ngx/pull/8792))
- Fix: Include email and webhook objects in the export [@stumpylog](https://github.com/stumpylog) ([#8790](https://github.com/paperless-ngx/paperless-ngx/pull/8790))
- Fix: use MIMEBase for email attachments [@shamoon](https://github.com/shamoon) ([#8762](https://github.com/paperless-ngx/paperless-ngx/pull/8762))
- Fix: handle page out of range in mgmt lists after delete [@shamoon](https://github.com/shamoon) ([#8771](https://github.com/paperless-ngx/paperless-ngx/pull/8771))
</details>
## paperless-ngx 2.14.3
### Bug Fixes
- Fix: Adds a default 30s timeout for emails, instead of no timeout [@stumpylog](https://github.com/stumpylog) ([#8757](https://github.com/paperless-ngx/paperless-ngx/pull/8757))
- Fix: import forms modules for entries component [@shamoon](https://github.com/shamoon) ([#8752](https://github.com/paperless-ngx/paperless-ngx/pull/8752))
- Fix: fix email/wh actions on consume started [@shamoon](https://github.com/shamoon) ([#8750](https://github.com/paperless-ngx/paperless-ngx/pull/8750))
- Fix: import date picker module in cf query dropdown [@shamoon](https://github.com/shamoon) ([#8749](https://github.com/paperless-ngx/paperless-ngx/pull/8749))
### All App Changes
<details>
<summary>5 changes</summary>
- Fix: Adds a default 30s timeout for emails, instead of no timeout [@stumpylog](https://github.com/stumpylog) ([#8757](https://github.com/paperless-ngx/paperless-ngx/pull/8757))
- Enhancement: set autofocus on MFA code field [@mxmehl](https://github.com/mxmehl) ([#8756](https://github.com/paperless-ngx/paperless-ngx/pull/8756))
- Fix: import forms modules for entries component [@shamoon](https://github.com/shamoon) ([#8752](https://github.com/paperless-ngx/paperless-ngx/pull/8752))
- Fix: fix email/wh actions on consume started [@shamoon](https://github.com/shamoon) ([#8750](https://github.com/paperless-ngx/paperless-ngx/pull/8750))
- Fix: import date picker module in cf query dropdown [@shamoon](https://github.com/shamoon) ([#8749](https://github.com/paperless-ngx/paperless-ngx/pull/8749))
</details>
## paperless-ngx 2.14.2
### Bug Fixes
- Fix: dont try to parse empty webhook params [@shamoon](https://github.com/shamoon) ([#8742](https://github.com/paperless-ngx/paperless-ngx/pull/8742))
- Fix: pass working file to workflows, pickle file bytes [@shamoon](https://github.com/shamoon) ([#8741](https://github.com/paperless-ngx/paperless-ngx/pull/8741))
- Fix: use hard delete when bulk editing custom fields [@shamoon](https://github.com/shamoon) ([#8740](https://github.com/paperless-ngx/paperless-ngx/pull/8740))
- Fix: Ensure email attachments use the latest document path for attachments [@stumpylog](https://github.com/stumpylog) ([#8737](https://github.com/paperless-ngx/paperless-ngx/pull/8737))
- Fix: include tooltip module for custom fields display [@shamoon](https://github.com/shamoon) ([#8739](https://github.com/paperless-ngx/paperless-ngx/pull/8739))
- Fix: remove id of webhook/email actions on copy [@shamoon](https://github.com/shamoon) ([#8729](https://github.com/paperless-ngx/paperless-ngx/pull/8729))
- Fix: import dnd module for merge confirm dialog [@shamoon](https://github.com/shamoon) ([#8727](https://github.com/paperless-ngx/paperless-ngx/pull/8727))
### Dependencies
- Chore(deps): Bump django from 5.1.4 to 5.1.5 [@dependabot](https://github.com/dependabot) ([#8738](https://github.com/paperless-ngx/paperless-ngx/pull/8738))
### All App Changes
<details>
<summary>7 changes</summary>
- Fix: dont try to parse empty webhook params [@shamoon](https://github.com/shamoon) ([#8742](https://github.com/paperless-ngx/paperless-ngx/pull/8742))
- Fix: pass working file to workflows, pickle file bytes [@shamoon](https://github.com/shamoon) ([#8741](https://github.com/paperless-ngx/paperless-ngx/pull/8741))
- Fix: use hard delete when bulk editing custom fields [@shamoon](https://github.com/shamoon) ([#8740](https://github.com/paperless-ngx/paperless-ngx/pull/8740))
- Fix: Ensure email attachments use the latest document path for attachments [@stumpylog](https://github.com/stumpylog) ([#8737](https://github.com/paperless-ngx/paperless-ngx/pull/8737))
- Fix: include tooltip module for custom fields display [@shamoon](https://github.com/shamoon) ([#8739](https://github.com/paperless-ngx/paperless-ngx/pull/8739))
- Fix: remove id of webhook/email actions on copy [@shamoon](https://github.com/shamoon) ([#8729](https://github.com/paperless-ngx/paperless-ngx/pull/8729))
- Fix: import dnd module for merge confirm dialog [@shamoon](https://github.com/shamoon) ([#8727](https://github.com/paperless-ngx/paperless-ngx/pull/8727))
</details>
## paperless-ngx 2.14.1
### Bug Fixes
- Fix: prevent error if bulk edit method not in MODIFIED_FIELD_BY_METHOD [@shamoon](https://github.com/shamoon) ([#8710](https://github.com/paperless-ngx/paperless-ngx/pull/8710))
- Fix: include tag component in list view [@shamoon](https://github.com/shamoon) ([#8706](https://github.com/paperless-ngx/paperless-ngx/pull/8706))
- Fix: use unmodified original for checksum if exists [@shamoon](https://github.com/shamoon) ([#8693](https://github.com/paperless-ngx/paperless-ngx/pull/8693))
- Fix: complete load with native PDF viewer [@shamoon](https://github.com/shamoon) ([#8699](https://github.com/paperless-ngx/paperless-ngx/pull/8699))
### All App Changes
<details>
<summary>4 changes</summary>
- Fix: prevent error if bulk edit method not in MODIFIED_FIELD_BY_METHOD [@shamoon](https://github.com/shamoon) ([#8710](https://github.com/paperless-ngx/paperless-ngx/pull/8710))
- Fix: include tag component in list view [@shamoon](https://github.com/shamoon) ([#8706](https://github.com/paperless-ngx/paperless-ngx/pull/8706))
- Fix: use unmodified original for checksum if exists [@shamoon](https://github.com/shamoon) ([#8693](https://github.com/paperless-ngx/paperless-ngx/pull/8693))
- Fix: complete load with native PDF viewer [@shamoon](https://github.com/shamoon) ([#8699](https://github.com/paperless-ngx/paperless-ngx/pull/8699))
</details>
## paperless-ngx 2.14.0
### Features
- Enhancement: custom field sorting [@shamoon](https://github.com/shamoon) ([#8494](https://github.com/paperless-ngx/paperless-ngx/pull/8494))
- Enhancement: process mail button [@shamoon](https://github.com/shamoon) ([#8466](https://github.com/paperless-ngx/paperless-ngx/pull/8466))
- Feature: bulk edit custom field values [@shamoon](https://github.com/shamoon) ([#8428](https://github.com/paperless-ngx/paperless-ngx/pull/8428))
- Enhancement: improved loading visuals [@shamoon](https://github.com/shamoon) ([#8435](https://github.com/paperless-ngx/paperless-ngx/pull/8435))
- Enhancement: prune audit logs and management command [@shamoon](https://github.com/shamoon) ([#8416](https://github.com/paperless-ngx/paperless-ngx/pull/8416))
- Change: make saved views manage its own component [@shamoon](https://github.com/shamoon) ([#8423](https://github.com/paperless-ngx/paperless-ngx/pull/8423))
- Enhancement: file task filtering [@shamoon](https://github.com/shamoon) ([#8421](https://github.com/paperless-ngx/paperless-ngx/pull/8421))
- Enhancement: auto-link duplicate document [@shamoon](https://github.com/shamoon) ([#8415](https://github.com/paperless-ngx/paperless-ngx/pull/8415))
- Feature: email, webhook workflow actions [@shamoon](https://github.com/shamoon) ([#8108](https://github.com/paperless-ngx/paperless-ngx/pull/8108))
- Enhancement: use stable unique IDs for custom field select options [@shamoon](https://github.com/shamoon) ([#8299](https://github.com/paperless-ngx/paperless-ngx/pull/8299))
- Enhancement: better TIFF display browser support [@shamoon](https://github.com/shamoon) ([#8087](https://github.com/paperless-ngx/paperless-ngx/pull/8087))
- Enhancement: filterable list count sorting and opacification [@shamoon](https://github.com/shamoon) ([#8386](https://github.com/paperless-ngx/paperless-ngx/pull/8386))
- Enhancement: preview button for document list and trash, refactor [@shamoon](https://github.com/shamoon) ([#8384](https://github.com/paperless-ngx/paperless-ngx/pull/8384))
- Enhancement: use theme-color meta tag [@shamoon](https://github.com/shamoon) ([#8359](https://github.com/paperless-ngx/paperless-ngx/pull/8359))
- Feature: scheduled workflow trigger [@shamoon](https://github.com/shamoon) ([#8036](https://github.com/paperless-ngx/paperless-ngx/pull/8036))
- Enhancement: support owner permissions for file tasks [@shamoon](https://github.com/shamoon) ([#8195](https://github.com/paperless-ngx/paperless-ngx/pull/8195))
- Fixhancement: change update content to handle archive disabled [@shamoon](https://github.com/shamoon) ([#8315](https://github.com/paperless-ngx/paperless-ngx/pull/8315))
- Enhancement: next / previous shortcuts for document list [@shamoon](https://github.com/shamoon) ([#8309](https://github.com/paperless-ngx/paperless-ngx/pull/8309))
- Feature: two-factor authentication [@shamoon](https://github.com/shamoon) ([#8012](https://github.com/paperless-ngx/paperless-ngx/pull/8012))
- Enhancement: save \& next / close shortcut key [@shamoon](https://github.com/shamoon) ([#8243](https://github.com/paperless-ngx/paperless-ngx/pull/8243))
- Feature: loading preview, better text popup preview [@shamoon](https://github.com/shamoon) ([#8011](https://github.com/paperless-ngx/paperless-ngx/pull/8011))
### Bug Fixes
- Fix: add some minor frontend permissions checks [@shamoon](https://github.com/shamoon) ([#8524](https://github.com/paperless-ngx/paperless-ngx/pull/8524))
- FIx: obliquely trim spaces from global search [@shamoon](https://github.com/shamoon) ([#8484](https://github.com/paperless-ngx/paperless-ngx/pull/8484))
- Fix: include global perms for bulk edit endpoint [@shamoon](https://github.com/shamoon) ([#8468](https://github.com/paperless-ngx/paperless-ngx/pull/8468))
- Fix: frontend better reflect global perms for bulk edit, disabled form state [@shamoon](https://github.com/shamoon) ([#8469](https://github.com/paperless-ngx/paperless-ngx/pull/8469))
- Fixhancement: dispatch change event from current field prior to save [@shamoon](https://github.com/shamoon) ([#8369](https://github.com/paperless-ngx/paperless-ngx/pull/8369))
- Fix: Fixes install script to handle languages with dashes or underscores [@stumpylog](https://github.com/stumpylog) ([#8341](https://github.com/paperless-ngx/paperless-ngx/pull/8341))
- Fix: handle very old dates with positive offset too [@shamoon](https://github.com/shamoon) ([#8335](https://github.com/paperless-ngx/paperless-ngx/pull/8335))
- Fixhancement: change update content to handle archive disabled [@shamoon](https://github.com/shamoon) ([#8315](https://github.com/paperless-ngx/paperless-ngx/pull/8315))
- Fix: include db_index caveat in squashed migrations [@shamoon](https://github.com/shamoon) ([#8292](https://github.com/paperless-ngx/paperless-ngx/pull/8292))
- Fix: prevent duplicate workflow runs [@shamoon](https://github.com/shamoon) ([#8268](https://github.com/paperless-ngx/paperless-ngx/pull/8268))
- Fix: add note about select options to edit dialog [@shamoon](https://github.com/shamoon) ([#8267](https://github.com/paperless-ngx/paperless-ngx/pull/8267))
### Maintenance
- Chore(deps): Bump codecov/codecov-action from 4 to 5 in the actions group [@dependabot](https://github.com/dependabot) ([#8401](https://github.com/paperless-ngx/paperless-ngx/pull/8401))
### Dependencies
<details>
<summary>16 changes</summary>
- Chore(deps): Bump the small-changes group with 3 updates [@dependabot](https://github.com/dependabot) ([#8627](https://github.com/paperless-ngx/paperless-ngx/pull/8627))
- Chore(deps-dev): Bump ruff from 0.8.4 to 0.8.6 in the development group [@dependabot](https://github.com/dependabot) ([#8626](https://github.com/paperless-ngx/paperless-ngx/pull/8626))
- Chore(deps): Bump django-allauth from 65.3.0 to 65.3.1 in the django group [@dependabot](https://github.com/dependabot) ([#8574](https://github.com/paperless-ngx/paperless-ngx/pull/8574))
- Chore(deps-dev): Bump ruff from 0.8.3 to 0.8.4 in the development group [@dependabot](https://github.com/dependabot) ([#8546](https://github.com/paperless-ngx/paperless-ngx/pull/8546))
- Chore(deps): Bump the small-changes group with 6 updates [@dependabot](https://github.com/dependabot) ([#8547](https://github.com/paperless-ngx/paperless-ngx/pull/8547))
- Chore: update ng2 pdf viewer [@shamoon](https://github.com/shamoon) ([#8462](https://github.com/paperless-ngx/paperless-ngx/pull/8462))
- Chore(deps-dev): Bump the development group with 2 updates [@dependabot](https://github.com/dependabot) ([#8458](https://github.com/paperless-ngx/paperless-ngx/pull/8458))
- Chore(deps): Bump django-soft-delete from 1.0.15 to 1.0.16 in the django group [@dependabot](https://github.com/dependabot) ([#8459](https://github.com/paperless-ngx/paperless-ngx/pull/8459))
- Chore(deps): Bump the small-changes group with 4 updates [@dependabot](https://github.com/dependabot) ([#8460](https://github.com/paperless-ngx/paperless-ngx/pull/8460))
- Chore(deps): Bump django from 5.1.3 to 5.1.4 [@dependabot](https://github.com/dependabot) ([#8445](https://github.com/paperless-ngx/paperless-ngx/pull/8445))
- Chore(deps-dev): Bump the development group with 4 updates [@dependabot](https://github.com/dependabot) ([#8414](https://github.com/paperless-ngx/paperless-ngx/pull/8414))
- Chore(deps): Bump codecov/codecov-action from 4 to 5 in the actions group [@dependabot](https://github.com/dependabot) ([#8401](https://github.com/paperless-ngx/paperless-ngx/pull/8401))
- Chore(deps-dev): Bump the development group with 4 updates [@dependabot](https://github.com/dependabot) ([#8352](https://github.com/paperless-ngx/paperless-ngx/pull/8352))
- Chore(deps): Bump the small-changes group across 1 directory with 7 updates [@dependabot](https://github.com/dependabot) ([#8399](https://github.com/paperless-ngx/paperless-ngx/pull/8399))
- Chore(deps): Bump tornado from 6.4.1 to 6.4.2 [@dependabot](https://github.com/dependabot) ([#8336](https://github.com/paperless-ngx/paperless-ngx/pull/8336))
- Chore(deps): Bump watchdog from 5.0.3 to 6.0.0 in the major-versions group [@dependabot](https://github.com/dependabot) ([#8257](https://github.com/paperless-ngx/paperless-ngx/pull/8257))
</details>
### All App Changes
<details>
<summary>65 changes</summary>
- Fix: use state param with oauth [@shamoon](https://github.com/shamoon) ([#8636](https://github.com/paperless-ngx/paperless-ngx/pull/8636))
- Fix: check permissions for all documents via bulk download [@shamoon](https://github.com/shamoon) ([#8631](https://github.com/paperless-ngx/paperless-ngx/pull/8631))
- Chore(deps): Bump the small-changes group with 3 updates [@dependabot](https://github.com/dependabot) ([#8627](https://github.com/paperless-ngx/paperless-ngx/pull/8627))
- Chore(deps-dev): Bump ruff from 0.8.4 to 0.8.6 in the development group [@dependabot](https://github.com/dependabot) ([#8626](https://github.com/paperless-ngx/paperless-ngx/pull/8626))
- Chore: Switch from os.path to pathlib.Path [@gothicVI](https://github.com/gothicVI) ([#8325](https://github.com/paperless-ngx/paperless-ngx/pull/8325))
- Chore: disable max-age for some document endpoints [@tsia](https://github.com/tsia) ([#8611](https://github.com/paperless-ngx/paperless-ngx/pull/8611))
- Fix: do not accept empty string for doc link value via API [@shamoon](https://github.com/shamoon) ([#8596](https://github.com/paperless-ngx/paperless-ngx/pull/8596))
- Enhancement: angular 19 [@shamoon](https://github.com/shamoon) ([#8584](https://github.com/paperless-ngx/paperless-ngx/pull/8584))
- Fix: fix hotkey arrows [@shamoon](https://github.com/shamoon) ([#8583](https://github.com/paperless-ngx/paperless-ngx/pull/8583))
- Chore: remove outdated admin logentry handler [@shamoon](https://github.com/shamoon) ([#8580](https://github.com/paperless-ngx/paperless-ngx/pull/8580))
- Chore(deps): Bump django-allauth from 65.3.0 to 65.3.1 in the django group [@dependabot](https://github.com/dependabot) ([#8574](https://github.com/paperless-ngx/paperless-ngx/pull/8574))
- Enhancement: custom field sorting [@shamoon](https://github.com/shamoon) ([#8494](https://github.com/paperless-ngx/paperless-ngx/pull/8494))
- Fix: fix occasional error toast overflow [@shamoon](https://github.com/shamoon) ([#8552](https://github.com/paperless-ngx/paperless-ngx/pull/8552))
- Fix: fix share link archive version detection [@shamoon](https://github.com/shamoon) ([#8551](https://github.com/paperless-ngx/paperless-ngx/pull/8551))
- Chore(deps-dev): Bump ruff from 0.8.3 to 0.8.4 in the development group [@dependabot](https://github.com/dependabot) ([#8546](https://github.com/paperless-ngx/paperless-ngx/pull/8546))
- Chore(deps): Bump the small-changes group with 6 updates [@dependabot](https://github.com/dependabot) ([#8547](https://github.com/paperless-ngx/paperless-ngx/pull/8547))
- Enhancement: add timeout for Tika client [@HiranChaudhuri](https://github.com/HiranChaudhuri) ([#8520](https://github.com/paperless-ngx/paperless-ngx/pull/8520))
- Fix: add some minor frontend permissions checks [@shamoon](https://github.com/shamoon) ([#8524](https://github.com/paperless-ngx/paperless-ngx/pull/8524))
- FIx: obliquely trim spaces from global search [@shamoon](https://github.com/shamoon) ([#8484](https://github.com/paperless-ngx/paperless-ngx/pull/8484))
- Fix: include global perms for bulk edit endpoint [@shamoon](https://github.com/shamoon) ([#8468](https://github.com/paperless-ngx/paperless-ngx/pull/8468))
- Enhancement: process mail button [@shamoon](https://github.com/shamoon) ([#8466](https://github.com/paperless-ngx/paperless-ngx/pull/8466))
- Fix: frontend better reflect global perms for bulk edit, disabled form state [@shamoon](https://github.com/shamoon) ([#8469](https://github.com/paperless-ngx/paperless-ngx/pull/8469))
- Chore: update ng2 pdf viewer [@shamoon](https://github.com/shamoon) ([#8462](https://github.com/paperless-ngx/paperless-ngx/pull/8462))
- Chore(deps-dev): Bump the development group with 2 updates [@dependabot](https://github.com/dependabot) ([#8458](https://github.com/paperless-ngx/paperless-ngx/pull/8458))
- Chore(deps): Bump django-soft-delete from 1.0.15 to 1.0.16 in the django group [@dependabot](https://github.com/dependabot) ([#8459](https://github.com/paperless-ngx/paperless-ngx/pull/8459))
- Chore(deps): Bump the small-changes group with 4 updates [@dependabot](https://github.com/dependabot) ([#8460](https://github.com/paperless-ngx/paperless-ngx/pull/8460))
- Chore: use rxjs instead of JS setInterval for timers [@shamoon](https://github.com/shamoon) ([#8461](https://github.com/paperless-ngx/paperless-ngx/pull/8461))
- Feature: bulk edit custom field values [@shamoon](https://github.com/shamoon) ([#8428](https://github.com/paperless-ngx/paperless-ngx/pull/8428))
- Enhancement: improved loading visuals [@shamoon](https://github.com/shamoon) ([#8435](https://github.com/paperless-ngx/paperless-ngx/pull/8435))
- Enhancement: prune audit logs and management command [@shamoon](https://github.com/shamoon) ([#8416](https://github.com/paperless-ngx/paperless-ngx/pull/8416))
- Change: make saved views manage its own component [@shamoon](https://github.com/shamoon) ([#8423](https://github.com/paperless-ngx/paperless-ngx/pull/8423))
- Enhancement: file task filtering [@shamoon](https://github.com/shamoon) ([#8421](https://github.com/paperless-ngx/paperless-ngx/pull/8421))
- Enhancement: auto-link duplicate document [@shamoon](https://github.com/shamoon) ([#8415](https://github.com/paperless-ngx/paperless-ngx/pull/8415))
- Enhancement: include current filename placeholder in workflows @Lu-Fi ([#8319](https://github.com/paperless-ngx/paperless-ngx/pull/8319))
- Feature: email, webhook workflow actions [@shamoon](https://github.com/shamoon) ([#8108](https://github.com/paperless-ngx/paperless-ngx/pull/8108))
- Chore(deps-dev): Bump the development group with 4 updates [@dependabot](https://github.com/dependabot) ([#8414](https://github.com/paperless-ngx/paperless-ngx/pull/8414))
- Enhancement: use stable unique IDs for custom field select options [@shamoon](https://github.com/shamoon) ([#8299](https://github.com/paperless-ngx/paperless-ngx/pull/8299))
- Chore(deps-dev): Bump the development group with 4 updates [@dependabot](https://github.com/dependabot) ([#8352](https://github.com/paperless-ngx/paperless-ngx/pull/8352))
- Enhancement: better TIFF display browser support [@shamoon](https://github.com/shamoon) ([#8087](https://github.com/paperless-ngx/paperless-ngx/pull/8087))
- Chore(deps): Bump the small-changes group across 1 directory with 7 updates [@dependabot](https://github.com/dependabot) ([#8399](https://github.com/paperless-ngx/paperless-ngx/pull/8399))
- Enhancement: History (audit log) for bulk edit operations [@shamoon](https://github.com/shamoon) ([#8196](https://github.com/paperless-ngx/paperless-ngx/pull/8196))
- Enhancement: larger previews in action dialogs [@shamoon](https://github.com/shamoon) ([#8387](https://github.com/paperless-ngx/paperless-ngx/pull/8387))
- Enhancement: filterable list count sorting and opacification [@shamoon](https://github.com/shamoon) ([#8386](https://github.com/paperless-ngx/paperless-ngx/pull/8386))
- Enhancement: preview button for document list and trash, refactor [@shamoon](https://github.com/shamoon) ([#8384](https://github.com/paperless-ngx/paperless-ngx/pull/8384))
- Fixhancement: dispatch change event from current field prior to save [@shamoon](https://github.com/shamoon) ([#8369](https://github.com/paperless-ngx/paperless-ngx/pull/8369))
- Enhancement: use theme-color meta tag [@shamoon](https://github.com/shamoon) ([#8359](https://github.com/paperless-ngx/paperless-ngx/pull/8359))
- Chore: cleanup urls, use actions for some views [@shamoon](https://github.com/shamoon) ([#8346](https://github.com/paperless-ngx/paperless-ngx/pull/8346))
- Feature: scheduled workflow trigger [@shamoon](https://github.com/shamoon) ([#8036](https://github.com/paperless-ngx/paperless-ngx/pull/8036))
- Fix: handle very old dates with positive offset too [@shamoon](https://github.com/shamoon) ([#8335](https://github.com/paperless-ngx/paperless-ngx/pull/8335))
- Refactor: fix unnecessary use of filterable dropdown sorting [@shamoon](https://github.com/shamoon) ([#8328](https://github.com/paperless-ngx/paperless-ngx/pull/8328))
- Enhancement: offer link to restored document [@shamoon](https://github.com/shamoon) ([#8321](https://github.com/paperless-ngx/paperless-ngx/pull/8321))
- Enhancement: support owner permissions for file tasks [@shamoon](https://github.com/shamoon) ([#8195](https://github.com/paperless-ngx/paperless-ngx/pull/8195))
- Fixhancement: change update content to handle archive disabled [@shamoon](https://github.com/shamoon) ([#8315](https://github.com/paperless-ngx/paperless-ngx/pull/8315))
- Chore(deps): Bump watchdog from 5.0.3 to 6.0.0 in the major-versions group [@dependabot](https://github.com/dependabot) ([#8257](https://github.com/paperless-ngx/paperless-ngx/pull/8257))
- Enhancement: Add --compare-json option to document_exporter to write json files only if changed [@kdoren](https://github.com/kdoren) ([#8261](https://github.com/paperless-ngx/paperless-ngx/pull/8261))
- Enhancement: next / previous shortcuts for document list [@shamoon](https://github.com/shamoon) ([#8309](https://github.com/paperless-ngx/paperless-ngx/pull/8309))
- Feature: two-factor authentication [@shamoon](https://github.com/shamoon) ([#8012](https://github.com/paperless-ngx/paperless-ngx/pull/8012))
- Fix: include db_index caveat in squashed migrations [@shamoon](https://github.com/shamoon) ([#8292](https://github.com/paperless-ngx/paperless-ngx/pull/8292))
- Tweak: use fixed position for navbar [@shamoon](https://github.com/shamoon) ([#8279](https://github.com/paperless-ngx/paperless-ngx/pull/8279))
- Fix: prevent duplicate workflow runs [@shamoon](https://github.com/shamoon) ([#8268](https://github.com/paperless-ngx/paperless-ngx/pull/8268))
- Fix: add note about select options to edit dialog [@shamoon](https://github.com/shamoon) ([#8267](https://github.com/paperless-ngx/paperless-ngx/pull/8267))
- Enhancement: save \& next / close shortcut key [@shamoon](https://github.com/shamoon) ([#8243](https://github.com/paperless-ngx/paperless-ngx/pull/8243))
- Feature: loading preview, better text popup preview [@shamoon](https://github.com/shamoon) ([#8011](https://github.com/paperless-ngx/paperless-ngx/pull/8011))
- Chore: switch src/documents/bulk\*.py from os.path to pathlib.Path [@gothicVI](https://github.com/gothicVI) ([#7862](https://github.com/paperless-ngx/paperless-ngx/pull/7862))
- Chore: Bulk backend dependency updates [@stumpylog](https://github.com/stumpylog) ([#8212](https://github.com/paperless-ngx/paperless-ngx/pull/8212))
</details>
## paperless-ngx 2.13.5
### Bug Fixes
+11 -7
View File
@@ -198,6 +198,12 @@ Docker, this may be the `environment` key of the webserver or a
containing the configuration parameters. Be sure to use the correct format
and watch out for indentation if editing the YAML file.
#### [`PAPERLESS_EINVOICE_PARSER_ENABLED=<bool>`](#PAPERLESS_EINVOICE_PARSER_ENABLED) {#PAPERLESS_EINVOICE_PARSER_ENABLED}
: Enable (or disable) the e-invoice parser. Note that this feature requires Tika to be enabled.
Defaults to false.
## Paths and folders
#### [`PAPERLESS_CONSUMPTION_DIR=<path>`](#PAPERLESS_CONSUMPTION_DIR) {#PAPERLESS_CONSUMPTION_DIR}
@@ -596,7 +602,7 @@ system. See the corresponding
: Disables the regular frontend username / password login, i.e. once you have setup SSO. Note that this setting does not disable the Django admin login nor logging in with local credentials via the API. To prevent access to the Django admin, consider blocking `/admin/` in your [web server or reverse proxy configuration](https://github.com/paperless-ngx/paperless-ngx/wiki/Using-a-Reverse-Proxy-with-Paperless-ngx).
You can optionally also automatically redirect users to the SSO login with [PAPERLESS_REDIRECT_LOGIN_TO_SSO](#PAPERLESS_REDIRECT_LOGIN_TO_SSO)
You can optionally also automatically redirect users to the SSO login with [PAPERLESS_REDIRECT_LOGIN_TO_SSO](#PAPERLESS_REDIRECT_LOGIN_TO_SSO)
Defaults to False
@@ -1073,6 +1079,8 @@ or hidden folders some tools use to store data.
If you have problems that your Barcodes/QR-Codes are not detected
(especially with bad scan quality and/or small codes), try the other one.
zxing is not available on all platforms.
#### [`PAPERLESS_PRE_CONSUME_SCRIPT=<filename>`](#PAPERLESS_PRE_CONSUME_SCRIPT) {#PAPERLESS_PRE_CONSUME_SCRIPT}
: After some initial validation, Paperless can trigger an arbitrary
@@ -1215,10 +1223,6 @@ consumers working on the same file. Configure this to prevent that.
Defaults to none (thus will use [PAPERLESS_URL](#PAPERLESS_URL)).
!!! note
This setting only applies to OAuth Email setup (not to the SSO setup).
#### [`PAPERLESS_GMAIL_OAUTH_CLIENT_ID=<str>`](#PAPERLESS_GMAIL_OAUTH_CLIENT_ID) {#PAPERLESS_GMAIL_OAUTH_CLIENT_ID}
: The OAuth client ID for Gmail. This is required for Gmail OAuth Email setup. See [OAuth Email Setup](usage.md#oauth-email-setup) for more information.
@@ -1521,7 +1525,7 @@ one pod).
actual user ID on the host system, which you can get by executing
``` shell-session
id -u
$ id -u
```
Paperless will change ownership on its folders to this user, so you
@@ -1536,7 +1540,7 @@ actual user ID on the host system, which you can get by executing
actual group ID on the host system, which you can get by executing
``` shell-session
id -g
$ id -g
```
Paperless will change ownership on its folders to this group, so you
+12 -35
View File
@@ -69,13 +69,13 @@ first-time setup.
3. Create `consume` and `media` directories:
```bash
mkdir -p consume media
$ mkdir -p consume media
```
4. Install the Python dependencies:
```bash
pipenv install --dev
$ pipenv install --dev
```
!!! note
@@ -85,7 +85,7 @@ first-time setup.
5. Install pre-commit hooks:
```bash
pre-commit install
$ pre-commit install
```
6. Apply migrations and create a superuser for your development instance:
@@ -93,8 +93,8 @@ first-time setup.
```bash
# src/
python3 manage.py migrate
python3 manage.py createsuperuser
$ python3 manage.py migrate
$ python3 manage.py createsuperuser
```
7. You can now either ...
@@ -108,7 +108,7 @@ first-time setup.
- spin up a bare redis container
```
docker run -d -p 6379:6379 --restart unless-stopped redis:latest
$ docker run -d -p 6379:6379 --restart unless-stopped redis:latest
```
8. Continue with either back-end or front-end development or both :-).
@@ -176,7 +176,7 @@ The front end is built using AngularJS. In order to get started, you need Node.j
1. Install the Angular CLI. You might need sudo privileges to perform this command:
```bash
npm install -g @angular/cli
$ npm install -g @angular/cli
```
2. Make sure that it's on your path.
@@ -184,13 +184,13 @@ The front end is built using AngularJS. In order to get started, you need Node.j
3. Install all necessary modules:
```bash
npm install
$ npm install
```
4. You can launch a development server by running:
```bash
ng serve
$ ng serve
```
This will automatically update whenever you save. However, in-place
@@ -335,13 +335,13 @@ If you want to build the documentation locally, this is how you do it:
1. Have an active pipenv shell (`pipenv shell`) and install Python dependencies:
```bash
pipenv install --dev
$ pipenv install --dev
```
2. Build the documentation
```bash
mkdocs build --config-file mkdocs.yml
$ mkdocs build --config-file mkdocs.yml
```
_alternatively..._
@@ -352,7 +352,7 @@ If you want to build the documentation locally, this is how you do it:
something.
```bash
mkdocs serve
$ mkdocs serve
```
## Building the Docker image
@@ -450,26 +450,3 @@ def myparser_consumer_declaration(sender, **kwargs):
mime types have many extensions associated with them and the Python
methods responsible for guessing the extension do not always return
the same value.
## Using Visual Studio Code devcontainer
Another easy way to get started with development is to use Visual Studio
Code devcontainers. This approach will create a preconfigured development
environment with all of the required tools and dependencies.
[Learn more about devcontainers](https://code.visualstudio.com/docs/devcontainers/containers).
The .devcontainer/vscode/tasks.json and .devcontainer/vscode/launch.json files
contain more information about the specific tasks and launch configurations (see the
non-standard "description" field).
To get started:
1. Clone the repository on your machine and open the Paperless-ngx folder in VS Code.
2. VS Code will prompt you with "Reopen in container". Do so and wait for the environment to start.
3. Initialize the project by running the task **Project Setup: Run all Init Tasks**. This
will initialize the database tables and create a superuser. Then you can compile the front end
for production or run the frontend in debug mode.
4. The project is ready for debugging, start either run the fullstack debug or individual debug
processes. Yo spin up the project without debugging run the task **Project Start: Run all Services**
+104 -54
View File
@@ -2,10 +2,10 @@
You can go multiple routes to setup and run Paperless:
- [Use the script to setup a Docker install](#docker_script)
- [Use the Docker compose templates](#docker)
- [Use the easy install docker script](#docker_script)
- [Pull the image from Docker Hub](#docker_hub)
- [Build the Docker image yourself](#docker_build)
- [Install Paperless-ngx directly on your system manually ("bare metal")](#bare_metal)
- [Install Paperless directly on your system manually (bare metal)](#bare_metal)
- A user-maintained list of commercial hosting providers can be found [in the wiki](https://github.com/paperless-ngx/paperless-ngx/wiki/Related-Projects)
The Docker routes are quick & easy. These are the recommended routes.
@@ -18,66 +18,108 @@ The bare metal route is complicated to setup but makes it easier should
you want to contribute some code back. You need to configure and run the
above mentioned components yourself.
### Use the Installation Script {#docker_script}
### Docker using the Installation Script {#docker_script}
Paperless provides an interactive installation script to setup a Docker Compose
installation. The script asks for a couple configuration options, and will then create the
necessary configuration files, pull the docker image, start Paperless-ngx and create your superuser
account. The script essentially automatically performs the steps described in [Docker setup](#docker).
Paperless provides an interactive installation script. This script will
ask you for a couple configuration options, download and create the
necessary configuration files, pull the docker image, start paperless
and create your user account. This script essentially performs all the
steps described in [Docker setup](#docker_hub) automatically.
1. Make sure that Docker and Docker Compose are [installed](https://docs.docker.com/engine/install/){:target="\_blank"}.
1. Make sure that Docker and Docker Compose are installed.
!!! tip
See the Docker installation instructions at https://docs.docker.com/engine/install/
2. Download and run the installation script:
```shell-session
bash -c "$(curl --location --silent --show-error https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/install-paperless-ngx.sh)"
$ bash -c "$(curl --location --silent --show-error https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/install-paperless-ngx.sh)"
```
!!! note
macOS users will need to install [gnu-sed](https://formulae.brew.sh/formula/gnu-sed) with support
for running as `sed` as well as [wget](https://formulae.brew.sh/formula/wget).
macOS users will need to install e.g. [gnu-sed](https://formulae.brew.sh/formula/gnu-sed) with support
for running as `sed`.
### Use Docker Compose {#docker}
### From GHCR / Docker Hub {#docker_hub}
1. Make sure that Docker and Docker Compose are [installed](https://docs.docker.com/engine/install/){:target="\_blank"}.
1. Login with your user and create a folder in your home-directory to have a place for your
configuration files and consumption directory.
```shell-session
$ mkdir -v ~/paperless-ngx
```
2. Go to the [/docker/compose directory on the project
page](https://github.com/paperless-ngx/paperless-ngx/tree/main/docker/compose){:target="\_blank"}
and download one of the `docker-compose.*.yml` files, depending on which database backend
you want to use. Place the files in a local directory and rename it `docker-compose.yml`. Download the
`docker-compose.env` file and the `.env` file as well in the same directory.
If you want to enable optional support for Office and other documents, download a
file with `-tika` in the file name.
page](https://github.com/paperless-ngx/paperless-ngx/tree/main/docker/compose)
and download one of the `docker-compose.*.yml` files,
depending on which database backend you want to use. Rename this
file to `docker-compose.yml`. If you want to enable
optional support for Office documents, download a file with
`-tika` in the file name. Download the
`docker-compose.env` file and the `.env` file as well and store them
in the same directory.
!!! tip
For new installations, it is recommended to use PostgreSQL as the
database backend.
3. Modify `docker-compose.yml` as needed. For example, you may want to change the paths to the
consumption, media etc. directories to use 'bind mounts'.
Find the line that specifies where to mount the directory, e.g.:
3. Install [Docker](https://docs.docker.com/engine/install/) and
[Docker Compose](https://docs.docker.com/compose/install/).
!!! warning
If you want to use the included `docker-compose.*.yml` file, you
need to have at least Docker version **17.09.0** and Docker Compose
version **v2**. To check do: `docker compose version` or `docker -v`
See the [Docker installation guide](https://docs.docker.com/engine/install/) on how to install the current
version of Docker for your operating system or Linux distribution of
choice. To get the latest version of Docker Compose, follow the
[Docker Compose installation guide](https://docs.docker.com/compose/install/linux/) if your package repository
doesn't include it.
4. Modify `docker-compose.yml` to your preferences. You may want to
change the path to the consumption directory. Find the line that
specifies where to mount the consumption directory:
```yaml
- ./consume:/usr/src/paperless/consume
```
Replace the part _before_ the colon with a local directory of your choice:
Replace the part BEFORE the colon with a local directory of your
choice:
```yaml
- /home/jonaswinkler/paperless-inbox:/usr/src/paperless/consume
```
You may also want to change the default port that the webserver will
use from the default (8000) to something else, e.g. for port 8010:
Don't change the part after the colon or paperless won't find your
documents.
You may also need to change the default port that the webserver will
use from the default (8000):
```yaml
ports:
- 8000:8000
```
Replace the part BEFORE the colon with a port of your choice:
```yaml
ports:
- 8010:8000
```
Don't change the part after the colon or edit other lines that
refer to port 8000. Modifying the part before the colon will map
requests on another port to the webserver running on the default
port.
**Rootless**
!!! warning
@@ -101,16 +143,21 @@ account. The script essentially automatically performs the steps described in [D
> user: <user_id>
> ```
4. Modify `docker-compose.env` with any configuration options you'd like.
See the [configuration documentation](configuration.md) for all options.
You may also need to set `USERMAP_UID` and `USERMAP_GID` to
5. Modify `docker-compose.env`, following the comments in the file. The
most important change is to set `USERMAP_UID` and `USERMAP_GID` to
the uid and gid of your user on the host system. Use `id -u` and
`id -g` to get these. This ensures that both the container and the host
user have write access to the consumption directory. If your UID
`id -g` to get these.
This ensures that both the docker container and you on the host
machine have write access to the consumption directory. If your UID
and GID on the host system is 1000 (the default for the first normal
user on most systems), it will work out of the box without any
modifications. Run `id "username"` to check.
modifications. `id "username"` to check.
!!! note
You can copy any setting from the file `paperless.conf.example` and
paste it here. Have a look at [configuration](configuration.md) to see what's available.
!!! note
@@ -127,30 +174,33 @@ account. The script essentially automatically performs the steps described in [D
[`PAPERLESS_CONSUMER_POLLING`](configuration.md#PAPERLESS_CONSUMER_POLLING), which will disable inotify. See
[here](configuration.md#polling).
5. Run `docker compose pull`. This will pull the image from the GitHub container registry
by default but you can change the image to pull from Docker Hub by changing the `image`
line to `image: paperlessngx/paperless-ngx:latest`.
6. Run `docker compose pull`. This will pull the image.
6. To be able to login, you will need a "superuser". To create it,
7. To be able to login, you will need a super user. To create it,
execute the following command:
```shell-session
docker compose run --rm webserver createsuperuser
$ docker compose run --rm webserver createsuperuser
```
or using docker exec from within the container:
```shell-session
python3 manage.py createsuperuser
$ python3 manage.py createsuperuser
```
This will guide you through the superuser setup.
This will prompt you to set a username, an optional e-mail address
and finally a password (at least 8 characters).
7. Run `docker compose up -d`. This will create and start the necessary containers.
8. Run `docker compose up -d`. This will create and start the necessary containers.
8. Congratulations! Your Paperless-ngx instance should now be accessible at `http://127.0.0.1:8000`
(or similar, depending on your configuration). Use the superuser credentials you have
created in the previous step to login.
9. The default `docker-compose.yml` exports the webserver on your local
port
8000\. If you did not change this, you should now be able to visit
your Paperless instance at `http://127.0.0.1:8000` or your servers
IP-Address:8000. Use the login credentials you have created with the
previous step.
### Build the Docker image yourself {#docker_build}
@@ -184,11 +234,11 @@ account. The script essentially automatically performs the steps described in [D
context: .
```
4. Follow the [Docker setup](#docker) above except when asked to run
`docker compose pull` to pull the image, run
4. Follow steps 3 to 8 of [Docker Setup](#docker_hub). When asked to run
`docker compose pull` to pull the image, do
```shell-session
docker compose build
$ docker compose build
```
instead to build the image.
@@ -557,8 +607,8 @@ Migration to paperless-ngx is then performed in a few simple steps:
1. Stop paperless.
```bash
cd /path/to/current/paperless
docker compose down
$ cd /path/to/current/paperless
$ docker compose down
```
2. Do a backup for two purposes: If something goes wrong, you still
@@ -582,7 +632,7 @@ Migration to paperless-ngx is then performed in a few simple steps:
names of your volumes with
``` shell-session
docker volume ls | grep _data
$ docker volume ls | grep _data
```
and adjust the project name in the `.env` file so that it matches
@@ -593,7 +643,7 @@ Migration to paperless-ngx is then performed in a few simple steps:
after you migrated your existing SQLite database.
5. Adjust `docker-compose.yml` and `docker-compose.env` to your needs.
See [Docker setup](#docker) details on
See [Docker setup](#docker_hub) details on
which edits are advised.
6. [Update paperless.](administration.md#updating)
@@ -603,7 +653,7 @@ Migration to paperless-ngx is then performed in a few simple steps:
the search index:
```shell-session
docker compose run --rm webserver document_index reindex
$ docker compose run --rm webserver document_index reindex
```
This will migrate your database and create the search index. After
@@ -612,7 +662,7 @@ Migration to paperless-ngx is then performed in a few simple steps:
8. Start paperless-ngx.
```bash
docker compose up -d
$ docker compose up -d
```
This will run paperless in the background and automatically start it
+2 -2
View File
@@ -18,7 +18,7 @@ Check for the following issues:
automatically. Manually invoke the task processor by executing
```shell-session
celery --app paperless worker
$ celery --app paperless worker
```
- Look at the output of paperless and inspect it for any errors.
@@ -144,7 +144,7 @@ The following error occurred while consuming document.pdf: [Errno 13] Permission
This happens when paperless does not have permission to delete files
inside the consumption directory. Ensure that `USERMAP_UID` and
`USERMAP_GID` are set to the user id and group id you use on the host
operating system, if these are different from `1000`. See [Docker setup](setup.md#docker).
operating system, if these are different from `1000`. See [Docker setup](setup.md#docker_hub).
Also ensure that you are able to read and write to the consumption
directory on the host.
+12 -60
View File
@@ -1,9 +1,9 @@
# Usage Overview
Paperless-ngx is an application that manages your personal documents. With
the (optional) help of a document scanner (see [the scanners wiki](https://github.com/paperless-ngx/paperless-ngx/wiki/Scanner-&-Software-Recommendations)), Paperless-ngx transforms your unwieldy
physical documents into a searchable archive and provides many utilities
for finding and managing your documents.
Paperless is an application that manages your personal documents. With
the help of a document scanner (see [the scanners wiki](https://github.com/paperless-ngx/paperless-ngx/wiki/Scanner-&-Software-Recommendations)),
paperless transforms your unwieldy physical document binders into a searchable archive
and provides many utilities for finding and managing your documents.
## Terms and definitions
@@ -12,10 +12,10 @@ documents:
- The _consumer_ watches a specified folder and adds all documents in
that folder to paperless.
- The _web server_ (web UI) provides a UI that you use to manage and
search documents.
- The _web server_ provides a UI that you use to manage and search for
your scanned documents.
Each document has data fields that you can assign to them:
Each document has a couple of fields that you can assign to them:
- A _Document_ is a piece of paper that sometimes contains valuable
information.
@@ -41,53 +41,6 @@ Each document has data fields that you can assign to them:
- The _content_ of a document is the text that was OCR'ed from the
document. This text is fed into the search engine and is used for
matching tags, correspondents and document types.
- Paperless-ngx also supports _custom fields_ which can be used to
store additional metadata about a document.
## The Web UI
The web UI is the primary way to interact with Paperless-ngx. It is a
single-page application that is built with modern web technologies and
is designed to be fast and responsive. The web UI includes a robust
interface for filtering, viewing, searching and editing documents.
You can also manage tags, correspondents, document types, and other
settings from the web UI.
The web UI also includes a 'tour' feature that can be accessed from the
settings page or from the dashboard for new users. The tour highlights
some of the key features of the web UI and can be useful for new users.
### Dashboard
The dashboard is the first page you see when you log in. By default, it
does not show any documents, but you can add saved views to the dashboard
to show documents that match certain criteria. The dashboard also includes
a button to upload documents to Paperless-ngx but you can also drag and
drop files anywhere in the app to initiate the consumption process.
### Document List
The document list is the primary way to view and interact with your documents.
You can filter the list by tags, correspondents, document types, and other
criteria. You can also edit documents in bulk including assigning tags,
correspondents, document types, and custom fields. Selecting document(s) from
the list will allow you to perform the various bulk edit operations. The
document list also includes a search bar that allows you to search for documents
by title, ASN, and use advanced search syntax.
### Document Detail
The document detail page shows all the information about a single document.
You can view the document, edit its metadata, assign tags, correspondents,
document types, and custom fields. You can also view the document history,
download the document or share it via a share link.
### Management Lists
Paperless-ngx includes management lists for tags, correspondents, document types
and more. These areas allow you to view, add, edit, delete and manage permissions
for these objects. You can also manage saved views, mail accounts, mail rules,
workflows and more from the management sections.
## Adding documents to paperless
@@ -299,7 +252,7 @@ permissions can be granted to limit access to certain parts of the UI (and corre
#### Superusers
Superusers can access all parts of the front and backend application as well as any and all objects. Superuser status can only be granted by another superuser.
Superusers can access all parts of the front and backend application as well as any and all objects.
#### Admin Status
@@ -466,7 +419,6 @@ The following workflow action types are available:
- The URL to send the request to
- The request body as text or as key-value pairs, which can include placeholders, see [placeholders](usage.md#workflow-placeholders) below.
- Encoding for the request body, either JSON or form data
- The request headers as key-value pairs
#### Workflow placeholders
@@ -836,8 +788,8 @@ Paperless-ngx consists of the following components:
with paperless. You may start the webserver directly with
```shell-session
cd /path/to/paperless/src/
gunicorn -c ../gunicorn.conf.py paperless.wsgi
$ cd /path/to/paperless/src/
$ gunicorn -c ../gunicorn.conf.py paperless.wsgi
```
or by any other means such as Apache `mod_wsgi`.
@@ -852,8 +804,8 @@ Paperless-ngx consists of the following components:
Start the consumer with the management command `document_consumer`:
```shell-session
cd /path/to/paperless/src/
python3 manage.py document_consumer
$ cd /path/to/paperless/src/
$ python3 manage.py document_consumer
```
- **The task processor:** Paperless relies on [Celery - Distributed
+1 -1
View File
@@ -3,7 +3,7 @@ import os
# See https://docs.gunicorn.org/en/stable/settings.html for
# explanations of settings
bind = f"{os.getenv('PAPERLESS_BIND_ADDR', '[::]')}:{os.getenv('PAPERLESS_PORT', 8000)}"
bind = f'{os.getenv("PAPERLESS_BIND_ADDR", "[::]")}:{os.getenv("PAPERLESS_PORT", 8000)}'
workers = int(os.getenv("PAPERLESS_WEBSERVER_WORKERS", 1))
worker_class = "paperless.workers.ConfigurableWorker"
+1
View File
@@ -87,6 +87,7 @@
#PAPERLESS_TIKA_ENABLED=false
#PAPERLESS_TIKA_ENDPOINT=http://localhost:9998
#PAPERLESS_TIKA_GOTENBERG_ENDPOINT=http://localhost:3000
#PAPERLESS_EINVOICE_PARSER_ENABLED=true
# Binaries
+1 -2
View File
@@ -81,8 +81,7 @@
"scripts": [],
"allowedCommonJsDependencies": [
"ng2-pdf-viewer",
"file-saver",
"utif"
"file-saver"
],
"vendorChunk": true,
"extractLicenses": false,
@@ -135,11 +135,11 @@ test('sorting', async ({ page }) => {
test('change views', async ({ page }) => {
await page.routeFromHAR(REQUESTS_HAR5, { notFound: 'fallback' })
await page.goto('/documents')
await page.locator('.btn-group > label').first().click()
await page.locator('.btn-group label').first().click()
await expect(page.locator('pngx-document-list table')).toBeVisible()
await page.locator('label:nth-child(4)').first().click()
await page.locator('.btn-group label').nth(1).click()
await expect(page.locator('pngx-document-card-small').first()).toBeAttached()
await page.locator('label:nth-child(6)').click()
await page.locator('.btn-group label').nth(2).click()
await expect(page.locator('pngx-document-card-large').first()).toBeAttached()
})
+1052 -1093
View File
File diff suppressed because it is too large Load Diff
+2771 -4066
View File
File diff suppressed because it is too large Load Diff
+34 -35
View File
@@ -11,17 +11,17 @@
},
"private": true,
"dependencies": {
"@angular/cdk": "^19.1.2",
"@angular/common": "~19.1.4",
"@angular/compiler": "~19.1.4",
"@angular/core": "~19.1.4",
"@angular/forms": "~19.1.4",
"@angular/localize": "~19.1.4",
"@angular/platform-browser": "~19.1.4",
"@angular/platform-browser-dynamic": "~19.1.4",
"@angular/router": "~19.1.4",
"@ng-bootstrap/ng-bootstrap": "^18.0.0",
"@ng-select/ng-select": "^14.2.0",
"@angular/cdk": "^18.2.11",
"@angular/common": "~18.2.10",
"@angular/compiler": "~18.2.10",
"@angular/core": "~18.2.10",
"@angular/forms": "~18.2.10",
"@angular/localize": "~18.2.10",
"@angular/platform-browser": "~18.2.10",
"@angular/platform-browser-dynamic": "~18.2.10",
"@angular/router": "~18.2.10",
"@ng-bootstrap/ng-bootstrap": "^17.0.1",
"@ng-select/ng-select": "^13.9.1",
"@ngneat/dirty-check-forms": "^3.0.3",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
@@ -30,40 +30,39 @@
"ng2-pdf-viewer": "^10.4.0",
"ngx-bootstrap-icons": "^1.9.3",
"ngx-color": "^9.0.0",
"ngx-cookie-service": "^19.1.0",
"ngx-device-detector": "^9.0.0",
"ngx-cookie-service": "^18.0.0",
"ngx-file-drop": "^16.0.0",
"ngx-ui-tour-ng-bootstrap": "^16.0.0",
"ngx-ui-tour-ng-bootstrap": "^15.0.0",
"rxjs": "^7.8.1",
"tslib": "^2.8.1",
"utif": "^3.1.0",
"uuid": "^11.0.5",
"zone.js": "^0.15.0"
"uuid": "^11.0.2",
"zone.js": "^0.14.8"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^19.0.0",
"@angular-builders/jest": "^19.0.0",
"@angular-devkit/build-angular": "^19.0.4",
"@angular-devkit/core": "^19.1.5",
"@angular-devkit/schematics": "^19.1.5",
"@angular-eslint/builder": "19.0.2",
"@angular-eslint/eslint-plugin": "19.0.2",
"@angular-eslint/eslint-plugin-template": "19.0.2",
"@angular-eslint/schematics": "19.0.2",
"@angular-eslint/template-parser": "19.0.2",
"@angular/cli": "~19.1.5",
"@angular/compiler-cli": "~19.1.4",
"@codecov/webpack-plugin": "^1.8.0",
"@playwright/test": "^1.50.1",
"@angular-builders/custom-webpack": "^18.0.0",
"@angular-builders/jest": "^18.0.0",
"@angular-devkit/build-angular": "^18.2.2",
"@angular-devkit/core": "^18.2.11",
"@angular-devkit/schematics": "^18.2.11",
"@angular-eslint/builder": "18.4.0",
"@angular-eslint/eslint-plugin": "18.4.0",
"@angular-eslint/eslint-plugin-template": "18.4.0",
"@angular-eslint/schematics": "18.4.0",
"@angular-eslint/template-parser": "18.4.0",
"@angular/cli": "~18.2.11",
"@angular/compiler-cli": "~18.2.2",
"@codecov/webpack-plugin": "^1.2.1",
"@playwright/test": "^1.48.2",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.0",
"@typescript-eslint/eslint-plugin": "^8.22.0",
"@typescript-eslint/parser": "^8.22.0",
"@types/node": "^22.8.6",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"@typescript-eslint/utils": "^8.0.0",
"eslint": "^9.19.0",
"eslint": "^9.14.0",
"jest": "29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-preset-angular": "^14.4.2",
"jest-preset-angular": "^14.2.4",
"jest-websocket-mock": "^2.5.0",
"patch-package": "^8.0.0",
"prettier-plugin-organize-imports": "^4.1.0",
+1 -11
View File
@@ -1,9 +1,8 @@
import '@angular/localize/init'
import { jest } from '@jest/globals'
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'
import { TextDecoder, TextEncoder } from 'util'
if (process.env.NODE_ENV === 'test') {
setupZoneTestEnv()
require('jest-preset-angular/setup-jest')
}
global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
@@ -100,15 +99,6 @@ Object.defineProperty(navigator, 'clipboard', {
},
})
Object.defineProperty(navigator, 'canShare', { value: () => true })
if (!navigator.share) {
Object.defineProperty(navigator, 'share', { value: jest.fn() })
}
if (!URL.createObjectURL) {
Object.defineProperty(window.URL, 'createObjectURL', { value: jest.fn() })
}
if (!URL.revokeObjectURL) {
Object.defineProperty(window.URL, 'revokeObjectURL', { value: jest.fn() })
}
Object.defineProperty(window, 'ResizeObserver', { value: mock() })
Object.defineProperty(window, 'location', {
configurable: true,
+13 -17
View File
@@ -2,13 +2,12 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import {
ComponentFixture,
fakeAsync,
TestBed,
fakeAsync,
tick,
} from '@angular/core/testing'
import { Router, RouterModule } from '@angular/router'
import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap'
import { allIcons, NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgxFileDropModule } from 'ngx-file-drop'
import { TourNgBootstrapModule, TourService } from 'ngx-ui-tour-ng-bootstrap'
import { Subject } from 'rxjs'
@@ -18,20 +17,20 @@ import { ToastsComponent } from './components/common/toasts/toasts.component'
import { FileDropComponent } from './components/file-drop/file-drop.component'
import { DirtySavedViewGuard } from './guards/dirty-saved-view.guard'
import { PermissionsGuard } from './guards/permissions.guard'
import {
ConsumerStatusService,
FileStatus,
} from './services/consumer-status.service'
import { HotKeyService } from './services/hot-key.service'
import { PermissionsService } from './services/permissions.service'
import { SettingsService } from './services/settings.service'
import { Toast, ToastService } from './services/toast.service'
import {
FileStatus,
WebsocketStatusService,
} from './services/websocket-status.service'
describe('AppComponent', () => {
let component: AppComponent
let fixture: ComponentFixture<AppComponent>
let tourService: TourService
let websocketStatusService: WebsocketStatusService
let consumerStatusService: ConsumerStatusService
let permissionsService: PermissionsService
let toastService: ToastService
let router: Router
@@ -40,15 +39,12 @@ describe('AppComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [AppComponent, ToastsComponent, FileDropComponent],
imports: [
TourNgBootstrapModule,
RouterModule.forRoot(routes),
NgxFileDropModule,
NgbModalModule,
AppComponent,
ToastsComponent,
FileDropComponent,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
PermissionsGuard,
@@ -59,7 +55,7 @@ describe('AppComponent', () => {
}).compileComponents()
tourService = TestBed.inject(TourService)
websocketStatusService = TestBed.inject(WebsocketStatusService)
consumerStatusService = TestBed.inject(ConsumerStatusService)
permissionsService = TestBed.inject(PermissionsService)
settingsService = TestBed.inject(SettingsService)
toastService = TestBed.inject(ToastService)
@@ -90,7 +86,7 @@ describe('AppComponent', () => {
const toastSpy = jest.spyOn(toastService, 'show')
const fileStatusSubject = new Subject<FileStatus>()
jest
.spyOn(websocketStatusService, 'onDocumentConsumptionFinished')
.spyOn(consumerStatusService, 'onDocumentConsumptionFinished')
.mockReturnValue(fileStatusSubject)
component.ngOnInit()
const status = new FileStatus()
@@ -109,7 +105,7 @@ describe('AppComponent', () => {
const toastSpy = jest.spyOn(toastService, 'show')
const fileStatusSubject = new Subject<FileStatus>()
jest
.spyOn(websocketStatusService, 'onDocumentConsumptionFinished')
.spyOn(consumerStatusService, 'onDocumentConsumptionFinished')
.mockReturnValue(fileStatusSubject)
component.ngOnInit()
fileStatusSubject.next(new FileStatus())
@@ -122,7 +118,7 @@ describe('AppComponent', () => {
const toastSpy = jest.spyOn(toastService, 'show')
const fileStatusSubject = new Subject<FileStatus>()
jest
.spyOn(websocketStatusService, 'onDocumentDetected')
.spyOn(consumerStatusService, 'onDocumentDetected')
.mockReturnValue(fileStatusSubject)
component.ngOnInit()
fileStatusSubject.next(new FileStatus())
@@ -136,7 +132,7 @@ describe('AppComponent', () => {
const toastSpy = jest.spyOn(toastService, 'show')
const fileStatusSubject = new Subject<FileStatus>()
jest
.spyOn(websocketStatusService, 'onDocumentDetected')
.spyOn(consumerStatusService, 'onDocumentDetected')
.mockReturnValue(fileStatusSubject)
component.ngOnInit()
fileStatusSubject.next(new FileStatus())
@@ -148,7 +144,7 @@ describe('AppComponent', () => {
const toastSpy = jest.spyOn(toastService, 'showError')
const fileStatusSubject = new Subject<FileStatus>()
jest
.spyOn(websocketStatusService, 'onDocumentConsumptionFailed')
.spyOn(consumerStatusService, 'onDocumentConsumptionFailed')
.mockReturnValue(fileStatusSubject)
component.ngOnInit()
fileStatusSubject.next(new FileStatus())
+10 -20
View File
@@ -1,11 +1,9 @@
import { Component, OnDestroy, OnInit, Renderer2 } from '@angular/core'
import { Router, RouterOutlet } from '@angular/router'
import { TourNgBootstrapModule, TourService } from 'ngx-ui-tour-ng-bootstrap'
import { Router } from '@angular/router'
import { TourService } from 'ngx-ui-tour-ng-bootstrap'
import { first, Subscription } from 'rxjs'
import { ToastsComponent } from './components/common/toasts/toasts.component'
import { FileDropComponent } from './components/file-drop/file-drop.component'
import { SETTINGS_KEYS } from './data/ui-settings'
import { ComponentRouterService } from './services/component-router.service'
import { ConsumerStatusService } from './services/consumer-status.service'
import { HotKeyService } from './services/hot-key.service'
import {
PermissionAction,
@@ -15,18 +13,11 @@ import {
import { SettingsService } from './services/settings.service'
import { TasksService } from './services/tasks.service'
import { ToastService } from './services/toast.service'
import { WebsocketStatusService } from './services/websocket-status.service'
@Component({
selector: 'pngx-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
imports: [
FileDropComponent,
ToastsComponent,
TourNgBootstrapModule,
RouterOutlet,
],
})
export class AppComponent implements OnInit, OnDestroy {
newDocumentSubscription: Subscription
@@ -35,15 +26,14 @@ export class AppComponent implements OnInit, OnDestroy {
constructor(
private settings: SettingsService,
private websocketStatusService: WebsocketStatusService,
private consumerStatusService: ConsumerStatusService,
private toastService: ToastService,
private router: Router,
private tasksService: TasksService,
public tourService: TourService,
private renderer: Renderer2,
private permissionsService: PermissionsService,
private hotKeyService: HotKeyService,
private componentRouterService: ComponentRouterService
private hotKeyService: HotKeyService
) {
let anyWindow = window as any
anyWindow.pdfWorkerSrc = 'assets/js/pdf.worker.min.mjs'
@@ -51,7 +41,7 @@ export class AppComponent implements OnInit, OnDestroy {
}
ngOnDestroy(): void {
this.websocketStatusService.disconnect()
this.consumerStatusService.disconnect()
if (this.successSubscription) {
this.successSubscription.unsubscribe()
}
@@ -76,9 +66,9 @@ export class AppComponent implements OnInit, OnDestroy {
}
ngOnInit(): void {
this.websocketStatusService.connect()
this.consumerStatusService.connect()
this.successSubscription = this.websocketStatusService
this.successSubscription = this.consumerStatusService
.onDocumentConsumptionFinished()
.subscribe((status) => {
this.tasksService.reload()
@@ -108,7 +98,7 @@ export class AppComponent implements OnInit, OnDestroy {
}
})
this.failedSubscription = this.websocketStatusService
this.failedSubscription = this.consumerStatusService
.onDocumentConsumptionFailed()
.subscribe((status) => {
this.tasksService.reload()
@@ -121,7 +111,7 @@ export class AppComponent implements OnInit, OnDestroy {
}
})
this.newDocumentSubscription = this.websocketStatusService
this.newDocumentSubscription = this.consumerStatusService
.onDocumentDetected()
.subscribe((status) => {
this.tasksService.reload()
+579
View File
@@ -0,0 +1,579 @@
import { DragDropModule } from '@angular/cdk/drag-drop'
import { DatePipe, registerLocaleData } from '@angular/common'
import {
HTTP_INTERCEPTORS,
provideHttpClient,
withInterceptorsFromDi,
} from '@angular/common/http'
import { APP_INITIALIZER, NgModule } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { BrowserModule } from '@angular/platform-browser'
import {
NgbDateAdapter,
NgbDateParserFormatter,
NgbModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgSelectModule } from '@ng-select/ng-select'
import { PdfViewerModule } from 'ng2-pdf-viewer'
import {
airplane,
archive,
arrowClockwise,
arrowCounterclockwise,
arrowDown,
arrowLeft,
arrowRepeat,
arrowRight,
arrowRightShort,
arrowUpRight,
asterisk,
bodyText,
boxArrowUp,
boxArrowUpRight,
boxes,
braces,
calendar,
calendarEvent,
calendarEventFill,
cardChecklist,
cardHeading,
caretDown,
caretUp,
chatLeftText,
check,
check2All,
checkAll,
checkCircleFill,
checkLg,
chevronDoubleLeft,
chevronDoubleRight,
clipboard,
clipboardCheck,
clipboardCheckFill,
clipboardFill,
dash,
dashCircle,
diagram3,
dice5,
doorOpen,
download,
envelope,
envelopeAt,
envelopeAtFill,
exclamationCircleFill,
exclamationTriangle,
exclamationTriangleFill,
eye,
fileEarmark,
fileEarmarkCheck,
fileEarmarkFill,
fileEarmarkLock,
fileEarmarkMinus,
fileEarmarkRichtext,
files,
fileText,
filter,
folder,
folderFill,
funnel,
gear,
google,
grid,
gripVertical,
hash,
hddStack,
house,
infoCircle,
journals,
link,
listTask,
listUl,
microsoft,
NgxBootstrapIconsModule,
nodePlus,
pencil,
people,
peopleFill,
person,
personCircle,
personFill,
personFillLock,
personLock,
personSquare,
plus,
plusCircle,
questionCircle,
scissors,
search,
slashCircle,
sliders2Vertical,
sortAlphaDown,
sortAlphaUpAlt,
tag,
tagFill,
tags,
textIndentLeft,
textLeft,
threeDots,
threeDotsVertical,
trash,
uiRadios,
upcScan,
windowStack,
x,
xCircle,
xLg,
} from 'ngx-bootstrap-icons'
import { ColorSliderModule } from 'ngx-color/slider'
import { CookieService } from 'ngx-cookie-service'
import { NgxFileDropModule } from 'ngx-file-drop'
import { TourNgBootstrapModule } from 'ngx-ui-tour-ng-bootstrap'
import { AppRoutingModule } from './app-routing.module'
import { AppComponent } from './app.component'
import { ConfigComponent } from './components/admin/config/config.component'
import { LogsComponent } from './components/admin/logs/logs.component'
import { SettingsComponent } from './components/admin/settings/settings.component'
import { TasksComponent } from './components/admin/tasks/tasks.component'
import { TrashComponent } from './components/admin/trash/trash.component'
import { UsersAndGroupsComponent } from './components/admin/users-groups/users-groups.component'
import { AppFrameComponent } from './components/app-frame/app-frame.component'
import { GlobalSearchComponent } from './components/app-frame/global-search/global-search.component'
import { ClearableBadgeComponent } from './components/common/clearable-badge/clearable-badge.component'
import { ConfirmButtonComponent } from './components/common/confirm-button/confirm-button.component'
import { ConfirmDialogComponent } from './components/common/confirm-dialog/confirm-dialog.component'
import { DeletePagesConfirmDialogComponent } from './components/common/confirm-dialog/delete-pages-confirm-dialog/delete-pages-confirm-dialog.component'
import { MergeConfirmDialogComponent } from './components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component'
import { RotateConfirmDialogComponent } from './components/common/confirm-dialog/rotate-confirm-dialog/rotate-confirm-dialog.component'
import { SplitConfirmDialogComponent } from './components/common/confirm-dialog/split-confirm-dialog/split-confirm-dialog.component'
import { CustomFieldDisplayComponent } from './components/common/custom-field-display/custom-field-display.component'
import { CustomFieldsDropdownComponent } from './components/common/custom-fields-dropdown/custom-fields-dropdown.component'
import { CustomFieldsQueryDropdownComponent } from './components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component'
import { DatesDropdownComponent } from './components/common/dates-dropdown/dates-dropdown.component'
import { CorrespondentEditDialogComponent } from './components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component'
import { CustomFieldEditDialogComponent } from './components/common/edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component'
import { DocumentTypeEditDialogComponent } from './components/common/edit-dialog/document-type-edit-dialog/document-type-edit-dialog.component'
import { GroupEditDialogComponent } from './components/common/edit-dialog/group-edit-dialog/group-edit-dialog.component'
import { MailAccountEditDialogComponent } from './components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component'
import { MailRuleEditDialogComponent } from './components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component'
import { StoragePathEditDialogComponent } from './components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component'
import { TagEditDialogComponent } from './components/common/edit-dialog/tag-edit-dialog/tag-edit-dialog.component'
import { UserEditDialogComponent } from './components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component'
import { WorkflowEditDialogComponent } from './components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component'
import { FilterableDropdownComponent } from './components/common/filterable-dropdown/filterable-dropdown.component'
import { ToggleableDropdownButtonComponent } from './components/common/filterable-dropdown/toggleable-dropdown-button/toggleable-dropdown-button.component'
import { HotkeyDialogComponent } from './components/common/hotkey-dialog/hotkey-dialog.component'
import { CheckComponent } from './components/common/input/check/check.component'
import { ColorComponent } from './components/common/input/color/color.component'
import { DateComponent } from './components/common/input/date/date.component'
import { DocumentLinkComponent } from './components/common/input/document-link/document-link.component'
import { DragDropSelectComponent } from './components/common/input/drag-drop-select/drag-drop-select.component'
import { EntriesComponent } from './components/common/input/entries/entries.component'
import { FileComponent } from './components/common/input/file/file.component'
import { MonetaryComponent } from './components/common/input/monetary/monetary.component'
import { NumberComponent } from './components/common/input/number/number.component'
import { PasswordComponent } from './components/common/input/password/password.component'
import { PermissionsFormComponent } from './components/common/input/permissions/permissions-form/permissions-form.component'
import { PermissionsGroupComponent } from './components/common/input/permissions/permissions-group/permissions-group.component'
import { PermissionsUserComponent } from './components/common/input/permissions/permissions-user/permissions-user.component'
import { SelectComponent } from './components/common/input/select/select.component'
import { SwitchComponent } from './components/common/input/switch/switch.component'
import { TagsComponent } from './components/common/input/tags/tags.component'
import { TextComponent } from './components/common/input/text/text.component'
import { TextAreaComponent } from './components/common/input/textarea/textarea.component'
import { UrlComponent } from './components/common/input/url/url.component'
import { LogoComponent } from './components/common/logo/logo.component'
import { PageHeaderComponent } from './components/common/page-header/page-header.component'
import { PermissionsDialogComponent } from './components/common/permissions-dialog/permissions-dialog.component'
import { PermissionsFilterDropdownComponent } from './components/common/permissions-filter-dropdown/permissions-filter-dropdown.component'
import { PermissionsSelectComponent } from './components/common/permissions-select/permissions-select.component'
import { PreviewPopupComponent } from './components/common/preview-popup/preview-popup.component'
import { ProfileEditDialogComponent } from './components/common/profile-edit-dialog/profile-edit-dialog.component'
import { SelectDialogComponent } from './components/common/select-dialog/select-dialog.component'
import { ShareLinksDropdownComponent } from './components/common/share-links-dropdown/share-links-dropdown.component'
import { SystemStatusDialogComponent } from './components/common/system-status-dialog/system-status-dialog.component'
import { TagComponent } from './components/common/tag/tag.component'
import { ToastsComponent } from './components/common/toasts/toasts.component'
import { DashboardComponent } from './components/dashboard/dashboard.component'
import { SavedViewWidgetComponent } from './components/dashboard/widgets/saved-view-widget/saved-view-widget.component'
import { StatisticsWidgetComponent } from './components/dashboard/widgets/statistics-widget/statistics-widget.component'
import { UploadFileWidgetComponent } from './components/dashboard/widgets/upload-file-widget/upload-file-widget.component'
import { WelcomeWidgetComponent } from './components/dashboard/widgets/welcome-widget/welcome-widget.component'
import { WidgetFrameComponent } from './components/dashboard/widgets/widget-frame/widget-frame.component'
import { DocumentAsnComponent } from './components/document-asn/document-asn.component'
import { DocumentDetailComponent } from './components/document-detail/document-detail.component'
import { MetadataCollapseComponent } from './components/document-detail/metadata-collapse/metadata-collapse.component'
import { DocumentHistoryComponent } from './components/document-history/document-history.component'
import { BulkEditorComponent } from './components/document-list/bulk-editor/bulk-editor.component'
import { CustomFieldsBulkEditDialogComponent } from './components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component'
import { DocumentCardLargeComponent } from './components/document-list/document-card-large/document-card-large.component'
import { DocumentCardSmallComponent } from './components/document-list/document-card-small/document-card-small.component'
import { DocumentListComponent } from './components/document-list/document-list.component'
import { FilterEditorComponent } from './components/document-list/filter-editor/filter-editor.component'
import { SaveViewConfigDialogComponent } from './components/document-list/save-view-config-dialog/save-view-config-dialog.component'
import { DocumentNotesComponent } from './components/document-notes/document-notes.component'
import { FileDropComponent } from './components/file-drop/file-drop.component'
import { CorrespondentListComponent } from './components/manage/correspondent-list/correspondent-list.component'
import { CustomFieldsComponent } from './components/manage/custom-fields/custom-fields.component'
import { DocumentTypeListComponent } from './components/manage/document-type-list/document-type-list.component'
import { MailComponent } from './components/manage/mail/mail.component'
import { SavedViewsComponent } from './components/manage/saved-views/saved-views.component'
import { StoragePathListComponent } from './components/manage/storage-path-list/storage-path-list.component'
import { TagListComponent } from './components/manage/tag-list/tag-list.component'
import { WorkflowsComponent } from './components/manage/workflows/workflows.component'
import { NotFoundComponent } from './components/not-found/not-found.component'
import { IfObjectPermissionsDirective } from './directives/if-object-permissions.directive'
import { IfOwnerDirective } from './directives/if-owner.directive'
import { IfPermissionsDirective } from './directives/if-permissions.directive'
import { SortableDirective } from './directives/sortable.directive'
import { DirtyDocGuard } from './guards/dirty-doc.guard'
import { DirtySavedViewGuard } from './guards/dirty-saved-view.guard'
import { PermissionsGuard } from './guards/permissions.guard'
import { ApiVersionInterceptor } from './interceptors/api-version.interceptor'
import { CsrfInterceptor } from './interceptors/csrf.interceptor'
import { CustomDatePipe } from './pipes/custom-date.pipe'
import { DocumentTitlePipe } from './pipes/document-title.pipe'
import { FileSizePipe } from './pipes/file-size.pipe'
import { FilterPipe } from './pipes/filter.pipe'
import { IsNumberPipe } from './pipes/is-number.pipe'
import { SafeHtmlPipe } from './pipes/safehtml.pipe'
import { SafeUrlPipe } from './pipes/safeurl.pipe'
import { UsernamePipe } from './pipes/username.pipe'
import { YesNoPipe } from './pipes/yes-no.pipe'
import { SettingsService } from './services/settings.service'
import { LocalizedDateParserFormatter } from './utils/ngb-date-parser-formatter'
import { ISODateAdapter } from './utils/ngb-iso-date-adapter'
const icons = {
airplane,
archive,
arrowClockwise,
arrowCounterclockwise,
arrowDown,
arrowLeft,
arrowRepeat,
arrowRight,
arrowRightShort,
arrowUpRight,
asterisk,
braces,
bodyText,
boxArrowUp,
boxArrowUpRight,
boxes,
calendar,
calendarEvent,
calendarEventFill,
cardChecklist,
cardHeading,
caretDown,
caretUp,
chatLeftText,
check,
check2All,
checkAll,
checkCircleFill,
checkLg,
chevronDoubleLeft,
chevronDoubleRight,
clipboard,
clipboardCheck,
clipboardCheckFill,
clipboardFill,
dash,
dashCircle,
diagram3,
dice5,
doorOpen,
download,
envelope,
envelopeAt,
envelopeAtFill,
exclamationCircleFill,
exclamationTriangle,
exclamationTriangleFill,
eye,
fileEarmark,
fileEarmarkCheck,
fileEarmarkFill,
fileEarmarkLock,
fileEarmarkMinus,
fileEarmarkRichtext,
files,
fileText,
filter,
folder,
folderFill,
funnel,
gear,
google,
grid,
gripVertical,
hash,
hddStack,
house,
infoCircle,
journals,
link,
listTask,
listUl,
microsoft,
nodePlus,
pencil,
people,
peopleFill,
person,
personCircle,
personFill,
personFillLock,
personLock,
personSquare,
plus,
plusCircle,
questionCircle,
scissors,
search,
slashCircle,
sliders2Vertical,
sortAlphaDown,
sortAlphaUpAlt,
tagFill,
tag,
tags,
textIndentLeft,
textLeft,
threeDots,
threeDotsVertical,
trash,
uiRadios,
upcScan,
windowStack,
x,
xCircle,
xLg,
}
import localeAf from '@angular/common/locales/af'
import localeAr from '@angular/common/locales/ar'
import localeBe from '@angular/common/locales/be'
import localeBg from '@angular/common/locales/bg'
import localeCa from '@angular/common/locales/ca'
import localeCs from '@angular/common/locales/cs'
import localeDa from '@angular/common/locales/da'
import localeDe from '@angular/common/locales/de'
import localeEl from '@angular/common/locales/el'
import localeEnGb from '@angular/common/locales/en-GB'
import localeEs from '@angular/common/locales/es'
import localeFi from '@angular/common/locales/fi'
import localeFr from '@angular/common/locales/fr'
import localeHu from '@angular/common/locales/hu'
import localeIt from '@angular/common/locales/it'
import localeJa from '@angular/common/locales/ja'
import localeKo from '@angular/common/locales/ko'
import localeLb from '@angular/common/locales/lb'
import localeNl from '@angular/common/locales/nl'
import localeNo from '@angular/common/locales/no'
import localePl from '@angular/common/locales/pl'
import localePt from '@angular/common/locales/pt'
import localeRo from '@angular/common/locales/ro'
import localeRu from '@angular/common/locales/ru'
import localeSk from '@angular/common/locales/sk'
import localeSl from '@angular/common/locales/sl'
import localeSr from '@angular/common/locales/sr'
import localeSv from '@angular/common/locales/sv'
import localeTr from '@angular/common/locales/tr'
import localeUk from '@angular/common/locales/uk'
import localeZh from '@angular/common/locales/zh'
registerLocaleData(localeAf)
registerLocaleData(localeAr)
registerLocaleData(localeBe)
registerLocaleData(localeBg)
registerLocaleData(localeCa)
registerLocaleData(localeCs)
registerLocaleData(localeDa)
registerLocaleData(localeDe)
registerLocaleData(localeEl)
registerLocaleData(localeEnGb)
registerLocaleData(localeEs)
registerLocaleData(localeFi)
registerLocaleData(localeFr)
registerLocaleData(localeHu)
registerLocaleData(localeIt)
registerLocaleData(localeJa)
registerLocaleData(localeKo)
registerLocaleData(localeLb)
registerLocaleData(localeNl)
registerLocaleData(localeNo)
registerLocaleData(localePl)
registerLocaleData(localePt, 'pt-BR')
registerLocaleData(localePt, 'pt-PT')
registerLocaleData(localeRo)
registerLocaleData(localeRu)
registerLocaleData(localeSk)
registerLocaleData(localeSl)
registerLocaleData(localeSr)
registerLocaleData(localeSv)
registerLocaleData(localeTr)
registerLocaleData(localeUk)
registerLocaleData(localeZh)
function initializeApp(settings: SettingsService) {
return () => {
return settings.initializeSettings()
}
}
@NgModule({
declarations: [
AppComponent,
DocumentListComponent,
DocumentDetailComponent,
DashboardComponent,
TagListComponent,
DocumentTypeListComponent,
CorrespondentListComponent,
StoragePathListComponent,
LogsComponent,
SettingsComponent,
NotFoundComponent,
CorrespondentEditDialogComponent,
ConfirmDialogComponent,
TagEditDialogComponent,
DocumentTypeEditDialogComponent,
StoragePathEditDialogComponent,
TagComponent,
ClearableBadgeComponent,
PageHeaderComponent,
AppFrameComponent,
ToastsComponent,
FilterEditorComponent,
FilterableDropdownComponent,
ToggleableDropdownButtonComponent,
DatesDropdownComponent,
DocumentCardLargeComponent,
DocumentCardSmallComponent,
BulkEditorComponent,
TextComponent,
TextAreaComponent,
SelectComponent,
CheckComponent,
UrlComponent,
PasswordComponent,
SaveViewConfigDialogComponent,
TagsComponent,
IfPermissionsDirective,
SortableDirective,
SavedViewWidgetComponent,
StatisticsWidgetComponent,
UploadFileWidgetComponent,
WidgetFrameComponent,
WelcomeWidgetComponent,
YesNoPipe,
FileSizePipe,
FilterPipe,
DocumentTitlePipe,
MetadataCollapseComponent,
SelectDialogComponent,
NumberComponent,
SafeUrlPipe,
SafeHtmlPipe,
CustomDatePipe,
DateComponent,
ColorComponent,
DocumentAsnComponent,
DocumentNotesComponent,
TasksComponent,
UserEditDialogComponent,
GroupEditDialogComponent,
PermissionsSelectComponent,
MailAccountEditDialogComponent,
MailRuleEditDialogComponent,
PermissionsUserComponent,
PermissionsGroupComponent,
IfOwnerDirective,
IfObjectPermissionsDirective,
PermissionsDialogComponent,
PermissionsFormComponent,
PermissionsFilterDropdownComponent,
UsernamePipe,
LogoComponent,
IsNumberPipe,
ShareLinksDropdownComponent,
WorkflowsComponent,
WorkflowEditDialogComponent,
MailComponent,
UsersAndGroupsComponent,
FileDropComponent,
CustomFieldsComponent,
CustomFieldEditDialogComponent,
CustomFieldsDropdownComponent,
CustomFieldsQueryDropdownComponent,
ProfileEditDialogComponent,
DocumentLinkComponent,
PreviewPopupComponent,
SwitchComponent,
ConfigComponent,
FileComponent,
ConfirmButtonComponent,
MonetaryComponent,
SystemStatusDialogComponent,
RotateConfirmDialogComponent,
MergeConfirmDialogComponent,
SplitConfirmDialogComponent,
DocumentHistoryComponent,
DragDropSelectComponent,
CustomFieldDisplayComponent,
GlobalSearchComponent,
HotkeyDialogComponent,
DeletePagesConfirmDialogComponent,
TrashComponent,
EntriesComponent,
SavedViewsComponent,
CustomFieldsBulkEditDialogComponent,
],
bootstrap: [AppComponent],
imports: [
BrowserModule,
AppRoutingModule,
NgbModule,
FormsModule,
ReactiveFormsModule,
PdfViewerModule,
NgxFileDropModule,
NgSelectModule,
ColorSliderModule,
TourNgBootstrapModule,
DragDropModule,
NgxBootstrapIconsModule.pick(icons),
],
providers: [
{
provide: APP_INITIALIZER,
useFactory: initializeApp,
deps: [SettingsService],
multi: true,
},
DatePipe,
CookieService,
{
provide: HTTP_INTERCEPTORS,
useClass: CsrfInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: ApiVersionInterceptor,
multi: true,
},
FilterPipe,
DocumentTitlePipe,
{ provide: NgbDateAdapter, useClass: ISODateAdapter },
{ provide: NgbDateParserFormatter, useClass: LocalizedDateParserFormatter },
PermissionsGuard,
DirtyDocGuard,
DirtySavedViewGuard,
UsernamePipe,
provideHttpClient(withInterceptorsFromDi()),
],
})
export class AppModule {}
@@ -29,13 +29,7 @@ describe('ConfigComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
BrowserModule,
NgbModule,
NgSelectModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
declarations: [
ConfigComponent,
TextComponent,
SelectComponent,
@@ -44,6 +38,14 @@ describe('ConfigComponent', () => {
FileComponent,
PageHeaderComponent,
],
imports: [
BrowserModule,
NgbModule,
NgSelectModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
@@ -1,15 +1,6 @@
import { AsyncPipe } from '@angular/common'
import { Component, OnDestroy, OnInit } from '@angular/core'
import {
AbstractControl,
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'
import { AbstractControl, FormControl, FormGroup } from '@angular/forms'
import { DirtyComponent, dirtyCheck } from '@ngneat/dirty-check-forms'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import {
BehaviorSubject,
Observable,
@@ -27,31 +18,12 @@ import {
import { ConfigService } from 'src/app/services/config.service'
import { SettingsService } from 'src/app/services/settings.service'
import { ToastService } from 'src/app/services/toast.service'
import { FileComponent } from '../../common/input/file/file.component'
import { NumberComponent } from '../../common/input/number/number.component'
import { SelectComponent } from '../../common/input/select/select.component'
import { SwitchComponent } from '../../common/input/switch/switch.component'
import { TextComponent } from '../../common/input/text/text.component'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
@Component({
selector: 'pngx-config',
templateUrl: './config.component.html',
styleUrl: './config.component.scss',
imports: [
PageHeaderComponent,
SelectComponent,
SwitchComponent,
TextComponent,
NumberComponent,
FileComponent,
AsyncPipe,
NgbNavModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule,
],
})
export class ConfigComponent
extends LoadingComponentWithPermissions
@@ -1,6 +1,7 @@
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { BrowserModule, By } from '@angular/platform-browser'
import { NgbModule, NgbNavLink } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
@@ -32,12 +33,13 @@ describe('LogsComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [LogsComponent, PageHeaderComponent],
imports: [
BrowserModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
LogsComponent,
PageHeaderComponent,
FormsModule,
ReactiveFormsModule,
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
@@ -6,23 +6,14 @@ import {
OnInit,
ViewChild,
} from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'
import { filter, takeUntil, timer } from 'rxjs'
import { LogService } from 'src/app/services/rest/log.service'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
@Component({
selector: 'pngx-logs',
templateUrl: './logs.component.html',
styleUrls: ['./logs.component.scss'],
imports: [
PageHeaderComponent,
NgbNavModule,
FormsModule,
ReactiveFormsModule,
],
})
export class LogsComponent
extends LoadingComponentWithPermissions
@@ -41,7 +41,7 @@
<ng-template ngbNavContent>
<div class="row">
<div class="col-xl-6 pe-xl-5">
<h5 i18n>Appearance</h5>
<h4 i18n>Appearance</h4>
<div class="row mb-3">
<div class="col-md-3 col-form-label pt-0">
<span i18n>Display language</span>
@@ -144,7 +144,7 @@
<div class="col-md-3 col-form-label pt-0">
<span i18n>Theme Color</span>
</div>
<div class="col col-md-4">
<div class="col col-md-3">
<pngx-input-color i18n-title formControlName="themeColor" [error]="error?.color"></pngx-input-color>
</div>
<div class="col-2">
@@ -154,9 +154,30 @@
</div>
</div>
<h5 class="mt-3" id="update-checking" i18n>Update checking</h5>
<h4 class="mt-4" i18n>Document editing</h4>
<div class="row mb-3">
<div class="col d-flex flex-row align-items-start">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Use PDF viewer provided by the browser" i18n-hint hint="This is usually faster for displaying large PDF documents, but it might not work on some browsers." formControlName="useNativePdfViewer"></pngx-input-check>
</div>
</div>
<div class="row mb-3">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Automatically remove inbox tag(s) on save" formControlName="documentEditingRemoveInboxTags"></pngx-input-check>
</div>
</div>
<div class="row mb-3">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Show document thumbnail during loading" formControlName="documentEditingOverlayThumbnail"></pngx-input-check>
</div>
</div>
</div>
<div class="col-xl-6 ps-xl-5">
<h4 class="mt-4" id="update-checking" i18n>Update checking</h4>
<div class="row mb-3">
<div class="offset-md-3 col d-flex flex-row align-items-start">
<pngx-input-check i18n-title title="Enable update checking" formControlName="updateCheckingEnabled"></pngx-input-check>
<button class="btn btn-sm btn-link text-muted me-auto p-0 ms-2" title="What's this?" i18n-title type="button" triggers="mouseenter:mouseleave" [ngbPopover]="updatesPopover" [autoClose]="true">
<i-bs name="question-circle"></i-bs>
@@ -172,74 +193,25 @@
</div>
</div>
<h5 class="mt-3" i18n>Saved Views</h5>
<h4 class="mt-4" i18n>Bulk editing</h4>
<div class="row mb-3">
<div class="col">
<pngx-input-check i18n-title title="Show warning when closing saved views with unsaved changes" formControlName="savedViewsWarnOnUnsavedChange"></pngx-input-check>
</div>
</div>
</div>
<div class="col-xl-6 ps-xl-5">
<h5 class="mt-3 mt-md-0" i18n>Document editing</h5>
<div class="row mb-3">
<div class="col">
<pngx-input-check i18n-title title="Use PDF viewer provided by the browser" i18n-hint hint="This is usually faster for displaying large PDF documents, but it might not work on some browsers." formControlName="useNativePdfViewer"></pngx-input-check>
</div>
</div>
<div class="row mb-3">
<div class="col-2">
<span i18n>Default zoom:</span>
</div>
<div class="col">
<select class="form-select" formControlName="pdfViewerDefaultZoom">
<option [ngValue]="ZoomSetting.PageWidth" i18n>Fit width</option>
<option [ngValue]="ZoomSetting.PageFit" i18n>Fit page</option>
</select>
<p class="small text-muted mt-1" i18n>Only applies to the Paperless-ngx PDF viewer.</p>
</div>
</div>
<div class="row mb-3">
<div class="col">
<pngx-input-check i18n-title title="Automatically remove inbox tag(s) on save" formControlName="documentEditingRemoveInboxTags"></pngx-input-check>
</div>
</div>
<div class="row mb-3">
<div class="col">
<pngx-input-check i18n-title title="Show document thumbnail during loading" formControlName="documentEditingOverlayThumbnail"></pngx-input-check>
</div>
</div>
<h5 class="mt-3" i18n>Notes</h5>
<div class="row mb-3">
<div class="col">
<pngx-input-check i18n-title title="Enable notes" formControlName="notesEnabled"></pngx-input-check>
</div>
</div>
<h5 class="mt-3" i18n>Bulk editing</h5>
<div class="row mb-3">
<div class="col">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Show confirmation dialogs" formControlName="bulkEditConfirmationDialogs"></pngx-input-check>
<pngx-input-check i18n-title title="Apply on close" formControlName="bulkEditApplyOnClose"></pngx-input-check>
</div>
</div>
<h5 class="mt-3" i18n>Global search</h5>
<h4 class="mt-4" i18n>Global search</h4>
<div class="row mb-3">
<div class="col">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Do not include advanced search results" formControlName="searchDbOnly"></pngx-input-check>
</div>
</div>
<div class="row mb-3">
<div class="col">
<div class="offset-md-3 col">
<div class="row">
<div class="col-md-3 col-form-label pt-0">
<div class="col-md-2 col-form-label pt-0">
<span i18n>Full search links to</span>
</div>
<div class="col">
@@ -252,6 +224,19 @@
</div>
</div>
<h4 class="mt-4" i18n>Saved Views</h4>
<div class="row mb-3">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Show warning when closing saved views with unsaved changes" formControlName="savedViewsWarnOnUnsavedChange"></pngx-input-check>
</div>
</div>
<h4 class="mt-4" i18n>Notes</h4>
<div class="row mb-3">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Enable notes" formControlName="notesEnabled"></pngx-input-check>
</div>
</div>
</div>
</div>
@@ -262,10 +247,10 @@
<a ngbNavLink i18n>Permissions</a>
<ng-template ngbNavContent>
<h5 i18n>Default Permissions</h5>
<h4 i18n>Default Permissions</h4>
<div class="row mb-3">
<div class="col">
<div class="offset-md-3 col">
<p i18n>
Settings apply to this user account for objects (Tags, Mail Rules, etc.) created via the web UI
</p>
@@ -344,10 +329,10 @@
<a ngbNavLink i18n>Notifications</a>
<ng-template ngbNavContent>
<h5 i18n>Document processing</h5>
<h4 i18n>Document processing</h4>
<div class="row mb-3">
<div class="col">
<div class="offset-md-3 col">
<pngx-input-check i18n-title title="Show notifications when new documents are detected" formControlName="notificationsConsumerNewDocument"></pngx-input-check>
<pngx-input-check i18n-title title="Show notifications when document processing completes successfully" formControlName="notificationsConsumerSuccess"></pngx-input-check>
<pngx-input-check i18n-title title="Show notifications when document processing fails" formControlName="notificationsConsumerFailed"></pngx-input-check>
@@ -75,16 +75,7 @@ describe('SettingsComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
NgbModule,
RouterTestingModule.withRoutes(routes),
FormsModule,
ReactiveFormsModule,
NgbAlertModule,
NgSelectModule,
NgxBootstrapIconsModule.pick(allIcons),
NgbModalModule,
DragDropModule,
declarations: [
SettingsComponent,
PageHeaderComponent,
IfPermissionsDirective,
@@ -103,6 +94,17 @@ describe('SettingsComponent', () => {
ConfirmButtonComponent,
DragDropSelectComponent,
],
imports: [
NgbModule,
RouterTestingModule.withRoutes(routes),
FormsModule,
ReactiveFormsModule,
NgbAlertModule,
NgSelectModule,
NgxBootstrapIconsModule.pick(allIcons),
NgbModalModule,
DragDropModule,
],
providers: [
CustomDatePipe,
DatePipe,
@@ -212,7 +214,7 @@ describe('SettingsComponent', () => {
expect(toastErrorSpy).toHaveBeenCalled()
expect(storeSpy).toHaveBeenCalled()
expect(appearanceSettingsSpy).not.toHaveBeenCalled()
expect(setSpy).toHaveBeenCalledTimes(29)
expect(setSpy).toHaveBeenCalledTimes(28)
// succeed
storeSpy.mockReturnValueOnce(of(true))
@@ -1,4 +1,4 @@
import { AsyncPipe, ViewportScroller } from '@angular/common'
import { ViewportScroller } from '@angular/common'
import {
AfterViewInit,
Component,
@@ -7,22 +7,14 @@ import {
OnDestroy,
OnInit,
} from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormControl, FormGroup } from '@angular/forms'
import { ActivatedRoute, Router } from '@angular/router'
import {
NgbModal,
NgbModalRef,
NgbNavChangeEvent,
NgbNavModule,
NgbPopoverModule,
} from '@ng-bootstrap/ng-bootstrap'
import { DirtyComponent, dirtyCheck } from '@ngneat/dirty-check-forms'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { TourService } from 'ngx-ui-tour-ng-bootstrap'
import {
BehaviorSubject,
@@ -40,8 +32,6 @@ import {
} from 'src/app/data/system-status'
import { GlobalSearchType, SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { User } from 'src/app/data/user'
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { DocumentListViewService } from 'src/app/services/document-list-view.service'
import {
PermissionAction,
@@ -56,14 +46,7 @@ import {
} from 'src/app/services/settings.service'
import { SystemStatusService } from 'src/app/services/system-status.service'
import { Toast, ToastService } from 'src/app/services/toast.service'
import { CheckComponent } from '../../common/input/check/check.component'
import { ColorComponent } from '../../common/input/color/color.component'
import { PermissionsGroupComponent } from '../../common/input/permissions/permissions-group/permissions-group.component'
import { PermissionsUserComponent } from '../../common/input/permissions/permissions-user/permissions-user.component'
import { SelectComponent } from '../../common/input/select/select.component'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { SystemStatusDialogComponent } from '../../common/system-status-dialog/system-status-dialog.component'
import { ZoomSetting } from '../../document-detail/document-detail.component'
import { ComponentWithPermissions } from '../../with-permissions/with-permissions.component'
enum SettingsNavIDs {
@@ -83,22 +66,6 @@ const systemDateFormat = {
selector: 'pngx-settings',
templateUrl: './settings.component.html',
styleUrls: ['./settings.component.scss'],
imports: [
PageHeaderComponent,
CheckComponent,
ColorComponent,
SelectComponent,
PermissionsGroupComponent,
PermissionsUserComponent,
CustomDatePipe,
IfPermissionsDirective,
AsyncPipe,
FormsModule,
ReactiveFormsModule,
NgbNavModule,
NgbPopoverModule,
NgxBootstrapIconsModule,
],
})
export class SettingsComponent
extends ComponentWithPermissions
@@ -126,7 +93,6 @@ export class SettingsComponent
defaultPermsEditUsers: new FormControl(null),
defaultPermsEditGroups: new FormControl(null),
useNativePdfViewer: new FormControl(null),
pdfViewerDefaultZoom: new FormControl(null),
documentEditingRemoveInboxTags: new FormControl(null),
documentEditingOverlayThumbnail: new FormControl(null),
searchDbOnly: new FormControl(null),
@@ -156,8 +122,6 @@ export class SettingsComponent
public readonly GlobalSearchType = GlobalSearchType
public readonly ZoomSetting = ZoomSetting
get systemStatusHasErrors(): boolean {
return (
this.systemStatus.database.status === SystemStatusItemStatus.ERROR ||
@@ -280,9 +244,6 @@ export class SettingsComponent
useNativePdfViewer: this.settings.get(
SETTINGS_KEYS.USE_NATIVE_PDF_VIEWER
),
pdfViewerDefaultZoom: this.settings.get(
SETTINGS_KEYS.PDF_VIEWER_ZOOM_SETTING
),
displayLanguage: this.settings.getLanguage(),
dateLocale: this.settings.get(SETTINGS_KEYS.DATE_LOCALE),
dateFormat: this.settings.get(SETTINGS_KEYS.DATE_FORMAT),
@@ -442,10 +403,6 @@ export class SettingsComponent
SETTINGS_KEYS.USE_NATIVE_PDF_VIEWER,
this.settingsForm.value.useNativePdfViewer
)
this.settings.set(
SETTINGS_KEYS.PDF_VIEWER_ZOOM_SETTING,
this.settingsForm.value.pdfViewerDefaultZoom
)
this.settings.set(
SETTINGS_KEYS.DATE_LOCALE,
this.settingsForm.value.dateLocale
@@ -119,17 +119,19 @@ describe('TasksComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
NgbModule,
RouterTestingModule.withRoutes(routes),
NgxBootstrapIconsModule.pick(allIcons),
FormsModule,
declarations: [
TasksComponent,
PageHeaderComponent,
IfPermissionsDirective,
CustomDatePipe,
ConfirmDialogComponent,
],
imports: [
NgbModule,
RouterTestingModule.withRoutes(routes),
NgxBootstrapIconsModule.pick(allIcons),
FormsModule,
],
providers: [
{
provide: PermissionsService,
@@ -1,16 +1,6 @@
import { NgTemplateOutlet, SlicePipe } from '@angular/common'
import { Component, OnDestroy, OnInit } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { Router } from '@angular/router'
import {
NgbCollapseModule,
NgbDropdownModule,
NgbModal,
NgbNavModule,
NgbPaginationModule,
NgbPopoverModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import {
debounceTime,
distinctUntilChanged,
@@ -21,11 +11,8 @@ import {
timer,
} from 'rxjs'
import { PaperlessTask } from 'src/app/data/paperless-task'
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { TasksService } from 'src/app/services/tasks.service'
import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dialog.component'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
export enum TaskTab {
@@ -49,21 +36,6 @@ const FILTER_TARGETS = [
selector: 'pngx-tasks',
templateUrl: './tasks.component.html',
styleUrls: ['./tasks.component.scss'],
imports: [
PageHeaderComponent,
IfPermissionsDirective,
CustomDatePipe,
SlicePipe,
FormsModule,
ReactiveFormsModule,
NgTemplateOutlet,
NgbCollapseModule,
NgbDropdownModule,
NgbNavModule,
NgbPaginationModule,
NgbPopoverModule,
NgxBootstrapIconsModule,
],
})
export class TasksComponent
extends LoadingComponentWithPermissions
@@ -1,4 +0,0 @@
// hide caret on mobile dropdown
.d-block.d-sm-none .dropdown-toggle::after {
display: none;
}
@@ -43,6 +43,12 @@ describe('TrashComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
TrashComponent,
PageHeaderComponent,
ConfirmDialogComponent,
SafeHtmlPipe,
],
imports: [
HttpClientTestingModule,
FormsModule,
@@ -50,10 +56,6 @@ describe('TrashComponent', () => {
NgbPopoverModule,
NgbPaginationModule,
NgxBootstrapIconsModule.pick(allIcons),
TrashComponent,
PageHeaderComponent,
ConfirmDialogComponent,
SafeHtmlPipe,
],
}).compileComponents()
@@ -1,12 +1,6 @@
import { Component, OnDestroy } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { Router } from '@angular/router'
import {
NgbDropdownModule,
NgbModal,
NgbPaginationModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { delay, takeUntil, tap } from 'rxjs'
import { Document } from 'src/app/data/document'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
@@ -14,23 +8,12 @@ import { SettingsService } from 'src/app/services/settings.service'
import { ToastService } from 'src/app/services/toast.service'
import { TrashService } from 'src/app/services/trash.service'
import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dialog.component'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { PreviewPopupComponent } from '../../common/preview-popup/preview-popup.component'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
@Component({
selector: 'pngx-trash',
templateUrl: './trash.component.html',
styleUrl: './trash.component.scss',
imports: [
PageHeaderComponent,
PreviewPopupComponent,
FormsModule,
ReactiveFormsModule,
NgbDropdownModule,
NgbPaginationModule,
NgxBootstrapIconsModule,
],
})
export class TrashComponent
extends LoadingComponentWithPermissions
@@ -86,17 +69,12 @@ export class TrashComponent
modal.componentInstance.buttonsEnabled = false
this.trashService.emptyTrash([document.id]).subscribe({
next: () => {
this.toastService.showInfo(
$localize`Document "${document.title}" deleted`
)
this.toastService.showInfo($localize`Document deleted`)
modal.close()
this.reload()
},
error: (err) => {
this.toastService.showError(
$localize`Error deleting document "${document.title}"`,
err
)
this.toastService.showError($localize`Error deleting document`, err)
modal.close()
},
})
@@ -141,7 +119,7 @@ export class TrashComponent
this.trashService.restoreDocuments([document.id]).subscribe({
next: () => {
this.toastService.show({
content: $localize`Document "${document.title}" restored`,
content: $localize`Document restored`,
delay: 5000,
actionName: $localize`Open document`,
action: () => {
@@ -151,10 +129,7 @@ export class TrashComponent
this.reload()
},
error: (err) => {
this.toastService.showError(
$localize`Error restoring document "${document.title}"`,
err
)
this.toastService.showError($localize`Error restoring document`, err)
},
})
}
@@ -7,13 +7,25 @@ import {
fakeAsync,
tick,
} from '@angular/core/testing'
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { RouterTestingModule } from '@angular/router/testing'
import {
NgbAlertModule,
NgbModal,
NgbModalRef,
NgbModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgSelectModule } from '@ng-select/ng-select'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { of, throwError } from 'rxjs'
import { routes } from 'src/app/app-routing.module'
import { Group } from 'src/app/data/group'
import { User } from 'src/app/data/user'
import { IfOwnerDirective } from 'src/app/directives/if-owner.directive'
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
import { PermissionsGuard } from 'src/app/guards/permissions.guard'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe'
import { PermissionsService } from 'src/app/services/permissions.service'
import { GroupService } from 'src/app/services/rest/group.service'
import { UserService } from 'src/app/services/rest/user.service'
@@ -22,6 +34,16 @@ import { ToastService } from 'src/app/services/toast.service'
import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dialog.component'
import { GroupEditDialogComponent } from '../../common/edit-dialog/group-edit-dialog/group-edit-dialog.component'
import { UserEditDialogComponent } from '../../common/edit-dialog/user-edit-dialog/user-edit-dialog.component'
import { CheckComponent } from '../../common/input/check/check.component'
import { NumberComponent } from '../../common/input/number/number.component'
import { PasswordComponent } from '../../common/input/password/password.component'
import { PermissionsGroupComponent } from '../../common/input/permissions/permissions-group/permissions-group.component'
import { PermissionsUserComponent } from '../../common/input/permissions/permissions-user/permissions-user.component'
import { SelectComponent } from '../../common/input/select/select.component'
import { TagsComponent } from '../../common/input/tags/tags.component'
import { TextComponent } from '../../common/input/text/text.component'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { SettingsComponent } from '../settings/settings.component'
import { UsersAndGroupsComponent } from './users-groups.component'
const users = [
@@ -45,7 +67,33 @@ describe('UsersAndGroupsComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [NgxBootstrapIconsModule.pick(allIcons)],
declarations: [
UsersAndGroupsComponent,
SettingsComponent,
PageHeaderComponent,
IfPermissionsDirective,
CustomDatePipe,
ConfirmDialogComponent,
CheckComponent,
SafeHtmlPipe,
SelectComponent,
TextComponent,
PasswordComponent,
NumberComponent,
TagsComponent,
PermissionsUserComponent,
PermissionsGroupComponent,
IfOwnerDirective,
],
imports: [
NgbModule,
RouterTestingModule.withRoutes(routes),
FormsModule,
ReactiveFormsModule,
NgbAlertModule,
NgSelectModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
CustomDatePipe,
DatePipe,
@@ -134,7 +182,7 @@ describe('UsersAndGroupsComponent', () => {
deleteSpy.mockReturnValueOnce(of(true))
deleteDialog.confirm()
expect(listAllSpy).toHaveBeenCalled()
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted user "user1"')
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted user')
})
it('should logout current user if password changed, after delay', fakeAsync(() => {
@@ -178,7 +226,7 @@ describe('UsersAndGroupsComponent', () => {
completeSetup()
let modal: NgbModalRef
modalService.activeInstances.subscribe((refs) => (modal = refs[0]))
component.deleteGroup(groups[0])
component.deleteGroup(users[0])
const deleteDialog = modal.componentInstance as ConfirmDialogComponent
const deleteSpy = jest.spyOn(groupService, 'delete')
const toastErrorSpy = jest.spyOn(toastService, 'showError')
@@ -192,7 +240,7 @@ describe('UsersAndGroupsComponent', () => {
deleteSpy.mockReturnValueOnce(of(true))
deleteDialog.confirm()
expect(listAllSpy).toHaveBeenCalled()
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted group "group1"')
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted group')
})
it('should get group name', () => {
@@ -1,10 +1,8 @@
import { Component, OnDestroy, OnInit } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { Subject, first, takeUntil } from 'rxjs'
import { Group } from 'src/app/data/group'
import { User } from 'src/app/data/user'
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
import { PermissionsService } from 'src/app/services/permissions.service'
import { GroupService } from 'src/app/services/rest/group.service'
import { UserService } from 'src/app/services/rest/user.service'
@@ -14,18 +12,12 @@ import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dial
import { EditDialogMode } from '../../common/edit-dialog/edit-dialog.component'
import { GroupEditDialogComponent } from '../../common/edit-dialog/group-edit-dialog/group-edit-dialog.component'
import { UserEditDialogComponent } from '../../common/edit-dialog/user-edit-dialog/user-edit-dialog.component'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { ComponentWithPermissions } from '../../with-permissions/with-permissions.component'
@Component({
selector: 'pngx-users-groups',
templateUrl: './users-groups.component.html',
styleUrls: ['./users-groups.component.scss'],
imports: [
PageHeaderComponent,
IfPermissionsDirective,
NgxBootstrapIconsModule,
],
})
export class UsersAndGroupsComponent
extends ComponentWithPermissions
@@ -129,16 +121,13 @@ export class UsersAndGroupsComponent
this.usersService.delete(user).subscribe({
next: () => {
modal.close()
this.toastService.showInfo($localize`Deleted user "${user.username}"`)
this.toastService.showInfo($localize`Deleted user`)
this.usersService.listAll().subscribe((r) => {
this.users = r.results
})
},
error: (e) => {
this.toastService.showError(
$localize`Error deleting user "${user.username}".`,
e
)
this.toastService.showError($localize`Error deleting user.`, e)
},
})
})
@@ -182,16 +171,13 @@ export class UsersAndGroupsComponent
this.groupsService.delete(group).subscribe({
next: () => {
modal.close()
this.toastService.showInfo($localize`Deleted group "${group.name}"`)
this.toastService.showInfo($localize`Deleted group`)
this.groupsService.listAll().subscribe((r) => {
this.groups = r.results
})
},
error: (e) => {
this.toastService.showError(
$localize`Error deleting group "${group.name}".`,
e
)
this.toastService.showError($localize`Error deleting group.`, e)
},
})
})
@@ -1,3 +1,6 @@
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
/*
* Sidebar
*/
@@ -12,7 +15,6 @@
overflow-y: auto;
--pngx-sidebar-width: 100%;
max-width: var(--pngx-sidebar-width);
transition: all .2s ease;
.sidebar-heading .spinner-border {
width: 0.8em;
@@ -35,6 +37,8 @@
@media (min-width: 2400px) {
--pngx-sidebar-width: 8.33333333%;
}
transition: all .2s ease;
}
@media (max-width: 767.98px) {
.sidebar {
@@ -95,6 +95,11 @@ describe('AppFrameComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [
AppFrameComponent,
IfPermissionsDirective,
GlobalSearchComponent,
],
imports: [
BrowserModule,
RouterTestingModule.withRoutes(routes),
@@ -104,9 +109,6 @@ describe('AppFrameComponent', () => {
DragDropModule,
NgbModalModule,
NgxBootstrapIconsModule.pick(allIcons),
AppFrameComponent,
IfPermissionsDirective,
GlobalSearchComponent,
],
providers: [
SettingsService,
@@ -2,29 +2,17 @@ import {
CdkDragDrop,
CdkDragEnd,
CdkDragStart,
DragDropModule,
moveItemInArray,
} from '@angular/cdk/drag-drop'
import { NgClass } from '@angular/common'
import { Component, HostListener, OnInit } from '@angular/core'
import { ActivatedRoute, Router, RouterModule } from '@angular/router'
import {
NgbCollapseModule,
NgbDropdownModule,
NgbModal,
NgbNavModule,
NgbPopoverModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { TourNgBootstrapModule } from 'ngx-ui-tour-ng-bootstrap'
import { ActivatedRoute, Router } from '@angular/router'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { Observable } from 'rxjs'
import { first } from 'rxjs/operators'
import { Document } from 'src/app/data/document'
import { SavedView } from 'src/app/data/saved-view'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
import { ComponentCanDeactivate } from 'src/app/guards/dirty-doc.guard'
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
import {
DjangoMessageLevel,
DjangoMessagesService,
@@ -47,26 +35,11 @@ import { environment } from 'src/environments/environment'
import { ProfileEditDialogComponent } from '../common/profile-edit-dialog/profile-edit-dialog.component'
import { DocumentDetailComponent } from '../document-detail/document-detail.component'
import { ComponentWithPermissions } from '../with-permissions/with-permissions.component'
import { GlobalSearchComponent } from './global-search/global-search.component'
@Component({
selector: 'pngx-app-frame',
templateUrl: './app-frame.component.html',
styleUrls: ['./app-frame.component.scss'],
imports: [
GlobalSearchComponent,
DocumentTitlePipe,
IfPermissionsDirective,
RouterModule,
NgClass,
NgbDropdownModule,
NgbPopoverModule,
NgbCollapseModule,
NgbNavModule,
NgxBootstrapIconsModule,
DragDropModule,
TourNgBootstrapModule,
],
})
export class AppFrameComponent
extends ComponentWithPermissions
@@ -138,13 +138,13 @@ describe('GlobalSearchComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [GlobalSearchComponent],
imports: [
NgbModalModule,
NgbDropdownModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
GlobalSearchComponent,
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
@@ -1,4 +1,3 @@
import { NgTemplateOutlet } from '@angular/common'
import {
Component,
ElementRef,
@@ -7,15 +6,8 @@ import {
ViewChild,
ViewChildren,
} from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { Router } from '@angular/router'
import {
NgbDropdown,
NgbDropdownModule,
NgbModal,
NgbModalRef,
} from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgbDropdown, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
import { Subject, debounceTime, distinctUntilChanged, filter } from 'rxjs'
import { DataType } from 'src/app/data/datatype'
import {
@@ -28,7 +20,6 @@ import {
} from 'src/app/data/filter-rule-type'
import { ObjectWithId } from 'src/app/data/object-with-id'
import { GlobalSearchType, SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { DocumentListViewService } from 'src/app/services/document-list-view.service'
import { HotKeyService } from 'src/app/services/hot-key.service'
import {
@@ -59,14 +50,6 @@ import { WorkflowEditDialogComponent } from '../../common/edit-dialog/workflow-e
selector: 'pngx-global-search',
templateUrl: './global-search.component.html',
styleUrl: './global-search.component.scss',
imports: [
CustomDatePipe,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule,
NgbDropdownModule,
NgTemplateOutlet,
],
})
export class GlobalSearchComponent implements OnInit {
public DataType = DataType
@@ -8,10 +8,8 @@ describe('ClearableBadgeComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
NgxBootstrapIconsModule.pick(allIcons),
ClearableBadgeComponent,
],
declarations: [ClearableBadgeComponent],
imports: [NgxBootstrapIconsModule.pick(allIcons)],
}).compileComponents()
fixture = TestBed.createComponent(ClearableBadgeComponent)
@@ -1,11 +1,9 @@
import { Component, EventEmitter, Input, Output } from '@angular/core'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
@Component({
selector: 'pngx-clearable-badge',
templateUrl: './clearable-badge.component.html',
styleUrls: ['./clearable-badge.component.scss'],
imports: [NgxBootstrapIconsModule],
})
export class ClearableBadgeComponent {
constructor() {}
@@ -10,11 +10,8 @@ describe('ConfirmButtonComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
NgbPopoverModule,
NgxBootstrapIconsModule.pick(allIcons),
ConfirmButtonComponent,
],
declarations: [ConfirmButtonComponent],
imports: [NgbPopoverModule, NgxBootstrapIconsModule.pick(allIcons)],
}).compileComponents()
fixture = TestBed.createComponent(ConfirmButtonComponent)
@@ -5,14 +5,12 @@ import {
Output,
ViewChild,
} from '@angular/core'
import { NgbPopover, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
@Component({
selector: 'pngx-confirm-button',
templateUrl: './confirm-button.component.html',
styleUrl: './confirm-button.component.scss',
imports: [NgbPopoverModule, NgxBootstrapIconsModule],
})
export class ConfirmButtonComponent {
@Input()
@@ -11,8 +11,9 @@ describe('ConfirmDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [ConfirmDialogComponent, SafeHtmlPipe],
providers: [NgbActiveModal, SafeHtmlPipe],
imports: [ConfirmDialogComponent, SafeHtmlPipe],
imports: [],
}).compileComponents()
modal = TestBed.inject(NgbActiveModal)
@@ -1,15 +1,12 @@
import { DecimalPipe } from '@angular/common'
import { Component, EventEmitter, Input, Output } from '@angular/core'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { Subject } from 'rxjs'
import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
@Component({
selector: 'pngx-confirm-dialog',
templateUrl: './confirm-dialog.component.html',
styleUrls: ['./confirm-dialog.component.scss'],
imports: [DecimalPipe, SafeHtmlPipe],
})
export class ConfirmDialogComponent extends LoadingComponentWithPermissions {
constructor(public activeModal: NgbActiveModal) {
@@ -3,6 +3,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { PdfViewerComponent } from 'ng2-pdf-viewer'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe'
import { DeletePagesConfirmDialogComponent } from './delete-pages-confirm-dialog.component'
@@ -13,12 +14,11 @@ describe('DeletePagesConfirmDialogComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [],
declarations: [DeletePagesConfirmDialogComponent, PdfViewerComponent],
imports: [
NgxBootstrapIconsModule.pick(allIcons),
FormsModule,
ReactiveFormsModule,
DeletePagesConfirmDialogComponent,
],
providers: [
NgbActiveModal,
@@ -1,12 +1,6 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import {
PDFDocumentProxy,
PdfViewerComponent,
PdfViewerModule,
} from 'ng2-pdf-viewer'
import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe'
import { PDFDocumentProxy, PdfViewerComponent } from 'ng2-pdf-viewer'
import { DocumentService } from 'src/app/services/rest/document.service'
import { ConfirmDialogComponent } from '../confirm-dialog.component'
@@ -14,7 +8,6 @@ import { ConfirmDialogComponent } from '../confirm-dialog.component'
selector: 'pngx-delete-pages-confirm-dialog',
templateUrl: './delete-pages-confirm-dialog.component.html',
styleUrl: './delete-pages-confirm-dialog.component.scss',
imports: [PdfViewerModule, FormsModule, ReactiveFormsModule, SafeHtmlPipe],
})
export class DeletePagesConfirmDialogComponent extends ConfirmDialogComponent {
public documentID: number
@@ -15,11 +15,11 @@ describe('MergeConfirmDialogComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [MergeConfirmDialogComponent],
imports: [
NgxBootstrapIconsModule.pick(allIcons),
ReactiveFormsModule,
FormsModule,
MergeConfirmDialogComponent,
],
providers: [
NgbActiveModal,
@@ -1,12 +1,6 @@
import {
CdkDragDrop,
DragDropModule,
moveItemInArray,
} from '@angular/cdk/drag-drop'
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'
import { Component, OnInit } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { takeUntil } from 'rxjs'
import { Document } from 'src/app/data/document'
import { PermissionsService } from 'src/app/services/permissions.service'
@@ -17,12 +11,6 @@ import { ConfirmDialogComponent } from '../confirm-dialog.component'
selector: 'pngx-merge-confirm-dialog',
templateUrl: './merge-confirm-dialog.component.html',
styleUrl: './merge-confirm-dialog.component.scss',
imports: [
DragDropModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule,
],
})
export class MergeConfirmDialogComponent
extends ConfirmDialogComponent
@@ -12,11 +12,8 @@ describe('RotateConfirmDialogComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
NgxBootstrapIconsModule.pick(allIcons),
RotateConfirmDialogComponent,
SafeHtmlPipe,
],
declarations: [RotateConfirmDialogComponent, SafeHtmlPipe],
imports: [NgxBootstrapIconsModule.pick(allIcons)],
providers: [
NgbActiveModal,
SafeHtmlPipe,
@@ -1,8 +1,5 @@
import { NgStyle } from '@angular/common'
import { Component } from '@angular/core'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe'
import { DocumentService } from 'src/app/services/rest/document.service'
import { ConfirmDialogComponent } from '../confirm-dialog.component'
@@ -10,7 +7,6 @@ import { ConfirmDialogComponent } from '../confirm-dialog.component'
selector: 'pngx-rotate-confirm-dialog',
templateUrl: './rotate-confirm-dialog.component.html',
styleUrl: './rotate-confirm-dialog.component.scss',
imports: [NgStyle, NgxBootstrapIconsModule, SafeHtmlPipe],
})
export class RotateConfirmDialogComponent extends ConfirmDialogComponent {
public documentID: number
@@ -17,12 +17,12 @@ describe('SplitConfirmDialogComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [SplitConfirmDialogComponent],
imports: [
NgxBootstrapIconsModule.pick(allIcons),
ReactiveFormsModule,
FormsModule,
PdfViewerModule,
SplitConfirmDialogComponent,
],
providers: [
NgbActiveModal,
@@ -1,8 +1,6 @@
import { Component, OnInit } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { PDFDocumentProxy, PdfViewerModule } from 'ng2-pdf-viewer'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { PDFDocumentProxy } from 'ng2-pdf-viewer'
import { Document } from 'src/app/data/document'
import { PermissionsService } from 'src/app/services/permissions.service'
import { DocumentService } from 'src/app/services/rest/document.service'
@@ -12,12 +10,6 @@ import { ConfirmDialogComponent } from '../confirm-dialog.component'
selector: 'pngx-split-confirm-dialog',
templateUrl: './split-confirm-dialog.component.html',
styleUrl: './split-confirm-dialog.component.scss',
imports: [
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule,
PdfViewerModule,
],
})
export class SplitConfirmDialogComponent
extends ConfirmDialogComponent
@@ -49,7 +49,8 @@ describe('CustomFieldDisplayComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [CustomFieldDisplayComponent],
declarations: [CustomFieldDisplayComponent],
imports: [],
providers: [
DocumentService,
provideHttpClient(withInterceptorsFromDi()),
@@ -1,11 +1,9 @@
import { CurrencyPipe, getLocaleCurrencyCode } from '@angular/common'
import { getLocaleCurrencyCode } from '@angular/common'
import { Component, Inject, Input, LOCALE_ID, OnInit } from '@angular/core'
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
import { takeUntil } from 'rxjs'
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
import { DisplayField, Document } from 'src/app/data/document'
import { Results } from 'src/app/data/results'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service'
import { DocumentService } from 'src/app/services/rest/document.service'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
@@ -14,7 +12,6 @@ import { LoadingComponentWithPermissions } from '../../loading-component/loading
selector: 'pngx-custom-field-display',
templateUrl: './custom-field-display.component.html',
styleUrl: './custom-field-display.component.scss',
imports: [CustomDatePipe, CurrencyPipe, NgbTooltipModule],
})
export class CustomFieldDisplayComponent
extends LoadingComponentWithPermissions
@@ -19,7 +19,6 @@ import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { of } from 'rxjs'
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service'
import { SettingsService } from 'src/app/services/settings.service'
import { ToastService } from 'src/app/services/toast.service'
import { CustomFieldEditDialogComponent } from '../edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component'
import { SelectComponent } from '../input/select/select.component'
@@ -44,10 +43,10 @@ describe('CustomFieldsDropdownComponent', () => {
let customFieldService: CustomFieldsService
let toastService: ToastService
let modalService: NgbModal
let settingsService: SettingsService
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [CustomFieldsDropdownComponent, SelectComponent],
imports: [
NgSelectModule,
FormsModule,
@@ -55,8 +54,6 @@ describe('CustomFieldsDropdownComponent', () => {
NgbModalModule,
NgbDropdownModule,
NgxBootstrapIconsModule.pick(allIcons),
CustomFieldsDropdownComponent,
SelectComponent,
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
@@ -73,8 +70,6 @@ describe('CustomFieldsDropdownComponent', () => {
results: fields.concat([]),
})
)
settingsService = TestBed.inject(SettingsService)
settingsService.currentUser = { id: 1, username: 'test' }
fixture = TestBed.createComponent(CustomFieldsDropdownComponent)
component = fixture.componentInstance
fixture.detectChanges()
@@ -8,9 +8,7 @@ import {
ViewChild,
ViewChildren,
} from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { first, takeUntil } from 'rxjs'
import { CustomField, DATA_TYPE_LABELS } from 'src/app/data/custom-field'
import { CustomFieldInstance } from 'src/app/data/custom-field-instance'
@@ -28,12 +26,6 @@ import { CustomFieldEditDialogComponent } from '../edit-dialog/custom-field-edit
selector: 'pngx-custom-fields-dropdown',
templateUrl: './custom-fields-dropdown.component.html',
styleUrls: ['./custom-fields-dropdown.component.scss'],
imports: [
NgbDropdownModule,
NgxBootstrapIconsModule,
FormsModule,
ReactiveFormsModule,
],
})
export class CustomFieldsDropdownComponent extends LoadingComponentWithPermissions {
@Input()
@@ -67,9 +67,7 @@
(mousedown)="$event.stopImmediatePropagation()"
></ng-select>
<select class="w-25 form-select" [(ngModel)]="atom.operator" [disabled]="disabled">
@for (operator of getOperatorsForField(atom.field); track operator.label) {
<option [ngValue]="operator.value">{{operator.label}}</option>
}
<option *ngFor="let operator of getOperatorsForField(atom.field)" [ngValue]="operator.value">{{operator.label}}</option>
</select>
@switch (atom.operator) {
@case (CustomFieldQueryOperator.Exists) {
@@ -55,13 +55,13 @@ describe('CustomFieldsQueryDropdownComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CustomFieldsQueryDropdownComponent],
imports: [
NgbDropdownModule,
NgxBootstrapIconsModule.pick(allIcons),
NgSelectModule,
FormsModule,
ReactiveFormsModule,
CustomFieldsQueryDropdownComponent,
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
@@ -1,4 +1,3 @@
import { NgTemplateOutlet } from '@angular/common'
import {
Component,
EventEmitter,
@@ -8,14 +7,8 @@ import {
ViewChild,
ViewChildren,
} from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import {
NgbDatepickerModule,
NgbDropdown,
NgbDropdownModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
import { NgSelectComponent } from '@ng-select/ng-select'
import { first, Subject, takeUntil } from 'rxjs'
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
import {
@@ -36,7 +29,6 @@ import {
} from 'src/app/utils/custom-field-query-element'
import { popperOptionsReenablePreventOverflow } from 'src/app/utils/popper-options'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.component'
export class CustomFieldQueriesModel {
public queries: CustomFieldQueryElement[] = []
@@ -164,16 +156,6 @@ export class CustomFieldQueriesModel {
selector: 'pngx-custom-fields-query-dropdown',
templateUrl: './custom-fields-query-dropdown.component.html',
styleUrls: ['./custom-fields-query-dropdown.component.scss'],
imports: [
ClearableBadgeComponent,
FormsModule,
ReactiveFormsModule,
NgbDatepickerModule,
NgTemplateOutlet,
NgSelectModule,
NgxBootstrapIconsModule,
NgbDropdownModule,
],
})
export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPermissions {
public CustomFieldQueryComponentType = CustomFieldQueryElementType
@@ -27,14 +27,16 @@ describe('DatesDropdownComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [
DatesDropdownComponent,
ClearableBadgeComponent,
CustomDatePipe,
],
imports: [
NgbModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
DatesDropdownComponent,
ClearableBadgeComponent,
CustomDatePipe,
],
providers: [
SettingsService,
@@ -1,4 +1,3 @@
import { NgClass } from '@angular/common'
import {
Component,
EventEmitter,
@@ -7,20 +6,12 @@ import {
OnInit,
Output,
} from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import {
NgbDateAdapter,
NgbDatepickerModule,
NgbDropdownModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap'
import { Subject, Subscription } from 'rxjs'
import { debounceTime } from 'rxjs/operators'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { SettingsService } from 'src/app/services/settings.service'
import { ISODateAdapter } from 'src/app/utils/ngb-iso-date-adapter'
import { popperOptionsReenablePreventOverflow } from 'src/app/utils/popper-options'
import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.component'
export interface DateSelection {
createdBefore?: string
@@ -43,16 +34,6 @@ export enum RelativeDate {
templateUrl: './dates-dropdown.component.html',
styleUrls: ['./dates-dropdown.component.scss'],
providers: [{ provide: NgbDateAdapter, useClass: ISODateAdapter }],
imports: [
ClearableBadgeComponent,
CustomDatePipe,
NgxBootstrapIconsModule,
NgbDatepickerModule,
NgbDropdownModule,
FormsModule,
ReactiveFormsModule,
NgClass,
],
})
export class DatesDropdownComponent implements OnInit, OnDestroy {
public popperOptions = popperOptionsReenablePreventOverflow
@@ -20,11 +20,7 @@ describe('CorrespondentEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
declarations: [
CorrespondentEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -32,6 +28,7 @@ describe('CorrespondentEditDialogComponent', () => {
TextComponent,
PermissionsFormComponent,
],
imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule],
providers: [
NgbActiveModal,
provideHttpClient(withInterceptorsFromDi()),
@@ -1,34 +1,17 @@
import { Component } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
import { Correspondent } from 'src/app/data/correspondent'
import { DEFAULT_MATCHING_ALGORITHM } from 'src/app/data/matching-model'
import { IfOwnerDirective } from 'src/app/directives/if-owner.directive'
import { CorrespondentService } from 'src/app/services/rest/correspondent.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { PermissionsFormComponent } from '../../input/permissions/permissions-form/permissions-form.component'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
@Component({
selector: 'pngx-correspondent-edit-dialog',
templateUrl: './correspondent-edit-dialog.component.html',
styleUrls: ['./correspondent-edit-dialog.component.scss'],
imports: [
SelectComponent,
PermissionsFormComponent,
TextComponent,
IfOwnerDirective,
FormsModule,
ReactiveFormsModule,
],
})
export class CorrespondentEditDialogComponent extends EditDialogComponent<Correspondent> {
constructor(
@@ -24,12 +24,7 @@ describe('CustomFieldEditDialogComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
declarations: [
CustomFieldEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -37,6 +32,13 @@ describe('CustomFieldEditDialogComponent', () => {
TextComponent,
SafeHtmlPipe,
],
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
NgbActiveModal,
provideHttpClient(withInterceptorsFromDi()),
@@ -6,15 +6,8 @@ import {
QueryList,
ViewChildren,
} from '@angular/core'
import {
FormArray,
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormArray, FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { takeUntil } from 'rxjs'
import {
CustomField,
@@ -24,21 +17,12 @@ import {
import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
import { EditDialogComponent, EditDialogMode } from '../edit-dialog.component'
@Component({
selector: 'pngx-custom-field-edit-dialog',
templateUrl: './custom-field-edit-dialog.component.html',
styleUrls: ['./custom-field-edit-dialog.component.scss'],
imports: [
SelectComponent,
TextComponent,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule,
],
})
export class CustomFieldEditDialogComponent
extends EditDialogComponent<CustomField>
@@ -20,11 +20,7 @@ describe('DocumentTypeEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
declarations: [
DocumentTypeEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -32,6 +28,7 @@ describe('DocumentTypeEditDialogComponent', () => {
TextComponent,
PermissionsFormComponent,
],
imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule],
providers: [
NgbActiveModal,
provideHttpClient(withInterceptorsFromDi()),
@@ -1,34 +1,17 @@
import { Component } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
import { DocumentType } from 'src/app/data/document-type'
import { DEFAULT_MATCHING_ALGORITHM } from 'src/app/data/matching-model'
import { IfOwnerDirective } from 'src/app/directives/if-owner.directive'
import { DocumentTypeService } from 'src/app/services/rest/document-type.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { PermissionsFormComponent } from '../../input/permissions/permissions-form/permissions-form.component'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
@Component({
selector: 'pngx-document-type-edit-dialog',
templateUrl: './document-type-edit-dialog.component.html',
styleUrls: ['./document-type-edit-dialog.component.scss'],
imports: [
SelectComponent,
PermissionsFormComponent,
TextComponent,
IfOwnerDirective,
FormsModule,
ReactiveFormsModule,
],
})
export class DocumentTypeEditDialogComponent extends EditDialogComponent<DocumentType> {
constructor(
@@ -38,7 +38,6 @@ import { EditDialogComponent, EditDialogMode } from './edit-dialog.component'
<h4 class="modal-title" id="modal-basic-title">{{ getTitle() }}</h4>
</div>
`,
imports: [FormsModule, ReactiveFormsModule],
})
class TestComponent extends EditDialogComponent<Tag> {
constructor(
@@ -97,7 +96,8 @@ describe('EditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [FormsModule, ReactiveFormsModule, TestComponent],
declarations: [TestComponent],
imports: [FormsModule, ReactiveFormsModule],
providers: [
NgbActiveModal,
{
@@ -33,7 +33,7 @@ export abstract class EditDialogComponent<
protected service: AbstractPaperlessService<T>,
private activeModal: NgbActiveModal,
private userService: UserService,
protected settingsService: SettingsService
private settingsService: SettingsService
) {
super()
}
@@ -22,12 +22,7 @@ describe('GroupEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
declarations: [
GroupEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -36,6 +31,13 @@ describe('GroupEditDialogComponent', () => {
PermissionsFormComponent,
PermissionsSelectComponent,
],
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
NgbActiveModal,
provideHttpClient(withInterceptorsFromDi()),
@@ -1,29 +1,16 @@
import { Component } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
import { Group } from 'src/app/data/group'
import { GroupService } from 'src/app/services/rest/group.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { TextComponent } from '../../input/text/text.component'
import { PermissionsSelectComponent } from '../../permissions-select/permissions-select.component'
@Component({
selector: 'pngx-group-edit-dialog',
templateUrl: './group-edit-dialog.component.html',
styleUrls: ['./group-edit-dialog.component.scss'],
imports: [
PermissionsSelectComponent,
TextComponent,
FormsModule,
ReactiveFormsModule,
],
})
export class GroupEditDialogComponent extends EditDialogComponent<Group> {
constructor(
@@ -33,11 +33,7 @@ describe('MailAccountEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
declarations: [
MailAccountEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -47,6 +43,7 @@ describe('MailAccountEditDialogComponent', () => {
PermissionsFormComponent,
PasswordComponent,
],
imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule],
providers: [
NgbActiveModal,
provideHttpClient(withInterceptorsFromDi()),
@@ -1,24 +1,11 @@
import { Component, ViewChild } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import {
NgbActiveModal,
NgbAlert,
NgbAlertModule,
} from '@ng-bootstrap/ng-bootstrap'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal, NgbAlert } from '@ng-bootstrap/ng-bootstrap'
import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
import { IMAPSecurity, MailAccount } from 'src/app/data/mail-account'
import { MailAccountService } from 'src/app/services/rest/mail-account.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { CheckComponent } from '../../input/check/check.component'
import { PasswordComponent } from '../../input/password/password.component'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
const IMAP_SECURITY_OPTIONS = [
{ id: IMAPSecurity.None, name: $localize`No encryption` },
@@ -30,15 +17,6 @@ const IMAP_SECURITY_OPTIONS = [
selector: 'pngx-mail-account-edit-dialog',
templateUrl: './mail-account-edit-dialog.component.html',
styleUrls: ['./mail-account-edit-dialog.component.scss'],
imports: [
TextComponent,
CheckComponent,
PasswordComponent,
SelectComponent,
FormsModule,
ReactiveFormsModule,
NgbAlertModule,
],
})
export class MailAccountEditDialogComponent extends EditDialogComponent<MailAccount> {
testActive: boolean = false
@@ -33,11 +33,7 @@ describe('MailRuleEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
declarations: [
MailRuleEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -50,6 +46,7 @@ describe('MailRuleEditDialogComponent', () => {
CheckComponent,
SwitchComponent,
],
imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule],
providers: [
NgbActiveModal,
{
@@ -1,10 +1,5 @@
import { Component } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { first } from 'rxjs'
import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
@@ -25,12 +20,6 @@ import { MailAccountService } from 'src/app/services/rest/mail-account.service'
import { MailRuleService } from 'src/app/services/rest/mail-rule.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { CheckComponent } from '../../input/check/check.component'
import { NumberComponent } from '../../input/number/number.component'
import { SelectComponent } from '../../input/select/select.component'
import { SwitchComponent } from '../../input/switch/switch.component'
import { TagsComponent } from '../../input/tags/tags.component'
import { TextComponent } from '../../input/text/text.component'
const ATTACHMENT_TYPE_OPTIONS = [
{
@@ -49,7 +38,7 @@ const CONSUMPTION_SCOPE_OPTIONS = [
name: $localize`Only process attachments`,
},
{
id: MailRuleConsumptionScope.EmailOnly,
id: MailRuleConsumptionScope.Email_Only,
name: $localize`Process message as .eml`,
},
{
@@ -119,16 +108,6 @@ const METADATA_CORRESPONDENT_OPTIONS = [
selector: 'pngx-mail-rule-edit-dialog',
templateUrl: './mail-rule-edit-dialog.component.html',
styleUrls: ['./mail-rule-edit-dialog.component.scss'],
imports: [
SelectComponent,
TagsComponent,
CheckComponent,
TextComponent,
NumberComponent,
SwitchComponent,
FormsModule,
ReactiveFormsModule,
],
})
export class MailRuleEditDialogComponent extends EditDialogComponent<MailRule> {
accounts: MailAccount[]
@@ -1,13 +1,26 @@
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { By } from '@angular/platform-browser'
import { NgbAccordionButton, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import {
NgbAccordionButton,
NgbActiveModal,
NgbModule,
} from '@ng-bootstrap/ng-bootstrap'
import { NgSelectModule } from '@ng-select/ng-select'
import { of, throwError } from 'rxjs'
import { FILTER_TITLE } from 'src/app/data/filter-rule-type'
import { IfOwnerDirective } from 'src/app/directives/if-owner.directive'
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe'
import { DocumentService } from 'src/app/services/rest/document.service'
import { StoragePathService } from 'src/app/services/rest/storage-path.service'
import { SettingsService } from 'src/app/services/settings.service'
import { PermissionsFormComponent } from '../../input/permissions/permissions-form/permissions-form.component'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
import { TextAreaComponent } from '../../input/textarea/textarea.component'
import { EditDialogMode } from '../edit-dialog.component'
import { StoragePathEditDialogComponent } from './storage-path-edit-dialog.component'
@@ -19,7 +32,17 @@ describe('StoragePathEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [],
declarations: [
StoragePathEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
SelectComponent,
TextComponent,
TextAreaComponent,
PermissionsFormComponent,
SafeHtmlPipe,
],
imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule],
providers: [
NgbActiveModal,
provideHttpClient(withInterceptorsFromDi()),
@@ -1,13 +1,6 @@
import { AsyncPipe, NgTemplateOutlet } from '@angular/common'
import { Component, OnDestroy } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { NgbAccordionModule, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { NgSelectComponent } from '@ng-select/ng-select'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import {
Observable,
Subject,
@@ -26,35 +19,15 @@ import { Document } from 'src/app/data/document'
import { FILTER_TITLE } from 'src/app/data/filter-rule-type'
import { DEFAULT_MATCHING_ALGORITHM } from 'src/app/data/matching-model'
import { StoragePath } from 'src/app/data/storage-path'
import { IfOwnerDirective } from 'src/app/directives/if-owner.directive'
import { DocumentService } from 'src/app/services/rest/document.service'
import { StoragePathService } from 'src/app/services/rest/storage-path.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { CheckComponent } from '../../input/check/check.component'
import { PermissionsFormComponent } from '../../input/permissions/permissions-form/permissions-form.component'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
import { TextAreaComponent } from '../../input/textarea/textarea.component'
@Component({
selector: 'pngx-storage-path-edit-dialog',
templateUrl: './storage-path-edit-dialog.component.html',
styleUrls: ['./storage-path-edit-dialog.component.scss'],
imports: [
SelectComponent,
TextAreaComponent,
TextComponent,
CheckComponent,
PermissionsFormComponent,
IfOwnerDirective,
AsyncPipe,
NgTemplateOutlet,
FormsModule,
ReactiveFormsModule,
NgbAccordionModule,
NgSelectComponent,
],
})
export class StoragePathEditDialogComponent
extends EditDialogComponent<StoragePath>
@@ -23,12 +23,7 @@ describe('TagEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
declarations: [
TagEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -38,6 +33,13 @@ describe('TagEditDialogComponent', () => {
ColorComponent,
CheckComponent,
],
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
NgbActiveModal,
SettingsService,
@@ -1,39 +1,18 @@
import { Component } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
import { DEFAULT_MATCHING_ALGORITHM } from 'src/app/data/matching-model'
import { Tag } from 'src/app/data/tag'
import { IfOwnerDirective } from 'src/app/directives/if-owner.directive'
import { TagService } from 'src/app/services/rest/tag.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { randomColor } from 'src/app/utils/color'
import { CheckComponent } from '../../input/check/check.component'
import { ColorComponent } from '../../input/color/color.component'
import { PermissionsFormComponent } from '../../input/permissions/permissions-form/permissions-form.component'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
@Component({
selector: 'pngx-tag-edit-dialog',
templateUrl: './tag-edit-dialog.component.html',
styleUrls: ['./tag-edit-dialog.component.scss'],
imports: [
SelectComponent,
CheckComponent,
ColorComponent,
TextComponent,
IfOwnerDirective,
PermissionsFormComponent,
FormsModule,
ReactiveFormsModule,
],
})
export class TagEditDialogComponent extends EditDialogComponent<Tag> {
constructor(
@@ -34,12 +34,7 @@ describe('UserEditDialogComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
declarations: [
UserEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -49,6 +44,13 @@ describe('UserEditDialogComponent', () => {
PermissionsFormComponent,
PermissionsSelectComponent,
],
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
NgbActiveModal,
{
@@ -160,23 +162,4 @@ describe('UserEditDialogComponent', () => {
})
expect(component.currentUserIsSuperUser).toBeTruthy()
})
it('should disable superuser option if current user is not superuser', () => {
const control: AbstractControl = component.objectForm.get('is_superuser')
permissionsService.initialize([], {
id: 99,
username: 'user99',
is_superuser: false,
})
component.ngOnInit()
expect(control.disabled).toBeTruthy()
permissionsService.initialize([], {
id: 99,
username: 'user99',
is_superuser: true,
})
component.ngOnInit()
expect(control.disabled).toBeFalsy()
})
})
@@ -1,10 +1,5 @@
import { Component, OnInit } from '@angular/core'
import {
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { first } from 'rxjs'
import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
@@ -15,23 +10,11 @@ import { GroupService } from 'src/app/services/rest/group.service'
import { UserService } from 'src/app/services/rest/user.service'
import { SettingsService } from 'src/app/services/settings.service'
import { ToastService } from 'src/app/services/toast.service'
import { PasswordComponent } from '../../input/password/password.component'
import { SelectComponent } from '../../input/select/select.component'
import { TextComponent } from '../../input/text/text.component'
import { PermissionsSelectComponent } from '../../permissions-select/permissions-select.component'
@Component({
selector: 'pngx-user-edit-dialog',
templateUrl: './user-edit-dialog.component.html',
styleUrls: ['./user-edit-dialog.component.scss'],
imports: [
PermissionsSelectComponent,
SelectComponent,
TextComponent,
PasswordComponent,
FormsModule,
ReactiveFormsModule,
],
})
export class UserEditDialogComponent
extends EditDialogComponent<User>
@@ -60,11 +43,6 @@ export class UserEditDialogComponent
ngOnInit(): void {
super.ngOnInit()
this.onToggleSuperUser()
if (!this.currentUserIsSuperUser) {
this.objectForm.get('is_superuser').disable()
} else {
this.objectForm.get('is_superuser').enable()
}
}
getCreateTitle() {
@@ -180,7 +180,7 @@
<input type="hidden" formControlName="id" />
<pngx-input-select i18n-title title="Action type" [horizontal]="true" [items]="actionTypeOptions" formControlName="type"></pngx-input-select>
@switch(formGroup.get('type').value) {
@case (WorkflowActionType.Assignment) {
@case ( WorkflowActionType.Assignment) {
<div class="row">
<div class="col">
<pngx-input-text i18n-title title="Assign title" formControlName="assign_title" i18n-hint hint="Can include some placeholders, see <a target='_blank' href='https://docs.paperless-ngx.com/usage/#workflows'>documentation</a>." [error]="error?.actions?.[i]?.assign_title"></pngx-input-text>
@@ -338,10 +338,7 @@
<input type="hidden" formControlName="id" />
<div class="col">
<pngx-input-text i18n-title title="Webhook url" formControlName="url" [error]="error?.actions?.[i]?.url"></pngx-input-text>
<div class="d-flex">
<pngx-input-switch i18n-title title="Use parameters for webhook body" formControlName="use_params" [horizontal]="true"></pngx-input-switch>
<pngx-input-switch i18n-title title="Send webhook payload as JSON" formControlName="as_json" [horizontal]="true" class="ms-5"></pngx-input-switch>
</div>
<pngx-input-switch i18n-title title="Use parameters for webhook body" formControlName="use_params"></pngx-input-switch>
@if (formGroup.get('webhook').value['use_params']) {
<pngx-input-entries i18n-title title="Webhook params" formControlName="params" [error]="error?.actions?.[i]?.params"></pngx-input-entries>
} @else {
@@ -77,11 +77,7 @@ describe('WorkflowEditDialogComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule,
NgSelectModule,
NgbModule,
declarations: [
WorkflowEditDialogComponent,
IfPermissionsDirective,
IfOwnerDirective,
@@ -95,6 +91,7 @@ describe('WorkflowEditDialogComponent', () => {
SafeHtmlPipe,
ConfirmButtonComponent,
],
imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule],
providers: [
NgbActiveModal,
{
@@ -203,8 +200,7 @@ describe('WorkflowEditDialogComponent', () => {
})
it('should return source options, type options, type name, schedule date field options', () => {
jest.spyOn(settingsService, 'get').mockReturnValue(true)
component.ngOnInit()
// coverage
expect(component.sourceOptions).toEqual(DOCUMENT_SOURCE_OPTIONS)
expect(component.triggerTypeOptions).toEqual(WORKFLOW_TYPE_OPTIONS)
expect(
@@ -220,13 +216,6 @@ describe('WorkflowEditDialogComponent', () => {
expect(component.scheduleDateFieldOptions).toEqual(
SCHEDULE_DATE_FIELD_OPTIONS
)
// Email disabled
jest.spyOn(settingsService, 'get').mockReturnValue(false)
component.ngOnInit()
expect(component.actionTypeOptions).toEqual(
WORKFLOW_ACTION_OPTIONS.filter((a) => a.id !== WorkflowActionType.Email)
)
})
it('should support add and remove triggers and actions', () => {
@@ -1,19 +1,7 @@
import {
CdkDragDrop,
DragDropModule,
moveItemInArray,
} from '@angular/cdk/drag-drop'
import { NgTemplateOutlet } from '@angular/common'
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'
import { Component, OnInit } from '@angular/core'
import {
FormArray,
FormControl,
FormGroup,
FormsModule,
ReactiveFormsModule,
} from '@angular/forms'
import { NgbAccordionModule, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { FormArray, FormControl, FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { first } from 'rxjs'
import { Correspondent } from 'src/app/data/correspondent'
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
@@ -25,7 +13,6 @@ import {
MATCH_NONE,
} from 'src/app/data/matching-model'
import { StoragePath } from 'src/app/data/storage-path'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import { Workflow } from 'src/app/data/workflow'
import {
WorkflowAction,
@@ -45,17 +32,6 @@ import { StoragePathService } from 'src/app/services/rest/storage-path.service'
import { UserService } from 'src/app/services/rest/user.service'
import { WorkflowService } from 'src/app/services/rest/workflow.service'
import { SettingsService } from 'src/app/services/settings.service'
import { ConfirmButtonComponent } from '../../confirm-button/confirm-button.component'
import { CheckComponent } from '../../input/check/check.component'
import { EntriesComponent } from '../../input/entries/entries.component'
import { NumberComponent } from '../../input/number/number.component'
import { PermissionsGroupComponent } from '../../input/permissions/permissions-group/permissions-group.component'
import { PermissionsUserComponent } from '../../input/permissions/permissions-user/permissions-user.component'
import { SelectComponent } from '../../input/select/select.component'
import { SwitchComponent } from '../../input/switch/switch.component'
import { TagsComponent } from '../../input/tags/tags.component'
import { TextComponent } from '../../input/text/text.component'
import { TextAreaComponent } from '../../input/textarea/textarea.component'
import { EditDialogComponent } from '../edit-dialog.component'
export const DOCUMENT_SOURCE_OPTIONS = [
@@ -138,25 +114,6 @@ const TRIGGER_MATCHING_ALGORITHMS = MATCHING_ALGORITHMS.filter(
selector: 'pngx-workflow-edit-dialog',
templateUrl: './workflow-edit-dialog.component.html',
styleUrls: ['./workflow-edit-dialog.component.scss'],
imports: [
CheckComponent,
EntriesComponent,
SwitchComponent,
NumberComponent,
TextComponent,
SelectComponent,
TextAreaComponent,
TagsComponent,
PermissionsGroupComponent,
PermissionsUserComponent,
ConfirmButtonComponent,
FormsModule,
ReactiveFormsModule,
NgbAccordionModule,
NgTemplateOutlet,
DragDropModule,
NgxBootstrapIconsModule,
],
})
export class WorkflowEditDialogComponent
extends EditDialogComponent<Workflow>
@@ -175,8 +132,6 @@ export class WorkflowEditDialogComponent
expandedItem: number = null
private allowedActionTypes = []
constructor(
service: WorkflowService,
activeModal: NgbActiveModal,
@@ -251,11 +206,6 @@ export class WorkflowEditDialogComponent
this.checkRemovalActionFields.bind(this)
)
this.checkRemovalActionFields(this.objectForm.value)
this.allowedActionTypes = this.settingsService.get(
SETTINGS_KEYS.EMAIL_ENABLED
)
? WORKFLOW_ACTION_OPTIONS
: WORKFLOW_ACTION_OPTIONS.filter((a) => a.id !== WorkflowActionType.Email)
}
private checkRemovalActionFields(formWorkflow: Workflow) {
@@ -471,7 +421,6 @@ export class WorkflowEditDialogComponent
id: new FormControl(action.webhook?.id),
url: new FormControl(action.webhook?.url),
use_params: new FormControl(action.webhook?.use_params),
as_json: new FormControl(action.webhook?.as_json),
params: new FormControl(action.webhook?.params),
body: new FormControl(action.webhook?.body),
headers: new FormControl(action.webhook?.headers),
@@ -537,7 +486,7 @@ export class WorkflowEditDialogComponent
}
get actionTypeOptions() {
return this.allowedActionTypes
return WORKFLOW_ACTION_OPTIONS
}
getActionTypeOptionName(type: WorkflowActionType): string {
@@ -589,7 +538,6 @@ export class WorkflowEditDialogComponent
id: null,
url: null,
use_params: true,
as_json: false,
params: null,
body: null,
headers: null,

Some files were not shown because too many files have changed in this diff Show More