mirror of
https://github.com/inventree/InvenTree.git
synced 2026-06-09 18:34:26 +00:00
Merge branch 'master' of https://github.com/inventree/InvenTree into dependabot/pip/docs/gitpython-3.1.50
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -6,8 +6,6 @@ from django.db import migrations, models
|
||||
def add_integer_line_number(apps, schema_editor):
|
||||
"""Add integer line numbers to existing line items."""
|
||||
|
||||
print("\nUpdating line items to add integer line numbers:")
|
||||
|
||||
for model in [
|
||||
apps.get_model('order', 'PurchaseOrderLineItem'),
|
||||
apps.get_model('order', 'ReturnOrderLineItem'),
|
||||
@@ -27,7 +25,7 @@ def add_integer_line_number(apps, schema_editor):
|
||||
pass
|
||||
|
||||
if len(items) > 0:
|
||||
print(f"- Updating {len(items)} items for model {model._meta.model_name}")
|
||||
print(f"- Updating {len(items)} line items for model {model._meta.model_name}")
|
||||
model.objects.bulk_update(items, ['line_int'], batch_size=250)
|
||||
|
||||
|
||||
|
||||
@@ -29,3 +29,6 @@ dist-ssr
|
||||
/playwright/.cache/
|
||||
/.nyc_output/
|
||||
/coverage/
|
||||
|
||||
# Report generation
|
||||
stats.html
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { IconCode } from '@tabler/icons-react';
|
||||
|
||||
import { lazy } from 'react';
|
||||
import type { Editor } from '../TemplateEditor';
|
||||
import { CodeEditorComponent } from './CodeEditor';
|
||||
|
||||
const CodeEditorComponent = lazy(() =>
|
||||
import('./CodeEditor').then((module) => ({
|
||||
default: module.CodeEditorComponent
|
||||
}))
|
||||
);
|
||||
|
||||
export const CodeEditor: Editor = {
|
||||
key: 'code',
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { IconFileTypePdf } from '@tabler/icons-react';
|
||||
|
||||
import { lazy } from 'react';
|
||||
import type { PreviewArea } from '../TemplateEditor';
|
||||
import { PdfPreviewComponent } from './PdfPreview';
|
||||
|
||||
const PdfPreviewComponent = lazy(() =>
|
||||
import('./PdfPreview').then((module) => ({
|
||||
default: module.PdfPreviewComponent
|
||||
}))
|
||||
);
|
||||
|
||||
export const PdfPreview: PreviewArea = {
|
||||
key: 'pdf-preview',
|
||||
|
||||
@@ -3,10 +3,12 @@ import { Skeleton } from '@mantine/core';
|
||||
import { IconNotes } from '@tabler/icons-react';
|
||||
|
||||
import type { ModelType } from '@lib/enums/ModelType';
|
||||
import { lazy } from 'react';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import NotesEditor from '../editors/NotesEditor';
|
||||
import type { PanelType } from './Panel';
|
||||
|
||||
const NotesEditor = lazy(() => import('../editors/NotesEditor'));
|
||||
|
||||
export default function NotesPanel({
|
||||
model_type,
|
||||
model_id,
|
||||
|
||||
@@ -9,15 +9,33 @@ import { ModalsProvider } from '@mantine/modals';
|
||||
import { Notifications } from '@mantine/notifications';
|
||||
import { ContextMenuProvider } from 'mantine-contextmenu';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { AboutInvenTreeModal } from '../components/modals/AboutInvenTreeModal';
|
||||
import { LicenseModal } from '../components/modals/LicenseModal';
|
||||
import { QrModal } from '../components/modals/QrModal';
|
||||
import { ServerInfoModal } from '../components/modals/ServerInfoModal';
|
||||
import { useLocalState } from '../states/LocalState';
|
||||
import { LanguageContext } from './LanguageContext';
|
||||
import { colorSchema } from './colorSchema';
|
||||
|
||||
import type { JSX } from 'react';
|
||||
// Lazy load the various modal dialogs - they are not needed immediately, and this can help to reduce the initial bundle size
|
||||
const AboutInvenTreeModal = lazy(() =>
|
||||
import('../components/modals/AboutInvenTreeModal').then((module) => ({
|
||||
default: module.AboutInvenTreeModal
|
||||
}))
|
||||
);
|
||||
const LicenseModal = lazy(() =>
|
||||
import('../components/modals/LicenseModal').then((module) => ({
|
||||
default: module.LicenseModal
|
||||
}))
|
||||
);
|
||||
const QrModal = lazy(() =>
|
||||
import('../components/modals/QrModal').then((module) => ({
|
||||
default: module.QrModal
|
||||
}))
|
||||
);
|
||||
const ServerInfoModal = lazy(() =>
|
||||
import('../components/modals/ServerInfoModal').then((module) => ({
|
||||
default: module.ServerInfoModal
|
||||
}))
|
||||
);
|
||||
|
||||
import { type JSX, lazy } from 'react';
|
||||
|
||||
export function ThemeContext({
|
||||
children
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+16
-19
@@ -9,20 +9,22 @@ import 'mantine-contextmenu/styles.css';
|
||||
import 'mantine-datatable/styles.css';
|
||||
import 'react-grid-layout/css/styles.css';
|
||||
import 'react-resizable/css/styles.css';
|
||||
import * as MantineCore from '@mantine/core';
|
||||
import * as MantineNotifications from '@mantine/notifications';
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import * as ReactDOMClient from 'react-dom/client';
|
||||
import './styles/overrides.css';
|
||||
|
||||
// Lingui imports (required for plugin translation)
|
||||
import * as LinguiCore from '@lingui/core';
|
||||
import * as LinguiReact from '@lingui/react';
|
||||
import type * as LinguiCore from '@lingui/core';
|
||||
import type * as LinguiReact from '@lingui/react';
|
||||
// Global types to be exported for use in plugins
|
||||
import type * as MantineCore from '@mantine/core';
|
||||
import type * as MantineNotifications from '@mantine/notifications';
|
||||
import * as React from 'react';
|
||||
import type * as ReactDOM from 'react-dom';
|
||||
import * as ReactDOMClient from 'react-dom/client';
|
||||
|
||||
import './styles/overrides.css';
|
||||
|
||||
import { getBaseUrl } from '@lib/functions/Navigation';
|
||||
import type { HostList } from '@lib/types/Server';
|
||||
import MainView from './views/MainView';
|
||||
import { loadWindowGlobals } from './window';
|
||||
|
||||
// define settings
|
||||
declare global {
|
||||
@@ -43,6 +45,8 @@ declare global {
|
||||
ReactDOMClient: typeof ReactDOMClient;
|
||||
MantineCore: typeof MantineCore;
|
||||
MantineNotifications: typeof MantineNotifications;
|
||||
LinguiCore: typeof LinguiCore;
|
||||
LinguiReact: typeof LinguiReact;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,16 +110,6 @@ if (window.INVENTREE_SETTINGS.sentry_dsn) {
|
||||
environment: window.INVENTREE_SETTINGS.environment || 'default'
|
||||
});
|
||||
}
|
||||
|
||||
// Expose global objects for the plugin system
|
||||
(window as any).React = React;
|
||||
(window as any).ReactDOM = ReactDOM;
|
||||
(window as any).ReactDOMClient = ReactDOMClient;
|
||||
(window as any).MantineCore = MantineCore;
|
||||
(window as any).MantineNotifications = MantineNotifications;
|
||||
(window as any).LinguiCore = LinguiCore;
|
||||
(window as any).LinguiReact = LinguiReact;
|
||||
|
||||
// Redirect to base url if on /
|
||||
if (window.location.pathname === '/') {
|
||||
window.location.replace(`/${getBaseUrl()}`);
|
||||
@@ -128,3 +122,6 @@ ReactDOMClient.createRoot(
|
||||
<MainView />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
// Load globals onto the window object, so that they can be accessed by plugins without requiring direct imports
|
||||
loadWindowGlobals();
|
||||
|
||||
@@ -2,7 +2,13 @@ import { YesNoButton } from '@lib/components/YesNoButton';
|
||||
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||
import { ModelType } from '@lib/enums/ModelType';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { TemplateTable } from '../../../../tables/settings/TemplateTable';
|
||||
import { lazy } from 'react';
|
||||
|
||||
const TemplateTable = lazy(() =>
|
||||
import('../../../../tables/settings/TemplateTable').then((module) => ({
|
||||
default: module.TemplateTable
|
||||
}))
|
||||
);
|
||||
|
||||
function ReportTemplateTable() {
|
||||
return (
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Expose certain globals to the window object, so that they can be accessed by plugins,
|
||||
* without requiring plugins to import these dependencies directly.
|
||||
*/
|
||||
export function loadWindowGlobals() {
|
||||
// (window as any).React = React;
|
||||
import('react').then((module) => {
|
||||
window.React = module;
|
||||
});
|
||||
|
||||
// (window as any).ReactDOM = ReactDOM;
|
||||
import('react-dom').then((module) => {
|
||||
window.ReactDOM = module;
|
||||
});
|
||||
|
||||
// (window as any).ReactDOMClient = ReactDOMClient;
|
||||
import('react-dom/client').then((module) => {
|
||||
window.ReactDOMClient = module;
|
||||
});
|
||||
|
||||
// (window as any).MantineCore = MantineCore;
|
||||
import('@mantine/core').then((module) => {
|
||||
window.MantineCore = module;
|
||||
});
|
||||
|
||||
// (window as any).MantineNotifications = MantineNotifications;
|
||||
import('@mantine/notifications').then((module) => {
|
||||
window.MantineNotifications = module;
|
||||
});
|
||||
|
||||
import('@lingui/core').then((module) => {
|
||||
window.LinguiCore = module;
|
||||
});
|
||||
|
||||
import('@lingui/react').then((module) => {
|
||||
window.LinguiReact = module;
|
||||
});
|
||||
}
|
||||
@@ -3139,9 +3139,9 @@ fast-equals@^4.0.3:
|
||||
integrity sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==
|
||||
|
||||
fast-uri@^3.0.1:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa"
|
||||
integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.2.tgz#8af3d4fc9d3e71b11572cc2673b514a7d1a8c8ec"
|
||||
integrity sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==
|
||||
|
||||
fdir@^6.4.3, fdir@^6.4.4, fdir@^6.5.0:
|
||||
version "6.5.0"
|
||||
|
||||
Reference in New Issue
Block a user