mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-25 08:59:13 +00:00
fix: custom fields are last in order
This commit is contained in:
committed by
Carlos Valente
parent
78e905a735
commit
40f8976350
+19
-17
@@ -209,25 +209,8 @@ function MakeCustomField({ row, column, table }: CellContext<OntimeEntry, unknow
|
|||||||
*/
|
*/
|
||||||
export function makeCuesheetColumns(customFields: CustomFields, cuesheetMode: AppMode): ColumnDef<OntimeEntry>[] {
|
export function makeCuesheetColumns(customFields: CustomFields, cuesheetMode: AppMode): ColumnDef<OntimeEntry>[] {
|
||||||
const columnsDef: ColumnDef<OntimeEntry>[] = [];
|
const columnsDef: ColumnDef<OntimeEntry>[] = [];
|
||||||
const customFieldKeys = Object.keys(customFields);
|
|
||||||
const modeAllowsWrite = cuesheetMode === AppMode.Edit;
|
const modeAllowsWrite = cuesheetMode === AppMode.Edit;
|
||||||
|
|
||||||
for (let i = 0; i < customFieldKeys.length; i++) {
|
|
||||||
const key = customFieldKeys[i];
|
|
||||||
columnsDef.push({
|
|
||||||
accessorKey: key,
|
|
||||||
id: key,
|
|
||||||
header: customFields[key].label,
|
|
||||||
cell: customFields[key].type === 'text' ? MakeCustomField : LazyImage,
|
|
||||||
size: 250,
|
|
||||||
minSize: 75,
|
|
||||||
meta: {
|
|
||||||
colour: customFields[key].colour,
|
|
||||||
canWrite: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
columnsDef.push({
|
columnsDef.push({
|
||||||
accessorKey: 'flag',
|
accessorKey: 'flag',
|
||||||
id: 'flag',
|
id: 'flag',
|
||||||
@@ -298,5 +281,24 @@ export function makeCuesheetColumns(customFields: CustomFields, cuesheetMode: Ap
|
|||||||
meta: { canWrite: modeAllowsWrite },
|
meta: { canWrite: modeAllowsWrite },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// custom fields at the end
|
||||||
|
const customFieldKeys = Object.keys(customFields);
|
||||||
|
|
||||||
|
for (let i = 0; i < customFieldKeys.length; i++) {
|
||||||
|
const key = customFieldKeys[i];
|
||||||
|
columnsDef.push({
|
||||||
|
accessorKey: key,
|
||||||
|
id: key,
|
||||||
|
header: customFields[key].label,
|
||||||
|
cell: customFields[key].type === 'text' ? MakeCustomField : LazyImage,
|
||||||
|
size: 250,
|
||||||
|
minSize: 75,
|
||||||
|
meta: {
|
||||||
|
colour: customFields[key].colour,
|
||||||
|
canWrite: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return columnsDef;
|
return columnsDef;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user