Add a Clear button to empty the Import view when all is imported

This commit is contained in:
Bubka 2022-10-10 13:53:43 +02:00
parent 5c35f815ba
commit f867bd3fc5
2 changed files with 8 additions and 0 deletions

View File

@ -108,6 +108,9 @@
<button v-if="duplicateCount" @click="discardDuplicates()" class="has-text-grey button is-small is-ghost">{{ $t('twofaccounts.import.discard_duplicates') }} ({{duplicateCount}})</button> <button v-if="duplicateCount" @click="discardDuplicates()" class="has-text-grey button is-small is-ghost">{{ $t('twofaccounts.import.discard_duplicates') }} ({{duplicateCount}})</button>
<button @click="discardAccounts()" class="has-text-grey button is-small is-ghost">{{ $t('twofaccounts.import.discard_all') }}</button> <button @click="discardAccounts()" class="has-text-grey button is-small is-ghost">{{ $t('twofaccounts.import.discard_all') }}</button>
</div> </div>
<div v-if="importedCount == exportedAccounts.length" class="mt-2 is-size-7 is-pulled-right">
<button @click="exportedAccounts = []" class="has-text-grey button is-small is-ghost">{{ $t('commons.clear') }}</button>
</div>
</div> </div>
<div v-if="isFetching && exportedAccounts.length === 0" class="has-text-centered"> <div v-if="isFetching && exportedAccounts.length === 0" class="has-text-centered">
<span class="is-size-4"> <span class="is-size-4">
@ -177,6 +180,10 @@
duplicateCount() { duplicateCount() {
return this.exportedAccounts.filter(account => account.id === -1 && account.imported === -1).length; return this.exportedAccounts.filter(account => account.id === -1 && account.imported === -1).length;
}, },
importedCount() {
return this.exportedAccounts.filter(account => account.imported === 1).length;
}
}, },
mounted: async function() { mounted: async function() {

View File

@ -26,6 +26,7 @@ return [
'create' => 'Create', 'create' => 'Create',
'save' => 'Save', 'save' => 'Save',
'close' => 'Close', 'close' => 'Close',
'clear' => 'Clear',
'demo_do_not_post_sensitive_data' => 'This is a demo app, do not post any sensitive data', 'demo_do_not_post_sensitive_data' => 'This is a demo app, do not post any sensitive data',
'testing_do_not_post_sensitive_data' => 'This is a testing app, do not post any sensitive data', 'testing_do_not_post_sensitive_data' => 'This is a testing app, do not post any sensitive data',
'selected' => 'selected', 'selected' => 'selected',