Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/help/processListHelp.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ export default `
<span class="highlight">Errors on execution?</span> — Ensure all required
inputs are provided in the correct format.
</li>
<li>
<span class="highlight">Application package not accessible?</span> — This may happen after restarting the Kubernetes deployment
while keeping the PostgreSQL database running. In this case, the process metadata still exists, but the persistent volume
storing the CWL package is empty. Redeploy the process to restore the application package.
</li>
</ul>
</div>
</div>
Expand Down
53 changes: 50 additions & 3 deletions pages/processes/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,15 @@ const visualizeCwl = async (row: any) => {
'Accept-Language': locale.value
}
})
if (!res.ok) throw new Error(`Failed to fetch package (${res.status})`)

if (!res.ok) {
Notify.create({
type: 'warning',
message: t(
'CWL package cannot be accessed'
)
})
return
}

const response = await fetch('/cwl-demo/example-workflow.cwl')
const yamlText = await res.text()
Expand Down Expand Up @@ -472,6 +479,32 @@ const columns = [
}
]

const getInputType = (input: any) => {
const schema =
input?.['original-schema'] ||
input?.schema ||
input

// Handle allOf
if (schema?.allOf && Array.isArray(schema.allOf)) {
const refObj = schema.allOf.find((s: any) => s.$ref)
const formatObj = schema.allOf.find((s: any) => s.format)

if (formatObj?.format && refObj?.$ref) {
return {
label: formatObj.format,
link: refObj.$ref
}
}
}

if (schema?.type) {
return { label: schema.type }
}

return { label: 'object' }
}

const rows = computed(() => {
if (!data.value?.processes) return []
const term = filter.value.toLowerCase()
Expand Down Expand Up @@ -624,7 +657,21 @@ const onClearSearch = async () => {
<tbody>
<tr v-for="([key, val]) in Object.entries(selectedProcess?.inputs || {})" :key="key">
<td>{{ key }}</td>
<td>{{ val?.schema?.type || val?.type || 'unknown' }}</td>
<td>
<template v-if="getInputType(val).link">
<a
:href="getInputType(val).link"
target="_blank"
class="text-primary"
>
{{ getInputType(val).label }}
</a>
</template>

<template v-else>
{{ getInputType(val).label }}
</template>
</td>
<td>{{ val?.description || '—' }}</td>
</tr>

Expand Down