diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 2cd40f20a0bd..4f052e630abb 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -72,13 +72,6 @@ runs: uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # pin to v3.8.2 with: node-version: ${{ env.node_version }} - cache: 'npm' - cache-dependency-path: src/backend/package-lock.json - - name: Install npm packages - if: ${{ inputs.npm == 'true' }} - shell: bash - run: cd src/backend && npm install - # OS installs - name: Install OS Dependencies if: ${{ inputs.apt-dependency }} diff --git a/.github/scripts/check_js_templates.py b/.github/scripts/check_js_templates.py deleted file mode 100644 index 8b2ff60ad983..000000000000 --- a/.github/scripts/check_js_templates.py +++ /dev/null @@ -1,103 +0,0 @@ -"""Test that the "translated" javascript files to not contain template tags which need to be determined at "run time". - -This is because the "translated" javascript files are compiled into the "static" directory. -They should only contain template tags that render static information. -""" - -import os -import pathlib -import re -import sys - -here = os.path.abspath(os.path.dirname(__file__)) -template_dir = os.path.abspath(os.path.join(here, '..', 'InvenTree', 'templates')) - -# We only care about the 'translated' files -js_i18n_dir = os.path.join(template_dir, 'js', 'translated') -js_dynamic_dir = os.path.join(template_dir, 'js', 'dynamic') - -errors = 0 - -print('=================================') -print('Checking static javascript files:') -print('=================================') - - -def check_invalid_tag(data): - """Check for invalid tags.""" - pattern = r'{%(\w+)' - - err_count = 0 - - for idx, line in enumerate(data): - results = re.findall(pattern, line) - - for result in results: - err_count += 1 - - print(f' - Error on line {idx + 1}: %{{{result[0]}') - - return err_count - - -def check_prohibited_tags(data): - """Check for prohibited tags.""" - allowed_tags = [ - 'if', - 'elif', - 'else', - 'endif', - 'for', - 'endfor', - 'trans', - 'load', - 'include', - 'url', - ] - - pattern = r'{% (\w+)\s' - - err_count = 0 - - for idx, line in enumerate(data): - for tag in re.findall(pattern, line): - if tag not in allowed_tags: - print(f" > Line {idx + 1} contains prohibited template tag '{tag}'") - err_count += 1 - - return err_count - - -for filename in pathlib.Path(js_i18n_dir).rglob('*.js'): - print(f"Checking file 'translated/{os.path.basename(filename)}':") - - with open(filename, encoding='utf-8') as js_file: - data = js_file.readlines() - - errors += check_invalid_tag(data) - errors += check_prohibited_tags(data) - -for filename in pathlib.Path(js_dynamic_dir).rglob('*.js'): - print(f"Checking file 'dynamic/{os.path.basename(filename)}':") - - # Check that the 'dynamic' files do not contains any translated strings - with open(filename, encoding='utf-8') as js_file: - data = js_file.readlines() - - invalid_tags = ['blocktrans', 'blocktranslate', 'trans', 'translate'] - - err_count = 0 - - for idx, line in enumerate(data): - for tag in invalid_tags: - tag = '{% ' + tag - if tag in line: - err_count += 1 - - print(f" > Error on line {idx + 1}: Prohibited tag '{tag}' found") - - -if errors > 0: - print(f'Found {errors} incorrect template tags') - -sys.exit(errors) diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index fb8840daf12b..0952eb4cd4f7 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -68,30 +68,6 @@ jobs: contains(github.event.pull_request.labels.*.name, 'dependency') || contains(github.event.pull_request.labels.*.name, 'full-run') - javascript: - name: Style - Classic UI [JS] - runs-on: ubuntu-20.04 - - needs: ["pre-commit"] - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4.2.2 - with: - persist-credentials: false - - name: Environment Setup - uses: ./.github/actions/setup - with: - npm: true - install: true - - name: Check Templated JS Files - run: | - cd .github/scripts - python3 check_js_templates.py - - name: Lint Javascript Files - run: | - python src/backend/InvenTree/manage.py prerender - cd src/backend && npx eslint InvenTree/InvenTree/static_i18n/i18n/*.js - pre-commit: name: Style [pre-commit] runs-on: ubuntu-20.04 @@ -277,7 +253,6 @@ jobs: apt-dependency: gettext poppler-utils dev-install: true update: true - npm: true - name: Download Python Code For `${WRAPPER_NAME}` run: git clone --depth 1 https://github.com/inventree/${WRAPPER_NAME} ./${WRAPPER_NAME} - name: Start InvenTree Server diff --git a/.github/workflows/translations.yaml b/.github/workflows/translations.yaml index 7caa88615109..82fd50545720 100644 --- a/.github/workflows/translations.yaml +++ b/.github/workflows/translations.yaml @@ -38,7 +38,6 @@ jobs: uses: ./.github/actions/setup with: install: true - npm: true apt-dependency: gettext - name: Make Translations run: invoke dev.translate diff --git a/README.md b/README.md index b6fe3c508ff9..5f3000fe226f 100644 --- a/README.md +++ b/README.md @@ -82,16 +82,7 @@ InvenTree is designed to be **extensible**, and provides multiple options for **
- Client - CUI - -
- -
- Client - PUI + Client