Commit Graph

193 Commits

Author SHA1 Message Date
Matthias Mair
0bace3f3af
Code structure refactor (#5582)
* moved docker files to /contrib/container

* changed code owners to make more precise

* updated CI to use new subdirs

* added manual trigger for testing

* moved ci files

* moved assets into subdir

* moved deploy template file to contrib

* moved django files to src/backend

* updated paths in scripts etc

* updated reqs path

* fixed version file path

* fixed flake8 path

* fixed path to node ressources

* fixed task paths

* added dep path for node

* removed unused yarn lockfile

* removed unused ci script

* updated internal backend paths for tasks

* updated translation stats path

* fixed source path for coverage

* fixed main commit repo path

* fit in changes from testing

* gather packager improvements (#149)

* Matmair/issue5578 (#143)

* moved docker files to /contrib/container

* changed code owners to make more precise

* updated CI to use new subdirs

* added manual trigger for testing

* moved ci files

* moved assets into subdir

* moved deploy template file to contrib

* moved django files to src/backend

* updated paths in scripts etc

* updated reqs path

* fixed version file path

* fixed flake8 path

* fixed path to node ressources

* fixed task paths

* added dep path for node

* removed unused yarn lockfile

* removed unused ci script

* updated internal backend paths for tasks

* updated translation stats path

* fixed source path for coverage

* fixed main commit repo path

* fix docker path

* use project dir

* move project dir command

* fixed docker paths

* another fix?

* seperate tasks out

* remove tasks

* some debugging

* ci: add .deepsource.toml

* Update .deepsource.toml

* also ignore migrations

* more debugging

* fix path issues

* remove debug script

* fix style

* change locale path

* Fixed paths for requirements

* Added dummy requirements to fool packager

* fixed exec path

* remove deepsource

---------

Co-authored-by: deepsource-io[bot] <42547082+deepsource-io[bot]@users.noreply.github.com>

* Added docs for file structure

* Fixed style errors

* updated deepsource paths

* fix deepsource paths

* fixed reqs

* merge fixes

* move newly added dirs too

* fix reqs files

* another dep fix

* merge upstream/master

* revert removal of tags

* merge upstream

* enabled detection of old config files

* adapt coverage src

* also detect and support old location for plugins.txt

* style fix

* fix ~/init.sh location

* fix requirements path

* fix config to current master

* move new folders

* fix import order

* fix paths for qc_check

* fix docs build

* fix fix path

* set docker project dir

* just use a cd

* set image path?

* set file correct

* fix copy path

* fix tasks dir

* fix init path

* fix copy path

* set prject dir

* fix paths

* remove old prod files

* fix dev env path

* set docker file

* Fix devcontainer docker compose file

* fix login attempt values

* fix init.sh path

* Fix pathing for Docker

* Docker build fix

- Set INVENTREE_BACKEND_DIR separately

* Update init.sh

* Fix path

* Update requirements.txt

* merge

* fix rq merge

* fix docker compose usage

---------

Co-authored-by: deepsource-io[bot] <42547082+deepsource-io[bot]@users.noreply.github.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2024-04-03 12:16:59 +11:00
Matthias Mair
885658e71a
Python dependency bump (#6790)
* update python deps

* bump pre-commit

* fix wrong bump

* revert djangorestframework

* bump a bit further

* bump pre-commit

* do not strip extras
2024-03-22 09:19:29 +11:00
dependabot[bot]
7811ba5578
Bump django from 4.2.10 to 4.2.11 (#6745)
* Bump django from 4.2.10 to 4.2.11

Bumps [django](https://github.com/django/django) from 4.2.10 to 4.2.11.
- [Commits](https://github.com/django/django/compare/4.2.10...4.2.11)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix dep

* remove version id

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2024-03-19 10:21:49 +11:00
Oliver
a613a7b9fc
Use whitenoise for static file handling (#6662)
* Update config_template.yaml file

* Adjust ALLOWED_HOSTS behaviour

- Only add wildcard * in DEBUG mode
- Exit if ALLOWED_HOSTS not defined

* Tweak error message

* Use whitenoise for serving static files

- Any requests to /static/ are handled by whitenoise
- If an external reverse proxy (e.g. Caddy) is being used, this will not make a difference

* Update python package requirements

* Add extra log output

* Update ENV for CI checks

* Updates

- Thow error but do not exit
- Revert CI changes
2024-03-08 11:11:30 +11:00
Oliver
950bda4ef6
Fix grpcio version (#6635)
- Pinned in https://github.com/inventree/InvenTree/pull/6621 (for testing)
- Accidentally left in uploaded code
2024-03-04 12:17:09 +00:00
Oliver
cbc879f618
[Docker] Fix broken image (#6621)
* Install grpcio faster

- Pin version
- Update build packages

* Test dockerfile before push

- SImply test if invoke is present

* Revert commit to docker-compose

* Remove VIRTUAL_ENV from Dockerfile

* Fix pip install

* Run extra checks on docker image

* Ensure mariadb links are installed:

- Closes https://github.com/inventree/InvenTree/issues/6625

* Adjust CI

 build docker image manually

* Should fail

- Test that revert fails CI

* Ok, this should break it

* Fix Dockerfile
2024-03-04 22:50:00 +11:00
Oliver
f6123cc261
[WIP] docker / Caddy (#6551)
* remove docker-sqlite file

- Do not want to encourage use of sqlite

* Add Caddyfile

* Add default site URL to .env

- Matches Caddyfile

* Cleanup / simplify .env file

* Remove dev nginx conf file

* Further cleanup of .env file

* Update docker-compose.yml

- Use caddy image instead of nginx as proxy

* Set max body size

* gunicorn: enable external logging

* Update file structure

* Cleanup docker-compose file

* Update docker/docker-compose.yml

Co-authored-by: Matthias Mair <code@mjmair.com>

* Update docker/Caddyfile

Co-authored-by: Matthias Mair <code@mjmair.com>

* Fix for postgresql packages

- Need postgresql13-client to be installed, it contains pg_dump
- Without this, backup / restore *does not work*

* Create static_i18n dir if it does not exist

* Reduce output from collectstatic

* Revert gunicorn logging

- Want to see the logs in docker

* Fix trailing slash

Ref: https://github.com/inventree/InvenTree/pull/6551#issuecomment-1962423765

* tasks.py - pass 'nouv' option through

* Update package requirements:

- Allow installation of rapidfuzz without building

* Install uv as part of docker image

* Add environment variable to control downstream URL

* Do not use uv package manager by default

- Currently does not work "correctly" - ignores installed packages
- Requires further work to run reliably

* Fix docker-compose file

- Do not build locally

* Cleanup gunicorn file

- Remove unused lien

* Cleanup docker-compose.yml

- Simpler volume management

* Update Caddyfile

Add newline

* Update requirements.txt

Add newline

* Update tasks.py

Add missing blank line

* Simplify Caddyfile

* Adds option for customizing web port

* cleanup docker-compose.yml

- Better mapping of caddy data
- Cleaner volume setup

* Add django version template

- Ensure all docs links point to the current django version we are using

* docs: cleanup intro.md

* Cleanup serving_files.md

* Cleanup config.md

* docker install docs updates

* Enable code block copying

* Fix include file

* Fix link

* Update docker install docs

* Update docker.md

* Add info about demo dataset

* Tweak heading

* Update docs link checks

* Fix workflow

* Another fix

* More ignore pattearns

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-02-28 01:06:19 +11:00
Matthias Mair
f5e02fd292
Switch to uv (#6499)
* test UV performance

* second dummy change

* fix CI

* set version - uv is already proving to be great

* dummy bump

* bump to newer uv

* use uv in more places

* revert uv

* add flag to disable UV

* fix vevn for CI

* bump uv version

* bump to uv-016

* bump

* bump

* switch to uv
2024-02-23 09:55:19 +11:00
Matthias Mair
c4d68aeef9
Dependabot/pip/cryptography 42.0.4 (#6545)
* Bump cryptography from 42.0.2 to 42.0.4

Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.2 to 42.0.4.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.2...42.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix merge

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-22 08:57:56 +11:00
Matthias Mair
ebe01530e6
Bump CI/pre-commit versions (#6522)
* bump CI versions
and run new autofixes

* fix reqs
2024-02-20 10:47:57 +11:00
dependabot[bot]
4e58f0a3c7
Bump django from 4.2.9 to 4.2.10 (#6448)
Bumps [django](https://github.com/django/django) from 4.2.9 to 4.2.10.
- [Commits](https://github.com/django/django/compare/4.2.9...4.2.10)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-08 10:57:20 +11:00
Matthias Mair
e3fb12dc03
Bump deps (#6421)
* bump deps

* cleanup
2024-02-06 19:59:56 +11:00
dependabot[bot]
341f638e5d
Bump cryptography from 41.0.7 to 42.0.0 (#6419)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.7 to 42.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.7...42.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 07:54:03 +01:00
Matthias Mair
d36cf358f8
Bump to Dj 4.x (#6173)
* bump to dj >4.2

* switch to experimental git release

* bump django-import_export

* bump mptt

* replace is_ajax, which was removed
https://docs.djangoproject.com/en/3.1/releases/3.1/#id2

* Save before accessing values in m2m/fk fields

* move plugin init

* use dev version of django for fix

* update deps

* fix deps

* use django smaller 4.2

* fix reqs

* fix merge

* remove moved code

* another merge fix

* fix ajax call

* fix refs

* change python min v

* fix deps

* bump deps

* fix deps

* pin pillow

* dj 4.1 upgrades

* make diff smaller

* bump all deps

* drop down to py3.9

* bump versions

* merge fix

* fix diff

* more bumping

* diff cleanup

* bump deps

* fix reqs

* use accurate state for model migrations
using apps the historically correct state is used

* try import

* added more logs

* add try here too

* clean up rebuilds

* Dj 4.2 (#161)

* autochanges

* bump

* fix diff

* fix diff

* bump deps

* fix req

* remove select_related to test error influence

* switch to mptt fork

* fix reqs for upstream

* move tracking ensureance into save

* optimize check frequency

* use psycopg instead of psycopg2

* fix header

* just use the values

* switch to dj < 4.2

* fix req

* another req fix

* switch to 4.2 again

* fix merge error

* Check for null pk in calculate_total_price

Cannot access self.lines if pk is Null

* use patched mptt

* try psycopg2 again

* Remove tree rebuild from migrations

* Prevent notify_users if importing or migrating

* Add order_by() to subquery annotations

- Ref: https://stackoverflow.com/a/629691

* Update stock filters

- Append order_by()

* fix error if running without timezones in testing

* add logging to figure this out

* remove tz from self.creation if TZ is off

* add tz?

* move around?

* only run the test i am trying to figure out
not reproducible on my machine

* only run the test i am trying to figure out
not reproducible on my machine

* run all tests again

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2024-02-06 13:30:50 +11:00
dependabot[bot]
f35ce29612
Bump pillow from 10.1.0 to 10.2.0 (#6323)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.1.0...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 10:03:07 +11:00
Oliver
c5d0902379
django-allauth==0.6.1 (#6301) 2024-01-20 22:33:41 +00:00
Matthias Mair
64dbf8c1e3
[FR] Add tracing support (#6211)
* [FR] Add tracing support
Fixes #6208

* move checks out of manage.py

* fixed reqs

* small cleanup

* move tracing init to settings
similar to how sentry is handled

* rephrase

* clean up imports

* added argument regarding console debugging

* fix typing

* added auth section

* remove empty headers

* made protocol configurable

* rename vars & cleanup template

* more docs for template

* add docs
2024-01-18 17:50:05 +11:00
dependabot[bot]
8a764c2c05
Bump jinja2 from 3.1.2 to 3.1.3 (#6209)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 09:38:05 +11:00
Matthias Mair
e1b670ba57
CI updates (#6167)
* replaced flake8 with ruff
mostly for speed improvements

* fix codespell error

* move config section

* added isort again

* move djlint config to pyproject

* moved ruff section

* remove flake8 from code base

* remove flake8 from code base

* fix djlint syntax

* fix removed sections

* fix requirements file

* fix getattr useage

* auto fixed docstring

* adapted ruff settings to better fit code base

* reorder order of operations

* adjust checks

* disable autofix/format

* fixed reqs

* remove flake8 section from setup.cfg

* moved isort config

* added missing toml req

* fixed req

* fixed source path
2024-01-11 00:16:13 +11:00
Oliver
a63529a9cf
Update django-allauth version (#6099)
* Patch for django-allauth 0.55.0

- Some breaking changes here
- Add logger error if auth provider cannot be imported
- Fix for API endpoints

* Only provide URLs for configured plugins

* Update for django-allauth 0.56.0

- Remove support for keycloak
- Remove example from configuration template

* Update django-allauth in requirements.txt

* Update requirements.in

* Refactor SSO functions into common file

* Update config template file

* Update docs

* Fix template files

* Log SSO exceptions to the database

- WIll help greatly with debugging installs

* Add note about error handling in docs
2023-12-18 17:35:36 +11:00
Oliver
3410534f29
Bump django-maintenance-mode (#6079)
Fixes https://github.com/inventree/InvenTree/issues/6066
2023-12-13 22:57:27 +11:00
dependabot[bot]
875f3df2b8
Bump cryptography from 41.0.5 to 41.0.6 (#6002)
* Bump cryptography from 41.0.5 to 41.0.6

Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.5 to 41.0.6.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.5...41.0.6)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update requirements.txt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2023-11-29 13:25:17 +11:00
Matthias Mair
d30ff8a291
Bump weasyprint (#5885)
* bumped weasyprint

* factored reused section out (reduce DB access)

* added pdf-context testing

Co-authored-by: miggland <miggland@users.noreply.github.com>

* switched to pdfminer.six

* make test more resilient

---------

Co-authored-by: miggland <miggland@users.noreply.github.com>
2023-11-20 09:35:11 +11:00
dependabot[bot]
26b2e90fcf
Bump pillow from 9.5.0 to 10.0.1 (#5657)
* Bump pillow from 9.5.0 to 10.0.1

Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.5.0 to 10.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.5.0...10.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Patch requirements files

* Update package requirements

* Improve offload_task function:

- Return True if the task runs or was offloaded
- Improved warning information

* Improve unit tests for task offloading

- Check return value of offload_task
- Check log output

* Bump django-stdimage

* Fix tasks.py

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2023-11-07 10:08:03 +11:00
Matthias Mair
0d99e97e1d
Bump python dependencies (#5854)
* Bumped python dependencies

* Fixd for py3.9

* fixed for py 3.9
2023-11-04 09:51:48 +11:00
Bobbe
59f17a9885
Bump django_money version back to 3.2.0, Fix #5825 (#5828)
* Bump django_money version back to 3.2.0

* Test building docker image

* Revert "Test building docker image"

This reverts commit b8e9d4f4c1.
2023-11-01 10:05:47 +11:00
Bobbe
4913acda79
Update django money / py-moneyed dependencies (#5778)
* Replace moneyed format_money function

* Update django-money to 3.3.0 and py-moneyed to 3.0

* Add CurrencyField migrations

* Fix checking if decimal_places is set

* Add currency formatting test

* Test fixing deepsource test patterns

* Revert "Test fixing deepsource test patterns"

This reverts commit 398ef93cd6.

* FIx requirements.txt formatting

* Revert "FIx requirements.txt formatting"

This reverts commit bb554b0758.
2023-10-31 22:19:55 +11:00
Matthias Mair
158a209a0f
Version bump (#5740)
* Updated all dependencies

* fixed some spelling errors

* More spelling corrections

* Fixes for changes in react-query
2023-10-18 07:27:28 +11:00
Oliver
e9e505edd4
Import export fix (#5677)
* Update django-import-export

* Add custom handler to ensure data import is not too excessive
2023-10-09 11:48:17 +11:00
Matthias Mair
f5e8f27fcd
Bump deps (#5666)
* bumped deps

* bumped frontend deps

* fixed reqs file for py 3.9
2023-10-05 09:48:53 +11:00
Matthias Mair
683cf248ea
Bump deps (#5487)
* bump deps

* bump again

* bump frontend as well

* fixed allauth version for now

* fixed requirements files

* fixed requirements files 2

* fixed changed lib path
2023-09-07 09:02:31 +10:00
Matthias Mair
71026c338c
Use error report fork (#5171)
* switch to django-error-report-2

* fix commit

* bump version

* bump error-report version
2023-08-06 21:41:57 +10:00
Matthias Mair
879d496e26
Bump deps (#5385)
* bump deps

* use isinstance where possible

* and another bump ;-)

* small fix for isinstance

* fixed wrong comparison

* fixed comparision

* use exact comparision
2023-08-06 21:39:15 +10:00
Matthias Mair
13b9b57698
P-UI: Dependency bumps (#5298)
* add option to use sections and refactro

* translate error messages

* remove unneeded vars

* move function code

* move data inside

* add global section

* add plugin section

* use translated section titles

* add translation strings

* rename scan action

* add user settings

* use ordered data

* fix settings url

* use debounced value for strings (not choices!)

* rename contex to context

* move i18n provider up

* move theme options into seperate context/ component

* renmae statrtup vars

* move translations out

* reactivate sentry

* move i18n provider to seperate context

* move langauge state completly out of App

* use theme out

* move theme context

* move LanguageContext

* move function into state

* make sentry optional for now

* add key to accordion

* init langauge context on top

* remove unneeded css files

* move errorpage to tsx

* add translation for error page

* Add error to title

* add typecast for error

* move type definition out

* remove todo -> type was already added

* upgrade deps

* add bootstrap

* remove @mantine/core

* readd core

* switch to bootstrap

* simplify import

* Add SPA views for react #2789

* split up frontend urls

* Add settings for frontend url loading

* add new UI scaffold

* remove tracking insert

* add platform app

* ensure static indexes work too

* add lingui

* add lingui config

* add mgmt tasks

* add base locales

* settings for frontend dev

* fix typo

* update deps

* add pre-commit

* add eslint

* add testing scaffold

* fix paths

* remove error - tests trip correctly

* merge workflow

* cleanup samples

* use name inline with other tests

* Add real worl frontend tests

* setup env

* tun migrations first

* optimize setup time

* setup demo dataset

* optimize run setup

* add test for class ui

* rename

* fix typo

* and another typo

* do install

* run migrations first

* fix name

* cleanup

* use other credentials

* use other credentials

* fix qc

* move envs to qc

* remove create_site

* reduce testing env

* fix test

* fix test call

* allaccess user

* add ui plattform check

* add better check

* remove unneeded env

* enable debug

* reduce wait time

* also build frontend on static

* add sekeleton

* fix various issues

* add locales

* clean output before building

* cleanup dir

* remove bootstrap

* clean up deps

* fix settings panel

* remove assets

* move logo

* split out router

* split up chunks

* fix zustand import syntax

* bundl

* update pre-render

* use vendor splitting

* maximes space usage

* enlarge breakpoints

* remove wired color changes

* cleanup tabs

* fix error

* update auth functions

* default to mail login

* add placeholder marking

* Add text to placeholder

* readd codespell

* add another test

* add sort plugin

* add sort plugin

* sort imports

* fix order

* Add mega menu

* run pre-commit fixes

* add node min version

* Docker container (#129)

* Fix allocation check for completing build order (#5199)

- Allocation check only applies to untracked line items

* docker dev

Install required node packages to docker development image

* add import order settings

* cleanup settings

* cleanup dashboard

* clanup part tab

* refactor header to only use 1 line

* cleanup reqs for py3.9

* remove compiled UI

* revert reqs change

* cleanup tasks

* cleanout built ui

* remove default user

* cleanup package.json

* fix doctip

* remove sentry

* optimize loading

* reset versions

* clean

* factor out menu items

* refactor Navtabs

* refactor HoverMenu

* remove part

* remove prettier

* remove default arg from build

* remove eslint

* Merge branch 'plattform' of https://github.com/matmair/InvenTree into platform-ui_base

* optimize svg

* add build step for plattform UI

* fix install command

* fix test

* remove extra test

* set default host if none is set

* set nicer names

* fix tests

* fix logged-in test

* update translations

* ensure more path matches

* make loading of serverrefs dynamic

* use default radius

* fix issues / code smells

* clean code smell

* fix password reset

* fix error messages

* detect small screens

* use loader meachanism for views

* refactor structure

* move auth functions out

* use text

* refactor defaults

* Add email login
FR] Add email link based logins Closes #3531

* fix name error

* fix reqs

* fix backend for magic login

* fix frontend

* remove unused route

* remove now unneeded test section

* cleanup code

* add navigation header

* fix logo component for nesting

* factor out menu

* refactor style

* clean code

* Translate items and use unique ids

* use alpine commands

* increase margins to remove drawer scroller

* only render plugins if they are defined

* remove sample content

* fix assertation

* open on hover

* refactor

* merge fix

* cleanup navigation drawer

* change dependencies for UI testing

* add highlight filter

* Add correct menu items

* move design component out

* move pre-commit out

* move deps again

* move js styles in

* revert CI changes

* remove unneeded exclution

* changed placeholder user

* refactored EditButton to component

* refactored app loading to useEffect

* moved color lookup into global scope

* reafactored UserPanel render block

* marked placeholder pages in doc links

* made doc tooltip optional for MenuLink

* changed MenuLinkItem names

* fixes missing Link item in MenuLink

* fixed merge error

* bump deps

* bump python

* downgrade for py3.9

* bump further

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2023-07-24 08:32:18 +10:00
Oliver
81e2c2f8fa
Update django-allauth-2fa to 0.11.1 (#5273)
- 0.11.0 was yanked from pypi (rude)
2023-07-18 23:56:52 +10:00
Oliver
b717011f06
Docker build: Update python deps (#5270)
* Update python deps

* Update requirements.in

* Fix requirements-dev.txt
2023-07-18 19:43:45 +10:00
Matthias Mair
a9a8ac1c70
Add email login (#5209)
* Add email login
FR] Add email link based logins Closes #3531

* fix reqs

* fix backend code

* Add tests for magic login
2023-07-11 08:13:35 +10:00
Oliver
c91fbdbc48
use django-q2 (#5167)
* use django-q2

- Modern fork of django-q

* Update requirements.txt
2023-07-05 22:53:32 +10:00
Matthias Mair
aec56d4b34
Bump general deps (#5170)
* bump deps

* down to py 3.9

* pin pillow
2023-07-05 07:20:56 +10:00
Matthias Mair
83afa74927
Bump django - fix CVE-2023-36053 (#5168)
* bump deps - fix CVE-2023-36053

* downgrade to 3.9

* fix typo
2023-07-05 07:19:53 +10:00
Matthias Mair
b700b44c53
Add dj-rest-auth (#4187)
* Add dj-rest-auth
[FR] User registration via API
Fixes #3978

* add jwt support for API

* check for old password

* Add check if registration is allowed

* make email mandatory if selected

* lower postgres version?

* update req

* revert psql change

* move form options out

* Update reqs

* Add handlers for most OAuth2

* refactor and add logging

* make error message more actionable

* add handler for twitter

* add keycloak endpoint

* warning for legacy apps

* remove legacy twitter support

* rename file

* move url to sub

* make JWT optional (default off)

* Add var to config template

* Add API endpoint to list available providers

* fix url pattern
2023-06-20 16:26:02 +10:00
Matthias Mair
9f56ee1023
[FR] Add Feature flags (#4982)
* make currency choices independend

* Remove check for field, just try to get rid of it

* Add IF EXISTS to avoid error (works in postgres)

* Look for operational error, not programming error

* Use variants, depending on errors caused

* [FR] Add Feature flags
Fixes #4965

* Add option to define custom flags

* Revert "make currency choices independend"

This reverts commit ab84a7ff83.

* try fixing mysql

* more safeguards

* fix executioner call

* a fck

* use migrations. syntax

* and another round for mysql

* revert print change

* use UTC for datetime

* Update part.migrations.0112

- Add custom migration class which handles errors

* Add unit test for migration

- Ensure that the new fields are added to the model

* Update reference to PR

* fix ruleset for missing_models

* fix ruleset for flags_flagstate

* add API endpoints for flags

* add tests for new API endpoints

* fix tests

* fix merge

* fix tests

---------

Co-authored-by: martin <martin@iggland.com>
Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2023-06-12 13:13:53 +10:00
Matthias Mair
15ab911da6
Add more version information (#5014)
* Add info for installer, branch, publisher

* include version info

* fix permissions

* fix typo

* add more info

* use GH url

* fix node

* remove publisher

* remove more logging

* Add info to version view

* enable branch discovery when not set

* fix ref to github version

* add branch to about dialog

* use precise plattform information - if no env is set

* fix ref names

* load VERSION info

* rename plattform to target

* extend installer var

* add generic plattform info

* add docs for version info

* add more info

* add installer codes

* Ammend navigation
2023-06-12 00:32:03 +10:00
Matthias Mair
58a33c2e67
[FR] Switch from git to dulwich (#4966)
* [FR] Switch from pure git to dulwich Fixes #4942

* fix lenght

* change length again

* change length again
2023-06-05 19:27:46 +10:00
dependabot[bot]
2ed7eefa27
Bump cryptography from 40.0.1 to 41.0.0 (#4955)
* Bump cryptography from 40.0.1 to 41.0.0

Bumps [cryptography](https://github.com/pyca/cryptography) from 40.0.1 to 41.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/40.0.1...41.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump everything

* do not build for linux/arm/v7
see https://github.com/inventree/InvenTree/pull/4955#issuecomment-1575909025

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2023-06-05 19:27:27 +10:00
Matthias Mair
a196f443a1
Bump deps (#4911)
* bump deps

* Update requirements.txt

* fix pint

* fix reqs

* fix dev reqs
2023-05-31 09:18:02 +10:00
Oliver
9e77b9fc56
Parameter filtering (#4823)
* adds new field 'parameter type' to PartParameterTemplate model

* Move part parameter settings onto their own page

* Add "choices" and "regex" template types

* Adds validation for PartParameter based on template type

* javascript cleanup

* Fix for serializers.py

* Add unit testing for parameter validation

* Add filters

* Rename "type" field to "param_type"

- Should have seen that one coming

* Coerce 'boolean' value to True/False

* table update

* js linting

* Add requirement for "pint" package

* Add validator for physical unit types

- Revert a previous migration which adds "parameter type" and "validator" fields
- These will get implemented later, too much scope creep for this PR
- Add unit test for validation of "units" field

* Update PartParameter model

- Add data_numeric field (will be used later)
- Add MinLengthValidator to data field

* Run validation for part parameter data

- Ensure it can be converted to internal units

* Update admin interface to display partparameter values inline for a part

* Adds validation of part parameter data value

- Also converts to base units, and stores as "numeric" value
- Display "numeric" value in tables
- Create new file conversion.py for data conversion

* Update unit tests and fix some bugs

* Update docstring

* Add units to parameter columns in parameteric part table

* Allow part list to be ordered by a particular parameter value

- Annotate queryset with new "order_by_parameter" method
- Skeleton method for future work

* Bump API version

* Adds unit testing for sorting parts by parameter value

* Update historical data migrations

- Turns out RunPython.noop is a thing?

* Cache the unit registry

- Creating the unit registry takes a significant amount of time
- Construct when first called, and then cache for subsequent hits
- Massive improvement in performance

* Throw error on empty values when converting between units

* Data migration for converting existing part parameter values

* Handle more error cases

* Show parameteric table on top-level part page too

* Unit test for data migration

* Update credits in docs

* Improved error checking

* WIP docs updates

* Fix parameteric table filtering

* remove zoom property

* Fix for import path

* Update parameter docs

* Run background task to rebuild parameters when template changes

* Make "data_numeric" field nullable

- Defaulting to zero is not appropriate, as the actual value may be zero
- Sorting still seems to work just fine

* Fixes for unit test

* More unit test fixes

* Further fixes for unit tests

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2023-05-19 13:24:55 +10:00
Oliver
e2505433a2
Docker build fix (#4811)
* Attempt to fix crypto build on raspbian

* Run CI if requirements files change
2023-05-15 08:27:26 +10:00
Oliver
41cef1a190
Add reload functionality for build item table (#4799)
* Add reload functionality for build item table

* Update requirements.txt file

(cherry picked from commit c976d06ec75d17e4c2fd4e557eb0bda858ae391e)
2023-05-12 14:29:29 +10:00
dependabot[bot]
306f36bff8
Bump django from 3.2.18 to 3.2.19 (#4795)
Bumps [django](https://github.com/django/django) from 3.2.18 to 3.2.19.
- [Commits](https://github.com/django/django/compare/3.2.18...3.2.19)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-10 08:21:59 +10:00