refactor: new data import flow

This commit is contained in:
Jannat Patel
2025-11-20 18:02:02 +05:30
parent 9b7d763d52
commit 3d7a3ecfc5
4 changed files with 41 additions and 37 deletions

View File

@@ -17,20 +17,24 @@
</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>
</router-link>
</div>
<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>
</router-link>
</div>
</template>
</Popover>
</template>

View File

@@ -3,7 +3,7 @@
class="sticky flex items-center justify-between top-0 z-10 border-b bg-surface-white px-3 py-2.5 sm:px-5"
>
<Breadcrumbs :items="breadcrumbs" />
<Dropdown
placement="start"
side="bottom"

View File

@@ -1,13 +1,13 @@
<template>
<DataImport
:doctype="route.params.doctype"
:importName="route.params.importName"
:doctypeMap="doctypeMap"
/>
<DataImport
:doctype="route.params.doctype"
:importName="route.params.importName"
:doctypeMap="doctypeMap"
/>
</template>
<script setup lang="ts">
import { usePageMeta } from "frappe-ui"
import { DataImport } from "frappe-ui/frappe"
import { usePageMeta } from 'frappe-ui'
import { DataImport } from 'frappe-ui/frappe'
import { sessionStore } from '../stores/session'
import { useRoute } from 'vue-router'
@@ -15,19 +15,19 @@ const { brand } = sessionStore()
const route = useRoute()
const doctypeMap = {
"LMS Course": {
title: "Courses",
listRoute: "/courses",
pageRoute: `/courses/docname`
},
"LMS Batch": {
title: "Batches",
listRoute: "/batches"
},
"LMS Category": {
title: "Categories",
listRoute: "/lms"
}
'LMS Course': {
title: 'Courses',
listRoute: '/courses',
pageRoute: `/courses/docname`,
},
'LMS Batch': {
title: 'Batches',
listRoute: '/batches',
},
'LMS Category': {
title: 'Categories',
listRoute: '/lms',
},
}
usePageMeta(() => {
@@ -36,4 +36,4 @@ usePageMeta(() => {
icon: brand.favicon,
}
})
</script>
</script>

View File

@@ -259,7 +259,7 @@ const routes = [
name: 'DataImport',
component: () => import('@/pages/DataImport.vue'),
props: true,
}
},
]
let router = createRouter({