Browse Source

fix: Fixed tablenode and view node click issue in mobile and removed edit mode on view node on mobile

pull/6498/head
Muhammed Mustafa 1 year ago
parent
commit
5ec0ac6ce7
  1. 5
      packages/nc-gui/components/dashboard/TreeView/TableNode.vue
  2. 10
      packages/nc-gui/components/dashboard/TreeView/ViewsList.vue
  3. 1
      packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue

5
packages/nc-gui/components/dashboard/TreeView/TableNode.vue

@ -46,6 +46,7 @@ const { setMenuContext, openRenameTableDialog, duplicateTable } = inject(TreeVie
const { loadViews: _loadViews } = useViewsStore()
const { activeView } = storeToRefs(useViewsStore())
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
// todo: temp
const { projectTables } = storeToRefs(useTablesStore())
@ -108,6 +109,10 @@ const onOpenTable = async () => {
isLoading.value = true
try {
await _openTable(table.value)
if (isMobileMode.value) {
isLeftSidebarOpen.value = false
}
} catch (e) {
message.error(await extractSdkResponseErrorMsg(e))
} finally {

10
packages/nc-gui/components/dashboard/TreeView/ViewsList.vue

@ -31,6 +31,8 @@ const emits = defineEmits<Emits>()
const project = inject(ProjectInj)!
const table = inject(SidebarTableInj)!
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { isMobileMode } = useGlobal()
const { $e } = useNuxtApp()
@ -190,13 +192,17 @@ const initSortable = (el: HTMLElement) => {
onMounted(() => menuRef.value && initSortable(menuRef.value.$el))
/** Navigate to view by changing url param */
function changeView(view: ViewType) {
navigateToView({
async function changeView(view: ViewType) {
await navigateToView({
view,
tableId: table.value.id!,
projectId: project.value.id!,
hardReload: view.type === ViewTypes.FORM && selected.value[0] === view.id,
})
if (isMobileMode.value) {
isLeftSidebarOpen.value = false
}
}
/** Rename a view */

1
packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue

@ -80,6 +80,7 @@ const onClick = useDebounceFn(() => {
/** Enable editing view name on dbl click */
function onDblClick() {
if (isMobileMode.value) return
if (!isUIAllowed('viewCreateOrEdit')) return
if (!isEditing.value) {

Loading…
Cancel
Save