mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-02 10:18:42 +00:00
[UI] Panel indicator badges (#11956)
* Refactor panel indicator dots - Allow indicator status to be fetched async * Add indicator dot for attachments * Support parameters panel * Refactor - Expose more types to @lib - Define new PanelIndicatorType type - Support old interface
This commit is contained in:
@@ -21,6 +21,12 @@ export type {
|
||||
StockAdjustmentFormsContext
|
||||
} from './types/Plugins';
|
||||
|
||||
export type {
|
||||
PanelIndicatorType,
|
||||
PanelType,
|
||||
PanelGroupType
|
||||
} from './types/Panel';
|
||||
|
||||
export type {
|
||||
RowAction,
|
||||
RowViewProps,
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
// The type of indicator dot to be shown against a panel
|
||||
export type PanelIndicatorType = 'info' | 'warning' | 'danger' | null;
|
||||
|
||||
/**
|
||||
* Type used to specify a single panel in a panel group
|
||||
*/
|
||||
export type PanelType = {
|
||||
name: string;
|
||||
label: string;
|
||||
controls?: ReactNode;
|
||||
icon?: ReactNode;
|
||||
notification_dot?: PanelIndicatorType | (() => Promise<PanelIndicatorType>);
|
||||
content?: ReactNode;
|
||||
hidden?: boolean;
|
||||
disabled?: boolean;
|
||||
showHeadline?: boolean;
|
||||
supportsDirty?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Type used to specify a group of panels
|
||||
*/
|
||||
export type PanelGroupType = {
|
||||
id: string;
|
||||
label: string;
|
||||
panelIDs?: string[];
|
||||
panels?: PanelType[];
|
||||
};
|
||||
Reference in New Issue
Block a user