Browse Source

fix(gui): add rating validation while pasting

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4551/head
Pranav C 2 years ago
parent
commit
c5c6945bfa
  1. 7
      packages/nc-gui/composables/useMultiSelect/convertCellData.ts
  2. 2
      packages/nc-gui/plugins/tele.ts

7
packages/nc-gui/composables/useMultiSelect/convertCellData.ts

@ -17,6 +17,13 @@ export default function convertCellData(args: { from: UITypes; to: UITypes; valu
}
return parsedNumber
}
case UITypes.Rating: {
const parsedNumber = Number(value ?? 0)
if (isNaN(parsedNumber)) {
throw new TypeError(`Cannot convert '${value}' to rating`)
}
return parsedNumber
}
case UITypes.Checkbox:
return Boolean(value)
case UITypes.Date: {

2
packages/nc-gui/plugins/tele.ts

@ -86,5 +86,5 @@ export default defineNuxtPlugin(async (nuxtApp) => {
})
nuxtApp.provide('tele', tele)
nuxtApp.provide('e', tele.emit)
nuxtApp.provide('e', (e: string, data?: Record<string, any>) => tele.emit(e, { data }))
})

Loading…
Cancel
Save