mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #580 from paperless-ngx/docs-frontend-tests-style
Add frontend tests to docs
This commit is contained in:
commit
48175d5b8e
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,3 +1,7 @@
|
|||||||
|
<!--
|
||||||
|
Note: All PRs with code changes should be targeted to the `dev` branch, pure documentation changes can target `main`
|
||||||
|
-->
|
||||||
|
|
||||||
## Proposed change
|
## Proposed change
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -60,7 +60,7 @@ The endpoints correctly serve the response header fields ``Content-Disposition``
|
|||||||
and ``Content-Type`` to indicate the filename for download and the type of content of
|
and ``Content-Type`` to indicate the filename for download and the type of content of
|
||||||
the document.
|
the document.
|
||||||
|
|
||||||
In order to download or preview the original document when an archied document is available,
|
In order to download or preview the original document when an archived document is available,
|
||||||
supply the query parameter ``original=true``.
|
supply the query parameter ``original=true``.
|
||||||
|
|
||||||
.. hint::
|
.. hint::
|
||||||
|
@ -34,6 +34,8 @@ it fixed for everyone!
|
|||||||
Before contributing please review our `code of conduct`_ and other important
|
Before contributing please review our `code of conduct`_ and other important
|
||||||
information in the `contributing guidelines`_.
|
information in the `contributing guidelines`_.
|
||||||
|
|
||||||
|
.. _code-formatting-with-pre-commit-hooks:
|
||||||
|
|
||||||
Code formatting with pre-commit Hooks
|
Code formatting with pre-commit Hooks
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
@ -85,6 +87,7 @@ To do the setup you need to perform the steps from the following chapters in a c
|
|||||||
docker run -d -p 6379:6379 --restart unless-stopped redis:latest
|
docker run -d -p 6379:6379 --restart unless-stopped redis:latest
|
||||||
|
|
||||||
7. Install the python dependencies by performing in the src/ directory.
|
7. Install the python dependencies by performing in the src/ directory.
|
||||||
|
|
||||||
.. code:: shell-session
|
.. code:: shell-session
|
||||||
|
|
||||||
pipenv install --dev
|
pipenv install --dev
|
||||||
@ -183,6 +186,31 @@ X-Frame-Options are in place so that the front end behaves exactly as in product
|
|||||||
relies on you being logged into the back end. Without a valid session, The front end will simply
|
relies on you being logged into the back end. Without a valid session, The front end will simply
|
||||||
not work.
|
not work.
|
||||||
|
|
||||||
|
Testing and code style:
|
||||||
|
|
||||||
|
* The frontend code (.ts, .html, .scss) use ``prettier`` for code formatting via the Git
|
||||||
|
``pre-commit`` hooks which run automatically on commit. See
|
||||||
|
:ref:`above <code-formatting-with-pre-commit-hooks>` for installation. You can also run this
|
||||||
|
via cli with a command such as
|
||||||
|
|
||||||
|
.. code:: shell-session
|
||||||
|
|
||||||
|
$ git ls-files -- '*.ts' | xargs pre-commit run prettier --files
|
||||||
|
|
||||||
|
* Frontend testing uses jest and cypress. There is currently a need for significantly more
|
||||||
|
frontend tests. Unit tests and e2e tests, respectively, can be run non-interactively with:
|
||||||
|
|
||||||
|
.. code:: shell-session
|
||||||
|
|
||||||
|
$ ng test
|
||||||
|
$ npm run e2e:ci
|
||||||
|
|
||||||
|
Cypress also includes a UI which can be run from within the ``src-ui`` directory with
|
||||||
|
|
||||||
|
.. code:: shell-session
|
||||||
|
|
||||||
|
$ ./node_modules/.bin/cypress open
|
||||||
|
|
||||||
In order to build the front end and serve it as part of django, execute
|
In order to build the front end and serve it as part of django, execute
|
||||||
|
|
||||||
.. code:: shell-session
|
.. code:: shell-session
|
||||||
|
@ -25,6 +25,19 @@ Check for the following issues:
|
|||||||
* Go to the admin interface, and check if there are failed tasks. If so, the
|
* Go to the admin interface, and check if there are failed tasks. If so, the
|
||||||
tasks will contain an error message.
|
tasks will contain an error message.
|
||||||
|
|
||||||
|
Consumer warns ``OCR for XX failed``
|
||||||
|
####################################
|
||||||
|
|
||||||
|
If you find the OCR accuracy to be too low, and/or the document consumer warns
|
||||||
|
that ``OCR for XX failed, but we're going to stick with what we've got since
|
||||||
|
FORGIVING_OCR is enabled``, then you might need to install the
|
||||||
|
`Tesseract language files <http://packages.ubuntu.com/search?keywords=tesseract-ocr>`_
|
||||||
|
marching your document's languages.
|
||||||
|
|
||||||
|
As an example, if you are running Paperless-ngx from any Ubuntu or Debian
|
||||||
|
box, and your documents are written in Spanish you may need to run::
|
||||||
|
|
||||||
|
apt-get install -y tesseract-ocr-spa
|
||||||
|
|
||||||
Consumer fails to pickup any new files
|
Consumer fails to pickup any new files
|
||||||
######################################
|
######################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user