mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 11:10:54 +00:00
Expose ModelInformationDict to plugins (#9810)
* Expose ModelInformationDict to plugins * Expose internal modal dict * Add comment * Fix import string
This commit is contained in:
@ -9,6 +9,7 @@ export {
|
||||
// Common type definitions
|
||||
export { ApiEndpoints } from './enums/ApiEndpoints';
|
||||
export { ModelType } from './enums/ModelType';
|
||||
export type { ModelDict } from './enums/ModelInformation';
|
||||
export { UserRoles, UserPermissions } from './enums/Roles';
|
||||
|
||||
export type { InvenTreePluginContext } from './types/Plugins';
|
||||
|
@ -2,6 +2,7 @@ import type { MantineColorScheme, MantineTheme } from '@mantine/core';
|
||||
import type { QueryClient } from '@tanstack/react-query';
|
||||
import type { AxiosInstance } from 'axios';
|
||||
import type { NavigateFunction } from 'react-router-dom';
|
||||
import type { ModelDict } from '../enums/ModelInformation';
|
||||
import type { ModelType } from '../enums/ModelType';
|
||||
import type { ApiFormModalProps, BulkEditApiFormModalProps } from './Forms';
|
||||
import type { UseModalReturn } from './Modals';
|
||||
@ -43,6 +44,7 @@ export type InvenTreeFormsContext = {
|
||||
* @param host - The current host URL
|
||||
* @param locale - The current locale string (e.g. 'en' / 'de')
|
||||
* @param model - The model type associated with the rendered component (if applicable)
|
||||
* @param modelInformation - A dictionary of available model information
|
||||
* @param id - The ID (primary key) of the model instance for the plugin (if applicable)
|
||||
* @param instance - The model instance data (if available)
|
||||
* @param reloadContent - A function which can be called to reload the plugin content
|
||||
@ -56,6 +58,7 @@ export type InvenTreePluginContext = {
|
||||
user: UserStateProps;
|
||||
userSettings: SettingsStateProps;
|
||||
globalSettings: SettingsStateProps;
|
||||
modelInformation: ModelDict;
|
||||
host: string;
|
||||
locale: string;
|
||||
navigate: NavigateFunction;
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@inventreedb/ui",
|
||||
"description": "UI components for the InvenTree project",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
} from '../../states/SettingsState';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
|
||||
import { ModelInformationDict } from '@lib/enums/ModelInformation';
|
||||
import {
|
||||
INVENTREE_MANTINE_VERSION,
|
||||
INVENTREE_PLUGIN_VERSION,
|
||||
@ -48,6 +49,7 @@ export const useInvenTreeContext = () => {
|
||||
navigate: navigate,
|
||||
globalSettings: globalSettings,
|
||||
userSettings: userSettings,
|
||||
modelInformation: ModelInformationDict,
|
||||
theme: theme,
|
||||
colorScheme: colorScheme,
|
||||
forms: {
|
||||
|
Reference in New Issue
Block a user