Improve RenderOwner function (#5910)

This commit is contained in:
Oliver 2023-11-13 23:12:37 +11:00 committed by GitHub
parent 0d193d8cff
commit 3e063750b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 5 deletions

View File

@ -1,11 +1,17 @@
import { IconUser, IconUsersGroup } from '@tabler/icons-react';
import { ReactNode } from 'react';
import { RenderInlineModel } from './Instance';
export function RenderOwner({ instance }: { instance: any }): ReactNode {
// TODO: Icon based on user / group status?
return instance && <RenderInlineModel primary={instance.name} />;
return (
instance && (
<RenderInlineModel
primary={instance.name}
suffix={instance.label == 'group' ? <IconUsersGroup /> : <IconUser />}
/>
)
);
}
export function RenderUser({ instance }: { instance: any }): ReactNode {

View File

@ -54,7 +54,10 @@ export function buildOrderFields(): ApiFormFieldSet {
icon: <IconUser />
},
responsible: {
icon: <IconUsersGroup />
icon: <IconUsersGroup />,
filters: {
is_active: true
}
}
};
}

View File

@ -35,7 +35,11 @@ export function partFields({
},
default_expiry: {},
minimum_stock: {},
responsible: {},
responsible: {
filters: {
is_active: true
}
},
component: {},
assembly: {},
is_template: {},