Skip to content
Open
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
2 changes: 1 addition & 1 deletion api/types/processing/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
debug: {
type: 'boolean',
title: 'Mode debug',
description: 'Active le mode debug pour ce traitement',
description: 'Capture des logs détaillés (stacks d\'erreurs, appels HTTP) réservés aux super-admins, pour diagnostiquer un plugin en erreur.',
readOnly: true
},
owner: {
Expand Down
79 changes: 61 additions & 18 deletions ui/src/components/processing/processing-actions.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
<template>
<!-- Navigation -->
<template v-if="linkedDatasets.length">
<v-list-subheader class="text-uppercase">
{{ t('navigation') }}
</v-list-subheader>
<v-list-item
v-for="d in linkedDatasets"
:key="d.id"
:href="`/data-fair/dataset/${d.id}`"
target="_blank"
rounded
>
<template #prepend>
<v-icon
color="primary"
:icon="mdiOpenInNew"
/>
</template>
{{ t('viewDataset', { title: d.title }) }}
</v-list-item>
</template>

<v-list-subheader
v-if="hasActions"
class="text-uppercase"
>
{{ t('actions') }}
</v-list-subheader>

<!-- Execute -->
<v-menu
v-if="canAdmin || canExec"
Expand Down Expand Up @@ -230,22 +259,6 @@
</v-card>
</v-menu>

<!-- Dataset link -->
<v-list-item
v-if="processing?.config?.dataset?.id"
:href="`/data-fair/dataset/${processing.config.dataset.id}`"
target="_blank"
rounded
>
<template #prepend>
<v-icon
color="primary"
:icon="mdiOpenInNew"
/>
</template>
{{ t('viewDataset') }}
</v-list-item>

<!-- Documentation link -->
<v-list-item
v-if="metadata?.documentation"
Expand Down Expand Up @@ -342,6 +355,32 @@ const newOwner = ref<Account>(session.state.account)
const duplicateTitle = ref(`${processing.title} ${t('copy')}`)

const canSubscribeNotif = computed(() => processing?.owner.type === session.state.account.type && processing?.owner.id === session.state.account.id)

const linkedDatasets = computed(() => {
const seen = new Set<string>()
const result: { id: string, title: string }[] = []
const add = (d: any) => {
if (!d?.id || seen.has(d.id)) return
seen.add(d.id)
result.push({ id: d.id, title: d.title || d.id })
}
const cfg = processing?.config
if (!cfg) return result
add(cfg.dataset)
if (Array.isArray(cfg.datasets)) {
for (const entry of cfg.datasets) {
add(entry?.dataset ?? entry)
}
}
return result
})

const hasActions = computed(() =>
canAdmin || canExec ||
!!metadata?.documentation ||
!!session.state.user?.adminMode ||
(!!eventsSubscribeUrl.value && canSubscribeNotif.value)
)
const ownerString = computed(() => `${processing?.owner.type}:${processing?.owner.id}${processing?.owner.department ? ':' + processing?.owner.department : ''}`)

const eventsSubscribeUrl = computed(() => {
Expand Down Expand Up @@ -461,7 +500,9 @@ en:
sensitiveOperation: Sensitive operation
changeOwnerWarning: Changing the owner of a processing can have consequences on the processing execution.
confirm: Confirm
viewDataset: View the dataset
navigation: Navigation
actions: Actions
viewDataset: "View {title}"
tutorial: Tutorial
useApi: Use the API
notifications: Notifications
Expand Down Expand Up @@ -497,7 +538,9 @@ fr:
sensitiveOperation: Opération sensible
changeOwnerWarning: Changer le propriétaire d'un traitement peut avoir des conséquences sur l'execution du traitement.
confirm: Confirmer
viewDataset: Voir le jeu de données
navigation: Navigation
actions: Actions
viewDataset: "Voir {title}"
tutorial: Tutoriel
useApi: Utiliser l'API
notifications: Notifications
Expand Down
1 change: 1 addition & 0 deletions ui/src/components/processing/processing-activity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<v-list-item
:prepend-avatar="avatarUrl"
:title="ownerName"
prepend-gap="20"
/>
<v-list-item
v-if="processing.updated"
Expand Down
6 changes: 4 additions & 2 deletions ui/src/components/processing/processing-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@

<!-- Last run -->
<template v-if="processing.lastRun">
<v-list-item v-if="processing.lastRun.status === 'running'">
<v-list-item
v-if="processing.lastRun.status === 'running'"
prepend-gap="28"
>
<template #prepend>
<v-progress-circular
indeterminate
color="primary"
size="small"
class="mr-7"
/>
</template>
{{ t('runStarted') }} {{ dayjs(processing.lastRun.startedAt).fromNow() }}
Expand Down
1 change: 1 addition & 0 deletions ui/src/components/run/run-list-item.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<v-list-item
class="py-4"
prepend-gap="32"
:to="link ? `/processings/${run.processing._id}/runs/${run._id}` : ''"
>
<template #prepend>
Expand Down
Loading