Browse Source

fix: review changes

pull/7173/head
Ramesh Mane 12 months ago
parent
commit
d57ea38297
  1. 2
      packages/nc-gui/components/smartsheet/grid/Table.vue
  2. 10
      packages/nc-gui/composables/usePaste.ts
  3. 3
      packages/nc-gui/lang/en.json

2
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -169,7 +169,7 @@ const predictNextFormulas = async () => {
await _predictNextFormulas(meta) await _predictNextFormulas(meta)
} }
const { paste } = usePaste() const { paste } = usePaste(true)
// #Refs // #Refs

10
packages/nc-gui/composables/usePaste.ts

@ -1,4 +1,8 @@
export const usePaste = () => { import { useI18n, message } from '#imports'
export const usePaste = (showDialogIfFailed = false) => {
const { t } = useI18n()
const paste = async (): Promise<boolean> => { const paste = async (): Promise<boolean> => {
try { try {
// Check if the Clipboard API is supported // Check if the Clipboard API is supported
@ -23,6 +27,10 @@ export const usePaste = () => {
document.dispatchEvent(pasteEvent) document.dispatchEvent(pasteEvent)
return true return true
} catch (e) { } catch (e) {
if (!showDialogIfFailed) throw new Error(t('msg.error.pasteFromClipboardError'))
message.error(t('msg.error.pasteFromClipboardError'))
return false return false
} }
} }

3
packages/nc-gui/lang/en.json

@ -1288,7 +1288,8 @@
"duplicateParameterKeysAreNotAllowed": "Duplicate parameter keys are not allowed", "duplicateParameterKeysAreNotAllowed": "Duplicate parameter keys are not allowed",
"fieldRequired": "{value} cannot be empty.", "fieldRequired": "{value} cannot be empty.",
"projectNotAccessible": "Base not accessible", "projectNotAccessible": "Base not accessible",
"copyToClipboardError": "Failed to copy to clipboard" "copyToClipboardError": "Failed to copy to clipboard",
"pasteFromClipboardError": "Failed to paste from clipboard"
}, },
"toast": { "toast": {
"exportMetadata": "Base metadata exported successfully", "exportMetadata": "Base metadata exported successfully",

Loading…
Cancel
Save