fix: data import issues

This commit is contained in:
Jannat Patel
2025-11-26 14:14:09 +05:30
parent a98e8025c4
commit c846e36032
11 changed files with 144 additions and 5543 deletions

View File

@@ -1,44 +1,26 @@
<template>
<Popover placement="right-start" class="flex w-full" trigger="hover">
<template #target="{ togglePopover }">
<button
:class="[
'group w-full flex h-7 items-center justify-between rounded px-2 text-base text-ink-gray-7 hover:bg-surface-gray-2',
]"
<div
class="grid grid-cols-3 justify-between bg-surface-white"
>
<div key="name" class="py-1 px-2 hover:bg-surface-gray-2 rounded">
<router-link
:to="{
name: 'DataImportList',
query: {
step: 'list',
},
}"
>
<div class="flex gap-2">
<Wrench class="size-4 stroke-1.5 text-ink-gray-7" />
<span class="whitespace-nowrap">
{{ __('Configuration') }}
</span>
</div>
<ChevronRight class="h-4 w-4 stroke-1.5" />
</button>
</template>
<template #body-main>
<div class="text-base p-2">
<router-link
:to="{
name: 'DataImportList',
query: {
step: 'list',
},
}"
>
<div
class="flex items-center space-x-2 hover:bg-surface-gray-2 px-2 py-1 rounded-sm"
>
<ArrowDownToLine class="size-4 stroke-1.5 text-ink-gray-7" />
<div class="text-sm text-ink-gray-7">
{{ __('Data Import') }}
</div>
<div class="flex flex-col items-center space-y-1">
<ArrowDownToLine class="size-9 text-ink-gray-7 p-2 bg-surface-gray-2 rounded-md" />
<div class="text-sm text-ink-gray-7">
{{ __('Import') }}
</div>
</router-link>
</div>
</template>
</Popover>
</div>
</router-link>
</div>
</div>
</template>
<script setup>
import { Popover } from 'frappe-ui'
import { ArrowDownToLine, ChevronRight, Wrench } from 'lucide-vue-next'
</script>
<script setup lang="ts">
import { ArrowDownToLine } from 'lucide-vue-next'
</script>

View File

@@ -85,6 +85,7 @@ import {
User,
Settings,
Sun,
Wrench,
Zap,
} from 'lucide-vue-next'
@@ -170,7 +171,13 @@ const userDropdownOptions = computed(() => {
},
},
{
component: markRaw(Configuration),
label: "Configuration",
icon: Wrench,
submenu: [
{
component: markRaw(Configuration),
}
],
condition: () => {
return userResource.data?.is_moderator
},

View File

@@ -1,3 +1,3 @@
@import './assets/Inter/inter.css';
@import 'frappe-ui/src/style.css';
@import 'frappe-ui/style.css';
@import './styles/codemirror.css';

View File

@@ -1,7 +1,5 @@
import { io } from 'socket.io-client'
import { socketio_port } from '../../../../sites/common_site_config.json'
import { getCachedListResource } from 'frappe-ui/src/resources/listResource'
import { getCachedResource } from 'frappe-ui/src/resources/resources'
export function initSocket() {
let host = window.location.hostname
@@ -14,15 +12,6 @@ export function initSocket() {
withCredentials: true,
reconnectionAttempts: 5,
})
socket.on('refetch_resource', (data) => {
if (data.cache_key) {
let resource =
getCachedResource(data.cache_key) ||
getCachedListResource(data.cache_key)
if (resource) {
resource.reload()
}
}
})
return socket
}