@inventreedb/ui 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +18 -7
- package/dist/.vite/manifest.json +168 -0
- package/dist/_virtual/errors.js +5 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/index.js +6 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/lexer.js +5 -0
- package/dist/_virtual/lexer.js.map +1 -0
- package/dist/_virtual/moo.js +5 -0
- package/dist/_virtual/moo.js.map +1 -0
- package/dist/_virtual/parser.js +6 -0
- package/dist/_virtual/parser.js.map +1 -0
- package/dist/_virtual/parser2.js +5 -0
- package/dist/_virtual/parser2.js.map +1 -0
- package/dist/enums/ApiEndpoints.d.ts +179 -0
- package/dist/enums/ApiEndpoints.js +184 -0
- package/dist/enums/ApiEndpoints.js.map +1 -0
- package/dist/enums/ModelInformation.d.ts +20 -0
- package/dist/enums/ModelInformation.js +590 -0
- package/dist/enums/ModelInformation.js.map +1 -0
- package/dist/enums/ModelType.d.ts +35 -0
- package/dist/enums/ModelType.js +40 -0
- package/dist/enums/ModelType.js.map +1 -0
- package/dist/enums/Roles.d.ts +18 -0
- package/dist/functions/Api.d.ts +11 -0
- package/dist/functions/Api.js +27 -0
- package/dist/functions/Api.js.map +1 -0
- package/dist/functions/Events.d.ts +1 -0
- package/dist/functions/Events.js +10 -0
- package/dist/functions/Events.js.map +1 -0
- package/dist/functions/Navigation.d.ts +8 -0
- package/dist/functions/Navigation.js +38 -0
- package/dist/functions/Navigation.js.map +1 -0
- package/dist/functions/Plugins.d.ts +2 -0
- package/dist/functions/Plugins.js +23 -0
- package/dist/functions/Plugins.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/node_modules/@lingui/core/dist/index.js +405 -0
- package/dist/node_modules/@lingui/core/dist/index.js.map +1 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js +326 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js +74 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js +223 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js.map +1 -0
- package/dist/node_modules/moo/moo.js +539 -0
- package/dist/node_modules/moo/moo.js.map +1 -0
- package/dist/node_modules/unraw/dist/errors.js +39 -0
- package/dist/node_modules/unraw/dist/errors.js.map +1 -0
- package/dist/node_modules/unraw/dist/index.js +112 -0
- package/dist/node_modules/unraw/dist/index.js.map +1 -0
- package/dist/types/Auth.d.ts +51 -0
- package/dist/types/Core.d.ts +10 -0
- package/dist/types/Filters.d.ts +56 -0
- package/dist/types/Forms.d.ts +159 -0
- package/dist/types/Icons.d.ts +5 -0
- package/dist/types/Modals.d.ts +15 -0
- package/dist/types/Plugins.d.ts +58 -0
- package/dist/types/Plugins.js +5 -0
- package/dist/types/Plugins.js.map +1 -0
- package/dist/types/Server.d.ts +7 -0
- package/dist/types/Settings.d.ts +48 -0
- package/dist/types/Tables.d.ts +34 -0
- package/dist/types/User.d.ts +55 -0
- package/{src/components/render/ModelType.tsx → lib/enums/ModelInformation.tsx} +4 -18
- package/lib/functions/Navigation.tsx +58 -0
- package/lib/index.ts +6 -0
- package/lib/types/Icons.tsx +9 -0
- package/package.json +9 -1
- package/.babelrc +0 -8
- package/.linguirc +0 -55
- package/index.html +0 -15
- package/netlify.toml +0 -22
- package/playwright/global-setup.ts +0 -45
- package/playwright.config.ts +0 -99
- package/src/App.tsx +0 -35
- package/src/assets/inventree.svg +0 -1
- package/src/components/Boundary.tsx +0 -43
- package/src/components/SplashScreen.tsx +0 -35
- package/src/components/barcodes/BarcodeCameraInput.tsx +0 -207
- package/src/components/barcodes/BarcodeInput.tsx +0 -127
- package/src/components/barcodes/BarcodeKeyboardInput.tsx +0 -50
- package/src/components/barcodes/BarcodeScanDialog.tsx +0 -101
- package/src/components/barcodes/BarcodeScanItem.tsx +0 -23
- package/src/components/barcodes/QRCode.tsx +0 -211
- package/src/components/buttons/ActionButton.tsx +0 -61
- package/src/components/buttons/AddItemButton.tsx +0 -10
- package/src/components/buttons/AdminButton.tsx +0 -91
- package/src/components/buttons/ButtonMenu.tsx +0 -33
- package/src/components/buttons/CopyButton.tsx +0 -52
- package/src/components/buttons/PrimaryActionButton.tsx +0 -40
- package/src/components/buttons/PrintingActions.tsx +0 -191
- package/src/components/buttons/RemoveRowButton.tsx +0 -22
- package/src/components/buttons/SSOButton.tsx +0 -53
- package/src/components/buttons/ScanButton.tsx +0 -27
- package/src/components/buttons/SegmentedIconControl.tsx +0 -51
- package/src/components/buttons/SplitButton.css.ts +0 -19
- package/src/components/buttons/SplitButton.tsx +0 -111
- package/src/components/buttons/SpotlightButton.tsx +0 -22
- package/src/components/buttons/StarredToggleButton.tsx +0 -62
- package/src/components/buttons/YesNoButton.tsx +0 -42
- package/src/components/calendar/Calendar.tsx +0 -193
- package/src/components/calendar/OrderCalendar.tsx +0 -209
- package/src/components/charts/colors.tsx +0 -12
- package/src/components/charts/tooltipFormatter.tsx +0 -12
- package/src/components/dashboard/DashboardLayout.tsx +0 -327
- package/src/components/dashboard/DashboardMenu.tsx +0 -136
- package/src/components/dashboard/DashboardWidget.tsx +0 -82
- package/src/components/dashboard/DashboardWidgetDrawer.tsx +0 -130
- package/src/components/dashboard/DashboardWidgetLibrary.tsx +0 -189
- package/src/components/dashboard/widgets/ColorToggleWidget.tsx +0 -28
- package/src/components/dashboard/widgets/GetStartedWidget.tsx +0 -19
- package/src/components/dashboard/widgets/LanguageSelectWidget.tsx +0 -28
- package/src/components/dashboard/widgets/NewsWidget.tsx +0 -143
- package/src/components/dashboard/widgets/QueryCountDashboardWidget.tsx +0 -134
- package/src/components/details/Details.tsx +0 -514
- package/src/components/details/DetailsBadge.tsx +0 -20
- package/src/components/details/DetailsImage.tsx +0 -462
- package/src/components/details/ItemDetails.tsx +0 -17
- package/src/components/editors/NotesEditor.tsx +0 -232
- package/src/components/editors/TemplateEditor/CodeEditor/CodeEditor.tsx +0 -158
- package/src/components/editors/TemplateEditor/CodeEditor/index.tsx +0 -12
- package/src/components/editors/TemplateEditor/PdfPreview/PdfPreview.tsx +0 -90
- package/src/components/editors/TemplateEditor/PdfPreview/index.tsx +0 -12
- package/src/components/editors/TemplateEditor/TemplateEditor.tsx +0 -425
- package/src/components/editors/TemplateEditor/index.tsx +0 -3
- package/src/components/errors/ClientError.tsx +0 -28
- package/src/components/errors/GenericErrorPage.tsx +0 -73
- package/src/components/errors/NotAuthenticated.tsx +0 -12
- package/src/components/errors/NotFound.tsx +0 -12
- package/src/components/errors/PermissionDenied.tsx +0 -12
- package/src/components/errors/ServerError.tsx +0 -13
- package/src/components/forms/ApiForm.tsx +0 -718
- package/src/components/forms/AuthFormOptions.tsx +0 -39
- package/src/components/forms/AuthenticationForm.tsx +0 -332
- package/src/components/forms/HostOptionsForm.tsx +0 -96
- package/src/components/forms/InstanceOptions.tsx +0 -178
- package/src/components/forms/StandaloneField.tsx +0 -55
- package/src/components/forms/fields/ApiFormField.tsx +0 -281
- package/src/components/forms/fields/ChoiceField.tsx +0 -86
- package/src/components/forms/fields/DateField.tsx +0 -79
- package/src/components/forms/fields/DependentField.tsx +0 -91
- package/src/components/forms/fields/IconField.tsx +0 -353
- package/src/components/forms/fields/NestedObjectField.tsx +0 -45
- package/src/components/forms/fields/RelatedModelField.tsx +0 -339
- package/src/components/forms/fields/TableField.tsx +0 -275
- package/src/components/forms/fields/TextField.tsx +0 -81
- package/src/components/images/ApiImage.tsx +0 -35
- package/src/components/images/Thumbnail.tsx +0 -52
- package/src/components/importer/ImportDataSelector.tsx +0 -433
- package/src/components/importer/ImporterColumnSelector.tsx +0 -244
- package/src/components/importer/ImporterDrawer.tsx +0 -173
- package/src/components/importer/ImporterImportProgress.tsx +0 -45
- package/src/components/items/ActionDropdown.tsx +0 -290
- package/src/components/items/ApiIcon.css.ts +0 -13
- package/src/components/items/ApiIcon.tsx +0 -32
- package/src/components/items/AttachmentLink.tsx +0 -79
- package/src/components/items/ColorToggle.tsx +0 -34
- package/src/components/items/DashboardItem.tsx +0 -33
- package/src/components/items/DocInfo.tsx +0 -20
- package/src/components/items/DocTooltip.tsx +0 -98
- package/src/components/items/ErrorItem.tsx +0 -17
- package/src/components/items/Expand.tsx +0 -14
- package/src/components/items/GettingStartedCarousel.css.ts +0 -30
- package/src/components/items/GettingStartedCarousel.tsx +0 -49
- package/src/components/items/InfoItem.tsx +0 -64
- package/src/components/items/InvenTreeLogo.tsx +0 -24
- package/src/components/items/LanguageSelect.tsx +0 -43
- package/src/components/items/LanguageToggle.tsx +0 -37
- package/src/components/items/MenuLinks.tsx +0 -113
- package/src/components/items/OnlyStaff.tsx +0 -10
- package/src/components/items/ProgressBar.tsx +0 -45
- package/src/components/items/StylishText.tsx +0 -59
- package/src/components/items/TitleWithDoc.tsx +0 -26
- package/src/components/items/UnavailableIndicator.tsx +0 -5
- package/src/components/items/inventree.svg +0 -1
- package/src/components/modals/AboutInvenTreeModal.tsx +0 -203
- package/src/components/modals/LicenseModal.tsx +0 -116
- package/src/components/modals/QrModal.tsx +0 -21
- package/src/components/modals/ServerInfoModal.tsx +0 -136
- package/src/components/nav/Alerts.tsx +0 -130
- package/src/components/nav/BreadcrumbList.tsx +0 -84
- package/src/components/nav/DetailDrawer.css.ts +0 -6
- package/src/components/nav/DetailDrawer.tsx +0 -105
- package/src/components/nav/Footer.tsx +0 -11
- package/src/components/nav/Header.tsx +0 -226
- package/src/components/nav/InstanceDetail.tsx +0 -46
- package/src/components/nav/Layout.tsx +0 -85
- package/src/components/nav/MainMenu.tsx +0 -101
- package/src/components/nav/NavHoverMenu.tsx +0 -15
- package/src/components/nav/NavigationDrawer.tsx +0 -230
- package/src/components/nav/NavigationTree.tsx +0 -210
- package/src/components/nav/NotificationDrawer.tsx +0 -231
- package/src/components/nav/PageDetail.tsx +0 -171
- package/src/components/nav/PageTitle.tsx +0 -53
- package/src/components/nav/SearchDrawer.tsx +0 -598
- package/src/components/nav/SettingsHeader.tsx +0 -50
- package/src/components/panels/AttachmentPanel.tsx +0 -27
- package/src/components/panels/NotesPanel.tsx +0 -36
- package/src/components/panels/Panel.tsx +0 -15
- package/src/components/panels/PanelGroup.css.ts +0 -10
- package/src/components/panels/PanelGroup.tsx +0 -292
- package/src/components/plugins/LocateItemButton.tsx +0 -94
- package/src/components/plugins/PluginContext.tsx +0 -67
- package/src/components/plugins/PluginDrawer.tsx +0 -156
- package/src/components/plugins/PluginInterface.tsx +0 -34
- package/src/components/plugins/PluginPanel.tsx +0 -37
- package/src/components/plugins/PluginSettingsPanel.tsx +0 -34
- package/src/components/plugins/PluginSource.tsx +0 -48
- package/src/components/plugins/PluginUIFeature.tsx +0 -174
- package/src/components/plugins/PluginUIFeatureTypes.ts +0 -78
- package/src/components/plugins/RemoteComponent.tsx +0 -137
- package/src/components/render/Build.tsx +0 -54
- package/src/components/render/Company.tsx +0 -114
- package/src/components/render/Generic.tsx +0 -49
- package/src/components/render/Instance.tsx +0 -240
- package/src/components/render/InstanceFromUrl.tsx +0 -33
- package/src/components/render/Order.tsx +0 -124
- package/src/components/render/Part.tsx +0 -109
- package/src/components/render/Plugin.tsx +0 -21
- package/src/components/render/Report.tsx +0 -29
- package/src/components/render/StatusRenderer.tsx +0 -178
- package/src/components/render/Stock.tsx +0 -84
- package/src/components/render/User.tsx +0 -42
- package/src/components/settings/FactCollection.tsx +0 -31
- package/src/components/settings/FactItem.tsx +0 -17
- package/src/components/settings/SettingItem.tsx +0 -176
- package/src/components/settings/SettingList.tsx +0 -217
- package/src/components/wizards/OrderPartsWizard.tsx +0 -473
- package/src/components/wizards/WizardDrawer.tsx +0 -188
- package/src/contexts/ApiContext.tsx +0 -31
- package/src/contexts/LanguageContext.tsx +0 -155
- package/src/contexts/ThemeContext.tsx +0 -58
- package/src/contexts/colorSchema.tsx +0 -67
- package/src/defaults/actions.tsx +0 -87
- package/src/defaults/backendMappings.tsx +0 -32
- package/src/defaults/defaultHostList.tsx +0 -4
- package/src/defaults/defaults.tsx +0 -38
- package/src/defaults/formatters.tsx +0 -176
- package/src/defaults/links.tsx +0 -193
- package/src/defaults/templates.tsx +0 -53
- package/src/forms/BomForms.tsx +0 -26
- package/src/forms/BuildForms.tsx +0 -615
- package/src/forms/CommonForms.tsx +0 -89
- package/src/forms/CompanyForms.tsx +0 -133
- package/src/forms/ImporterForms.tsx +0 -20
- package/src/forms/PartForms.tsx +0 -281
- package/src/forms/PurchaseOrderForms.tsx +0 -779
- package/src/forms/ReturnOrderForms.tsx +0 -263
- package/src/forms/SalesOrderForms.tsx +0 -408
- package/src/forms/StockForms.tsx +0 -1296
- package/src/forms/selectionListFields.tsx +0 -120
- package/src/functions/api.tsx +0 -61
- package/src/functions/auth.tsx +0 -574
- package/src/functions/conversion.tsx +0 -42
- package/src/functions/forms.tsx +0 -173
- package/src/functions/icons.tsx +0 -294
- package/src/functions/loading.tsx +0 -29
- package/src/functions/navigation.tsx +0 -20
- package/src/functions/notifications.tsx +0 -101
- package/src/functions/tables.tsx +0 -26
- package/src/functions/uid.tsx +0 -15
- package/src/functions/urls.tsx +0 -58
- package/src/hooks/UseCalendar.tsx +0 -178
- package/src/hooks/UseDashboardItems.tsx +0 -118
- package/src/hooks/UseDataExport.tsx +0 -125
- package/src/hooks/UseDataOutput.tsx +0 -109
- package/src/hooks/UseFilter.tsx +0 -67
- package/src/hooks/UseFilterSet.tsx +0 -24
- package/src/hooks/UseForm.tsx +0 -161
- package/src/hooks/UseGenerator.tsx +0 -92
- package/src/hooks/UseImportSession.tsx +0 -139
- package/src/hooks/UseInstance.tsx +0 -137
- package/src/hooks/UseInstanceName.tsx +0 -14
- package/src/hooks/UseModal.tsx +0 -38
- package/src/hooks/UsePlaceholder.tsx +0 -66
- package/src/hooks/UsePluginPanels.tsx +0 -123
- package/src/hooks/UsePluginUIFeature.tsx +0 -95
- package/src/hooks/UsePlugins.tsx +0 -45
- package/src/hooks/UseSelectedRows.tsx +0 -37
- package/src/hooks/UseStatusCodes.tsx +0 -50
- package/src/hooks/UseTable.tsx +0 -145
- package/src/hooks/UseWizard.tsx +0 -133
- package/src/locales/ar/messages.d.ts +0 -4
- package/src/locales/ar/messages.po +0 -10695
- package/src/locales/ar/messages.ts +0 -1
- package/src/locales/bg/messages.d.ts +0 -4
- package/src/locales/bg/messages.po +0 -10695
- package/src/locales/bg/messages.ts +0 -1
- package/src/locales/cs/messages.d.ts +0 -4
- package/src/locales/cs/messages.po +0 -10695
- package/src/locales/cs/messages.ts +0 -1
- package/src/locales/da/messages.d.ts +0 -4
- package/src/locales/da/messages.po +0 -10695
- package/src/locales/da/messages.ts +0 -1
- package/src/locales/de/messages.d.ts +0 -4
- package/src/locales/de/messages.po +0 -10695
- package/src/locales/de/messages.ts +0 -1
- package/src/locales/el/messages.d.ts +0 -4
- package/src/locales/el/messages.po +0 -10695
- package/src/locales/el/messages.ts +0 -1
- package/src/locales/en/messages.d.ts +0 -4
- package/src/locales/en/messages.po +0 -10689
- package/src/locales/en/messages.ts +0 -1
- package/src/locales/es/messages.d.ts +0 -4
- package/src/locales/es/messages.po +0 -10695
- package/src/locales/es/messages.ts +0 -1
- package/src/locales/es_MX/messages.d.ts +0 -4
- package/src/locales/es_MX/messages.po +0 -10695
- package/src/locales/es_MX/messages.ts +0 -1
- package/src/locales/et/messages.d.ts +0 -4
- package/src/locales/et/messages.po +0 -10695
- package/src/locales/et/messages.ts +0 -1
- package/src/locales/fa/messages.d.ts +0 -4
- package/src/locales/fa/messages.po +0 -10695
- package/src/locales/fa/messages.ts +0 -1
- package/src/locales/fi/messages.d.ts +0 -4
- package/src/locales/fi/messages.po +0 -10695
- package/src/locales/fi/messages.ts +0 -1
- package/src/locales/fr/messages.d.ts +0 -4
- package/src/locales/fr/messages.po +0 -10695
- package/src/locales/fr/messages.ts +0 -1
- package/src/locales/he/messages.d.ts +0 -4
- package/src/locales/he/messages.po +0 -10695
- package/src/locales/he/messages.ts +0 -1
- package/src/locales/hi/messages.d.ts +0 -4
- package/src/locales/hi/messages.po +0 -10695
- package/src/locales/hi/messages.ts +0 -1
- package/src/locales/hu/messages.d.ts +0 -4
- package/src/locales/hu/messages.po +0 -10695
- package/src/locales/hu/messages.ts +0 -1
- package/src/locales/id/messages.po +0 -10695
- package/src/locales/it/messages.d.ts +0 -4
- package/src/locales/it/messages.po +0 -10695
- package/src/locales/it/messages.ts +0 -1
- package/src/locales/ja/messages.d.ts +0 -4
- package/src/locales/ja/messages.po +0 -10695
- package/src/locales/ja/messages.ts +0 -1
- package/src/locales/ko/messages.d.ts +0 -4
- package/src/locales/ko/messages.po +0 -10695
- package/src/locales/ko/messages.ts +0 -1
- package/src/locales/lt/messages.d.ts +0 -4
- package/src/locales/lt/messages.po +0 -10695
- package/src/locales/lt/messages.ts +0 -1
- package/src/locales/lv/messages.d.ts +0 -4
- package/src/locales/lv/messages.po +0 -10695
- package/src/locales/lv/messages.ts +0 -1
- package/src/locales/nl/messages.d.ts +0 -4
- package/src/locales/nl/messages.po +0 -10695
- package/src/locales/nl/messages.ts +0 -1
- package/src/locales/no/messages.d.ts +0 -4
- package/src/locales/no/messages.po +0 -10695
- package/src/locales/no/messages.ts +0 -1
- package/src/locales/pl/messages.d.ts +0 -4
- package/src/locales/pl/messages.po +0 -10695
- package/src/locales/pl/messages.ts +0 -1
- package/src/locales/pseudo-LOCALE/messages.d.ts +0 -4
- package/src/locales/pseudo-LOCALE/messages.po +0 -8003
- package/src/locales/pseudo-LOCALE/messages.ts +0 -1
- package/src/locales/pt/messages.d.ts +0 -4
- package/src/locales/pt/messages.po +0 -10696
- package/src/locales/pt/messages.ts +0 -1
- package/src/locales/pt_BR/messages.d.ts +0 -4
- package/src/locales/pt_BR/messages.po +0 -10695
- package/src/locales/pt_BR/messages.ts +0 -1
- package/src/locales/ro/messages.po +0 -10695
- package/src/locales/ro/messages.ts +0 -1
- package/src/locales/ru/messages.d.ts +0 -4
- package/src/locales/ru/messages.po +0 -10695
- package/src/locales/ru/messages.ts +0 -1
- package/src/locales/sk/messages.d.ts +0 -4
- package/src/locales/sk/messages.po +0 -10695
- package/src/locales/sk/messages.ts +0 -1
- package/src/locales/sl/messages.d.ts +0 -4
- package/src/locales/sl/messages.po +0 -10695
- package/src/locales/sl/messages.ts +0 -1
- package/src/locales/sr/messages.d.ts +0 -4
- package/src/locales/sr/messages.po +0 -10695
- package/src/locales/sr/messages.ts +0 -1
- package/src/locales/sv/messages.d.ts +0 -4
- package/src/locales/sv/messages.po +0 -10695
- package/src/locales/sv/messages.ts +0 -1
- package/src/locales/th/messages.d.ts +0 -4
- package/src/locales/th/messages.po +0 -10695
- package/src/locales/th/messages.ts +0 -1
- package/src/locales/tr/messages.d.ts +0 -4
- package/src/locales/tr/messages.po +0 -10695
- package/src/locales/tr/messages.ts +0 -1
- package/src/locales/uk/messages.d.ts +0 -3
- package/src/locales/uk/messages.po +0 -10695
- package/src/locales/uk/messages.ts +0 -1
- package/src/locales/vi/messages.d.ts +0 -4
- package/src/locales/vi/messages.po +0 -10695
- package/src/locales/vi/messages.ts +0 -1
- package/src/locales/zh_Hans/messages.d.ts +0 -4
- package/src/locales/zh_Hans/messages.po +0 -10695
- package/src/locales/zh_Hans/messages.ts +0 -1
- package/src/locales/zh_Hant/messages.d.ts +0 -4
- package/src/locales/zh_Hant/messages.po +0 -10695
- package/src/locales/zh_Hant/messages.ts +0 -1
- package/src/main.css.ts +0 -148
- package/src/main.tsx +0 -123
- package/src/pages/Auth/ChangePassword.tsx +0 -84
- package/src/pages/Auth/Layout.tsx +0 -74
- package/src/pages/Auth/LoggedIn.tsx +0 -21
- package/src/pages/Auth/Login.tsx +0 -133
- package/src/pages/Auth/Logout.tsx +0 -16
- package/src/pages/Auth/MFA.tsx +0 -36
- package/src/pages/Auth/MFASetup.tsx +0 -38
- package/src/pages/Auth/Register.tsx +0 -28
- package/src/pages/Auth/Reset.tsx +0 -30
- package/src/pages/Auth/ResetPassword.tsx +0 -48
- package/src/pages/Auth/VerifyEmail.tsx +0 -34
- package/src/pages/ErrorPage.tsx +0 -26
- package/src/pages/Index/Home.tsx +0 -12
- package/src/pages/Index/Scan.tsx +0 -258
- package/src/pages/Index/Settings/AccountSettings/AccountDetailPanel.tsx +0 -162
- package/src/pages/Index/Settings/AccountSettings/QrRegistrationForm.tsx +0 -38
- package/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx +0 -713
- package/src/pages/Index/Settings/AccountSettings/UserPanel.tsx +0 -24
- package/src/pages/Index/Settings/AccountSettings/UserThemePanel.tsx +0 -207
- package/src/pages/Index/Settings/AccountSettings/useConfirm.tsx +0 -117
- package/src/pages/Index/Settings/AdminCenter/CurrencyManagementPanel.tsx +0 -111
- package/src/pages/Index/Settings/AdminCenter/Index.tsx +0 -251
- package/src/pages/Index/Settings/AdminCenter/LabelTemplatePanel.tsx +0 -23
- package/src/pages/Index/Settings/AdminCenter/MachineManagementPanel.tsx +0 -110
- package/src/pages/Index/Settings/AdminCenter/PartParameterPanel.tsx +0 -29
- package/src/pages/Index/Settings/AdminCenter/PluginManagementPanel.tsx +0 -84
- package/src/pages/Index/Settings/AdminCenter/ReportTemplatePanel.tsx +0 -38
- package/src/pages/Index/Settings/AdminCenter/StocktakePanel.tsx +0 -31
- package/src/pages/Index/Settings/AdminCenter/TaskManagementPanel.tsx +0 -73
- package/src/pages/Index/Settings/AdminCenter/UnitManagementPanel.tsx +0 -74
- package/src/pages/Index/Settings/AdminCenter/UserManagementPanel.tsx +0 -49
- package/src/pages/Index/Settings/SystemSettings.tsx +0 -339
- package/src/pages/Index/Settings/UserSettings.tsx +0 -143
- package/src/pages/Notifications.tsx +0 -134
- package/src/pages/build/BuildDetail.tsx +0 -579
- package/src/pages/build/BuildIndex.tsx +0 -100
- package/src/pages/company/CompanyDetail.tsx +0 -352
- package/src/pages/company/CustomerDetail.tsx +0 -13
- package/src/pages/company/ManufacturerDetail.tsx +0 -13
- package/src/pages/company/ManufacturerPartDetail.tsx +0 -307
- package/src/pages/company/SupplierDetail.tsx +0 -13
- package/src/pages/company/SupplierPartDetail.tsx +0 -433
- package/src/pages/core/CoreIndex.tsx +0 -50
- package/src/pages/core/GroupDetail.tsx +0 -97
- package/src/pages/core/UserDetail.tsx +0 -193
- package/src/pages/part/CategoryDetail.tsx +0 -369
- package/src/pages/part/PartAllocationPanel.tsx +0 -40
- package/src/pages/part/PartDetail.tsx +0 -1071
- package/src/pages/part/PartPricingPanel.tsx +0 -155
- package/src/pages/part/PartSchedulingDetail.tsx +0 -315
- package/src/pages/part/PartStocktakeDetail.tsx +0 -285
- package/src/pages/part/PartSupplierDetail.tsx +0 -31
- package/src/pages/part/pricing/BomPricingPanel.tsx +0 -269
- package/src/pages/part/pricing/PriceBreakPanel.tsx +0 -182
- package/src/pages/part/pricing/PricingOverviewPanel.tsx +0 -338
- package/src/pages/part/pricing/PricingPanel.tsx +0 -82
- package/src/pages/part/pricing/PurchaseHistoryPanel.tsx +0 -134
- package/src/pages/part/pricing/SaleHistoryPanel.tsx +0 -95
- package/src/pages/part/pricing/SupplierPricingPanel.tsx +0 -80
- package/src/pages/part/pricing/VariantPricingPanel.tsx +0 -112
- package/src/pages/purchasing/PurchaseOrderDetail.tsx +0 -547
- package/src/pages/purchasing/PurchasingIndex.tsx +0 -131
- package/src/pages/sales/ReturnOrderDetail.tsx +0 -529
- package/src/pages/sales/SalesIndex.tsx +0 -148
- package/src/pages/sales/SalesOrderDetail.tsx +0 -593
- package/src/pages/sales/SalesOrderShipmentDetail.tsx +0 -385
- package/src/pages/stock/LocationDetail.tsx +0 -413
- package/src/pages/stock/StockDetail.tsx +0 -951
- package/src/router.tsx +0 -213
- package/src/states/ApiState.tsx +0 -85
- package/src/states/IconState.tsx +0 -94
- package/src/states/LocalState.tsx +0 -181
- package/src/states/SettingsState.tsx +0 -206
- package/src/states/StatusState.tsx +0 -55
- package/src/states/UserState.tsx +0 -202
- package/src/states/states.tsx +0 -69
- package/src/tables/Column.tsx +0 -29
- package/src/tables/ColumnRenderers.tsx +0 -320
- package/src/tables/ColumnSelect.tsx +0 -39
- package/src/tables/Filter.tsx +0 -297
- package/src/tables/FilterSelectDrawer.tsx +0 -358
- package/src/tables/InvenTreeTable.tsx +0 -750
- package/src/tables/InvenTreeTableHeader.tsx +0 -257
- package/src/tables/RowActions.tsx +0 -176
- package/src/tables/RowExpansionIcon.tsx +0 -16
- package/src/tables/Search.tsx +0 -42
- package/src/tables/TableHoverCard.tsx +0 -91
- package/src/tables/bom/BomTable.tsx +0 -590
- package/src/tables/bom/UsedInTable.tsx +0 -114
- package/src/tables/build/BuildAllocatedStockTable.tsx +0 -233
- package/src/tables/build/BuildLineTable.tsx +0 -800
- package/src/tables/build/BuildOrderTable.tsx +0 -226
- package/src/tables/build/BuildOrderTestTable.tsx +0 -265
- package/src/tables/build/BuildOutputTable.tsx +0 -599
- package/src/tables/company/AddressTable.tsx +0 -211
- package/src/tables/company/CompanyTable.tsx +0 -176
- package/src/tables/company/ContactTable.tsx +0 -182
- package/src/tables/core/UserTable.tsx +0 -88
- package/src/tables/general/AttachmentTable.tsx +0 -404
- package/src/tables/general/BarcodeScanTable.tsx +0 -124
- package/src/tables/general/ExtraLineItemTable.tsx +0 -174
- package/src/tables/machine/MachineListTable.tsx +0 -634
- package/src/tables/machine/MachineTypeTable.tsx +0 -395
- package/src/tables/notifications/NotificationTable.tsx +0 -60
- package/src/tables/part/ParametricPartTable.tsx +0 -297
- package/src/tables/part/PartBuildAllocationsTable.tsx +0 -128
- package/src/tables/part/PartCategoryTable.tsx +0 -208
- package/src/tables/part/PartCategoryTemplateTable.tsx +0 -157
- package/src/tables/part/PartParameterTable.tsx +0 -226
- package/src/tables/part/PartParameterTemplateTable.tsx +0 -168
- package/src/tables/part/PartPurchaseOrdersTable.tsx +0 -163
- package/src/tables/part/PartSalesAllocationsTable.tsx +0 -130
- package/src/tables/part/PartTable.tsx +0 -423
- package/src/tables/part/PartTestTemplateTable.tsx +0 -290
- package/src/tables/part/PartThumbTable.tsx +0 -230
- package/src/tables/part/PartVariantTable.tsx +0 -52
- package/src/tables/part/RelatedPartTable.tsx +0 -182
- package/src/tables/part/SelectionListTable.tsx +0 -134
- package/src/tables/plugin/PluginErrorTable.tsx +0 -58
- package/src/tables/plugin/PluginListTable.tsx +0 -440
- package/src/tables/purchasing/ManufacturerPartParameterTable.tsx +0 -136
- package/src/tables/purchasing/ManufacturerPartTable.tsx +0 -158
- package/src/tables/purchasing/PurchaseOrderLineItemTable.tsx +0 -424
- package/src/tables/purchasing/PurchaseOrderTable.tsx +0 -193
- package/src/tables/purchasing/SupplierPartTable.tsx +0 -281
- package/src/tables/purchasing/SupplierPriceBreakTable.tsx +0 -222
- package/src/tables/sales/ReturnOrderLineItemTable.tsx +0 -271
- package/src/tables/sales/ReturnOrderTable.tsx +0 -201
- package/src/tables/sales/SalesOrderAllocationTable.tsx +0 -330
- package/src/tables/sales/SalesOrderLineItemTable.tsx +0 -508
- package/src/tables/sales/SalesOrderShipmentTable.tsx +0 -225
- package/src/tables/sales/SalesOrderTable.tsx +0 -212
- package/src/tables/settings/ApiTokenTable.tsx +0 -203
- package/src/tables/settings/BarcodeScanHistoryTable.tsx +0 -281
- package/src/tables/settings/CustomStateTable.tsx +0 -226
- package/src/tables/settings/CustomUnitsTable.tsx +0 -125
- package/src/tables/settings/ErrorTable.tsx +0 -170
- package/src/tables/settings/ExportSessionTable.tsx +0 -60
- package/src/tables/settings/FailedTasksTable.tsx +0 -103
- package/src/tables/settings/GroupTable.tsx +0 -240
- package/src/tables/settings/ImportSessionTable.tsx +0 -175
- package/src/tables/settings/PendingTasksTable.tsx +0 -63
- package/src/tables/settings/ProjectCodeTable.tsx +0 -115
- package/src/tables/settings/ScheduledTasksTable.tsx +0 -62
- package/src/tables/settings/StocktakeReportTable.tsx +0 -111
- package/src/tables/settings/TemplateTable.tsx +0 -404
- package/src/tables/settings/UserTable.tsx +0 -329
- package/src/tables/stock/InstalledItemsTable.tsx +0 -146
- package/src/tables/stock/LocationTypesTable.tsx +0 -132
- package/src/tables/stock/StockItemTable.tsx +0 -707
- package/src/tables/stock/StockItemTestResultTable.tsx +0 -487
- package/src/tables/stock/StockLocationTable.tsx +0 -208
- package/src/tables/stock/StockTrackingTable.tsx +0 -244
- package/src/theme.ts +0 -5
- package/src/views/DesktopAppView.tsx +0 -28
- package/src/views/MainView.tsx +0 -38
- package/src/views/MobileAppView.tsx +0 -43
- package/tests/baseFixtures.ts +0 -93
- package/tests/defaults.ts +0 -18
- package/tests/helpers.ts +0 -122
- package/tests/login.ts +0 -97
- package/tests/pages/pui_build.spec.ts +0 -373
- package/tests/pages/pui_company.spec.ts +0 -40
- package/tests/pages/pui_core.spec.ts +0 -26
- package/tests/pages/pui_dashboard.spec.ts +0 -64
- package/tests/pages/pui_part.spec.ts +0 -413
- package/tests/pages/pui_purchase_order.spec.ts +0 -388
- package/tests/pages/pui_sales_order.spec.ts +0 -224
- package/tests/pages/pui_scan.spec.ts +0 -114
- package/tests/pages/pui_stock.spec.ts +0 -259
- package/tests/pui_exporting.spec.ts +0 -124
- package/tests/pui_forms.spec.ts +0 -131
- package/tests/pui_general.spec.ts +0 -60
- package/tests/pui_login.spec.ts +0 -74
- package/tests/pui_modals.spec.ts +0 -144
- package/tests/pui_plugins.spec.ts +0 -216
- package/tests/pui_printing.spec.ts +0 -149
- package/tests/pui_settings.spec.ts +0 -285
- package/tests/pui_tables.spec.ts +0 -65
- package/tests/settings/selectionList.spec.ts +0 -103
- package/tests/settings.ts +0 -54
- package/tsconfig.json +0 -25
- package/tsconfig.lib.json +0 -13
- package/tsconfig.node.json +0 -11
- package/vite-env.d.ts +0 -11
- package/vite.config.ts +0 -98
- package/vite.lib.config.ts +0 -50
- /package/{public → dist}/inventree.svg +0 -0
- /package/{src/functions/events.tsx → lib/functions/Events.tsx} +0 -0
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
import { t } from '@lingui/core/macro';
|
|
2
|
-
import { Badge, Group, Text, Tooltip } from '@mantine/core';
|
|
3
|
-
import { showNotification } from '@mantine/notifications';
|
|
4
|
-
import {
|
|
5
|
-
IconCircleCheck,
|
|
6
|
-
IconCirclePlus,
|
|
7
|
-
IconInfoCircle
|
|
8
|
-
} from '@tabler/icons-react';
|
|
9
|
-
import { useQuery } from '@tanstack/react-query';
|
|
10
|
-
import { DataTable } from 'mantine-datatable';
|
|
11
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
|
-
|
|
13
|
-
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
|
14
|
-
import { UserRoles } from '@lib/enums/Roles';
|
|
15
|
-
import { apiUrl } from '@lib/functions/Api';
|
|
16
|
-
import type { TableFilter } from '@lib/types/Filters';
|
|
17
|
-
import type { ApiFormFieldSet } from '@lib/types/Forms';
|
|
18
|
-
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
|
19
|
-
import { PassFailButton } from '../../components/buttons/YesNoButton';
|
|
20
|
-
import { AttachmentLink } from '../../components/items/AttachmentLink';
|
|
21
|
-
import { RenderUser } from '../../components/render/User';
|
|
22
|
-
import { useApi } from '../../contexts/ApiContext';
|
|
23
|
-
import { formatDate } from '../../defaults/formatters';
|
|
24
|
-
import { useTestResultFields } from '../../forms/StockForms';
|
|
25
|
-
import {
|
|
26
|
-
useCreateApiFormModal,
|
|
27
|
-
useDeleteApiFormModal,
|
|
28
|
-
useEditApiFormModal
|
|
29
|
-
} from '../../hooks/UseForm';
|
|
30
|
-
import { useTable } from '../../hooks/UseTable';
|
|
31
|
-
import { useGlobalSettingsState } from '../../states/SettingsState';
|
|
32
|
-
import { useUserState } from '../../states/UserState';
|
|
33
|
-
import type { TableColumn } from '../Column';
|
|
34
|
-
import { DateColumn, DescriptionColumn, NoteColumn } from '../ColumnRenderers';
|
|
35
|
-
import { InvenTreeTable } from '../InvenTreeTable';
|
|
36
|
-
import {
|
|
37
|
-
type RowAction,
|
|
38
|
-
RowActions,
|
|
39
|
-
RowDeleteAction,
|
|
40
|
-
RowEditAction
|
|
41
|
-
} from '../RowActions';
|
|
42
|
-
|
|
43
|
-
export default function StockItemTestResultTable({
|
|
44
|
-
partId,
|
|
45
|
-
itemId
|
|
46
|
-
}: Readonly<{
|
|
47
|
-
partId: number;
|
|
48
|
-
itemId: number;
|
|
49
|
-
}>) {
|
|
50
|
-
const api = useApi();
|
|
51
|
-
const user = useUserState();
|
|
52
|
-
const table = useTable('stocktests');
|
|
53
|
-
|
|
54
|
-
const globalSettings = useGlobalSettingsState();
|
|
55
|
-
const includeTestStation = useMemo(
|
|
56
|
-
() => globalSettings.isSet('TEST_STATION_DATA'),
|
|
57
|
-
[globalSettings]
|
|
58
|
-
);
|
|
59
|
-
// Fetch the test templates required for this stock item
|
|
60
|
-
const { data: testTemplates } = useQuery({
|
|
61
|
-
queryKey: ['stocktesttemplates', partId, itemId],
|
|
62
|
-
queryFn: async () => {
|
|
63
|
-
if (!partId) {
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return api
|
|
68
|
-
.get(apiUrl(ApiEndpoints.part_test_template_list), {
|
|
69
|
-
params: {
|
|
70
|
-
part: partId,
|
|
71
|
-
include_inherited: true,
|
|
72
|
-
enabled: true
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
.then((response) => response.data)
|
|
76
|
-
.catch((_error) => []);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
table.refreshTable();
|
|
82
|
-
}, [testTemplates]);
|
|
83
|
-
|
|
84
|
-
// Format the test results based on the returned data
|
|
85
|
-
const formatRecords = useCallback(
|
|
86
|
-
(records: any[]): any[] => {
|
|
87
|
-
// Construct a list of test templates
|
|
88
|
-
const results = testTemplates.map((template: any) => {
|
|
89
|
-
return {
|
|
90
|
-
...template,
|
|
91
|
-
templateId: template.pk,
|
|
92
|
-
results: []
|
|
93
|
-
};
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// If any of the tests results point to templates which we do not have, add them in
|
|
97
|
-
records.forEach((record) => {
|
|
98
|
-
if (!results.find((r: any) => r.templateId == record.template)) {
|
|
99
|
-
results.push({
|
|
100
|
-
...record.template_detail,
|
|
101
|
-
templateId: record.template,
|
|
102
|
-
results: []
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// Iterate through the returned records
|
|
108
|
-
// Note that the results are sorted by oldest first,
|
|
109
|
-
// to ensure that the most recent result is displayed "on top"
|
|
110
|
-
records
|
|
111
|
-
.sort((a: any, b: any) => {
|
|
112
|
-
return a.pk > b.pk ? 1 : -1;
|
|
113
|
-
})
|
|
114
|
-
.forEach((record) => {
|
|
115
|
-
// Find matching template
|
|
116
|
-
const idx = results.findIndex(
|
|
117
|
-
(r: any) => r.templateId == record.template
|
|
118
|
-
);
|
|
119
|
-
if (idx >= 0) {
|
|
120
|
-
results[idx] = {
|
|
121
|
-
...results[idx],
|
|
122
|
-
...record
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
results[idx].results.push(record);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
return results;
|
|
130
|
-
},
|
|
131
|
-
[partId, itemId, testTemplates]
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
const tableColumns: TableColumn[] = useMemo(() => {
|
|
135
|
-
return [
|
|
136
|
-
{
|
|
137
|
-
accessor: 'test',
|
|
138
|
-
title: t`Test`,
|
|
139
|
-
switchable: false,
|
|
140
|
-
sortable: true,
|
|
141
|
-
render: (record: any) => {
|
|
142
|
-
const enabled = record.enabled ?? record.template_detail?.enabled;
|
|
143
|
-
const installed =
|
|
144
|
-
record.stock_item != undefined && record.stock_item != itemId;
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<Group justify='space-between' wrap='nowrap'>
|
|
148
|
-
<Text
|
|
149
|
-
style={{ fontStyle: installed ? 'italic' : undefined }}
|
|
150
|
-
c={enabled ? undefined : 'red'}
|
|
151
|
-
>
|
|
152
|
-
{!record.templateId && '- '}
|
|
153
|
-
{record.test_name ?? record.template_detail?.test_name}
|
|
154
|
-
</Text>
|
|
155
|
-
<Group justify='right'>
|
|
156
|
-
{record.results && record.results.length > 1 && (
|
|
157
|
-
<Tooltip label={t`Test Results`}>
|
|
158
|
-
<Badge color='lightblue' variant='filled'>
|
|
159
|
-
{record.results.length}
|
|
160
|
-
</Badge>
|
|
161
|
-
</Tooltip>
|
|
162
|
-
)}
|
|
163
|
-
{installed && (
|
|
164
|
-
<Tooltip label={t`Test result for installed stock item`}>
|
|
165
|
-
<IconInfoCircle size={16} color='blue' />
|
|
166
|
-
</Tooltip>
|
|
167
|
-
)}
|
|
168
|
-
</Group>
|
|
169
|
-
</Group>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
accessor: 'result',
|
|
175
|
-
title: t`Result`,
|
|
176
|
-
switchable: false,
|
|
177
|
-
sortable: true,
|
|
178
|
-
render: (record: any) => {
|
|
179
|
-
if (record.result === undefined) {
|
|
180
|
-
return (
|
|
181
|
-
<Badge color='lightblue' variant='filled'>{t`No Result`}</Badge>
|
|
182
|
-
);
|
|
183
|
-
} else {
|
|
184
|
-
return <PassFailButton value={record.result} />;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
DescriptionColumn({
|
|
189
|
-
accessor: 'description'
|
|
190
|
-
}),
|
|
191
|
-
{
|
|
192
|
-
accessor: 'value',
|
|
193
|
-
title: t`Value`
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
accessor: 'attachment',
|
|
197
|
-
title: t`Attachment`,
|
|
198
|
-
render: (record: any) =>
|
|
199
|
-
record.attachment && (
|
|
200
|
-
<AttachmentLink attachment={record.attachment} />
|
|
201
|
-
),
|
|
202
|
-
noContext: true
|
|
203
|
-
},
|
|
204
|
-
NoteColumn({}),
|
|
205
|
-
DateColumn({}),
|
|
206
|
-
{
|
|
207
|
-
accessor: 'user',
|
|
208
|
-
title: t`User`,
|
|
209
|
-
sortable: false,
|
|
210
|
-
render: (record: any) =>
|
|
211
|
-
record.user_detail && <RenderUser instance={record.user_detail} />
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
accessor: 'test_station',
|
|
215
|
-
sortable: true,
|
|
216
|
-
title: t`Test station`,
|
|
217
|
-
hidden: !includeTestStation
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
accessor: 'started_datetime',
|
|
221
|
-
sortable: true,
|
|
222
|
-
title: t`Started`,
|
|
223
|
-
hidden: !includeTestStation,
|
|
224
|
-
render: (record: any) => {
|
|
225
|
-
return (
|
|
226
|
-
<Group justify='space-between'>
|
|
227
|
-
{formatDate(record.started_datetime, {
|
|
228
|
-
showTime: true,
|
|
229
|
-
showSeconds: true
|
|
230
|
-
})}
|
|
231
|
-
</Group>
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
accessor: 'finished_datetime',
|
|
237
|
-
sortable: true,
|
|
238
|
-
title: t`Finished`,
|
|
239
|
-
hidden: !includeTestStation,
|
|
240
|
-
render: (record: any) => {
|
|
241
|
-
return (
|
|
242
|
-
<Group justify='space-between'>
|
|
243
|
-
{formatDate(record.finished_datetime, {
|
|
244
|
-
showTime: true,
|
|
245
|
-
showSeconds: true
|
|
246
|
-
})}
|
|
247
|
-
</Group>
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
];
|
|
252
|
-
}, [itemId, includeTestStation]);
|
|
253
|
-
|
|
254
|
-
const [selectedTemplate, setSelectedTemplate] = useState<number | undefined>(
|
|
255
|
-
undefined
|
|
256
|
-
);
|
|
257
|
-
|
|
258
|
-
const newResultFields: ApiFormFieldSet = useTestResultFields({
|
|
259
|
-
partId: partId,
|
|
260
|
-
itemId: itemId,
|
|
261
|
-
templateId: selectedTemplate,
|
|
262
|
-
editing: false
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
const editResultFields: ApiFormFieldSet = useTestResultFields({
|
|
266
|
-
partId: partId,
|
|
267
|
-
itemId: itemId,
|
|
268
|
-
templateId: selectedTemplate,
|
|
269
|
-
editing: true
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
const newTestModal = useCreateApiFormModal({
|
|
273
|
-
url: ApiEndpoints.stock_test_result_list,
|
|
274
|
-
fields: useMemo(() => ({ ...newResultFields }), [newResultFields]),
|
|
275
|
-
initialData: {
|
|
276
|
-
template: selectedTemplate,
|
|
277
|
-
result: true
|
|
278
|
-
},
|
|
279
|
-
title: t`Add Test Result`,
|
|
280
|
-
table: table,
|
|
281
|
-
successMessage: t`Test result added`
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
const [selectedTest, setSelectedTest] = useState<number>(0);
|
|
285
|
-
|
|
286
|
-
const editTestModal = useEditApiFormModal({
|
|
287
|
-
url: ApiEndpoints.stock_test_result_list,
|
|
288
|
-
pk: selectedTest,
|
|
289
|
-
fields: useMemo(() => ({ ...editResultFields }), [editResultFields]),
|
|
290
|
-
title: t`Edit Test Result`,
|
|
291
|
-
table: table,
|
|
292
|
-
successMessage: t`Test result updated`
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
const deleteTestModal = useDeleteApiFormModal({
|
|
296
|
-
url: ApiEndpoints.stock_test_result_list,
|
|
297
|
-
pk: selectedTest,
|
|
298
|
-
title: t`Delete Test Result`,
|
|
299
|
-
table: table,
|
|
300
|
-
successMessage: t`Test result deleted`
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
const passTest = useCallback(
|
|
304
|
-
(templateId: number) => {
|
|
305
|
-
api
|
|
306
|
-
.post(apiUrl(ApiEndpoints.stock_test_result_list), {
|
|
307
|
-
template: templateId,
|
|
308
|
-
stock_item: itemId,
|
|
309
|
-
result: true
|
|
310
|
-
})
|
|
311
|
-
.then(() => {
|
|
312
|
-
table.refreshTable();
|
|
313
|
-
showNotification({
|
|
314
|
-
title: t`Test Passed`,
|
|
315
|
-
message: t`Test result has been recorded`,
|
|
316
|
-
color: 'green'
|
|
317
|
-
});
|
|
318
|
-
})
|
|
319
|
-
.catch(() => {
|
|
320
|
-
showNotification({
|
|
321
|
-
title: t`Error`,
|
|
322
|
-
message: t`Failed to record test result`,
|
|
323
|
-
color: 'red'
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
},
|
|
327
|
-
[itemId]
|
|
328
|
-
);
|
|
329
|
-
|
|
330
|
-
const rowActions = useCallback(
|
|
331
|
-
(record: any): RowAction[] => {
|
|
332
|
-
if (record.stock_item != undefined && record.stock_item != itemId) {
|
|
333
|
-
// Test results for other stock items cannot be edited
|
|
334
|
-
return [];
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
return [
|
|
338
|
-
{
|
|
339
|
-
title: t`Pass Test`,
|
|
340
|
-
color: 'green',
|
|
341
|
-
icon: <IconCircleCheck />,
|
|
342
|
-
hidden:
|
|
343
|
-
!record.templateId ||
|
|
344
|
-
record?.requires_attachment ||
|
|
345
|
-
record?.requires_value ||
|
|
346
|
-
record.result,
|
|
347
|
-
onClick: () => passTest(record.templateId)
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
title: t`Add`,
|
|
351
|
-
tooltip: t`Add Test Result`,
|
|
352
|
-
color: 'green',
|
|
353
|
-
icon: <IconCirclePlus />,
|
|
354
|
-
hidden: !user.hasAddRole(UserRoles.stock) || !record.templateId,
|
|
355
|
-
onClick: () => {
|
|
356
|
-
setSelectedTemplate(record.templateId);
|
|
357
|
-
newTestModal.open();
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
RowEditAction({
|
|
361
|
-
tooltip: t`Edit Test Result`,
|
|
362
|
-
hidden:
|
|
363
|
-
!user.hasChangeRole(UserRoles.stock) || !record.template_detail,
|
|
364
|
-
onClick: () => {
|
|
365
|
-
setSelectedTest(record.pk);
|
|
366
|
-
editTestModal.open();
|
|
367
|
-
}
|
|
368
|
-
}),
|
|
369
|
-
RowDeleteAction({
|
|
370
|
-
tooltip: t`Delete Test Result`,
|
|
371
|
-
hidden:
|
|
372
|
-
!user.hasDeleteRole(UserRoles.stock) || !record.template_detail,
|
|
373
|
-
onClick: () => {
|
|
374
|
-
setSelectedTest(record.pk);
|
|
375
|
-
deleteTestModal.open();
|
|
376
|
-
}
|
|
377
|
-
})
|
|
378
|
-
];
|
|
379
|
-
},
|
|
380
|
-
[user, itemId]
|
|
381
|
-
);
|
|
382
|
-
|
|
383
|
-
const tableFilters: TableFilter[] = useMemo(() => {
|
|
384
|
-
return [
|
|
385
|
-
{
|
|
386
|
-
name: 'required',
|
|
387
|
-
label: t`Required`,
|
|
388
|
-
description: t`Show results for required tests`
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
name: 'include_installed',
|
|
392
|
-
label: t`Include Installed`,
|
|
393
|
-
description: t`Show results for installed stock items`
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
name: 'result',
|
|
397
|
-
label: t`Passed`,
|
|
398
|
-
description: t`Show only passed tests`
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
name: 'enabled',
|
|
402
|
-
label: t`Enabled`,
|
|
403
|
-
description: t`Show results for enabled tests`
|
|
404
|
-
}
|
|
405
|
-
];
|
|
406
|
-
}, []);
|
|
407
|
-
|
|
408
|
-
const tableActions = useMemo(() => {
|
|
409
|
-
return [
|
|
410
|
-
<AddItemButton
|
|
411
|
-
key='add-test-result'
|
|
412
|
-
tooltip={t`Add Test Result`}
|
|
413
|
-
onClick={() => {
|
|
414
|
-
setSelectedTemplate(undefined);
|
|
415
|
-
newTestModal.open();
|
|
416
|
-
}}
|
|
417
|
-
hidden={!user.hasAddRole(UserRoles.stock)}
|
|
418
|
-
/>
|
|
419
|
-
];
|
|
420
|
-
}, [user]);
|
|
421
|
-
|
|
422
|
-
// Row expansion controller
|
|
423
|
-
const rowExpansion: any = useMemo(() => {
|
|
424
|
-
const cols: any = [
|
|
425
|
-
...tableColumns,
|
|
426
|
-
{
|
|
427
|
-
accessor: 'actions',
|
|
428
|
-
title: ' ',
|
|
429
|
-
hidden: false,
|
|
430
|
-
switchable: false,
|
|
431
|
-
width: 50,
|
|
432
|
-
render: (record: any) => (
|
|
433
|
-
<RowActions actions={rowActions(record) ?? []} />
|
|
434
|
-
)
|
|
435
|
-
}
|
|
436
|
-
];
|
|
437
|
-
|
|
438
|
-
return {
|
|
439
|
-
allowMultiple: true,
|
|
440
|
-
expandable: (record: any) => record.results && record.results.length > 1,
|
|
441
|
-
content: ({ record }: { record: any }) => {
|
|
442
|
-
if (!record || !record.results || record.results.length < 2) {
|
|
443
|
-
return null;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
const results = record?.results ?? [];
|
|
447
|
-
|
|
448
|
-
return (
|
|
449
|
-
<DataTable
|
|
450
|
-
key={record.pk}
|
|
451
|
-
idAccessor={'test'}
|
|
452
|
-
noHeader
|
|
453
|
-
columns={cols}
|
|
454
|
-
records={results.slice(0, -1)}
|
|
455
|
-
/>
|
|
456
|
-
);
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
}, []);
|
|
460
|
-
|
|
461
|
-
return (
|
|
462
|
-
<>
|
|
463
|
-
{newTestModal.modal}
|
|
464
|
-
{editTestModal.modal}
|
|
465
|
-
{deleteTestModal.modal}
|
|
466
|
-
<InvenTreeTable
|
|
467
|
-
url={apiUrl(ApiEndpoints.stock_test_result_list)}
|
|
468
|
-
tableState={table}
|
|
469
|
-
columns={tableColumns}
|
|
470
|
-
props={{
|
|
471
|
-
dataFormatter: formatRecords,
|
|
472
|
-
enablePagination: false,
|
|
473
|
-
tableActions: tableActions,
|
|
474
|
-
tableFilters: tableFilters,
|
|
475
|
-
rowActions: rowActions,
|
|
476
|
-
rowExpansion: rowExpansion,
|
|
477
|
-
params: {
|
|
478
|
-
stock_item: itemId,
|
|
479
|
-
user_detail: true,
|
|
480
|
-
attachment_detail: true,
|
|
481
|
-
template_detail: true
|
|
482
|
-
}
|
|
483
|
-
}}
|
|
484
|
-
/>
|
|
485
|
-
</>
|
|
486
|
-
);
|
|
487
|
-
}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { t } from '@lingui/core/macro';
|
|
2
|
-
import { Group } from '@mantine/core';
|
|
3
|
-
import { useCallback, useMemo, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
|
6
|
-
import { ModelType } from '@lib/enums/ModelType';
|
|
7
|
-
import { UserRoles } from '@lib/enums/Roles';
|
|
8
|
-
import { apiUrl } from '@lib/functions/Api';
|
|
9
|
-
import type { TableFilter } from '@lib/types/Filters';
|
|
10
|
-
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
|
11
|
-
import { ActionDropdown } from '../../components/items/ActionDropdown';
|
|
12
|
-
import { ApiIcon } from '../../components/items/ApiIcon';
|
|
13
|
-
import { stockLocationFields } from '../../forms/StockForms';
|
|
14
|
-
import { InvenTreeIcon } from '../../functions/icons';
|
|
15
|
-
import {
|
|
16
|
-
useBulkEditApiFormModal,
|
|
17
|
-
useCreateApiFormModal,
|
|
18
|
-
useEditApiFormModal
|
|
19
|
-
} from '../../hooks/UseForm';
|
|
20
|
-
import { useTable } from '../../hooks/UseTable';
|
|
21
|
-
import { useUserState } from '../../states/UserState';
|
|
22
|
-
import type { TableColumn } from '../Column';
|
|
23
|
-
import { BooleanColumn, DescriptionColumn } from '../ColumnRenderers';
|
|
24
|
-
import { InvenTreeTable } from '../InvenTreeTable';
|
|
25
|
-
import { type RowAction, RowEditAction } from '../RowActions';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Stock location table
|
|
29
|
-
*/
|
|
30
|
-
export function StockLocationTable({ parentId }: Readonly<{ parentId?: any }>) {
|
|
31
|
-
const table = useTable('stocklocation');
|
|
32
|
-
const user = useUserState();
|
|
33
|
-
|
|
34
|
-
const tableFilters: TableFilter[] = useMemo(() => {
|
|
35
|
-
return [
|
|
36
|
-
{
|
|
37
|
-
name: 'cascade',
|
|
38
|
-
label: t`Include Sublocations`,
|
|
39
|
-
description: t`Include sublocations in results`
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'structural',
|
|
43
|
-
label: t`Structural`,
|
|
44
|
-
description: t`Show structural locations`
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'external',
|
|
48
|
-
label: t`External`,
|
|
49
|
-
description: t`Show external locations`
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'has_location_type',
|
|
53
|
-
label: t`Has location type`
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'location_type',
|
|
57
|
-
label: t`Location Type`,
|
|
58
|
-
description: t`Filter by location type`,
|
|
59
|
-
apiUrl: apiUrl(ApiEndpoints.stock_location_type_list),
|
|
60
|
-
model: ModelType.stocklocationtype,
|
|
61
|
-
modelRenderer: (instance: any) => instance.name
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
}, []);
|
|
65
|
-
|
|
66
|
-
const tableColumns: TableColumn[] = useMemo(() => {
|
|
67
|
-
return [
|
|
68
|
-
{
|
|
69
|
-
accessor: 'name',
|
|
70
|
-
switchable: false,
|
|
71
|
-
render: (record: any) => (
|
|
72
|
-
<Group gap='xs'>
|
|
73
|
-
{record.icon && <ApiIcon name={record.icon} />}
|
|
74
|
-
{record.name}
|
|
75
|
-
</Group>
|
|
76
|
-
)
|
|
77
|
-
},
|
|
78
|
-
DescriptionColumn({}),
|
|
79
|
-
{
|
|
80
|
-
accessor: 'pathstring',
|
|
81
|
-
sortable: true
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
accessor: 'items',
|
|
85
|
-
sortable: true
|
|
86
|
-
},
|
|
87
|
-
BooleanColumn({
|
|
88
|
-
accessor: 'structural'
|
|
89
|
-
}),
|
|
90
|
-
BooleanColumn({
|
|
91
|
-
accessor: 'external'
|
|
92
|
-
}),
|
|
93
|
-
{
|
|
94
|
-
accessor: 'location_type',
|
|
95
|
-
sortable: false,
|
|
96
|
-
render: (record: any) => record.location_type_detail?.name
|
|
97
|
-
}
|
|
98
|
-
];
|
|
99
|
-
}, []);
|
|
100
|
-
|
|
101
|
-
const newLocation = useCreateApiFormModal({
|
|
102
|
-
url: ApiEndpoints.stock_location_list,
|
|
103
|
-
title: t`Add Stock Location`,
|
|
104
|
-
fields: stockLocationFields(),
|
|
105
|
-
focus: 'name',
|
|
106
|
-
initialData: {
|
|
107
|
-
parent: parentId
|
|
108
|
-
},
|
|
109
|
-
follow: true,
|
|
110
|
-
modelType: ModelType.stocklocation,
|
|
111
|
-
table: table
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
const [selectedLocation, setSelectedLocation] = useState<number>(-1);
|
|
115
|
-
|
|
116
|
-
const editLocation = useEditApiFormModal({
|
|
117
|
-
url: ApiEndpoints.stock_location_list,
|
|
118
|
-
pk: selectedLocation,
|
|
119
|
-
title: t`Edit Stock Location`,
|
|
120
|
-
fields: stockLocationFields(),
|
|
121
|
-
onFormSuccess: (record: any) => table.updateRecord(record)
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const setParent = useBulkEditApiFormModal({
|
|
125
|
-
url: ApiEndpoints.stock_location_list,
|
|
126
|
-
items: table.selectedIds,
|
|
127
|
-
title: t`Set Parent Location`,
|
|
128
|
-
fields: {
|
|
129
|
-
parent: {}
|
|
130
|
-
},
|
|
131
|
-
onFormSuccess: table.refreshTable
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
const tableActions = useMemo(() => {
|
|
135
|
-
const can_add = user.hasAddRole(UserRoles.stock_location);
|
|
136
|
-
const can_edit = user.hasChangeRole(UserRoles.stock_location);
|
|
137
|
-
|
|
138
|
-
return [
|
|
139
|
-
<ActionDropdown
|
|
140
|
-
tooltip={t`Location Actions`}
|
|
141
|
-
icon={<InvenTreeIcon icon='location' />}
|
|
142
|
-
disabled={!table.hasSelectedRecords}
|
|
143
|
-
actions={[
|
|
144
|
-
{
|
|
145
|
-
name: t`Set Parent`,
|
|
146
|
-
icon: <InvenTreeIcon icon='location' />,
|
|
147
|
-
tooltip: t`Set parent location for the selected items`,
|
|
148
|
-
hidden: !can_edit,
|
|
149
|
-
disabled: !table.hasSelectedRecords,
|
|
150
|
-
onClick: () => {
|
|
151
|
-
setParent.open();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
]}
|
|
155
|
-
/>,
|
|
156
|
-
<AddItemButton
|
|
157
|
-
key='add-stock-location'
|
|
158
|
-
tooltip={t`Add Stock Location`}
|
|
159
|
-
onClick={() => newLocation.open()}
|
|
160
|
-
hidden={!can_add}
|
|
161
|
-
/>
|
|
162
|
-
];
|
|
163
|
-
}, [user, table.hasSelectedRecords]);
|
|
164
|
-
|
|
165
|
-
const rowActions = useCallback(
|
|
166
|
-
(record: any): RowAction[] => {
|
|
167
|
-
const can_edit = user.hasChangeRole(UserRoles.stock_location);
|
|
168
|
-
|
|
169
|
-
return [
|
|
170
|
-
RowEditAction({
|
|
171
|
-
hidden: !can_edit,
|
|
172
|
-
onClick: () => {
|
|
173
|
-
setSelectedLocation(record.pk);
|
|
174
|
-
editLocation.open();
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
];
|
|
178
|
-
},
|
|
179
|
-
[user]
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
return (
|
|
183
|
-
<>
|
|
184
|
-
{newLocation.modal}
|
|
185
|
-
{editLocation.modal}
|
|
186
|
-
{setParent.modal}
|
|
187
|
-
<InvenTreeTable
|
|
188
|
-
url={apiUrl(ApiEndpoints.stock_location_list)}
|
|
189
|
-
tableState={table}
|
|
190
|
-
columns={tableColumns}
|
|
191
|
-
props={{
|
|
192
|
-
enableSelection: true,
|
|
193
|
-
enableDownload: true,
|
|
194
|
-
enableLabels: true,
|
|
195
|
-
enableReports: true,
|
|
196
|
-
params: {
|
|
197
|
-
parent: parentId,
|
|
198
|
-
top_level: parentId === undefined ? true : undefined
|
|
199
|
-
},
|
|
200
|
-
tableFilters: tableFilters,
|
|
201
|
-
tableActions: tableActions,
|
|
202
|
-
rowActions: rowActions,
|
|
203
|
-
modelType: ModelType.stocklocation
|
|
204
|
-
}}
|
|
205
|
-
/>
|
|
206
|
-
</>
|
|
207
|
-
);
|
|
208
|
-
}
|