Skip to content
Snippets Groups Projects

Add separator + confirm modals in the process status actions

Merged ml bonhomme requested to merge danger-danger into master
All threads resolved!
1 file
+ 36
36
Compare changes
  • Side-by-side
  • Inline
@@ -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
Loading