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 { 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 {

View File

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

View File

@ -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: {},