Nc fix(nc-gui): allow copy paste email id from gmail in team & settings, for example, abc <abc@gmail.com> (#7963)

* fix(nc-gui): allow copy paste email id from gmail

* fix(nc-gui): skip display error & add only valid emails if user copy paste bulk emails in team & settings invite input element

* fix(nc-gui): add a comment explaining the regex pattern for email validate/extract

* fix(nc-gui): allow copy paste emailid from gmail in team & settings oss

* fix(nc-gui): add support to extract email from pasted string in email cell if accept only email is true
This commit is contained in:
Ramesh Mane
2024-03-27 00:36:57 +05:30
committed by GitHub
parent 779db0104b
commit 1b8c47e2b0
6 changed files with 60 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import type { AttachmentType, ColumnType, LinkToAnotherRecordType, SelectOptions
import { UITypes, getDateFormat, getDateTimeFormat, populateUniqueFileName } from 'nocodb-sdk'
import type { AppInfo } from '~/composables/useGlobal'
import { isBt, isMm, isOo, parseProp } from '#imports'
import { extractEmail } from '~/helpers/parsers/parserHelpers'
export default function convertCellData(
args: { to: UITypes; value: string; column: ColumnType; appInfo: AppInfo; files?: FileList | File[]; oldValue?: unknown },
@@ -291,6 +292,12 @@ export default function convertCellData(
throw new Error(`Unsupported conversion for ${to}`)
}
}
case UITypes.Email: {
if (parseProp(column.meta).validate) {
return extractEmail(value) || value
}
return value
}
case UITypes.Lookup:
case UITypes.Rollup:
case UITypes.Formula: