mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Improve RenderOwner function (#5910)
This commit is contained in:
parent
0d193d8cff
commit
3e063750b5
@ -1,11 +1,17 @@
|
|||||||
|
import { IconUser, IconUsersGroup } from '@tabler/icons-react';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
|
|
||||||
import { RenderInlineModel } from './Instance';
|
import { RenderInlineModel } from './Instance';
|
||||||
|
|
||||||
export function RenderOwner({ instance }: { instance: any }): ReactNode {
|
export function RenderOwner({ instance }: { instance: any }): ReactNode {
|
||||||
// TODO: Icon based on user / group status?
|
return (
|
||||||
|
instance && (
|
||||||
return instance && <RenderInlineModel primary={instance.name} />;
|
<RenderInlineModel
|
||||||
|
primary={instance.name}
|
||||||
|
suffix={instance.label == 'group' ? <IconUsersGroup /> : <IconUser />}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function RenderUser({ instance }: { instance: any }): ReactNode {
|
export function RenderUser({ instance }: { instance: any }): ReactNode {
|
||||||
|
@ -54,7 +54,10 @@ export function buildOrderFields(): ApiFormFieldSet {
|
|||||||
icon: <IconUser />
|
icon: <IconUser />
|
||||||
},
|
},
|
||||||
responsible: {
|
responsible: {
|
||||||
icon: <IconUsersGroup />
|
icon: <IconUsersGroup />,
|
||||||
|
filters: {
|
||||||
|
is_active: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,11 @@ export function partFields({
|
|||||||
},
|
},
|
||||||
default_expiry: {},
|
default_expiry: {},
|
||||||
minimum_stock: {},
|
minimum_stock: {},
|
||||||
responsible: {},
|
responsible: {
|
||||||
|
filters: {
|
||||||
|
is_active: true
|
||||||
|
}
|
||||||
|
},
|
||||||
component: {},
|
component: {},
|
||||||
assembly: {},
|
assembly: {},
|
||||||
is_template: {},
|
is_template: {},
|
||||||
|
Loading…
Reference in New Issue
Block a user