Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/inventree/InvenTree
Browse files Browse the repository at this point in the history
  • Loading branch information
matmair committed Mar 23, 2024
2 parents 9c82a42 + 7169b5d commit 52fc00b
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
)
steps:
- name: Backport Action
uses: sqren/backport-github-action@f54e19901f2a57f8b82360f2490d47ee82ec82c6 # [email protected]
uses: sqren/backport-github-action@f7073a2287aefc1fa12685eb25a712ab5620445c # [email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
auto_backport_label_prefix: backport-to-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ jobs:
fi
- name: Login to Dockerhub
if: github.event_name != 'pull_request' && steps.docker_login.outputs.skip_dockerhub_login != 'true'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # pin@v3.0.0
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # pin@v3.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # pin@v3.0.0
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # pin@v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qc_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:
repository: inventree/schema
token: ${{ secrets.SCHEMA_PAT }}
- name: Download schema artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: schema.yml
- name: Move schema to correct location
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # pin@v8.0.0
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # pin@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue seems stale. Please react to show this is still important.'
Expand Down
2 changes: 1 addition & 1 deletion InvenTree/plugin/base/integration/ScheduleMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get_scheduled_tasks(self):
@property
def has_scheduled_tasks(self):
"""Are tasks defined for this plugin."""
return bool(self.scheduled_tasks)
return bool(self.get_scheduled_tasks())

def validate_scheduled_tasks(self):
"""Check that the provided scheduled tasks are valid."""
Expand Down
8 changes: 7 additions & 1 deletion InvenTree/plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ def mixin_enabled(self, key):
if fnc_name is True:
return True

return getattr(self, fnc_name, True)
attr = getattr(self, fnc_name, True)

if callable(attr):
return attr()
else:
return attr

return False

def add_mixin(self, key: str, fnc_enabled=True, cls=None):
Expand Down
15 changes: 3 additions & 12 deletions InvenTree/web/templatetags/spa_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,18 @@ def get_url(file: str) -> str:
return f'{settings.STATIC_URL}{app}/{file}'

if manifest_path == '':
manifest_path = Path(__file__).parent.parent.joinpath(
manifest = Path(__file__).parent.parent.joinpath(
'static/web/.vite/manifest.json'
)
else:
manifest = Path(manifest_path)

if not manifest.exists():
# Try old path for manifest file
manifest_path = Path(__file__).parent.parent.joinpath(
'static/web/manifest.json'
)
manifest = Path(__file__).parent.parent.joinpath('static/web/manifest.json')

# Final check - fail if manifest file not found
if not manifest_path.exists():
if not manifest.exists():
logger.error('Manifest file not found')
return

Expand All @@ -48,13 +46,6 @@ def get_url(file: str) -> str:
return

return_string = ''
# CSS (based on index.css file as entrypoint)
css_index = manifest_data.get('index.css')
if css_index:
return_string += (
f'<link rel="stylesheet" href="{get_url(css_index["file"])}" />'
)

# JS (based on index.html file as entrypoint)
index = manifest_data.get('index.html')
dynamic_files = index.get('dynamicImports', [])
Expand Down
5 changes: 1 addition & 4 deletions InvenTree/web/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ def assertSettings(self, settings_data):
def test_spa_bundle(self):
"""Test the 'spa_bundle' template tag."""
resp = spa_helper.spa_bundle()
self.assertTrue(
resp.startswith('<link rel="stylesheet" href="/static/web/assets/index')
)
shipped_js = resp.split('<script type="module" src="')[1:]
self.assertTrue(len(shipped_js) > 0)
self.assertTrue(len(shipped_js) == 3)

manifest_file = Path(__file__).parent.joinpath('static/web/manifest.json')
manifest_file = Path(__file__).parent.joinpath('static/web/.vite/manifest.json')
# Try with removed manifest file
manifest_file.rename(manifest_file.with_suffix('.json.bak')) # Rename
resp = resp = spa_helper.spa_bundle()
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@mantine/modals": "<7",
"@mantine/notifications": "<7",
"@naisutech/react-tree": "^3.1.0",
"@sentry/react": "^7.102.1",
"@sentry/react": "^7.108.0",
"@tabler/icons-react": "^2.47.0",
"@tanstack/react-query": "^5.24.1",
"@uiw/codemirror-theme-vscode": "^4.21.22",
Expand Down Expand Up @@ -59,14 +59,14 @@
"@lingui/macro": "^4.7.1",
"@playwright/test": "^1.41.2",
"@types/node": "^20.11.20",
"@types/react": "^18.2.59",
"@types/react": "^18.2.68",
"@types/react-dom": "^18.2.19",
"@types/react-grid-layout": "^1.3.5",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.2.1",
"babel-plugin-macros": "^3.1.0",
"typescript": "^5.3.3",
"vite": "^5.1.4",
"vite": "^5.2.3",
"vite-plugin-babel-macros": "^1.0.6"
}
}
166 changes: 83 additions & 83 deletions src/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1336,87 +1336,87 @@
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz#6abd79db7ff8d01a58865ba20a63cfd23d9e2a10"
integrity sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==

"@sentry-internal/feedback@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.107.0.tgz#144cf01b1c1739d61db3990519f59b49a356fef1"
integrity sha512-okF0B9AJHrpkwNMxNs/Lffw3N5ZNbGwz4uvCfyOfnMxc7E2VfDM18QzUvTBRvNr3bA9wl+InJ+EMG3aZhyPunA==
dependencies:
"@sentry/core" "7.107.0"
"@sentry/types" "7.107.0"
"@sentry/utils" "7.107.0"

"@sentry-internal/replay-canvas@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.107.0.tgz#ce2a8f6bf63ab962e696f26b509cfb87aa931302"
integrity sha512-dmDL9g3QDfo7axBOsVnpiKdJ/DXrdeuRv1AqsLgwzJKvItsv0ZizX0u+rj5b1UoxcwbXRMxJ0hit5a1yt3t/ow==
dependencies:
"@sentry/core" "7.107.0"
"@sentry/replay" "7.107.0"
"@sentry/types" "7.107.0"
"@sentry/utils" "7.107.0"

"@sentry-internal/tracing@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.107.0.tgz#a10b4abcbc9e0d8da948e3a95029574387ca7b16"
integrity sha512-le9wM8+OHBbq7m/8P7JUJ1UhSPIty+Z/HmRXc5Z64ODZcOwFV6TmDpYx729IXDdz36XUKmeI+BeM7yQdTTZPfQ==
dependencies:
"@sentry/core" "7.107.0"
"@sentry/types" "7.107.0"
"@sentry/utils" "7.107.0"

"@sentry/browser@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.107.0.tgz#a1caf4a3c39857862ba3314b9d4ed03f9259f338"
integrity sha512-KnqaQDhxv6w9dJ+mYLsNwPeGZfgbpM3vaismBNyJCKLgWn2V75kxkSq+bDX8LQT/13AyK7iFp317L6P8EuNa3g==
dependencies:
"@sentry-internal/feedback" "7.107.0"
"@sentry-internal/replay-canvas" "7.107.0"
"@sentry-internal/tracing" "7.107.0"
"@sentry/core" "7.107.0"
"@sentry/replay" "7.107.0"
"@sentry/types" "7.107.0"
"@sentry/utils" "7.107.0"

"@sentry/core@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.107.0.tgz#926838ba2c2861d6bd2bced0232e1f9d1ead6c75"
integrity sha512-C7ogye6+KPyBi8NVL0P8Rxx3Ur7Td8ufnjxosVy678lqY+dcYPk/HONROrzUFYW5fMKWL4/KYnwP+x9uHnkDmw==
dependencies:
"@sentry/types" "7.107.0"
"@sentry/utils" "7.107.0"

"@sentry/react@^7.102.1":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.107.0.tgz#45feb115383bde7d454e5f816663df34c1c28c39"
integrity sha512-3sXNKcDQjEimxwBPnRkewy3xNLt3KqStMAdDZ/dAF3rviOSVyk80DCQ3P6+HIqeB+IAXqWptg4eSWRA1qNZquA==
dependencies:
"@sentry/browser" "7.107.0"
"@sentry/core" "7.107.0"
"@sentry/types" "7.107.0"
"@sentry/utils" "7.107.0"
"@sentry-internal/feedback@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.108.0.tgz#7033352abd304f1383ec47640e056a0dfd5132b7"
integrity sha512-8JcgZEnk1uWrXJhsd3iRvFtEiVeaWOEhN0NZwhwQXHfvODqep6JtrkY1yCIyxbpA37aZmrPc2JhyotRERGfUjg==
dependencies:
"@sentry/core" "7.108.0"
"@sentry/types" "7.108.0"
"@sentry/utils" "7.108.0"

"@sentry-internal/replay-canvas@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.108.0.tgz#641133c19c0e1c423617b8d791f53d6cd0b0a862"
integrity sha512-R5tvjGqWUV5vSk0N1eBgVW7wIADinrkfDEBZ9FyKP2mXHBobsyNGt30heJDEqYmVqluRqjU2NuIRapsnnrpGnA==
dependencies:
"@sentry/core" "7.108.0"
"@sentry/replay" "7.108.0"
"@sentry/types" "7.108.0"
"@sentry/utils" "7.108.0"

"@sentry-internal/tracing@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.108.0.tgz#d1e660701fb860cfae72b6ebfa8fb267533421fa"
integrity sha512-zuK5XsTsb+U+hgn3SPetYDAogrXsM16U/LLoMW7+TlC6UjlHGYQvmX3o+M2vntejoU1QZS8m1bCAZSMWEypAEw==
dependencies:
"@sentry/core" "7.108.0"
"@sentry/types" "7.108.0"
"@sentry/utils" "7.108.0"

"@sentry/browser@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.108.0.tgz#b95810bb6572b63781f253615896f5afb1a3a5c0"
integrity sha512-FNpzsdTvGvdHJMUelqEouUXMZU7jC+dpN7CdT6IoHVVFEkoAgrjMVUhXZoQ/dmCkdKWHmFSQhJ8Fm6V+e9Aq0A==
dependencies:
"@sentry-internal/feedback" "7.108.0"
"@sentry-internal/replay-canvas" "7.108.0"
"@sentry-internal/tracing" "7.108.0"
"@sentry/core" "7.108.0"
"@sentry/replay" "7.108.0"
"@sentry/types" "7.108.0"
"@sentry/utils" "7.108.0"

"@sentry/core@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.108.0.tgz#a27e8d6f85f59c5730ce86071474f15ac899fde0"
integrity sha512-I/VNZCFgLASxHZaD0EtxZRM34WG9w2gozqgrKGNMzAymwmQ3K9g/1qmBy4e6iS3YRptb7J5UhQkZQHrcwBbjWQ==
dependencies:
"@sentry/types" "7.108.0"
"@sentry/utils" "7.108.0"

"@sentry/react@^7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.108.0.tgz#26a50324f6d7a9576f3753c099e7bcd8def94f3c"
integrity sha512-C60arh5/gtO42eMU9l34aWlKDLZUO+1j1goaEf/XRSwUcyJS9tbJrs+mT4nbKxUsEG714It2gRbfSEvh1eXmCg==
dependencies:
"@sentry/browser" "7.108.0"
"@sentry/core" "7.108.0"
"@sentry/types" "7.108.0"
"@sentry/utils" "7.108.0"
hoist-non-react-statics "^3.3.2"

"@sentry/replay@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.107.0.tgz#d714f864ef8602e6d009b2fa8ff8e4ef63c3e9e4"
integrity sha512-BNJDEVaEwr/YnV22qnyVA1almx/3p615m3+KaF8lPo7YleYgJGSJv1auH64j1G8INkrJ0J0wFBujb1EFjMYkxA==
"@sentry/replay@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.108.0.tgz#baa679bd19b4e3729e607d3f84cff5048aeb3415"
integrity sha512-jo8fDOzcZJclP1+4n9jUtVxTlBFT9hXwxhAMrhrt70FV/nfmCtYQMD3bzIj79nwbhUtFP6pN39JH1o7Xqt1hxQ==
dependencies:
"@sentry-internal/tracing" "7.107.0"
"@sentry/core" "7.107.0"
"@sentry/types" "7.107.0"
"@sentry/utils" "7.107.0"
"@sentry-internal/tracing" "7.108.0"
"@sentry/core" "7.108.0"
"@sentry/types" "7.108.0"
"@sentry/utils" "7.108.0"

"@sentry/types@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.107.0.tgz#5ba4b472be6ccad9aecd58dbc0141a09dafb68c1"
integrity sha512-H7qcPjPSUWHE/Zf5bR1EE24G0pGVuJgrSx8Tvvl5nKEepswMYlbXHRVSDN0gTk/E5Z7cqf+hUBOpkQgZyps77w==
"@sentry/types@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.108.0.tgz#5ceb959c4dabe511fc441fec8c2465f2d624900f"
integrity sha512-bKtHITmBN3kqtqE5eVvL8mY8znM05vEodENwRpcm6TSrrBjC2RnwNWVwGstYDdHpNfFuKwC8mLY9bgMJcENo8g==

"@sentry/utils@7.107.0":
version "7.107.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.107.0.tgz#b8524539d052a40f9c5f34a8347501f0f81a0751"
integrity sha512-C6PbN5gHh73MRHohnReeQ60N8rrLYa9LciHue3Ru2290eSThg4CzsPnx4SzkGpkSeVlhhptKtKZ+hp/ha3iVuw==
"@sentry/utils@7.108.0":
version "7.108.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.108.0.tgz#0231042956aed2ef35809891592238530349dfd9"
integrity sha512-a45yEFD5qtgZaIFRAcFkG8C8lnDzn6t4LfLXuV4OafGAy/3ZAN3XN8wDnrruHkiUezSSANGsLg3bXaLW/JLvJw==
dependencies:
"@sentry/types" "7.107.0"
"@sentry/types" "7.108.0"

"@sinclair/typebox@^0.27.8":
version "0.27.8"
Expand Down Expand Up @@ -1577,10 +1577,10 @@
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@^18.2.59":
version "18.2.67"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.67.tgz#96b7af0b5e79c756f4bdd981de2ca28472c858e5"
integrity sha512-vkIE2vTIMHQ/xL0rgmuoECBCkZFZeHr49HeWSc24AptMbNRo7pwSBvj73rlJJs9fGKj0koS+V7kQB1jHS0uCgw==
"@types/react@*", "@types/react@^18.2.68":
version "18.2.68"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.68.tgz#b4d0c3a9c883165d11842f7b998532743fc5adda"
integrity sha512-Fj/BAR6LDSRkqinWfo9nGzW9ndpjEtP049oIW8KWToucUq7AJVCr/fyY9NFpaJaCXnGrKHLLs2mwiHYE1SxaxA==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
Expand Down Expand Up @@ -3344,10 +3344,10 @@ vite-plugin-babel-macros@^1.0.6:
"@types/babel__core" "^7.1.18"
babel-plugin-macros "^3.1.0"

vite@^5.1.4:
version "5.2.2"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.2.2.tgz#b98f8de352d22e21d99508274ddd053ef82bf238"
integrity sha512-FWZbz0oSdLq5snUI0b6sULbz58iXFXdvkZfZWR/F0ZJuKTSPO7v72QPXt6KqYeMFb0yytNp6kZosxJ96Nr/wDQ==
vite@^5.2.3:
version "5.2.3"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.2.3.tgz#198efc2fd4d80eac813b146a68a4b0dbde884fc2"
integrity sha512-+i1oagbvkVIhEy9TnEV+fgXsng13nZM90JQbrcPrf6DvW2mXARlz+DK7DLiDP+qeKoD1FCVx/1SpFL1CLq9Mhw==
dependencies:
esbuild "^0.20.1"
postcss "^8.4.36"
Expand Down

0 comments on commit 52fc00b

Please sign in to comment.