Skip to content
Snippets Groups Projects
Commit 96682442 authored by ml bonhomme's avatar ml bonhomme :bee: Committed by Erwan Rouchet
Browse files

Change menu items order + throw unsupported action error

parent 83cf5f80
No related branches found
No related tags found
1 merge request!1683Add separator + confirm modals in the process status actions
......@@ -32,40 +32,6 @@
</div>
<div class="dropdown-menu">
<div class="dropdown-content">
<template v-if="finishedProcess">
<a
class="dropdown-item"
:class="!hasAdminAccess ? 'is-disabled' : ''"
v-if="isVerified"
v-on:click="retryAction"
:title="hasAdminAccess ? 'Retry this entire process' : 'An admin access is required to retry this process'"
>
<i class="icon-undo"></i>
Retry process
</a>
<hr class="navbar-divider" />
<router-link
v-if="process.element"
class="dropdown-item"
:to="{ name: 'element-details', params: { id: process.element.id } }"
>
<i class="icon-arrow-right"></i>
View element
</router-link>
</template>
<template v-else-if="activeProcess">
<a
class="dropdown-item has-text-danger"
:class="!isVerified ? 'is-disabled' : ''"
v-if="isVerified"
v-on:click="stopAction"
:title="hasAdminAccess ? 'Stop this process' : 'An admin access is required to stop this process'"
>
<i class="icon-minus"></i>
Stop process
</a>
<hr class="navbar-divider" />
</template>
<router-link
:to="hasActivities ? { name: 'process-workers-activity', params: { processId: process.id } } : ''"
class="dropdown-item"
......@@ -100,6 +66,40 @@
</a>
</template>
</TemplateCreation>
<template v-if="finishedProcess">
<router-link
v-if="process.element"
class="dropdown-item"
:to="{ name: 'element-details', params: { id: process.element.id } }"
>
<i class="icon-arrow-right"></i>
View element
</router-link>
<hr class="navbar-divider" />
<a
class="dropdown-item"
:class="!hasAdminAccess ? 'is-disabled' : ''"
v-if="isVerified"
v-on:click="retryAction"
:title="hasAdminAccess ? 'Retry this entire process' : 'An admin access is required to retry this process'"
>
<i class="icon-undo"></i>
Retry process
</a>
</template>
<template v-else-if="activeProcess">
<hr class="navbar-divider" />
<a
class="dropdown-item has-text-danger"
:class="!isVerified ? 'is-disabled' : ''"
v-if="isVerified"
v-on:click="stopAction"
:title="hasAdminAccess ? 'Stop this process' : 'An admin access is required to stop this process'"
>
<i class="icon-minus"></i>
Stop process
</a>
</template>
</div>
</div>
</div>
......@@ -160,7 +160,7 @@
<template v-slot:footer="{ close }">
<button class="button" v-on:click="close">Cancel</button>
<button
class="button"
class="button ml-auto"
:class="{ 'is-loading': loading, 'is-danger': confirmAction === 'stop', 'is-primary': confirmAction === 'retry' }"
v-on:click="confirmedAction"
>
......@@ -247,7 +247,7 @@ export default {
await this.retry()
this.confirmModal = false
this.confirmAction = ''
} else this.notify({ type: 'error', text: `Unknown action ${this.confirmAction}` })
} else throw new Error(`Unsupported action ${this.confirmAction}`)
},
async retry () {
if (!this.hasAdminAccess || !this.process.id || this.loading) return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment