@inventreedb/ui 0.0.1 → 0.0.2
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 +7 -0
- package/LICENSE +21 -0
- package/dist/.vite/manifest.json +43 -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/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/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 +6 -0
- package/dist/index.js +13 -0
- package/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/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/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/ModelType.tsx +0 -293
- 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/events.tsx +0 -6
- 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
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { t } from '@lingui/core/macro';
|
|
2
|
-
import { IconTruckDelivery } from '@tabler/icons-react';
|
|
3
|
-
import { useCallback, useMemo, useState } from 'react';
|
|
4
|
-
import { useNavigate } from 'react-router-dom';
|
|
5
|
-
|
|
6
|
-
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
|
7
|
-
import { ModelType } from '@lib/enums/ModelType';
|
|
8
|
-
import { UserRoles } from '@lib/enums/Roles';
|
|
9
|
-
import { apiUrl } from '@lib/functions/Api';
|
|
10
|
-
import type { TableFilter } from '@lib/types/Filters';
|
|
11
|
-
import dayjs from 'dayjs';
|
|
12
|
-
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
|
13
|
-
import { YesNoButton } from '../../components/buttons/YesNoButton';
|
|
14
|
-
import {
|
|
15
|
-
useSalesOrderShipmentCompleteFields,
|
|
16
|
-
useSalesOrderShipmentFields
|
|
17
|
-
} from '../../forms/SalesOrderForms';
|
|
18
|
-
import {
|
|
19
|
-
useCreateApiFormModal,
|
|
20
|
-
useDeleteApiFormModal,
|
|
21
|
-
useEditApiFormModal
|
|
22
|
-
} from '../../hooks/UseForm';
|
|
23
|
-
import { useTable } from '../../hooks/UseTable';
|
|
24
|
-
import { useUserState } from '../../states/UserState';
|
|
25
|
-
import type { TableColumn } from '../Column';
|
|
26
|
-
import { DateColumn, LinkColumn } from '../ColumnRenderers';
|
|
27
|
-
import { InvenTreeTable } from '../InvenTreeTable';
|
|
28
|
-
import {
|
|
29
|
-
type RowAction,
|
|
30
|
-
RowCancelAction,
|
|
31
|
-
RowEditAction,
|
|
32
|
-
RowViewAction
|
|
33
|
-
} from '../RowActions';
|
|
34
|
-
|
|
35
|
-
export default function SalesOrderShipmentTable({
|
|
36
|
-
orderId
|
|
37
|
-
}: Readonly<{
|
|
38
|
-
orderId: number;
|
|
39
|
-
}>) {
|
|
40
|
-
const user = useUserState();
|
|
41
|
-
const navigate = useNavigate();
|
|
42
|
-
const table = useTable('sales-order-shipment');
|
|
43
|
-
|
|
44
|
-
const [selectedShipment, setSelectedShipment] = useState<any>({});
|
|
45
|
-
|
|
46
|
-
const newShipmentFields = useSalesOrderShipmentFields({});
|
|
47
|
-
|
|
48
|
-
const editShipmentFields = useSalesOrderShipmentFields({});
|
|
49
|
-
|
|
50
|
-
const completeShipmentFields = useSalesOrderShipmentCompleteFields({});
|
|
51
|
-
|
|
52
|
-
const newShipment = useCreateApiFormModal({
|
|
53
|
-
url: ApiEndpoints.sales_order_shipment_list,
|
|
54
|
-
fields: newShipmentFields,
|
|
55
|
-
title: t`Create Shipment`,
|
|
56
|
-
table: table,
|
|
57
|
-
initialData: {
|
|
58
|
-
order: orderId
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const deleteShipment = useDeleteApiFormModal({
|
|
63
|
-
url: ApiEndpoints.sales_order_shipment_list,
|
|
64
|
-
pk: selectedShipment.pk,
|
|
65
|
-
title: t`Cancel Shipment`,
|
|
66
|
-
table: table
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const editShipment = useEditApiFormModal({
|
|
70
|
-
url: ApiEndpoints.sales_order_shipment_list,
|
|
71
|
-
pk: selectedShipment.pk,
|
|
72
|
-
fields: editShipmentFields,
|
|
73
|
-
title: t`Edit Shipment`,
|
|
74
|
-
table: table
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const completeShipment = useCreateApiFormModal({
|
|
78
|
-
url: ApiEndpoints.sales_order_shipment_complete,
|
|
79
|
-
pk: selectedShipment.pk,
|
|
80
|
-
fields: completeShipmentFields,
|
|
81
|
-
title: t`Complete Shipment`,
|
|
82
|
-
table: table,
|
|
83
|
-
focus: 'tracking_number',
|
|
84
|
-
initialData: {
|
|
85
|
-
...selectedShipment,
|
|
86
|
-
shipment_date: dayjs().format('YYYY-MM-DD')
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const tableColumns: TableColumn[] = useMemo(() => {
|
|
91
|
-
return [
|
|
92
|
-
{
|
|
93
|
-
accessor: 'reference',
|
|
94
|
-
title: t`Shipment Reference`,
|
|
95
|
-
switchable: false,
|
|
96
|
-
sortable: true
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
accessor: 'allocated_items',
|
|
100
|
-
sortable: true,
|
|
101
|
-
switchable: false,
|
|
102
|
-
title: t`Items`
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
accessor: 'shipped',
|
|
106
|
-
title: t`Shipped`,
|
|
107
|
-
switchable: true,
|
|
108
|
-
sortable: false,
|
|
109
|
-
render: (record: any) => <YesNoButton value={!!record.shipment_date} />
|
|
110
|
-
},
|
|
111
|
-
DateColumn({
|
|
112
|
-
accessor: 'shipment_date',
|
|
113
|
-
title: t`Shipment Date`
|
|
114
|
-
}),
|
|
115
|
-
DateColumn({
|
|
116
|
-
accessor: 'delivery_date',
|
|
117
|
-
title: t`Delivery Date`
|
|
118
|
-
}),
|
|
119
|
-
{
|
|
120
|
-
accessor: 'tracking_number'
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
accessor: 'invoice_number'
|
|
124
|
-
},
|
|
125
|
-
LinkColumn({
|
|
126
|
-
accessor: 'link'
|
|
127
|
-
})
|
|
128
|
-
];
|
|
129
|
-
}, []);
|
|
130
|
-
|
|
131
|
-
const rowActions = useCallback(
|
|
132
|
-
(record: any): RowAction[] => {
|
|
133
|
-
const shipped: boolean = !!record.shipment_date;
|
|
134
|
-
|
|
135
|
-
return [
|
|
136
|
-
RowViewAction({
|
|
137
|
-
title: t`View Shipment`,
|
|
138
|
-
modelType: ModelType.salesordershipment,
|
|
139
|
-
modelId: record.pk,
|
|
140
|
-
navigate: navigate
|
|
141
|
-
}),
|
|
142
|
-
{
|
|
143
|
-
hidden: shipped || !user.hasChangeRole(UserRoles.sales_order),
|
|
144
|
-
title: t`Complete Shipment`,
|
|
145
|
-
color: 'green',
|
|
146
|
-
icon: <IconTruckDelivery />,
|
|
147
|
-
onClick: () => {
|
|
148
|
-
setSelectedShipment(record);
|
|
149
|
-
completeShipment.open();
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
RowEditAction({
|
|
153
|
-
hidden: !user.hasChangeRole(UserRoles.sales_order),
|
|
154
|
-
tooltip: t`Edit shipment`,
|
|
155
|
-
onClick: () => {
|
|
156
|
-
setSelectedShipment(record);
|
|
157
|
-
editShipment.open();
|
|
158
|
-
}
|
|
159
|
-
}),
|
|
160
|
-
RowCancelAction({
|
|
161
|
-
hidden: shipped || !user.hasDeleteRole(UserRoles.sales_order),
|
|
162
|
-
tooltip: t`Cancel shipment`,
|
|
163
|
-
onClick: () => {
|
|
164
|
-
setSelectedShipment(record);
|
|
165
|
-
deleteShipment.open();
|
|
166
|
-
}
|
|
167
|
-
})
|
|
168
|
-
];
|
|
169
|
-
},
|
|
170
|
-
[user]
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
const tableActions = useMemo(() => {
|
|
174
|
-
return [
|
|
175
|
-
<AddItemButton
|
|
176
|
-
key='add-shipment'
|
|
177
|
-
tooltip={t`Add shipment`}
|
|
178
|
-
hidden={!user.hasAddRole(UserRoles.sales_order)}
|
|
179
|
-
onClick={() => {
|
|
180
|
-
newShipment.open();
|
|
181
|
-
}}
|
|
182
|
-
/>
|
|
183
|
-
];
|
|
184
|
-
}, [user]);
|
|
185
|
-
|
|
186
|
-
const tableFilters: TableFilter[] = useMemo(() => {
|
|
187
|
-
return [
|
|
188
|
-
{
|
|
189
|
-
name: 'shipped',
|
|
190
|
-
label: t`Shipped`,
|
|
191
|
-
description: t`Show shipments which have been shipped`
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: 'delivered',
|
|
195
|
-
label: t`Delivered`,
|
|
196
|
-
description: t`Show shipments which have been delivered`
|
|
197
|
-
}
|
|
198
|
-
];
|
|
199
|
-
}, []);
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<>
|
|
203
|
-
{newShipment.modal}
|
|
204
|
-
{editShipment.modal}
|
|
205
|
-
{deleteShipment.modal}
|
|
206
|
-
{completeShipment.modal}
|
|
207
|
-
<InvenTreeTable
|
|
208
|
-
url={apiUrl(ApiEndpoints.sales_order_shipment_list)}
|
|
209
|
-
tableState={table}
|
|
210
|
-
columns={tableColumns}
|
|
211
|
-
props={{
|
|
212
|
-
tableActions: tableActions,
|
|
213
|
-
tableFilters: tableFilters,
|
|
214
|
-
modelType: ModelType.salesordershipment,
|
|
215
|
-
enableSelection: true,
|
|
216
|
-
enableReports: true,
|
|
217
|
-
rowActions: rowActions,
|
|
218
|
-
params: {
|
|
219
|
-
order: orderId
|
|
220
|
-
}
|
|
221
|
-
}}
|
|
222
|
-
/>
|
|
223
|
-
</>
|
|
224
|
-
);
|
|
225
|
-
}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { t } from '@lingui/core/macro';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
|
|
4
|
-
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
|
5
|
-
import { ModelType } from '@lib/enums/ModelType';
|
|
6
|
-
import { UserRoles } from '@lib/enums/Roles';
|
|
7
|
-
import { apiUrl } from '@lib/functions/Api';
|
|
8
|
-
import type { TableFilter } from '@lib/types/Filters';
|
|
9
|
-
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
|
10
|
-
import { Thumbnail } from '../../components/images/Thumbnail';
|
|
11
|
-
import { ProgressBar } from '../../components/items/ProgressBar';
|
|
12
|
-
import { formatCurrency } from '../../defaults/formatters';
|
|
13
|
-
import { useSalesOrderFields } from '../../forms/SalesOrderForms';
|
|
14
|
-
import { useCreateApiFormModal } from '../../hooks/UseForm';
|
|
15
|
-
import { useTable } from '../../hooks/UseTable';
|
|
16
|
-
import { useUserState } from '../../states/UserState';
|
|
17
|
-
import {
|
|
18
|
-
CreatedByColumn,
|
|
19
|
-
CreationDateColumn,
|
|
20
|
-
DescriptionColumn,
|
|
21
|
-
LineItemsProgressColumn,
|
|
22
|
-
ProjectCodeColumn,
|
|
23
|
-
ReferenceColumn,
|
|
24
|
-
ResponsibleColumn,
|
|
25
|
-
ShipmentDateColumn,
|
|
26
|
-
StartDateColumn,
|
|
27
|
-
StatusColumn,
|
|
28
|
-
TargetDateColumn
|
|
29
|
-
} from '../ColumnRenderers';
|
|
30
|
-
import {
|
|
31
|
-
AssignedToMeFilter,
|
|
32
|
-
CompletedAfterFilter,
|
|
33
|
-
CompletedBeforeFilter,
|
|
34
|
-
CreatedAfterFilter,
|
|
35
|
-
CreatedBeforeFilter,
|
|
36
|
-
CreatedByFilter,
|
|
37
|
-
HasProjectCodeFilter,
|
|
38
|
-
MaxDateFilter,
|
|
39
|
-
MinDateFilter,
|
|
40
|
-
OrderStatusFilter,
|
|
41
|
-
OutstandingFilter,
|
|
42
|
-
OverdueFilter,
|
|
43
|
-
ProjectCodeFilter,
|
|
44
|
-
ResponsibleFilter,
|
|
45
|
-
StartDateAfterFilter,
|
|
46
|
-
StartDateBeforeFilter,
|
|
47
|
-
TargetDateAfterFilter,
|
|
48
|
-
TargetDateBeforeFilter
|
|
49
|
-
} from '../Filter';
|
|
50
|
-
import { InvenTreeTable } from '../InvenTreeTable';
|
|
51
|
-
|
|
52
|
-
export function SalesOrderTable({
|
|
53
|
-
partId,
|
|
54
|
-
customerId
|
|
55
|
-
}: Readonly<{
|
|
56
|
-
partId?: number;
|
|
57
|
-
customerId?: number;
|
|
58
|
-
}>) {
|
|
59
|
-
const table = useTable(!!partId ? 'salesorder-part' : 'salesorder-index');
|
|
60
|
-
const user = useUserState();
|
|
61
|
-
|
|
62
|
-
const tableFilters: TableFilter[] = useMemo(() => {
|
|
63
|
-
const filters: TableFilter[] = [
|
|
64
|
-
OrderStatusFilter({ model: ModelType.salesorder }),
|
|
65
|
-
OutstandingFilter(),
|
|
66
|
-
OverdueFilter(),
|
|
67
|
-
AssignedToMeFilter(),
|
|
68
|
-
MinDateFilter(),
|
|
69
|
-
MaxDateFilter(),
|
|
70
|
-
CreatedBeforeFilter(),
|
|
71
|
-
CreatedAfterFilter(),
|
|
72
|
-
TargetDateBeforeFilter(),
|
|
73
|
-
TargetDateAfterFilter(),
|
|
74
|
-
StartDateBeforeFilter(),
|
|
75
|
-
StartDateAfterFilter(),
|
|
76
|
-
{
|
|
77
|
-
name: 'has_target_date',
|
|
78
|
-
type: 'boolean',
|
|
79
|
-
label: t`Has Target Date`,
|
|
80
|
-
description: t`Show orders with a target date`
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'has_start_date',
|
|
84
|
-
type: 'boolean',
|
|
85
|
-
label: t`Has Start Date`,
|
|
86
|
-
description: t`Show orders with a start date`
|
|
87
|
-
},
|
|
88
|
-
CompletedBeforeFilter(),
|
|
89
|
-
CompletedAfterFilter(),
|
|
90
|
-
HasProjectCodeFilter(),
|
|
91
|
-
ProjectCodeFilter(),
|
|
92
|
-
ResponsibleFilter(),
|
|
93
|
-
CreatedByFilter()
|
|
94
|
-
];
|
|
95
|
-
|
|
96
|
-
if (!!partId) {
|
|
97
|
-
filters.push({
|
|
98
|
-
name: 'include_variants',
|
|
99
|
-
type: 'boolean',
|
|
100
|
-
label: t`Include Variants`,
|
|
101
|
-
description: t`Include orders for part variants`
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return filters;
|
|
106
|
-
}, [partId]);
|
|
107
|
-
|
|
108
|
-
const salesOrderFields = useSalesOrderFields({});
|
|
109
|
-
|
|
110
|
-
const newSalesOrder = useCreateApiFormModal({
|
|
111
|
-
url: ApiEndpoints.sales_order_list,
|
|
112
|
-
title: t`Add Sales Order`,
|
|
113
|
-
fields: salesOrderFields,
|
|
114
|
-
initialData: {
|
|
115
|
-
customer: customerId
|
|
116
|
-
},
|
|
117
|
-
follow: true,
|
|
118
|
-
modelType: ModelType.salesorder
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const tableActions = useMemo(() => {
|
|
122
|
-
return [
|
|
123
|
-
<AddItemButton
|
|
124
|
-
key='add-sales-order'
|
|
125
|
-
tooltip={t`Add Sales Order`}
|
|
126
|
-
onClick={() => newSalesOrder.open()}
|
|
127
|
-
hidden={!user.hasAddRole(UserRoles.sales_order)}
|
|
128
|
-
/>
|
|
129
|
-
];
|
|
130
|
-
}, [user]);
|
|
131
|
-
|
|
132
|
-
const tableColumns = useMemo(() => {
|
|
133
|
-
return [
|
|
134
|
-
ReferenceColumn({}),
|
|
135
|
-
{
|
|
136
|
-
accessor: 'customer__name',
|
|
137
|
-
title: t`Customer`,
|
|
138
|
-
sortable: true,
|
|
139
|
-
render: (record: any) => {
|
|
140
|
-
const customer = record.customer_detail ?? {};
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
<Thumbnail
|
|
144
|
-
src={customer?.image}
|
|
145
|
-
alt={customer.name}
|
|
146
|
-
text={customer.name}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
accessor: 'customer_reference',
|
|
153
|
-
title: t`Customer Reference`
|
|
154
|
-
},
|
|
155
|
-
DescriptionColumn({}),
|
|
156
|
-
LineItemsProgressColumn(),
|
|
157
|
-
{
|
|
158
|
-
accessor: 'shipments_count',
|
|
159
|
-
title: t`Shipments`,
|
|
160
|
-
render: (record: any) => (
|
|
161
|
-
<ProgressBar
|
|
162
|
-
progressLabel
|
|
163
|
-
value={record.completed_shipments_count}
|
|
164
|
-
maximum={record.shipments_count}
|
|
165
|
-
/>
|
|
166
|
-
)
|
|
167
|
-
},
|
|
168
|
-
StatusColumn({ model: ModelType.salesorder }),
|
|
169
|
-
ProjectCodeColumn({}),
|
|
170
|
-
CreationDateColumn({}),
|
|
171
|
-
CreatedByColumn({}),
|
|
172
|
-
StartDateColumn({}),
|
|
173
|
-
TargetDateColumn({}),
|
|
174
|
-
ShipmentDateColumn({}),
|
|
175
|
-
ResponsibleColumn({}),
|
|
176
|
-
{
|
|
177
|
-
accessor: 'total_price',
|
|
178
|
-
title: t`Total Price`,
|
|
179
|
-
sortable: true,
|
|
180
|
-
render: (record: any) => {
|
|
181
|
-
return formatCurrency(record.total_price, {
|
|
182
|
-
currency: record.order_currency || record.customer_detail?.currency
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
];
|
|
187
|
-
}, []);
|
|
188
|
-
|
|
189
|
-
return (
|
|
190
|
-
<>
|
|
191
|
-
{newSalesOrder.modal}
|
|
192
|
-
<InvenTreeTable
|
|
193
|
-
url={apiUrl(ApiEndpoints.sales_order_list)}
|
|
194
|
-
tableState={table}
|
|
195
|
-
columns={tableColumns}
|
|
196
|
-
props={{
|
|
197
|
-
params: {
|
|
198
|
-
customer_detail: true,
|
|
199
|
-
part: partId,
|
|
200
|
-
customer: customerId
|
|
201
|
-
},
|
|
202
|
-
tableFilters: tableFilters,
|
|
203
|
-
tableActions: tableActions,
|
|
204
|
-
modelType: ModelType.salesorder,
|
|
205
|
-
enableSelection: true,
|
|
206
|
-
enableDownload: true,
|
|
207
|
-
enableReports: true
|
|
208
|
-
}}
|
|
209
|
-
/>
|
|
210
|
-
</>
|
|
211
|
-
);
|
|
212
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
|
2
|
-
import { apiUrl } from '@lib/functions/Api';
|
|
3
|
-
import type { TableFilter } from '@lib/types/Filters';
|
|
4
|
-
import { t } from '@lingui/core/macro';
|
|
5
|
-
import { Trans } from '@lingui/react/macro';
|
|
6
|
-
import { Badge, Code, Flex, Modal, Text } from '@mantine/core';
|
|
7
|
-
import { useDisclosure } from '@mantine/hooks';
|
|
8
|
-
import { IconCircleX } from '@tabler/icons-react';
|
|
9
|
-
import { useCallback, useMemo, useState } from 'react';
|
|
10
|
-
import { api } from '../../App';
|
|
11
|
-
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
|
12
|
-
import { CopyButton } from '../../components/buttons/CopyButton';
|
|
13
|
-
import { StylishText } from '../../components/items/StylishText';
|
|
14
|
-
import { showApiErrorMessage } from '../../functions/notifications';
|
|
15
|
-
import { useCreateApiFormModal } from '../../hooks/UseForm';
|
|
16
|
-
import { useTable } from '../../hooks/UseTable';
|
|
17
|
-
import type { RowAction } from '../../tables/RowActions';
|
|
18
|
-
import { BooleanColumn } from '../ColumnRenderers';
|
|
19
|
-
import { UserFilter } from '../Filter';
|
|
20
|
-
import { InvenTreeTable } from '../InvenTreeTable';
|
|
21
|
-
|
|
22
|
-
export function ApiTokenTable({
|
|
23
|
-
only_myself = true
|
|
24
|
-
}: Readonly<{ only_myself: boolean }>) {
|
|
25
|
-
const [token, setToken] = useState<string>('');
|
|
26
|
-
const [opened, { open, close }] = useDisclosure(false);
|
|
27
|
-
|
|
28
|
-
const generateToken = useCreateApiFormModal({
|
|
29
|
-
url: ApiEndpoints.user_tokens,
|
|
30
|
-
title: t`Generate Token`,
|
|
31
|
-
fields: { name: {} },
|
|
32
|
-
successMessage: t`Token generated`,
|
|
33
|
-
onFormSuccess: (data: any) => {
|
|
34
|
-
setToken(data.token);
|
|
35
|
-
open();
|
|
36
|
-
table.refreshTable();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const tableActions = useMemo(() => {
|
|
40
|
-
if (only_myself)
|
|
41
|
-
return [
|
|
42
|
-
<AddItemButton
|
|
43
|
-
key={'generate'}
|
|
44
|
-
tooltip={t`Generate Token`}
|
|
45
|
-
onClick={() => generateToken.open()}
|
|
46
|
-
/>
|
|
47
|
-
];
|
|
48
|
-
return [];
|
|
49
|
-
}, [only_myself]);
|
|
50
|
-
|
|
51
|
-
const table = useTable('api-tokens', 'id');
|
|
52
|
-
|
|
53
|
-
const tableColumns = useMemo(() => {
|
|
54
|
-
const cols = [
|
|
55
|
-
{
|
|
56
|
-
accessor: 'name',
|
|
57
|
-
title: t`Name`,
|
|
58
|
-
sortable: true
|
|
59
|
-
},
|
|
60
|
-
BooleanColumn({
|
|
61
|
-
accessor: 'active',
|
|
62
|
-
title: t`Active`,
|
|
63
|
-
sortable: false
|
|
64
|
-
}),
|
|
65
|
-
BooleanColumn({
|
|
66
|
-
accessor: 'revoked',
|
|
67
|
-
title: t`Revoked`
|
|
68
|
-
}),
|
|
69
|
-
{
|
|
70
|
-
accessor: 'token',
|
|
71
|
-
title: t`Token`,
|
|
72
|
-
render: (record: any) => {
|
|
73
|
-
return (
|
|
74
|
-
<>
|
|
75
|
-
{record.token}{' '}
|
|
76
|
-
{record.in_use ? (
|
|
77
|
-
<Badge color='green'>
|
|
78
|
-
<Trans>In Use</Trans>
|
|
79
|
-
</Badge>
|
|
80
|
-
) : null}
|
|
81
|
-
</>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
accessor: 'last_seen',
|
|
87
|
-
title: t`Last Seen`,
|
|
88
|
-
sortable: true
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
accessor: 'expiry',
|
|
92
|
-
title: t`Expiry`,
|
|
93
|
-
sortable: true
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
accessor: 'created',
|
|
97
|
-
title: t`Created`,
|
|
98
|
-
sortable: true
|
|
99
|
-
}
|
|
100
|
-
];
|
|
101
|
-
if (!only_myself) {
|
|
102
|
-
cols.push({ accessor: 'user', title: t`User`, sortable: true });
|
|
103
|
-
}
|
|
104
|
-
return cols;
|
|
105
|
-
}, [only_myself]);
|
|
106
|
-
|
|
107
|
-
const tableFilters: TableFilter[] = useMemo(() => {
|
|
108
|
-
const filters: TableFilter[] = [
|
|
109
|
-
{
|
|
110
|
-
name: 'revoked',
|
|
111
|
-
label: t`Revoked`,
|
|
112
|
-
description: t`Show revoked tokens`
|
|
113
|
-
}
|
|
114
|
-
];
|
|
115
|
-
|
|
116
|
-
if (!only_myself) {
|
|
117
|
-
filters.push(
|
|
118
|
-
UserFilter({
|
|
119
|
-
name: 'user',
|
|
120
|
-
label: t`User`,
|
|
121
|
-
description: t`Filter by user`
|
|
122
|
-
})
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
return filters;
|
|
126
|
-
}, [only_myself]);
|
|
127
|
-
|
|
128
|
-
const rowActions = useCallback((record: any): RowAction[] => {
|
|
129
|
-
return [
|
|
130
|
-
{
|
|
131
|
-
title: t`Revoke`,
|
|
132
|
-
color: 'red',
|
|
133
|
-
hidden: !record.active || record.in_use,
|
|
134
|
-
icon: <IconCircleX />,
|
|
135
|
-
onClick: () => {
|
|
136
|
-
revokeToken(record.id);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
];
|
|
140
|
-
}, []);
|
|
141
|
-
|
|
142
|
-
const revokeToken = async (id: string) => {
|
|
143
|
-
let targetUrl = apiUrl(ApiEndpoints.user_tokens, id);
|
|
144
|
-
if (!only_myself) {
|
|
145
|
-
targetUrl += '?all_users=true';
|
|
146
|
-
}
|
|
147
|
-
api
|
|
148
|
-
.delete(targetUrl)
|
|
149
|
-
.then(() => {
|
|
150
|
-
table.refreshTable();
|
|
151
|
-
})
|
|
152
|
-
.catch((error) => {
|
|
153
|
-
showApiErrorMessage({
|
|
154
|
-
error: error,
|
|
155
|
-
title: t`Error revoking token`
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
const urlParams = useMemo(() => {
|
|
161
|
-
if (only_myself) return {};
|
|
162
|
-
return { all_users: true };
|
|
163
|
-
}, [only_myself]);
|
|
164
|
-
|
|
165
|
-
return (
|
|
166
|
-
<>
|
|
167
|
-
{only_myself && (
|
|
168
|
-
<>
|
|
169
|
-
{generateToken.modal}
|
|
170
|
-
<Modal
|
|
171
|
-
opened={opened}
|
|
172
|
-
onClose={close}
|
|
173
|
-
title={<StylishText size='xl'>{t`Token`}</StylishText>}
|
|
174
|
-
centered
|
|
175
|
-
>
|
|
176
|
-
<Text c='dimmed'>
|
|
177
|
-
<Trans>
|
|
178
|
-
Tokens are only shown once - make sure to note it down.
|
|
179
|
-
</Trans>
|
|
180
|
-
</Text>
|
|
181
|
-
<Flex>
|
|
182
|
-
<Code>{token}</Code>
|
|
183
|
-
<CopyButton value={token} />
|
|
184
|
-
</Flex>
|
|
185
|
-
</Modal>
|
|
186
|
-
</>
|
|
187
|
-
)}
|
|
188
|
-
<InvenTreeTable
|
|
189
|
-
tableState={table}
|
|
190
|
-
url={apiUrl(ApiEndpoints.user_tokens)}
|
|
191
|
-
columns={tableColumns}
|
|
192
|
-
props={{
|
|
193
|
-
params: urlParams,
|
|
194
|
-
rowActions: rowActions,
|
|
195
|
-
enableSearch: false,
|
|
196
|
-
enableColumnSwitching: false,
|
|
197
|
-
tableActions: tableActions,
|
|
198
|
-
tableFilters: tableFilters
|
|
199
|
-
}}
|
|
200
|
-
/>
|
|
201
|
-
</>
|
|
202
|
-
);
|
|
203
|
-
}
|