diff --git a/packages/nocodb/src/lib/models/Column.ts b/packages/nocodb/src/lib/models/Column.ts index f85c987c53..4a0f2afc9f 100644 --- a/packages/nocodb/src/lib/models/Column.ts +++ b/packages/nocodb/src/lib/models/Column.ts @@ -232,12 +232,14 @@ export default class Column implements ColumnType { } case UITypes.MultiSelect: { if (!column.colOptions?.options) { + const selectColors = [ '#cfdffe', '#d0f1fd', '#c2f5e8', '#ffdaf6', '#ffdce5', '#fee2d5', '#ffeab6', '#d1f7c4', '#ede2fe', '#eeeeee', ]; for (const [i, option] of column.dtxp?.split(',').entries() || [].entries()) { await SelectOption.insert( { fk_column_id: colId, title: option.replace(/^'/, '').replace(/'$/, ''), - order: i + 1 + order: i + 1, + color: selectColors[i % selectColors.length] }, ncMeta ); @@ -258,12 +260,14 @@ export default class Column implements ColumnType { } case UITypes.SingleSelect: { if (!column.colOptions?.options) { + const selectColors = [ '#cfdffe', '#d0f1fd', '#c2f5e8', '#ffdaf6', '#ffdce5', '#fee2d5', '#ffeab6', '#d1f7c4', '#ede2fe', '#eeeeee', ]; for (const [i, option] of column.dtxp?.split(',').entries() || [].entries()) { await SelectOption.insert( { fk_column_id: colId, title: option.replace(/^'/, '').replace(/'$/, ''), - order: i + 1 + order: i + 1, + color: selectColors[i % selectColors.length] }, ncMeta );