From 860ecc43e932ab1fa0664edbb653ebaf4f8c092e Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 16 Apr 2024 08:53:03 +1000 Subject: [PATCH 01/15] Fix typo in Procfile (#7043) --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 5ea6512d73..9b81d80a4d 100644 --- a/Procfile +++ b/Procfile @@ -1,7 +1,7 @@ # Web process: gunicorn web: env/bin/gunicorn --chdir $APP_HOME/src/backend/InvenTree -c src/backend/InvenTree/gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:$PORT # Worker process: qcluster -worker: env/bin/python src/backendInvenTree/manage.py qcluster +worker: env/bin/python src/backend/InvenTree/manage.py qcluster # Invoke commands invoke: echo "" | echo "" && . env/bin/activate && invoke # CLI: Provided for backwards compatibility From 9d2297da7de5272a34c6e3e2db78284d995c3a1c Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 16 Apr 2024 09:52:47 +1000 Subject: [PATCH 02/15] BOM pricing table fix (#7044) * Allow click-through from BOM pricing table * Allow sorting by price in BOM table * Add "Total Price" column to BOM table * Enable part table to be sorted by price range * Enable click-through on VariantPricing table * Update quantity columns for BOM tables * Improve rendering for UsedInTable --- .../pages/part/pricing/BomPricingPanel.tsx | 25 +++++++++++-- .../part/pricing/VariantPricingPanel.tsx | 6 ++-- src/frontend/src/tables/ColumnRenderers.tsx | 9 +++-- src/frontend/src/tables/bom/BomTable.tsx | 36 ++++++++++++++----- src/frontend/src/tables/bom/UsedInTable.tsx | 13 +++++-- src/frontend/src/tables/part/PartTable.tsx | 3 +- 6 files changed, 74 insertions(+), 18 deletions(-) diff --git a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx index 4284e954df..98a561d6c0 100644 --- a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx @@ -1,5 +1,11 @@ import { t } from '@lingui/macro'; -import { SegmentedControl, SimpleGrid, Stack } from '@mantine/core'; +import { + Group, + SegmentedControl, + SimpleGrid, + Stack, + Text +} from '@mantine/core'; import { ReactNode, useMemo, useState } from 'react'; import { Bar, @@ -17,6 +23,7 @@ import { import { CHART_COLORS } from '../../../components/charts/colors'; import { formatDecimal, formatPriceRange } from '../../../defaults/formatters'; import { ApiEndpoints } from '../../../enums/ApiEndpoints'; +import { ModelType } from '../../../enums/ModelType'; import { useTable } from '../../../hooks/UseTable'; import { apiUrl } from '../../../states/ApiState'; import { TableColumn } from '../../../tables/Column'; @@ -110,7 +117,17 @@ export default function BomPricingPanel({ title: t`Quantity`, sortable: true, switchable: false, - render: (record: any) => formatDecimal(record.quantity) + render: (record: any) => { + let quantity = formatDecimal(record.quantity); + let units = record.sub_part_detail?.units; + + return ( + + {quantity} + {units && [{units}]} + + ); + } }, { accessor: 'unit_price', @@ -178,7 +195,9 @@ export default function BomPricingPanel({ sub_part_detail: true, has_pricing: true }, - enableSelection: false + enableSelection: false, + modelType: ModelType.part, + modelField: 'sub_part' }} /> {bomPricingData.length > 0 ? ( diff --git a/src/frontend/src/pages/part/pricing/VariantPricingPanel.tsx b/src/frontend/src/pages/part/pricing/VariantPricingPanel.tsx index 2c5c21a3c3..2aeea96bfb 100644 --- a/src/frontend/src/pages/part/pricing/VariantPricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/VariantPricingPanel.tsx @@ -14,6 +14,7 @@ import { import { CHART_COLORS } from '../../../components/charts/colors'; import { formatCurrency } from '../../../defaults/formatters'; import { ApiEndpoints } from '../../../enums/ApiEndpoints'; +import { ModelType } from '../../../enums/ModelType'; import { useTable } from '../../../hooks/UseTable'; import { apiUrl } from '../../../states/ApiState'; import { TableColumn } from '../../../tables/Column'; @@ -37,7 +38,7 @@ export default function VariantPricingPanel({ title: t`Variant Part`, sortable: true, switchable: false, - render: (record: any) => PartColumn(record) + render: (record: any) => PartColumn(record, true) }, { accessor: 'pricing_min', @@ -90,7 +91,8 @@ export default function VariantPricingPanel({ ancestor: part?.pk, has_pricing: true }, - enablePagination: false + enablePagination: true, + modelType: ModelType.part }} /> {variantPricingData.length > 0 ? ( diff --git a/src/frontend/src/tables/ColumnRenderers.tsx b/src/frontend/src/tables/ColumnRenderers.tsx index 5353a467b8..f1d39858cf 100644 --- a/src/frontend/src/tables/ColumnRenderers.tsx +++ b/src/frontend/src/tables/ColumnRenderers.tsx @@ -16,8 +16,13 @@ import { TableColumn } from './Column'; import { ProjectCodeHoverCard } from './TableHoverCard'; // Render a Part instance within a table -export function PartColumn(part: any) { - return ; +export function PartColumn(part: any, full_name?: boolean) { + return ( + + ); } export function BooleanColumn({ diff --git a/src/frontend/src/tables/bom/BomTable.tsx b/src/frontend/src/tables/bom/BomTable.tsx index b2101897dc..6e2cea5b57 100644 --- a/src/frontend/src/tables/bom/BomTable.tsx +++ b/src/frontend/src/tables/bom/BomTable.tsx @@ -1,5 +1,5 @@ import { t } from '@lingui/macro'; -import { Text } from '@mantine/core'; +import { Group, Text } from '@mantine/core'; import { IconArrowRight, IconCircleCheck, @@ -10,7 +10,7 @@ import { useNavigate } from 'react-router-dom'; import { YesNoButton } from '../../components/buttons/YesNoButton'; import { Thumbnail } from '../../components/images/Thumbnail'; -import { formatPriceRange } from '../../defaults/formatters'; +import { formatDecimal, formatPriceRange } from '../../defaults/formatters'; import { ApiEndpoints } from '../../enums/ApiEndpoints'; import { ModelType } from '../../enums/ModelType'; import { UserRoles } from '../../enums/Roles'; @@ -98,9 +98,19 @@ export function BomTable({ { accessor: 'quantity', switchable: false, - sortable: true - // TODO: Custom quantity renderer - // TODO: see bom.js for existing implementation + sortable: true, + render: (record: any) => { + let quantity = formatDecimal(record.quantity); + let units = record.sub_part_detail?.units; + + return ( + + {quantity} + {record.overage && +{record.overage}} + {units && {units}} + + ); + } }, { accessor: 'substitutes', @@ -131,12 +141,22 @@ export function BomTable({ }), { accessor: 'price_range', - title: t`Price Range`, - - sortable: false, + title: t`Unit Price`, + ordering: 'pricing_max', + sortable: true, + switchable: true, render: (record: any) => formatPriceRange(record.pricing_min, record.pricing_max) }, + { + accessor: 'total_price', + title: t`Total Price`, + ordering: 'pricing_max_total', + sortable: true, + switchable: true, + render: (record: any) => + formatPriceRange(record.pricing_min_total, record.pricing_max_total) + }, { accessor: 'available_stock', sortable: true, diff --git a/src/frontend/src/tables/bom/UsedInTable.tsx b/src/frontend/src/tables/bom/UsedInTable.tsx index 6f62a7ef31..69da8b651b 100644 --- a/src/frontend/src/tables/bom/UsedInTable.tsx +++ b/src/frontend/src/tables/bom/UsedInTable.tsx @@ -1,7 +1,9 @@ import { t } from '@lingui/macro'; +import { Group, Text } from '@mantine/core'; import { useMemo } from 'react'; import { PartHoverCard } from '../../components/images/Thumbnail'; +import { formatDecimal } from '../../defaults/formatters'; import { ApiEndpoints } from '../../enums/ApiEndpoints'; import { ModelType } from '../../enums/ModelType'; import { useTable } from '../../hooks/UseTable'; @@ -39,8 +41,15 @@ export function UsedInTable({ { accessor: 'quantity', render: (record: any) => { - // TODO: render units if appropriate - return record.quantity; + let quantity = formatDecimal(record.quantity); + let units = record.sub_part_detail?.units; + + return ( + + {quantity} + {units && {units}} + + ); } }, ReferenceColumn() diff --git a/src/frontend/src/tables/part/PartTable.tsx b/src/frontend/src/tables/part/PartTable.tsx index 856e88524b..f9d46cad23 100644 --- a/src/frontend/src/tables/part/PartTable.tsx +++ b/src/frontend/src/tables/part/PartTable.tsx @@ -158,7 +158,8 @@ function partTableColumns(): TableColumn[] { { accessor: 'price_range', title: t`Price Range`, - sortable: false, + sortable: true, + ordering: 'pricing_max', render: (record: any) => formatPriceRange(record.pricing_min, record.pricing_max) }, From af49f1557f2f7c77f0bdb18dfd16cabf916dff9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:55:25 +1000 Subject: [PATCH 03/15] Bump @lingui/react from 4.8.0 to 4.10.0 in /src/frontend (#7032) Bumps [@lingui/react](https://github.com/lingui/js-lingui) from 4.8.0 to 4.10.0. - [Release notes](https://github.com/lingui/js-lingui/releases) - [Changelog](https://github.com/lingui/js-lingui/blob/main/CHANGELOG.md) - [Commits](https://github.com/lingui/js-lingui/compare/v4.8.0...v4.10.0) --- updated-dependencies: - dependency-name: "@lingui/react" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/frontend/package.json | 2 +- src/frontend/yarn.lock | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 702b3553f1..77652b3f68 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -18,7 +18,7 @@ "@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/react-fontawesome": "^0.2.0", "@lingui/core": "^4.7.1", - "@lingui/react": "^4.7.2", + "@lingui/react": "^4.10.0", "@mantine/carousel": "<7", "@mantine/core": "<7", "@mantine/dates": "<7", diff --git a/src/frontend/yarn.lock b/src/frontend/yarn.lock index dcdb20aa87..59a9743b07 100644 --- a/src/frontend/yarn.lock +++ b/src/frontend/yarn.lock @@ -1048,7 +1048,16 @@ jiti "^1.17.1" lodash.get "^4.4.2" -"@lingui/core@4.8.0", "@lingui/core@^4.7.1": +"@lingui/core@4.10.0", "@lingui/core@^4.7.1": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@lingui/core/-/core-4.10.0.tgz#7944cd49e3f6778f7a7be98f7ab64ccb0ec53b5f" + integrity sha512-KfwkghuCVFt3AxZlAIotTvIcopIpHj4prwG9v6iyrksLXoxKPQMBXutYGl/EIZE1KYQZdR6rjAaoilMl0pSGKA== + dependencies: + "@babel/runtime" "^7.20.13" + "@lingui/message-utils" "4.10.0" + unraw "^3.0.0" + +"@lingui/core@4.8.0": version "4.8.0" resolved "https://registry.yarnpkg.com/@lingui/core/-/core-4.8.0.tgz#9d94857e50e82b118d75074cbed41c1358c76ae0" integrity sha512-csETD7Vi2SSvH1F+gASGPf9TISoQFxA3YTB7MbRthtqK73TtWbEAmNtztIYPjPtNQemd7GwFztT/X6OANbjYhA== @@ -1078,6 +1087,14 @@ "@lingui/core" "4.8.0" "@lingui/message-utils" "4.8.0" +"@lingui/message-utils@4.10.0": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@lingui/message-utils/-/message-utils-4.10.0.tgz#2d575c5f2808b275c56495343b78c0b47d4443e6" + integrity sha512-p9Z4L4//ef1jpwqUR0hnILPbbqhVOXkLktY/EsZ7LMmvn18yhq4FjCtGsrorclTcTdtl0l7bqW4iEpEqGW91Gw== + dependencies: + "@messageformat/parser" "^5.0.0" + js-sha256 "^0.10.1" + "@lingui/message-utils@4.8.0": version "4.8.0" resolved "https://registry.yarnpkg.com/@lingui/message-utils/-/message-utils-4.8.0.tgz#2d2004e8b78d37f7f59d1d6184d0c1f25f708a8f" @@ -1086,13 +1103,13 @@ "@messageformat/parser" "^5.0.0" js-sha256 "^0.10.1" -"@lingui/react@^4.7.2": - version "4.8.0" - resolved "https://registry.yarnpkg.com/@lingui/react/-/react-4.8.0.tgz#7d9d24f465f6fdbf76cff622f4f8538a65d71546" - integrity sha512-GVoGDYZAN9wHrEvQWljxS1CZqZ80yLtK0LS8Y907RLlmD3GXLwNvT63iJUHwRu4710HNdgD7qM7XNOgPZZNu7A== +"@lingui/react@^4.10.0": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@lingui/react/-/react-4.10.0.tgz#56dce040659c94c1125640f8e399f68164b44ade" + integrity sha512-QBbgKnIEePbt2ktq/6AVi9q91TRbwvcdrruOMu3qqXBqcF4KMu7rf05M9tvk/cClTjImuOF+FI3k+MX6LGnnYQ== dependencies: "@babel/runtime" "^7.20.13" - "@lingui/core" "4.8.0" + "@lingui/core" "4.10.0" "@mantine/carousel@<7": version "6.0.21" From 471490096bdad730c04c98db022335c75d7049bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:55:41 +1000 Subject: [PATCH 04/15] Bump @playwright/test from 1.43.0 to 1.43.1 in /src/frontend (#7031) Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.43.0 to 1.43.1. - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.43.0...v1.43.1) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/frontend/package.json | 2 +- src/frontend/yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 77652b3f68..571ab3816d 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -59,7 +59,7 @@ "@babel/preset-typescript": "^7.23.3", "@lingui/cli": "^4.7.2", "@lingui/macro": "^4.7.2", - "@playwright/test": "^1.41.2", + "@playwright/test": "^1.43.1", "@types/node": "^20.12.3", "@types/react": "^18.2.74", "@types/react-dom": "^18.2.23", diff --git a/src/frontend/yarn.lock b/src/frontend/yarn.lock index 59a9743b07..fa523477f7 100644 --- a/src/frontend/yarn.lock +++ b/src/frontend/yarn.lock @@ -1209,12 +1209,12 @@ nanoid "^4.0.0" react-draggable "^4.4.5" -"@playwright/test@^1.41.2": - version "1.43.0" - resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.43.0.tgz#5d90f247b26d404dd5d81c60f9c7c5e5159eb664" - integrity sha512-Ebw0+MCqoYflop7wVKj711ccbNlrwTBCtjY5rlbiY9kHL2bCYxq+qltK6uPsVBGGAOb033H2VO0YobcQVxoW7Q== +"@playwright/test@^1.43.1": + version "1.43.1" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.43.1.tgz#16728a59eb8ce0f60472f98d8886d6cab0fa3e42" + integrity sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA== dependencies: - playwright "1.43.0" + playwright "1.43.1" "@radix-ui/number@1.0.0": version "1.0.0" @@ -3392,17 +3392,17 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -playwright-core@1.43.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.43.0.tgz#d8079acb653abebb0b63062e432479647a4e1271" - integrity sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w== +playwright-core@1.43.1: + version "1.43.1" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.43.1.tgz#0eafef9994c69c02a1a3825a4343e56c99c03b02" + integrity sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg== -playwright@1.43.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.43.0.tgz#2c2efd4ee2a25defd8c24c98ccb342bdd9d435f5" - integrity sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ== +playwright@1.43.1: + version "1.43.1" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.43.1.tgz#8ad08984ac66c9ef3d0db035be54dd7ec9f1c7d9" + integrity sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA== dependencies: - playwright-core "1.43.0" + playwright-core "1.43.1" optionalDependencies: fsevents "2.3.2" From 0460dffb284f8f88a9bf90c97175f3bb5239ca99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:55:48 +1000 Subject: [PATCH 05/15] Bump react-hook-form from 7.51.2 to 7.51.3 in /src/frontend (#7030) Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.51.2 to 7.51.3. - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.51.2...v7.51.3) --- updated-dependencies: - dependency-name: react-hook-form dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/frontend/package.json | 2 +- src/frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 571ab3816d..52dae6db46 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -44,7 +44,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-grid-layout": "^1.4.4", - "react-hook-form": "^7.51.2", + "react-hook-form": "^7.51.3", "react-is": "^18.2.0", "react-router-dom": "^6.22.1", "react-select": "^5.8.0", diff --git a/src/frontend/yarn.lock b/src/frontend/yarn.lock index fa523477f7..f6a519eb83 100644 --- a/src/frontend/yarn.lock +++ b/src/frontend/yarn.lock @@ -3509,10 +3509,10 @@ react-grid-layout@^1.4.4: react-resizable "^3.0.5" resize-observer-polyfill "^1.5.1" -react-hook-form@^7.51.2: - version "7.51.2" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.51.2.tgz#79f7f72ee217c5114ff831012d1a7ec344096e7f" - integrity sha512-y++lwaWjtzDt/XNnyGDQy6goHskFualmDlf+jzEZvjvz6KWDf7EboL7pUvRCzPTJd0EOPpdekYaQLEvvG6m6HA== +react-hook-form@^7.51.3: + version "7.51.3" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.51.3.tgz#7486dd2d52280b6b28048c099a98d2545931cab3" + integrity sha512-cvJ/wbHdhYx8aviSWh28w9ImjmVsb5Y05n1+FW786vEZQJV5STNM0pW6ujS+oiBecb0ARBxJFyAnXj9+GHXACQ== react-is@^16.10.2, react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" From 5fb343ff05783fbd34f6e956b4b58915c2619137 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:55:55 +1000 Subject: [PATCH 06/15] Bump embla-carousel-react from 8.0.1 to 8.0.2 in /src/frontend (#7029) Bumps [embla-carousel-react](https://github.com/davidjerleke/embla-carousel) from 8.0.1 to 8.0.2. - [Release notes](https://github.com/davidjerleke/embla-carousel/releases) - [Commits](https://github.com/davidjerleke/embla-carousel/compare/v8.0.1...v8.0.2) --- updated-dependencies: - dependency-name: embla-carousel-react dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/frontend/package.json | 2 +- src/frontend/yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 52dae6db46..7dc4e1aa3e 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -38,7 +38,7 @@ "axios": "^1.6.7", "dayjs": "^1.11.10", "easymde": "^2.18.0", - "embla-carousel-react": "^8.0.0", + "embla-carousel-react": "^8.0.2", "html5-qrcode": "^2.3.8", "mantine-datatable": "<7", "react": "^18.2.0", diff --git a/src/frontend/yarn.lock b/src/frontend/yarn.lock index f6a519eb83..dec37261a3 100644 --- a/src/frontend/yarn.lock +++ b/src/frontend/yarn.lock @@ -2376,23 +2376,23 @@ electron-to-chromium@^1.4.668: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.729.tgz#8477d21e2a50993781950885b2731d92ad532c00" integrity sha512-bx7+5Saea/qu14kmPTDHQxkp2UnziG3iajUQu3BxFvCOnpAJdDbMV4rSl+EqFDkkpNNVUFlR1kDfpL59xfy1HA== -embla-carousel-react@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/embla-carousel-react/-/embla-carousel-react-8.0.1.tgz#6c0420e54079a3f47fad1b4e982be782066f5b2c" - integrity sha512-cpFQ/HwCsjBjzpu9Z9IHmZ9DaCSf/wo4q+qUTcRW3SsNv+1Q8IY7Y8J2QIyTmz0vOWY7tliu3uE2gqRH7ZDwOQ== +embla-carousel-react@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/embla-carousel-react/-/embla-carousel-react-8.0.2.tgz#8f27b34c04aa9fccdd6059727f573d9e7ed63d27" + integrity sha512-RHe1GKLulOW8EDN+cJgbFbVVfRXcaLT2/89dyVw3ONGgVpZjD19wB87I1LUZ1aCzOSrTccx0PFSQanK4OOfGPA== dependencies: - embla-carousel "8.0.1" - embla-carousel-reactive-utils "8.0.1" + embla-carousel "8.0.2" + embla-carousel-reactive-utils "8.0.2" -embla-carousel-reactive-utils@8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/embla-carousel-reactive-utils/-/embla-carousel-reactive-utils-8.0.1.tgz#7fe11dd07bf9f8e95debdc2e4415d608fe8723c6" - integrity sha512-KBSkz2h9LwVFkOrwzIJKgXbmEDlIShkreeOHnV8Cph09AdBMzb412nRkcctbeDcuG9x3CVsqLzJrSXnZeYhFPQ== +embla-carousel-reactive-utils@8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/embla-carousel-reactive-utils/-/embla-carousel-reactive-utils-8.0.2.tgz#cd48cbe46198d9a64b0a8d62ce6832ae97c9fe70" + integrity sha512-nLZqDkQdO0hvOP49/dUwjkkepMnUXgIzhyRuDjwGqswpB4Ibnc5M+w7rSQQAM+uMj0cPaXnYOTlv8XD7I/zVNw== -embla-carousel@8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/embla-carousel/-/embla-carousel-8.0.1.tgz#a9dd052d91a97b15c362723611ba7687193dba99" - integrity sha512-RsaMRyBCd144N95gb3XoI+H9zj3RI4y0qcfvKYEh2tIAIEenL9CW9vwzltCeoYkWYipGdkvup+HGT9ewG1YTEw== +embla-carousel@8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/embla-carousel/-/embla-carousel-8.0.2.tgz#31546bcdff7971d44d29cf6bb824ebe923317233" + integrity sha512-bogsDO8xosuh/l3PxIvA5AMl3+BnRVAse9sDW/60amzj4MbGS5re4WH5eVEXiuH8G1/3G7QUAX2QNr3Yx8z5rA== emoji-regex@^8.0.0: version "8.0.0" From 5315886fb45b798370da566162123820e20d634d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:56:05 +1000 Subject: [PATCH 07/15] Bump stefanzweifel/git-auto-commit-action from 5.0.0 to 5.0.1 (#7037) Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 5.0.0 to 5.0.1. - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/8756aa072ef5b4a080af5dc8fef36c5d586e521d...8621497c8c39c72f3e2a999a26b4ca1b5058a842) --- updated-dependencies: - dependency-name: stefanzweifel/git-auto-commit-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/qc_checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index 69125f4572..693e0b7539 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -213,7 +213,7 @@ jobs: echo "Version: $version" mkdir export/${version} mv schema.yml export/${version}/api.yaml - - uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0 + - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 with: commit_message: "Update API schema for ${version}" From 0575c167aa360bf37825dbca9fa63babe9fd7334 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:56:27 +1000 Subject: [PATCH 08/15] Bump github/codeql-action from 3.24.10 to 3.25.0 (#7036) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.10 to 3.25.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/4355270be187e1b672a7a1c7c7bae5afdc1ab94a...df5a14dc28094dc936e103b37d749c6628682b60) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index e3633a6f27..2205ed9285 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10 + uses: github/codeql-action/upload-sarif@df5a14dc28094dc936e103b37d749c6628682b60 # v3.25.0 with: sarif_file: results.sarif From 1c67a92958bfb7921db2613374286a531d59a9c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:56:34 +1000 Subject: [PATCH 09/15] Bump sigstore/cosign-installer from 3.4.0 to 3.5.0 (#7035) Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/sigstore/cosign-installer/releases) - [Commits](https://github.com/sigstore/cosign-installer/compare/e1523de7571e31dbe865fd2e80c5c7c23ae71eb4...59acb6260d9c0ba8f4a2f9d9b48431a222b68e20) --- updated-dependencies: - dependency-name: sigstore/cosign-installer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 1fccc6bbf8..42af7251c2 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -128,7 +128,7 @@ jobs: uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # pin@v3.2.0 - name: Set up cosign if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 # pin@v3.4.0 + uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # pin@v3.5.0 - name: Check if Dockerhub login is required id: docker_login run: | From 251029c62e92fac8a0bd181ab604062f821e77f3 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 16 Apr 2024 13:22:52 +1000 Subject: [PATCH 10/15] Change backport action (#7046) - Change to korthout/backport-action - More actively maintained --- .github/workflows/backport.yml | 21 +++------------------ backportrc.json | 8 -------- 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 backportrc.json diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 9c6c9e013b..54c1bc8a93 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -18,25 +18,10 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - if: | - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'backport') - && ( - (github.event.action == 'labeled' && github.event.label.name == 'backport') - || (github.event.action == 'closed') - ) steps: - name: Backport Action - uses: sqren/backport-github-action@f54e19901f2a57f8b82360f2490d47ee82ec82c6 # pin@v9.2.2 + uses: korthout/backport-action@ef20d86abccbac3ee3a73cb2efbdc06344c390e5 # Pinned at v2.5.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - auto_backport_label_prefix: backport-to- - add_original_reviewers: true - - - name: Info log - if: ${{ success() }} - run: cat ~/.backport/backport.info.log - - - name: Debug log - if: ${{ failure() }} - run: cat ~/.backport/backport.debug.log + copy_labels_pattern: '*' + label_pattern: 'backport-to-([^ ]+)$' diff --git a/backportrc.json b/backportrc.json deleted file mode 100644 index ab8d11dccc..0000000000 --- a/backportrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "repoOwner": "Oliver Walters", - "repoName": "InvenTree", - "targetBranchChoices": [], - "branchLabelMapping": { - "^backport-to-(.+)$": "$1" - } -} From 3f7d7fd156a05324b261347b8c8f750c01f1335b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:33:04 +1000 Subject: [PATCH 11/15] Bump @lingui/macro from 4.8.0 to 4.10.0 in /src/frontend (#7033) Bumps [@lingui/macro](https://github.com/lingui/js-lingui) from 4.8.0 to 4.10.0. - [Release notes](https://github.com/lingui/js-lingui/releases) - [Changelog](https://github.com/lingui/js-lingui/blob/main/CHANGELOG.md) - [Commits](https://github.com/lingui/js-lingui/compare/v4.8.0...v4.10.0) --- updated-dependencies: - dependency-name: "@lingui/macro" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/frontend/package.json | 2 +- src/frontend/yarn.lock | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 7dc4e1aa3e..9d9e755234 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -58,7 +58,7 @@ "@babel/preset-react": "^7.23.3", "@babel/preset-typescript": "^7.23.3", "@lingui/cli": "^4.7.2", - "@lingui/macro": "^4.7.2", + "@lingui/macro": "^4.10.0", "@playwright/test": "^1.43.1", "@types/node": "^20.12.3", "@types/react": "^18.2.74", diff --git a/src/frontend/yarn.lock b/src/frontend/yarn.lock index dec37261a3..9297718e29 100644 --- a/src/frontend/yarn.lock +++ b/src/frontend/yarn.lock @@ -1036,6 +1036,18 @@ ramda "^0.27.1" source-map "^0.8.0-beta.0" +"@lingui/conf@4.10.0": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@lingui/conf/-/conf-4.10.0.tgz#f8ebe7bc115051b82bb5823ecb9222fbe28a82c2" + integrity sha512-jHeuCMG25YWEWUQTl1QYz46/RJlQH+Nyx4Qt4uI9OiSXMJ5MiaHopj+Oi9qdI1q2iY0P1RhdwRegBcdET+yF8w== + dependencies: + "@babel/runtime" "^7.20.13" + chalk "^4.1.0" + cosmiconfig "^8.0.0" + jest-validate "^29.4.3" + jiti "^1.17.1" + lodash.get "^4.4.2" + "@lingui/conf@4.8.0": version "4.8.0" resolved "https://registry.yarnpkg.com/@lingui/conf/-/conf-4.8.0.tgz#d2675806fcafecc6ad29d30d1e273fd28835d20e" @@ -1076,16 +1088,16 @@ date-fns "^3.6.0" pofile "^1.1.4" -"@lingui/macro@^4.7.2": - version "4.8.0" - resolved "https://registry.yarnpkg.com/@lingui/macro/-/macro-4.8.0.tgz#00f98bd3bc2b022e03c020e73a9594b61802788e" - integrity sha512-5/MGOzuBAqi7vQhn6/8HO0/pPdqk+bLO7QzLsz8imEL58amaBbQmc0WmQRI4DvUknIQnnqlMx5wSAyXuHridrg== +"@lingui/macro@^4.10.0": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@lingui/macro/-/macro-4.10.0.tgz#c0c909d318acbb4b2d2792f6c7266fd22a7e9830" + integrity sha512-u+rSqCfQOHPyNwpdq+69LfoOBN6hiQJf0pNOB88kxdVammv4ul9lqnnJW0+hz4gh9POX1jhXjbLf2pStTH1q9w== dependencies: "@babel/runtime" "^7.20.13" "@babel/types" "^7.20.7" - "@lingui/conf" "4.8.0" - "@lingui/core" "4.8.0" - "@lingui/message-utils" "4.8.0" + "@lingui/conf" "4.10.0" + "@lingui/core" "4.10.0" + "@lingui/message-utils" "4.10.0" "@lingui/message-utils@4.10.0": version "4.10.0" From 66ed85e0c0ab24c52e14fd74a1600b86586a0129 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 16 Apr 2024 14:46:20 +1000 Subject: [PATCH 12/15] Fix regex (#7048) * Fix regex * Fix permission and step condition --- .github/workflows/backport.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 54c1bc8a93..8d72e7ebb9 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -9,19 +9,18 @@ on: pull_request_target: types: [ "labeled", "closed" ] -permissions: - contents: write - jobs: backport: name: Backport PR runs-on: ubuntu-latest permissions: contents: write + pull-requests: write + if: github.event.pull_request.merged steps: - name: Backport Action uses: korthout/backport-action@ef20d86abccbac3ee3a73cb2efbdc06344c390e5 # Pinned at v2.5.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} copy_labels_pattern: '*' - label_pattern: 'backport-to-([^ ]+)$' + label_pattern: '^backport-to-(.+)$' From 22a25d4387083ab154325498ffbd99d96e77091e Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 16 Apr 2024 15:01:30 +1000 Subject: [PATCH 13/15] backport.yml : Fix copy_labels_pattern (#7050) --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 8d72e7ebb9..5a0adbc3e4 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -22,5 +22,5 @@ jobs: uses: korthout/backport-action@ef20d86abccbac3ee3a73cb2efbdc06344c390e5 # Pinned at v2.5.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - copy_labels_pattern: '*' + copy_labels_pattern: '.+' label_pattern: '^backport-to-(.+)$' From ed95ae44999f1dc8e57a549e44f5cddabf0f2909 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 16 Apr 2024 15:04:40 +1000 Subject: [PATCH 14/15] PUI BOM table updates (#7049) - Allow new BOM item to be created - Update modal forms --- src/frontend/src/tables/bom/BomTable.tsx | 107 ++++++++++++++++------- 1 file changed, 73 insertions(+), 34 deletions(-) diff --git a/src/frontend/src/tables/bom/BomTable.tsx b/src/frontend/src/tables/bom/BomTable.tsx index 6e2cea5b57..06e7603347 100644 --- a/src/frontend/src/tables/bom/BomTable.tsx +++ b/src/frontend/src/tables/bom/BomTable.tsx @@ -5,9 +5,10 @@ import { IconCircleCheck, IconSwitch3 } from '@tabler/icons-react'; -import { ReactNode, useCallback, useMemo } from 'react'; +import { ReactNode, useCallback, useMemo, useState } from 'react'; import { useNavigate } from 'react-router-dom'; +import { AddItemButton } from '../../components/buttons/AddItemButton'; import { YesNoButton } from '../../components/buttons/YesNoButton'; import { Thumbnail } from '../../components/images/Thumbnail'; import { formatDecimal, formatPriceRange } from '../../defaults/formatters'; @@ -15,7 +16,11 @@ import { ApiEndpoints } from '../../enums/ApiEndpoints'; import { ModelType } from '../../enums/ModelType'; import { UserRoles } from '../../enums/Roles'; import { bomItemFields } from '../../forms/BomForms'; -import { openDeleteApiForm, openEditApiForm } from '../../functions/forms'; +import { + useCreateApiFormModal, + useDeleteApiFormModal, + useEditApiFormModal +} from '../../hooks/UseForm'; import { useTable } from '../../hooks/UseTable'; import { apiUrl } from '../../states/ApiState'; import { useUserState } from '../../states/UserState'; @@ -289,6 +294,36 @@ export function BomTable({ ]; }, [partId, params]); + const [selectedBomItem, setSelectedBomItem] = useState(0); + + const newBomItem = useCreateApiFormModal({ + url: ApiEndpoints.bom_list, + title: t`Create BOM Item`, + fields: bomItemFields(), + initialData: { + part: partId + }, + successMessage: t`BOM item created`, + onFormSuccess: table.refreshTable + }); + + const editBomItem = useEditApiFormModal({ + url: ApiEndpoints.bom_list, + pk: selectedBomItem, + title: t`Edit BOM Item`, + fields: bomItemFields(), + successMessage: t`BOM item updated`, + onFormSuccess: table.refreshTable + }); + + const deleteBomItem = useDeleteApiFormModal({ + url: ApiEndpoints.bom_list, + pk: selectedBomItem, + title: t`Delete BOM Item`, + successMessage: t`BOM item deleted`, + onFormSuccess: table.refreshTable + }); + const rowActions = useCallback( (record: any) => { // If this BOM item is defined for a *different* parent, then it cannot be edited @@ -325,14 +360,8 @@ export function BomTable({ RowEditAction({ hidden: !user.hasChangeRole(UserRoles.part), onClick: () => { - openEditApiForm({ - url: ApiEndpoints.bom_list, - pk: record.pk, - title: t`Edit Bom Item`, - fields: bomItemFields(), - successMessage: t`Bom item updated`, - onFormSuccess: table.refreshTable - }); + setSelectedBomItem(record.pk); + editBomItem.open(); } }) ); @@ -342,14 +371,8 @@ export function BomTable({ RowDeleteAction({ hidden: !user.hasDeleteRole(UserRoles.part), onClick: () => { - openDeleteApiForm({ - url: ApiEndpoints.bom_list, - pk: record.pk, - title: t`Delete Bom Item`, - successMessage: t`Bom item deleted`, - onFormSuccess: table.refreshTable, - preFormWarning: t`Are you sure you want to remove this BOM item?` - }); + setSelectedBomItem(record.pk); + deleteBomItem.open(); } }) ); @@ -359,22 +382,38 @@ export function BomTable({ [partId, user] ); + const tableActions = useMemo(() => { + return [ +