Skip to content

Commit

Permalink
refactor: rename Task properties into args
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanzalu authored and bamthomas committed Aug 19, 2024
1 parent 7ed8e2f commit c5dd78a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/TasksList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default {
},
methods: {
isBatchDownloadEncrypted(item) {
return item.name.includes('BatchDownload') && item.properties.batchDownload.encrypted
return item.name.includes('BatchDownload') && item.args.batchDownload.encrypted
},
hasZipSize(item) {
return item.name.includes('BatchDownload') && item.state !== 'ERROR' && item.result?.size !== undefined
Expand Down
18 changes: 9 additions & 9 deletions src/pages/TaskBatchDownloadList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@
</div>
</template>
<tasks-list :tasks="tasks">
<template #status="{ item: { properties, state, error } }">
<template #status="{ item: { args, state, error } }">
<task-item-status
:task-item="{
...properties.batchDownload,
...args.batchDownload,
state,
errorMessage: error,
key: 'batchDownload'
}"
/>
</template>
<template #default="{ item: { id, name, properties, state } }">
<template #default="{ item: { id, name, args, state } }">
<div
:id="'task-batch-download-list__item--' + properties.batchDownload.uuid"
:id="'task-batch-download-list__item--' + args.batchDownload.uuid"
class="d-flex task-batch-download-list__item"
>
<a
v-if="properties.batchDownload.exists"
v-if="args.batchDownload.exists"
:href="downloadResultsUrl(id)"
class="task-batch-download-list__item__link"
target="_blank"
>
<fa icon="download" fixed-width />
{{ basename(properties.batchDownload.filename) }}
{{ basename(args.batchDownload.filename) }}
</a>
<span
v-else
Expand All @@ -38,14 +38,14 @@
:title="$t('batchDownload.noFile')"
>
<fa icon="xmark" fixed-width />
{{ basename(properties.batchDownload.filename) }}
{{ basename(args.batchDownload.filename) }}
</span>
<batch-download-actions
:id="id"
class="ms-auto"
:name="name"
:state="state"
:value="properties.batchDownload"
:value="args.batchDownload"
@relaunched="startPollingDownloadTasks"
@deleted="getDownloadTasks"
/>
Expand All @@ -71,7 +71,7 @@ import polling from '@/mixins/polling'
function extractDateFromTask(task) {
const dateRegExp = /\d{4}-[01]\d-[0-3]\dT[0-2]\d_[0-5]\d_[0-5]\d.\d+Z/
return task?.properties?.batchDownload?.filename?.match(dateRegExp)?.[0].replaceAll('_', ':') ?? null
return task?.args?.batchDownload?.filename?.match(dateRegExp)?.[0].replaceAll('_', ':') ?? null
}
export default {
name: 'TaskBatchDownloadList',
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/specs/pages/TaskBatchDownloadList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('TaskBatchDownloadList.vue', () => {
email: null,
name: null
},
properties: {
args: {
batchDownload: {
uuid: 'uuid_01',
encrypted: false,
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('TaskBatchDownloadList.vue', () => {
email: null,
name: null
},
properties: {
args: {
batchDownload: {
uuid: 'uuid_02',
encrypted: true,
Expand Down Expand Up @@ -84,7 +84,7 @@ describe('TaskBatchDownloadList.vue', () => {
email: null,
name: null
},
properties: {
args: {
batchDownload: {
uuid: 'uuid_03',
encrypted: false,
Expand Down Expand Up @@ -114,11 +114,11 @@ describe('TaskBatchDownloadList.vue', () => {
email: null,
name: null
},
properties: {
args: {
batchDownload: {
uuid: 'uuid_04',
encrypted: false,
filename: 'filename_03_2024-05-02T18_13_45.61Z',
filename: 'filename_04_2024-05-02T18_13_45.61Z',
query: 'query_04',
project: {
name: 'project',
Expand Down

0 comments on commit c5dd78a

Please sign in to comment.