-
Description
-
Token
-
Actions
+
{{ $t('labels.description') }}
+
{{ $t('labels.token') }}
+
{{ $t('labels.action') }}
diff --git a/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue b/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue
index 284fb9cad6..f863851a18 100644
--- a/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue
+++ b/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue
@@ -4,7 +4,7 @@ import type { Ref } from 'vue'
import ItemChip from './components/ItemChip.vue'
import ListItems from './components/ListItems.vue'
import { inject, ref, useProvideLTARStore, useSmartsheetRowStoreOrThrow } from '#imports'
-import { ActiveCellInj, CellValueInj, ColumnInj, ReloadViewDataHookInj, RowInj } from '~/context'
+import { ActiveCellInj, CellValueInj, ColumnInj, ReadonlyInj, ReloadViewDataHookInj, RowInj } from '~/context'
import MdiArrowExpand from '~icons/mdi/arrow-expand'
import MdiPlus from '~icons/mdi/plus'
@@ -18,6 +18,8 @@ const row = inject(RowInj)
const active = inject(ActiveCellInj)
+const editEnabled = inject(ReadonlyInj)
+
const listItemsDlg = ref(false)
const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow()
@@ -57,7 +59,7 @@ const unlinkRef = async (rec: Record) => {
-
+
) => {
class="select-none transform text-sm nc-action-icon text-gray-500/50 hover:text-gray-500"
@click="childListDlg = true"
/>
-
+
diff --git a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue
index 5db431b837..62e6221623 100644
--- a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue
+++ b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue
@@ -5,7 +5,7 @@ import ItemChip from './components/ItemChip.vue'
import ListChildItems from './components/ListChildItems.vue'
import ListItems from './components/ListItems.vue'
import { computed, inject, ref, useProvideLTARStore, useSmartsheetRowStoreOrThrow } from '#imports'
-import { CellValueInj, ColumnInj, IsFormInj, ReloadViewDataHookInj, RowInj } from '~/context'
+import { CellValueInj, ColumnInj, IsFormInj, ReadonlyInj, ReloadViewDataHookInj, RowInj } from '~/context'
const column = inject(ColumnInj)!
@@ -17,6 +17,8 @@ const reloadTrigger = inject(ReloadViewDataHookInj)!
const isForm = inject(IsFormInj)
+const editEnabled = inject(ReadonlyInj)
+
const listItemsDlg = ref(false)
const childListDlg = ref(false)
@@ -75,7 +77,11 @@ const unlinkRef = async (rec: Record
) => {
-
+
diff --git a/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue b/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue
index e7f0a5a7f7..15a7090530 100644
--- a/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue
+++ b/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue
@@ -13,8 +13,10 @@ const emit = defineEmits(['unlink'])
const { relatedTableMeta } = useLTARStoreOrThrow()
-const readonly = inject(ReadonlyInj, false)
+const editEnabled = inject(ReadonlyInj)
+
const active = inject(ActiveCellInj, ref(false))
+
const isForm = inject(IsFormInj)
const expandedFormDlg = ref(false)
@@ -27,12 +29,12 @@ const expandedFormDlg = ref(false)
@click="expandedFormDlg = true"
>
{{ value }}
-
+
()
const emit = defineEmits(['update:modelValue', 'attachRecord'])
const vModel = useVModel(props, 'modelValue', emit)
+
const isForm = inject(IsFormInj, ref(false))
+
const column = inject(ColumnInj)
+const editEnabled = inject(ReadonlyInj)
+
const {
childrenList,
meta,
@@ -64,7 +68,7 @@ const expandedFormRow = ref()
-
+
Link to '{{ meta.title }}'
@@ -90,7 +94,7 @@ const expandedFormRow = ref()
}}(Primary key : {{ getRelatedTableRowId(row) }})
-
+
{
if (!meta || !view) return
@@ -88,10 +90,12 @@ export function useViewColumns(
}
const saveOrUpdate = async (field: any, index: number) => {
- if (field.id && view?.value?.id) {
- await $api.dbViewColumn.update(view.value.id, field.id, field)
- } else if (view?.value?.id) {
- if (fields.value) fields.value[index] = (await $api.dbViewColumn.create(view.value.id, field)) as any
+ if (isUIAllowed('fieldsSync')) {
+ if (field.id && view?.value?.id) {
+ await $api.dbViewColumn.update(view.value.id, field.id, field)
+ } else if (view?.value?.id) {
+ if (fields.value) fields.value[index] = (await $api.dbViewColumn.create(view.value.id, field)) as any
+ }
}
reloadData?.()
diff --git a/packages/nc-gui-v2/composables/useViewSorts.ts b/packages/nc-gui-v2/composables/useViewSorts.ts
index b55e4c209b..31e4a998e4 100644
--- a/packages/nc-gui-v2/composables/useViewSorts.ts
+++ b/packages/nc-gui-v2/composables/useViewSorts.ts
@@ -10,17 +10,22 @@ export function useViewSorts(
const { $api } = useNuxtApp()
+ const { isUIAllowed } = useUIPermission()
+
const loadSorts = async () => {
if (!view?.value) return
sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list
}
const saveOrUpdate = async (sort: SortType, i: number) => {
- if (!sorts?.value) return
- if (sort.id) {
- await $api.dbTableSort.update(sort.id, sort)
- } else {
- sorts.value[i] = (await $api.dbTableSort.create(view?.value?.id as string, sort)) as any
+ // TODO:
+ // if (!this.shared && this._isUIAllowed('sortSync')) {
+ if (isUIAllowed('sortSync')) {
+ if (sort.id) {
+ await $api.dbTableSort.update(sort.id, sort)
+ } else {
+ sorts.value[i] = (await $api.dbTableSort.create(view?.value?.id as string, sort)) as any
+ }
}
reloadData?.()
}
@@ -31,11 +36,13 @@ export function useViewSorts(
}
const deleteSort = async (sort: SortType, i: number) => {
+ // TOOD:
// if (!this.shared && sort.id && this._isUIAllowed('sortSync')) {
- if (sort.id) {
+ if (isUIAllowed('sortSync') && sort.id) {
await $api.dbTableSort.delete(sort.id)
+ } else {
+ sorts.value.splice(i, 1)
}
- sorts.value.splice(i, 1)
}
return { sorts, loadSorts, addSort, deleteSort, saveOrUpdate }
}
diff --git a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue
index 8853ff9761..d2e6d3d68c 100644
--- a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue
+++ b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue
@@ -30,7 +30,7 @@ onKeyStroke(
clearTabs()
-if (!route.params.type) {
+if (!route.params.type && isUIAllowed('teamAndAuth')) {
addTab({ type: TabType.AUTH, title: 'Team & Auth' })
}
@@ -140,8 +140,8 @@ await loadTables()