|
|
|
@ -1609,6 +1609,30 @@ export default class View implements ViewType {
|
|
|
|
|
columns = await Column.list({ fk_model_id: view.fk_model_id }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// todo: avoid duplicate code
|
|
|
|
|
if (view.type === ViewTypes.KANBAN && !copyFromView) { |
|
|
|
|
// sort by display value & attachment first, then by singleLineText & Number
|
|
|
|
|
// so that later we can handle control `show` easily
|
|
|
|
|
columns.sort((a, b) => { |
|
|
|
|
const displayValueOrder = +b.pv - +a.pv; |
|
|
|
|
const attachmentOrder = |
|
|
|
|
+(b.uidt === UITypes.Attachment) - +(a.uidt === UITypes.Attachment); |
|
|
|
|
const singleLineTextOrder = |
|
|
|
|
+(b.uidt === UITypes.SingleLineText) - |
|
|
|
|
+(a.uidt === UITypes.SingleLineText); |
|
|
|
|
const numberOrder = |
|
|
|
|
+(b.uidt === UITypes.Number) - +(a.uidt === UITypes.Number); |
|
|
|
|
const defaultOrder = b.order - a.order; |
|
|
|
|
return ( |
|
|
|
|
displayValueOrder || |
|
|
|
|
attachmentOrder || |
|
|
|
|
singleLineTextOrder || |
|
|
|
|
numberOrder || |
|
|
|
|
defaultOrder |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let order = 1; |
|
|
|
|
let galleryShowLimit = 0; |
|
|
|
|
let kanbanShowLimit = 0; |
|
|
|
|