2
0
mirror of https://github.com/inventree/inventree-website.git synced 2025-04-29 22:16:45 +00:00

Merge remote-tracking branch 'origin/main'

This commit is contained in:
Oliver Walters 2022-12-21 21:40:49 +11:00
commit e83b8cd368
9 changed files with 146 additions and 14 deletions

25
.github/get_stats.py vendored
View File

@ -1,18 +1,24 @@
from enum import Enum
import json
import os
from pathlib import Path
from urllib.request import urlopen, Request
file_name = Path('_data/general/stats.yml')
github_project = "inventree/inventree"
crowdin_projet_id = 452300
class ReturnMode(Enum):
data = 0
header = 1
def get_data(url, key=None, default=0, mode: ReturnMode=ReturnMode.data):
def get_data(url, key=None, default=0, mode: ReturnMode=ReturnMode.data, auth=None):
"""Fetches data from remote endpoint"""
httprequest = Request(url, headers={"Accept": "application/json"})
if auth:
httprequest.add_header("Authorization", f"Bearer {auth}")
with urlopen(httprequest) as response:
if mode == ReturnMode.data:
data = response.read().decode()
@ -26,13 +32,17 @@ def get_data(url, key=None, default=0, mode: ReturnMode=ReturnMode.data):
return data
docker = get_data('https://hub.docker.com/v2/repositories/inventree/inventree', 'pull_count')
gh_data = get_data('https://api.github.com/repos/inventree/inventree')
docker = get_data(f'https://hub.docker.com/v2/repositories/{github_project}', 'pull_count')
gh_data = get_data(f'https://api.github.com/repos/{github_project}')
stars = gh_data.get('stargazers_count', 0)
forks = gh_data.get('forks_count', 0)
# See https://stackoverflow.com/a/60458265/17860466 # to enabble anon add `&anon=true`
link = get_data('https://api.github.com/repos/inventree/inventree/contributors?per_page=1', mode=ReturnMode.header).get('Link')
link = get_data(f'https://api.github.com/repos/{github_project}/contributors?per_page=1', mode=ReturnMode.header).get('Link')
contributors = link.split('page=')[-1].split('>')[0]
# Crowdin
crowdin_data = get_data(f'https://api.crowdin.com/api/v2/projects/{crowdin_projet_id}?limit=1000', 'data', auth=os.environ.get('CROWDIN_TOKEN'))
languages = len(crowdin_data.get('targetLanguageIds', []))
#translators = get_data(f'https://api.crowdin.com/api/v2/projects/{crowdin_projet_id}/members', 'data', auth=crowdin_token)
# Write data
file_name.write_text(
@ -44,4 +54,9 @@ f"""stats:
- name: Forks
number: {forks}
- name: Contributors
number: {contributors}""")
number: {contributors}
- name: Languages
number: {languages}""")
#- name: Translators
# number: {translators}
# """)

View File

@ -12,8 +12,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set selected color
with:
token: ${{ secrets.BOT_PAT }}
- name: Get Stats
run: python .github/get_stats.py
env:
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[Bot] Updated the stats"

View File

@ -62,12 +62,12 @@ GEM
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minitest (5.15.0)
nokogiri (1.13.9-x86_64-linux)
nokogiri (1.13.10-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.0)
racc (1.6.1)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)

View File

@ -1,9 +1,11 @@
stats:
- name: Docker pulls
number: 2089608
number: 2149113
- name: GitHub Stars
number: 2160
number: 2225
- name: Forks
number: 316
number: 346
- name: Contributors
number: 48
number: 49
- name: Languages
number: 26

21
_news/2022-12-12-0.9.0.md Normal file
View File

@ -0,0 +1,21 @@
---
author: oliver
title: 0.9.0 Release
---
InvenTree 0.9.0 stable release now available!
### 0.9.0 InvenTree Release
The InvenTree team is proud to announce the 0.9.0 stable release.
- [Read the blog](/blog/2022/12/12/0.9.0)
- [View the release notes](https://github.com/inventree/InvenTree/releases/tag/0.9.0)
### Python Library
A new version of the [python library](https://github.com/inventree/inventree-python/) has been released, and is now [available via PyPi](https://pypi.org/project/inventree/)
### Mobile App
We've also released an updated version of the [mobile app](https://docs.inventree.org/en/latest/app/app/) - available for Android and iOS devices.

View File

@ -19,7 +19,7 @@ As translations are entirely community contributed, we need a software framework
#### Backend - Django
At its core, InvenTree is built on the [Django](https://www.djangoproject.com/) framework, which provides a [translation framweork](https://docs.djangoproject.com/en/4.1/topics/i18n/translation/) "out of the box".
At its core, InvenTree is built on the [Django](https://www.djangoproject.com/) framework, which provides a [translation framework](https://docs.djangoproject.com/en/4.1/topics/i18n/translation/) "out of the box".
The Django translation framework provides a toolkit for marking certain text strings as "translatable". Translation strings are able to be replaced by a translated string from a language specified by the user - *if a translation for the text is available in that language*.
@ -55,4 +55,4 @@ If you would like to see improved translations in a particular language, read th
#### Adding New Languages
If you would like to see support for a new language, [raise an issue on our GitHub page](https://github.com/inventree/InvenTree/issues/new?assignees=&labels=enhancement%2Ctriage%3Anot-checked&template=feature_request.yaml&title=%5BFR%5D+title).
If you would like to see support for a new language, [raise an issue on our GitHub page](https://github.com/inventree/InvenTree/issues/new?assignees=&labels=enhancement%2Ctriage%3Anot-checked&template=feature_request.yaml&title=%5BFR%5D+title).

View File

@ -0,0 +1,90 @@
---
author: oliver
title: 0.9.0 Stable Release
---
The InvenTree team is very excited to announce the InvenTree 0.9.0 Stable Release!
This release is the culmination of many hours of work from multiple developers, providing numerous new features and bug fixes. We extend our thanks to the contributors who have helped on this release, as well as the users who have suggested new features or helped us track down outstanding software issues.
## New Features
The 0.9.0 release introduces many new features - some of the major ones are outlined briefly below:
### Installer
We now have a packaged command-line installer for simplified setup (on supported platforms), using the [packager.io](https://packager.io/) service. The installer is targetted for users who are installing InvenTree on a bare metal system (separate installers are available for container environments).
You can find more information about the installer at [docs.inventree.org](https://docs.inventree.org/en/latest/start/installer/).
### Backup and Restore
Database backup and restore functionality has been improved, using the [dbbackup library](https://django-dbbackup.readthedocs.io/en/master/). A backup of database records (and uploaded media files) can be performed with a simple command line action. Backup can also be configured to occur periodically, serviced by the background worker.
### Pricing Overhaul
This release provides a major overhaul for how pricing data is managed. The new pricing system calculates various pricing information (such as BOM cost or purchase price range) and caches this data in the database. This means that the efficiency of accessing pricing data in real time is greatly improved. For complex bills of material, viewing pricing data was (before this update) extremely prohibitive, due to the recursive calculations which were being performed "on the fly". The new achitecture makes use of the background worker to recalculate pricing information whenever the underlying data changes, ensuring that "up to date" pricing is readily available.
![BOM Pricing](/assets/blog/bom-pricing.png)
Additionally, more options for controlling how pricing information is calculated and handled have been implemented.
You can read more about managing pricing data in InvenTree at [docs.inventree.org](https://docs.inventree.org/en/latest/part/pricing/).
### Barcode Refactor
Barcode support has been significantly improved, allowing custom barcode functionality for a greater range of database model types, and simplifying the API.
- Custom barcodes can now be assigned to *Part* instances
- Custom barcodes can now be assigned to *Stock Location* instances
- Custom barcodes can now be assigned to *Supplier Part* instances
Read more about the updated barcode support in [the InvenTree documentation](https://docs.inventree.org/en/latest/barcodes/barcodes/).
### Builtin Plugins
As part of the ongoing improvements to the plugin system, InvenTree now features a number of "builtin" plugins. These plugins are always active (even if custom plugin support is disabled for the server) and provide core InvenTree functionality in a way which aligns with the operation of the plugin system. This is intended to streamline the way in which plugins are implemented, as core components of the code are now offloaded to the plugin with a simpler interface.
We have also made some significant improvements to the [plugin system documentation](https://docs.inventree.org/en/latest/extend/plugins/).
### Validation Plugins
A completely new type of plugin introduced in this release is the [validation plugin mixin](https://docs.inventree.org/en/latest/extend/plugins/validation/). This plugin allows users to implement custom validation methods for various database fields. In addition to allowing validation of field values against complex custom rules, this plugin allows automated generation of the "next value" for certain fields, such as serial numbers and batch codes.
### News Reader
Now that the new website is live, a [news feed](/news) is available. If enabled, news about InvenTree can be displayed in the InvenTree dashboard.
*Note that this feature is disabled by default, and must be enabled by a staff user*
![News Reader](/assets/blog/news-reader.png)
### Part Scheduling
The [Part Scheduling](https://docs.inventree.org/en/latest/part/scheduling/) functionality has received some updates in this release. If enabled, the *Part Scheduling* tab shows predicted future stock levels, based on incoming and outgoing orders.
### Supplier Part Pack Size
A major improvement to the way supplier parts are handled is the addition of "pack size" for supplier parts. While internally, parts are represented using "unit quantity", they can be sourced from suppliers in larger pack quantities. Pack sizing is also taken into quantity when calculating unit pricing.
### Data Sanitization
A number of security related changes have been implemented, providing multiple improvements related to input data sanitization. Some of these updates include:
- Remove invisible ASCII and unicode characters from user submitted data
- Sanitize uploaded SVG files
- Remove malicious HTML from form fields
More generally, a number of security fixes have been made for this release, following vulnerability reports received from the InvenTree community. You can view information on all our [security advisory notices on GitHub](https://github.com/inventree/InvenTree/security/advisories).
### Customizing
Further customization of InvenTree is now available, with custom splash screens and application icons supported in this release.
### Bug Fixes
In addition to many new features, this release also provides fixes for a number of bugs, of varying severity! Refer to the [release notes](#release-notes) for further information.
### Release Notes
This list covers only a fraction of the exciting new features. You can view the [full release notes](https://github.com/inventree/InvenTree/releases/tag/0.9.0) on our GitHub page.

BIN
assets/blog/bom-pricing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

BIN
assets/blog/news-reader.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB