mirror of
https://github.com/inventree/InvenTree.git
synced 2025-11-13 11:26:42 +00:00
- Improve field lookup priority
(cherry picked from commit b370d54394)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3044cee011
commit
f901eec771
@@ -194,7 +194,10 @@ export function TableStatusRenderer(
|
||||
accessor?: string
|
||||
): ((record: any) => any) | undefined {
|
||||
return (record: any) => {
|
||||
const status = resolveItem(record, accessor ?? 'status');
|
||||
const status =
|
||||
resolveItem(record, accessor ?? 'status') ??
|
||||
resolveItem(record, 'status_custom_key') ??
|
||||
resolveItem(record, 'status');
|
||||
|
||||
return (
|
||||
status && (
|
||||
|
||||
@@ -368,14 +368,14 @@ export type StatusColumnProps = TableColumnProps & {
|
||||
};
|
||||
|
||||
export function StatusColumn(props: StatusColumnProps): TableColumn {
|
||||
const accessor: string = props.accessor ?? 'status';
|
||||
const accessor: string = props.accessor ?? 'status_custom_key';
|
||||
|
||||
return {
|
||||
accessor: 'status',
|
||||
sortable: true,
|
||||
switchable: true,
|
||||
minWidth: '50px',
|
||||
render: TableStatusRenderer(props.model, accessor ?? 'status_custom_key'),
|
||||
render: TableStatusRenderer(props.model, accessor),
|
||||
...props
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user