See #223: delete actions is now dangerous anc cannot be applied to all files
This commit is contained in:
parent
7b84a988fd
commit
256d98b77d
|
@ -74,6 +74,7 @@ class ManageTrackFileSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
class ManageTrackFileActionSerializer(common_serializers.ActionSerializer):
|
class ManageTrackFileActionSerializer(common_serializers.ActionSerializer):
|
||||||
actions = ['delete']
|
actions = ['delete']
|
||||||
|
dangerous_actions = ['delete']
|
||||||
filterset_class = filters.ManageTrackFileFilterSet
|
filterset_class = filters.ManageTrackFileFilterSet
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
:class="['ui', {disabled: checked.length === 0}, {'loading': actionLoading}, 'button']">
|
:class="['ui', {disabled: checked.length === 0}, {'loading': actionLoading}, 'button']">
|
||||||
{{ $t('Go') }}</div>
|
{{ $t('Go') }}</div>
|
||||||
<dangerous-button
|
<dangerous-button
|
||||||
v-else :class="['ui', {disabled: checked.length === 0}, {'loading': actionLoading}, 'button']"
|
v-else-if="!currentAction.isDangerous" :class="['ui', {disabled: checked.length === 0}, {'loading': actionLoading}, 'button']"
|
||||||
confirm-color="green"
|
confirm-color="green"
|
||||||
color=""
|
color=""
|
||||||
@confirm="launchAction">
|
@confirm="launchAction">
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
<div class="count field">
|
<div class="count field">
|
||||||
<span v-if="selectAll">{{ $t('{% count %} on {% total %} selected', {count: objectsData.count, total: objectsData.count}) }}</span>
|
<span v-if="selectAll">{{ $t('{% count %} on {% total %} selected', {count: objectsData.count, total: objectsData.count}) }}</span>
|
||||||
<span v-else>{{ $t('{% count %} on {% total %} selected', {count: checked.length, total: objectsData.count}) }}</span>
|
<span v-else>{{ $t('{% count %} on {% total %} selected', {count: checked.length, total: objectsData.count}) }}</span>
|
||||||
<template v-if="checkable.length === checked.length">
|
<template v-if="!currentAction.isDangerous && checkable.length === checked.length">
|
||||||
<a @click="selectAll = true" v-if="!selectAll">
|
<a @click="selectAll = true" v-if="!selectAll">
|
||||||
{{ $t('Select all {% total %} elements', {total: objectsData.count}) }}
|
{{ $t('Select all {% total %} elements', {total: objectsData.count}) }}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -181,7 +181,8 @@ export default {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
label: this.$t('Delete')
|
label: this.$t('Delete'),
|
||||||
|
isDangerous: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue