diff --git a/api/funkwhale_api/manage/serializers.py b/api/funkwhale_api/manage/serializers.py index bbd393236580782723da487e5abb67d48cc1e6b8..02300ec0689c16f7250e5557a3c05d1eb2f07006 100644 --- a/api/funkwhale_api/manage/serializers.py +++ b/api/funkwhale_api/manage/serializers.py @@ -74,6 +74,7 @@ class ManageTrackFileSerializer(serializers.ModelSerializer): class ManageTrackFileActionSerializer(common_serializers.ActionSerializer): actions = ['delete'] + dangerous_actions = ['delete'] filterset_class = filters.ManageTrackFileFilterSet @transaction.atomic diff --git a/front/src/components/common/ActionTable.vue b/front/src/components/common/ActionTable.vue index 718e57b19b61672913d0de6145ec7447c69ac0cf..5221c328292c317c199850d6c9a3de58fec188f9 100644 --- a/front/src/components/common/ActionTable.vue +++ b/front/src/components/common/ActionTable.vue @@ -21,7 +21,7 @@ :class="['ui', {disabled: checked.length === 0}, {'loading': actionLoading}, 'button']"> {{ $t('Go') }}</div> <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" color="" @confirm="launchAction"> @@ -36,7 +36,7 @@ <div class="count field"> <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> - <template v-if="checkable.length === checked.length"> + <template v-if="!currentAction.isDangerous && checkable.length === checked.length"> <a @click="selectAll = true" v-if="!selectAll"> {{ $t('Select all {% total %} elements', {total: objectsData.count}) }} </a> diff --git a/front/src/components/manage/library/FilesTable.vue b/front/src/components/manage/library/FilesTable.vue index 7d230cc857effa8696300df3e9e69d353670ecf7..2788006f4a4b1c63ca3e5ff8445cad38f2ef7880 100644 --- a/front/src/components/manage/library/FilesTable.vue +++ b/front/src/components/manage/library/FilesTable.vue @@ -181,7 +181,8 @@ export default { return [ { name: 'delete', - label: this.$t('Delete') + label: this.$t('Delete'), + isDangerous: true } ] }