Browse Source

fix: review changes

pull/7207/head
Ramesh Mane 12 months ago
parent
commit
714926e892
  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)
}
const { paste } = usePaste()
const { paste } = usePaste(true)
// #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> => {
try {
// Check if the Clipboard API is supported
@ -23,6 +27,10 @@ export const usePaste = () => {
document.dispatchEvent(pasteEvent)
return true
} catch (e) {
if (!showDialogIfFailed) throw new Error(t('msg.error.pasteFromClipboardError'))
message.error(t('msg.error.pasteFromClipboardError'))
return false
}
}

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

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

Loading…
Cancel
Save