Skip to content

Commit

Permalink
Merge pull request #1802 from Aeredren/enh/emptyTrash
Browse files Browse the repository at this point in the history
Empty trash bin
  • Loading branch information
raimund-schluessler authored Oct 2, 2021
2 parents 5d98dbc + f7b38bb commit 1db9565
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions src/components/AppNavigation/Trashbin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
</div>
</template>
</div>
<p v-if="retentionDuration" class="footer">
{{ n('calendar', 'Elements in the trash bin are deleted after {numDays} day', 'Elements in the trash bin are deleted after {numDays} days', retentionDuration, { numDays: retentionDuration }) }}
</p>
<div class="footer">
<p v-if="retentionDuration">
{{ n('calendar', 'Elements in the trash bin are deleted after {numDays} day', 'Elements in the trash bin are deleted after {numDays} days', retentionDuration, { numDays: retentionDuration }) }}
</p>
<button @click="onEmptyTrashBin()">
{{ t('tasks','Empty trash bin') }}
</button>
</div>
</template>
</div>
</Modal>
Expand Down Expand Up @@ -225,9 +230,9 @@ export default {
break
}
} catch (error) {
logger.error('could not restore ' + item.url, { error })
logger.error('could not delete ' + item.url, { error })

showError(t('tasks', 'Could not restore calendar or event'))
showError(t('tasks', 'Could not delete calendar or event'))
}
},
async restore(item) {
Expand All @@ -254,6 +259,23 @@ export default {
showError(t('tasks', 'Could not restore calendar or event'))
}
},
onEmptyTrashBin() {
OC.dialogs.confirm(
t('tasks', 'Do you really want to empty the trash bin?'),
t('tasks', 'Empty trash bin'),
this.emptyTrashBin,
true
)
},

emptyTrashBin(confirm) {
if (!confirm) {
return
}
this.items.forEach((item) => {
this.onDeletePermanently(item)
})
},
},
}
</script>
Expand Down Expand Up @@ -318,6 +340,9 @@ export default {
text-align: center;
font-size: small;
margin-top: 16px;
& > p {
margin-bottom: 12px;
}
}

.icon-bullet {
Expand Down

0 comments on commit 1db9565

Please sign in to comment.