Skip to content

Commit

Permalink
feat: add table pages for batch download and batch searches
Browse files Browse the repository at this point in the history
  • Loading branch information
caro3801 committed Nov 14, 2024
1 parent d144688 commit 748cb9e
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 27 deletions.
8 changes: 8 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ declare module 'vue' {
DisplayStatusProgress: typeof import('./src/components/Display/DisplayStatusProgress.vue')['default']
DisplayTags: typeof import('./src/components/Display/DisplayTags.vue')['default']
DisplayTagsSearchParameter: typeof import('./src/components/Display/DisplayTagsSearchParameter.vue')['default']
DisplayTaskName: typeof import('./src/components/Display/DisplayTaskName.vue')['default']
DisplayUser: typeof import('./src/components/Display/DisplayUser.vue')['default']
DisplayVisibility: typeof import('./src/components/Display/DisplayVisibility.vue')['default']
DocumentActions: typeof import('./src/components/DocumentActions.vue')['default']
Expand Down Expand Up @@ -341,6 +342,9 @@ declare module 'vue' {
PageSettingsSectionGroup: typeof import('./src/components/PageSettings/PageSettingsSectionGroup.vue')['default']
PageSettingsTitle: typeof import('./src/components/PageSettings/PageSettingsTitle.vue')['default']
PageTable: typeof import('./src/components/PageTable/PageTable.vue')['default']
PageTableBak: typeof import('./src/components/PageTable/PageTableBak.vue')['default']
PageTableNew: typeof import('./src/components/PageTable/PageTableNew.vue')['default']
PageTableSimple: typeof import('./src/components/PageTable/PageTableSimple.vue')['default']
PageTableTdActions: typeof import('./src/components/PageTable/PageTableTdActions.vue')['default']
PageTableTh: typeof import('./src/components/PageTable/PageTableTh.vue')['default']
PageTableThSort: typeof import('./src/components/PageTable/PageTableThSort.vue')['default']
Expand Down Expand Up @@ -444,9 +448,13 @@ declare module 'vue' {
TabGroupNavigation: typeof import('./src/components/TabGroup/TabGroupNavigation/TabGroupNavigation.vue')['default']
TabGroupNavigationEntry: typeof import('./src/components/TabGroup/TabGroupNavigation/TabGroupNavigationEntry.vue')['default']
TabGroupTitle: typeof import('./src/components/TabGroup/TabGroupTitle.vue')['default']
TaskActions: typeof import('./src/components/Task/TaskActions.vue')['default']
TaskDocumentsForm: typeof import('./src/components/Task/TaskDocuments/TaskDocumentsForm.vue')['default']
TaskEntitiesForm: typeof import('./src/components/Task/TaskEntities/TaskEntitiesForm.vue')['default']
TaskItemStatus: typeof import('./src/components/TaskItemStatus.vue')['default']
TaskList: typeof import('./src/components/Task/TaskList.vue')['default']
TaskList_bak: typeof import('./src/components/Task/TaskList_bak.vue')['default']
'TaskList_bak*': typeof import('./src/components/Task/TaskList_bak*.vue')['default']
TasksList: typeof import('./src/components/TasksList.vue')['default']
TextTruncate: typeof import('./src/components/Text/TextTruncate.vue')['default']
UserHistorySaveSearchForm: typeof import('./src/components/UserHistorySaveSearchForm.vue')['default']
Expand Down
19 changes: 19 additions & 0 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,25 @@
"success":"Add document task is launched",
"error":"An error occurred when creating the task: {error}"
}
},
"batch-download": {
"title": "Batch downloads",
"list": {
"title":"All tasks",
"searchPlaceholder": "Search task",
"empty": "You have not yet started any tasks. <a href=\"{howToLink}\" target=\"_blank\">Read more.</a>"
}
},
"batch-search": {
"title": "Batch searches",
"list": {
"title":"All tasks",
"searchPlaceholder": "Search task",
"empty": "You have not yet started any tasks. <a href=\"{howToLink}\" target=\"_blank\">Read more.</a>"
},
"new": {
"title":"Run a new batch search"
}
}
},
"batchSearch": {
Expand Down
31 changes: 6 additions & 25 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,50 +198,31 @@ export const routes = [
{
name: 'task.batch-download',
path: 'batch-download',
component: () => import('@/views/TaskBatchDownload'),
meta: { title: 'task.batch-download.title' },
children: [
{
name: 'task.batch-download.list',
path: '',
component: () => import('@/views/TaskBatchDownloadList'),
component: () => import('@/views/Task/BatchDownload/TaskBatchDownloadList'),
meta: {
title: 'batchDownload.title',
docs: [
{
title: 'Add documents to Datashare',
path: '<%- os %>/add-documents-to-datashare-on-<%- os %>',
mode: ['LOCAL', 'EMBEDDED']
},
{
title: 'Analyse documents',
path: 'all/analyze-documents'
}
]
breadcrumb: false
}
}
]
},
{
name: 'task.batch-search',
path: 'batch-search',
components: {
default: () => import('@/views/TaskBatchSearch')
},
meta: { title: 'task.batch-search.title' },
children: [
{
path: '',
name: 'task.batch-search.list',
components: {
default: () => import('@/views/TaskBatchSearchList')
default: () => import('@/views/Task/BatchSearch/TaskBatchSearchList')
},
meta: {
title: 'batchSearch.title',
docs: [
{
title: 'How to use batch searches',
path: 'all/batch-search-documents'
}
]
breadcrumb: false
}
},
{
Expand Down
20 changes: 20 additions & 0 deletions src/views/Task/BatchDownload/TaskBatchDownloadList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup>
import Task from '@/views/Task/Task'
import TaskList from '@/components/Task/TaskList'
import DisplayStatus from '@/components/Display/DisplayStatus'
import DisplayDatetimeFromNow from '@/components/Display/DisplayDatetimeFromNow'
import DisplayProgress from '@/components/Display/DisplayProgress'
</script>
<template>
<task
v-slot="{ tasks, columns }"
:task-filter="['org.icij.datashare.tasks.BatchDownloadRunner']"
page-name="batch-download"
>
<task-list :tasks="tasks" :columns="columns" :stoppable="true">
<template #cell(state)="{ item }"><display-status :value="item.state" /></template>
<template #cell(createdAt)="{ item }"><display-datetime-from-now :value="item.createdAt" /></template>
<template #cell(progress)="{ item }"><display-progress :value="item.progress" /></template>
</task-list>
</task>
</template>
21 changes: 21 additions & 0 deletions src/views/Task/BatchSearch/TaskBatchSearchList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script setup>
import Task from '@/views/Task/Task'
import TaskList from '@/components/Task/TaskList'
import DisplayStatus from '@/components/Display/DisplayStatus'
import DisplayDatetimeFromNow from '@/components/Display/DisplayDatetimeFromNow'
import DisplayProgress from '@/components/Display/DisplayProgress'
</script>
<template>
<task
v-slot="{ tasks, columns }"
:task-filter="['org.icij.datashare.tasks.BatchSearchRunner']"
page-name="batch-search"
show-add
>
<task-list :tasks="tasks" :columns="columns" :stoppable="true">
<template #cell(state)="{ item }"><display-status :value="item.state" /></template>
<template #cell(createdAt)="{ item }"><display-datetime-from-now :value="item.createdAt" /></template>
<template #cell(progress)="{ item }"><display-progress :value="item.progress" /></template>
</task-list>
</task>
</template>
15 changes: 14 additions & 1 deletion src/views/Task/Documents/TaskDocumentsList.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<script setup>
import Task from '@/views/Task/Task'
import TaskList from '@/components/Task/TaskList'
import DisplayStatus from '@/components/Display/DisplayStatus'
import DisplayDatetimeFromNow from '@/components/Display/DisplayDatetimeFromNow'
import DisplayProgress from '@/components/Display/DisplayProgress'
</script>
<template>
<task
v-slot="{ tasks, columns }"
:task-filter="['org.icij.datashare.tasks.EnqueueFromIndexTask', 'org.icij.datashare.tasks.ScanTask']"
page-name="documents"
/>
show-add
>
<task-list :tasks="tasks" :columns="columns" :stoppable="true">
<template #cell(state)="{ item }"><display-status :value="item.state" /></template>
<template #cell(createdAt)="{ item }"><display-datetime-from-now :value="item.createdAt" /></template>
<template #cell(progress)="{ item }"><display-progress :value="item.progress" /></template>
<template #cell(name)="{ item }">{{ item.name }}</template>
</task-list>
</task>
</template>
18 changes: 17 additions & 1 deletion src/views/Task/Entities/TaskEntitiesList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
<script setup>
import Task from '@/views/Task/Task'
import TaskList from '@/components/Task/TaskList'
import DisplayStatus from '@/components/Display/DisplayStatus'
import DisplayProgress from '@/components/Display/DisplayProgress'
import DisplayDatetimeLong from '@/components/Display/DisplayDatetimeLong'
</script>
<template>
<task :task-filter="['org.icij.datashare.tasks.ExtractNlpTask']" page-name="entities" />
<task
v-slot="{ tasks, columns }"
:task-filter="['org.icij.datashare.tasks.ExtractNlpTask']"
page-name="entities"
show-add
>
<task-list :tasks="tasks" :columns="columns" :stoppable="true">
<template #cell(state)="{ item }"><display-status :value="item.state" /></template>
<template #cell(createdAt)="{ item }"><display-datetime-long :value="item.createdAt" /></template>
<template #cell(progress)="{ item }"><display-progress :value="item.progress" /></template>
<template #cell(name)="{ item }">{{ item.name }}</template>
</task-list>
</task>
</template>

0 comments on commit 748cb9e

Please sign in to comment.