Skip to content

Commit

Permalink
chore(ui): prevent display of file helpers if there is no file (#6568)
Browse files Browse the repository at this point in the history
  • Loading branch information
rd-99 authored Dec 23, 2024
1 parent 462c505 commit 93e7ff2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/src/components/executions/VarValue.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<el-button-group v-if="isFile(value)">
<el-button-group v-if="isFileValid(value)">
<a class="el-button el-button--small el-button--primary" :href="itemUrl(value)" target="_blank">
<Download />
{{ $t('download') }}
Expand Down Expand Up @@ -45,6 +45,10 @@
isFile(value) {
return typeof(value) === "string" && value.startsWith("kestra:///")
},
isFileValid(value) {
// we don't want to display the file if it's not a file or if the size is 0
return this.isFile(value) && this.humanSize && this.humanSize !== "0B"
},
isURI(value) {
try {
new URL(value);
Expand Down

0 comments on commit 93e7ff2

Please sign in to comment.