+
{{ importMeta.header }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('general.upload') }}
+
+
+
+
+
+
+
+
+ {{ $t('msg.info.import.clickOrDrag') }}
+
+
+ {{ importMeta.uploadHint }}
+
+
-
-
-
-
-
-
-
- {{ $t('msg.info.import.clickOrDrag') }}
-
-
- {{ importMeta.uploadHint }}
-
-
-
-
-
-
-
-
-
- JSON Editor
-
-
-
-
-
-
-
-
-
-
-
-
- URL
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ $t('title.advancedSettings') }}
-
-
-
-
-
-
-
-
- {{ $t('labels.flattenNested') }}
-
-
+
+
+
+
+
+
+ JSON Editor
+
+
+
+
+
+
+
+
+
+
+
+
+ URL
+
+
+
+
+
+
+
-
-
-
{{ $t('labels.importData') }}
+
+
+
+
+
+
{{ $t('title.advancedSettings') }}
+
+
+
+
+
+
+
+ Auto-Select Field Types
+
+
+
+
+
+ Use First Row as Headers
+
+
+
+
+
+
+ {{ $t('labels.flattenNested') }}
+
+
+
+
+
+ {{ $t('labels.importData') }}
+
-
-
+
Back
@@ -419,14 +492,14 @@ const customReqCbk = (customReqArgs: { file: any; onSuccess: () => void }) => {
key="pre-import"
type="primary"
class="nc-btn-import"
- :loading="loading"
+ :loading="preImportLoading"
:disabled="disablePreImportButton"
@click="handlePreImport"
>
{{ $t('activity.import') }}
-
+
{{ $t('activity.import') }}
diff --git a/packages/nc-gui/components/shared-view/Gallery.vue b/packages/nc-gui/components/shared-view/Gallery.vue
index 7d7bbb5e2c..363001839e 100644
--- a/packages/nc-gui/components/shared-view/Gallery.vue
+++ b/packages/nc-gui/components/shared-view/Gallery.vue
@@ -7,7 +7,7 @@ const reloadEventHook = createEventHook()
provide(ReloadViewDataHookInj, reloadEventHook)
-provide(ReadonlyInj, true)
+provide(ReadonlyInj, ref(true))
provide(MetaInj, meta)
diff --git a/packages/nc-gui/components/shared-view/Grid.vue b/packages/nc-gui/components/shared-view/Grid.vue
index 2d51c958a8..03d7068f51 100644
--- a/packages/nc-gui/components/shared-view/Grid.vue
+++ b/packages/nc-gui/components/shared-view/Grid.vue
@@ -28,7 +28,7 @@ useProvideSmartsheetStore(sharedView, meta, true, sorts, nestedFilters)
const reloadEventHook = createEventHook()
provide(ReloadViewDataHookInj, reloadEventHook)
-provide(ReadonlyInj, true)
+provide(ReadonlyInj, ref(true))
provide(MetaInj, meta)
provide(ActiveViewInj, sharedView)
provide(FieldsInj, ref(meta.value?.columns || []))
diff --git a/packages/nc-gui/components/shared-view/Kanban.vue b/packages/nc-gui/components/shared-view/Kanban.vue
index 8dd6b4e96a..f595c85b32 100644
--- a/packages/nc-gui/components/shared-view/Kanban.vue
+++ b/packages/nc-gui/components/shared-view/Kanban.vue
@@ -15,7 +15,7 @@ const reloadEventHook = createEventHook()
provide(ReloadViewDataHookInj, reloadEventHook)
-provide(ReadonlyInj, true)
+provide(ReadonlyInj, ref(true))
provide(MetaInj, meta)
diff --git a/packages/nc-gui/components/smartsheet/Cell.vue b/packages/nc-gui/components/smartsheet/Cell.vue
index 2ed187af22..bf562f6e6c 100644
--- a/packages/nc-gui/components/smartsheet/Cell.vue
+++ b/packages/nc-gui/components/smartsheet/Cell.vue
@@ -8,6 +8,7 @@ import {
IsFormInj,
IsLockedInj,
IsPublicInj,
+ ReadonlyInj,
computed,
inject,
provide,
@@ -47,7 +48,7 @@ provide(EditModeInj, useVModel(props, 'editEnabled', emit))
provide(ActiveCellInj, active)
if (readOnly?.value) {
- provide(ReadonlyInj, readOnly.value)
+ provide(ReadonlyInj, readOnly)
}
const isForm = inject(IsFormInj, ref(false))
diff --git a/packages/nc-gui/components/smartsheet/Gallery.vue b/packages/nc-gui/components/smartsheet/Gallery.vue
index b20c35f4b6..1ce19714f2 100644
--- a/packages/nc-gui/components/smartsheet/Gallery.vue
+++ b/packages/nc-gui/components/smartsheet/Gallery.vue
@@ -58,7 +58,6 @@ provide(IsGalleryInj, ref(true))
provide(IsGridInj, ref(false))
provide(PaginationDataInj, paginationData)
provide(ChangePageInj, changePage)
-provide(ReadonlyInj, !isUIAllowed('xcDatatableEditable'))
const fields = inject(FieldsInj, ref([]))
diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue
index 5e67310196..bd1d4622ec 100644
--- a/packages/nc-gui/components/smartsheet/Grid.vue
+++ b/packages/nc-gui/components/smartsheet/Grid.vue
@@ -18,6 +18,7 @@ import {
ReloadViewDataHookInj,
computed,
createEventHook,
+ enumColor,
extractPkFromRow,
inject,
isColumnRequiredAndNull,
@@ -32,6 +33,7 @@ import {
useI18n,
useMetas,
useMultiSelect,
+ useRoles,
useRoute,
useSmartsheetStoreOrThrow,
useUIPermission,
@@ -50,12 +52,13 @@ const view = inject(ActiveViewInj, ref())
// keep a root fields variable and will get modified from
// fields menu and get used in grid and gallery
const fields = inject(FieldsInj, ref([]))
-const readOnly = inject(ReadonlyInj, false)
+const readOnly = inject(ReadonlyInj, ref(false))
const isLocked = inject(IsLockedInj, ref(false))
const reloadViewDataHook = inject(ReloadViewDataHookInj, createEventHook())
const openNewRecordFormHook = inject(OpenNewRecordFormHookInj, createEventHook())
+const { hasRole } = useRoles()
const { isUIAllowed } = useUIPermission()
const hasEditPermission = $computed(() => isUIAllowed('xcDatatableEditable'))
@@ -67,7 +70,7 @@ const isView = false
let editEnabled = $ref(false)
-const { xWhere, isPkAvail, cellRefs, isSqlView } = useSmartsheetStoreOrThrow()
+const { xWhere, isPkAvail, isSqlView } = useSmartsheetStoreOrThrow()
const visibleColLength = $computed(() => fields.value?.length)
@@ -224,8 +227,6 @@ provide(PaginationDataInj, paginationData)
provide(ChangePageInj, changePage)
-provide(ReadonlyInj, !hasEditPermission)
-
const disableUrlOverlay = ref(false)
provide(CellUrlDisableOverlayInj, disableUrlOverlay)
@@ -273,7 +274,9 @@ watch(contextMenu, () => {
const rowRefs = $ref
()
-async function clearCell(ctx: { row: number; col: number }) {
+async function clearCell(ctx: { row: number; col: number } | null) {
+ if (!ctx) return
+
const rowObj = data.value[ctx.row]
const columnObj = fields.value[ctx.col]
@@ -561,7 +564,12 @@ watch(