Browse Source

feat: fallback to random color if not present in our color map for at import

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/3760/head
mertmit 2 years ago
parent
commit
396398c07c
  1. 2
      packages/nocodb/package.json
  2. 3
      packages/nocodb/src/lib/meta/api/sync/helpers/job.ts

2
packages/nocodb/package.json

@ -181,6 +181,7 @@
"slash": "^3.0.0",
"socket.io": "^4.4.1",
"sqlite3": "5.0.0",
"tinycolor2": "^1.4.2",
"twilio": "^3.55.1",
"unique-names-generator": "^4.3.1",
"uuid": "^8.2.0",
@ -202,6 +203,7 @@
"@types/node": "^18.0.0",
"@types/nodemailer": "^6.4.0",
"@types/supertest": "^2.0.10",
"@types/tinycolor2": "^1.4.3",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"@webserverless/fc-express": "^0.1.4",

3
packages/nocodb/src/lib/meta/api/sync/helpers/job.ts

@ -11,6 +11,7 @@ import hash from 'object-hash';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import tinycolor from 'tinycolor2';
import { importData, importLTARData } from './readAndProcessData';
dayjs.extend(utc);
@ -453,7 +454,7 @@ export default async (
title: (value as any).name,
color: selectColors[(value as any).color]
? selectColors[(value as any).color]
: null,
: tinycolor.random().toHexString(),
});
sMap.addToMappingTbl(

Loading…
Cancel
Save