add refresh accounts, categories and tags button on import dialog
This commit is contained in:
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Nicht unterstützter Kartenanbieter",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Bitte aktualisieren Sie die Seite und versuchen Sie es erneut. Wenn der Fehler weiterhin besteht, stellen Sie sicher, dass die Karteneinstellungen des Servers korrekt konfiguriert sind.",
|
||||
"Import Transactions": "Transaktionen importieren",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Datei hochladen",
|
||||
"Upload Transaction Data File": "Transaktionsdatendatei hochladen",
|
||||
"Define Column": "Define Column",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Unsupported Map Provider",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.",
|
||||
"Import Transactions": "Import Transactions",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Upload File",
|
||||
"Upload Transaction Data File": "Upload Transaction Data File",
|
||||
"Define Column": "Define Column",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Proveedor de mapas no compatible",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Actualice la página e inténtelo de nuevo. Si el error persiste, asegúrese de que la configuración del mapa del servidor esté configurada correctamente.",
|
||||
"Import Transactions": "Importar Transacciones",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Cargar Archivo",
|
||||
"Upload Transaction Data File": "Cargar Archivo de Datos",
|
||||
"Define Column": "Definir Columna",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Fournisseur de cartes non pris en charge",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Veuillez actualiser la page et réessayer. Si l'erreur persiste, assurez-vous que les paramètres de carte du serveur sont correctement configurés.",
|
||||
"Import Transactions": "Importer des transactions",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Télécharger un fichier",
|
||||
"Upload Transaction Data File": "Télécharger un fichier de données de transaction",
|
||||
"Define Column": "Définir les colonnes",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Fornitore mappa non supportato",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Aggiorna la pagina e riprova. Se l'errore persiste, assicurati che le impostazioni della mappa del server siano configurate correttamente.",
|
||||
"Import Transactions": "Importa transazioni",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Carica file",
|
||||
"Upload Transaction Data File": "Carica file dati transazione",
|
||||
"Define Column": "Definisci colonna",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "サポートされていないマッププロバイダーです",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "ページを更新してもう一度やり直してください。エラーが続く場合はサーバーのマップ設定が正しく構成されていることを確認してください。",
|
||||
"Import Transactions": "取引をインポート",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "ファイルをアップロード",
|
||||
"Upload Transaction Data File": "取引データファイルをアップロードします",
|
||||
"Define Column": "列の定義",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "ಬೆಂಬಲಿಸದ ನಕ್ಷೆ ಪೂರೈಕೆದಾರ",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "ದಯವಿಟ್ಟು ಪುಟವನ್ನು ರಿಫ್ರೆಶ್ ಮಾಡಿ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ. ದೋಷ ಮುಂದುವರೆದರೆ, ಸರ್ವರ್ನ ನಕ್ಷೆ ಸೆಟ್ಟಿಂಗ್ಗಳನ್ನು ಸರಿಯಾಗಿ ಸಂರಚಿಸಲಾಗಿದೆ ಎಂದು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ.",
|
||||
"Import Transactions": "ವಹಿವಾಟುಗಳನ್ನು ಆಮದು ಮಾಡಿ",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "ಫೈಲ್ ಅಪ್ಲೋಡ್ ಮಾಡಿ",
|
||||
"Upload Transaction Data File": "ವಹಿವಾಟು ಡೇಟಾ ಫೈಲ್ ಅಪ್ಲೋಡ್ ಮಾಡಿ",
|
||||
"Define Column": "ಕಾಲಮ್ ವ್ಯಾಖ್ಯಾನಿಸಿ",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "지원되지 않는 지도 제공업체",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "페이지를 새로 고치고 다시 시도하십시오. 오류가 지속되면 서버의 지도 설정이 올바르게 구성되었는지 확인하십시오.",
|
||||
"Import Transactions": "거래 가져오기",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "파일 업로드",
|
||||
"Upload Transaction Data File": "거래 데이터 파일 업로드",
|
||||
"Define Column": "열 정의",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Niet-ondersteunde kaartprovider",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Vernieuw de pagina en probeer het opnieuw. Blijft de fout optreden, controleer dan of de kaartinstellingen op de server correct zijn geconfigureerd.",
|
||||
"Import Transactions": "Transacties importeren",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Bestand uploaden",
|
||||
"Upload Transaction Data File": "Bestand met transactiegegevens uploaden",
|
||||
"Define Column": "Kolommen definiëren",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Provedor de Mapa Não Suportado",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Por favor, atualize a página e tente novamente. Se o erro persistir, verifique se as configurações de mapa do servidor estão corretamente configuradas.",
|
||||
"Import Transactions": "Importar Transações",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Enviar Arquivo",
|
||||
"Upload Transaction Data File": "Enviar Arquivo de Dados de Transação",
|
||||
"Define Column": "Definir Coluna",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Неподдерживаемый поставщик карт",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Пожалуйста, обновите страницу и попробуйте снова. Если ошибка сохраняется, убедитесь, что настройки карты на сервере настроены правильно.",
|
||||
"Import Transactions": "Импорт транзакций",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Загрузить файл",
|
||||
"Upload Transaction Data File": "Загрузить файл данных транзакций",
|
||||
"Define Column": "Define Column",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Nepodprt ponudnik zemljevidov",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Osvežite stran in poskusite znova. Če se napaka ponavlja, preverite, ali so nastavitve zemljevida na strežniku pravilno konfigurirane.",
|
||||
"Import Transactions": "Uvozi transakcije",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Naloži datoteko",
|
||||
"Upload Transaction Data File": "Naloži datoteko s podatki o transakcijah",
|
||||
"Define Column": "Določi stolpec",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "ஆதரிக்கப்படாத வரைபடம் வழங்குநர்",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "தயவுசெய்து பக்கம்வை புதுப்பி செய் மீண்டும் முயற்சிக்கவும். பிழை தொடர்ந்தால், சேவையகம் வரைபடம் அமைப்புகளை சரிஆக உள்ளமைக்கப்பட்டது என்று உறுதிசெய்யவும்.",
|
||||
"Import Transactions": "பரிவர்த்தனைகளை இறக்குமதி செய்",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "கோப்பு பதிவேற்று செய்",
|
||||
"Upload Transaction Data File": "பரிவர்த்தனை தரவு கோப்பு பதிவேற்று செய்",
|
||||
"Define Column": "நெடுவரிசையை வரையறு",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "ผู้ให้บริการแผนที่ไม่รองรับ",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "กรุณารีเฟรชหน้าและลองอีกครั้ง หากเกิดข้อผิดพลาดซ้ำ ตรวจสอบการตั้งค่าแผนที่บนเซิร์ฟเวอร์ให้ถูกต้อง",
|
||||
"Import Transactions": "นำเข้าธุรกรรม",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "อัปโหลดไฟล์",
|
||||
"Upload Transaction Data File": "อัปโหลดไฟล์ข้อมูลธุรกรรม",
|
||||
"Define Column": "กำหนดคอลัมน์",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Desteklenmeyen Harita Sağlayıcısı",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Lütfen sayfayı yenileyin ve tekrar deneyin. Hata devam ederse, sunucunun harita ayarlarının doğru yapılandırıldığından emin olun.",
|
||||
"Import Transactions": "İşlemleri İçe Aktar",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Dosya Yükle",
|
||||
"Upload Transaction Data File": "İşlem Veri Dosyası Yükle",
|
||||
"Define Column": "Sütun Tanımla",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Непідтримуваний провайдер карт",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Оновіть сторінку та спробуйте ще раз. Якщо помилка не зникає, перевірте налаштування мап на сервері.",
|
||||
"Import Transactions": "Імпортувати транзакції",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Завантажити файл",
|
||||
"Upload Transaction Data File": "Завантажити файл з даними транзакцій",
|
||||
"Define Column": "Визначити стовпець",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "Nhà cung cấp bản đồ không được hỗ trợ",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "Vui lòng làm mới trang và thử lại. Nếu lỗi vẫn tiếp diễn, hãy đảm bảo rằng cài đặt bản đồ của máy chủ được định cấu hình chính xác.",
|
||||
"Import Transactions": "Nhập giao dịch",
|
||||
"Refresh Accounts, Categories and Tags": "Refresh Accounts, Categories and Tags",
|
||||
"Upload File": "Tải lên tệp",
|
||||
"Upload Transaction Data File": "Tải lên tệp dữ liệu giao dịch",
|
||||
"Define Column": "Define Column",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "不支持的地图提供方",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "请刷新页面并重试。如果仍然显示错误,请确保正确设置了服务器地图设置。",
|
||||
"Import Transactions": "导入交易",
|
||||
"Refresh Accounts, Categories and Tags": "刷新账户、分类和标签",
|
||||
"Upload File": "上传文件",
|
||||
"Upload Transaction Data File": "上传交易数据文件",
|
||||
"Define Column": "定义列",
|
||||
|
||||
@@ -1952,6 +1952,7 @@
|
||||
"Unsupported Map Provider": "不支援的地圖提供者",
|
||||
"Please refresh the page and try again. If the error persists, ensure that the server's map settings are correctly configured.": "請重新載入頁面並重試。如果仍然顯示錯誤,請確保正確設定了伺服器地圖設定。",
|
||||
"Import Transactions": "匯入交易",
|
||||
"Refresh Accounts, Categories and Tags": "重新載入帳戶、分類和標籤",
|
||||
"Upload File": "上傳檔案",
|
||||
"Upload Transaction Data File": "上傳交易資料檔案",
|
||||
"Define Column": "定義欄位",
|
||||
|
||||
@@ -5,7 +5,18 @@
|
||||
<div class="d-flex align-center justify-center">
|
||||
<div class="d-flex w-100 align-center">
|
||||
<h4 class="text-h4">{{ tt('Import Transactions') }}</h4>
|
||||
<v-progress-circular indeterminate size="22" class="ms-2" v-if="loading"></v-progress-circular>
|
||||
<v-progress-circular indeterminate size="22" class="ms-2" v-if="currentStep !== 'checkData' && loading"></v-progress-circular>
|
||||
<v-btn density="compact" color="default" variant="text" size="24"
|
||||
class="ms-2" :icon="true" :disabled="loading"
|
||||
:loading="loading"
|
||||
v-if="currentStep === 'checkData'"
|
||||
@click="reloadBasisData">
|
||||
<template #loader>
|
||||
<v-progress-circular indeterminate size="20"/>
|
||||
</template>
|
||||
<v-icon :icon="mdiRefresh" size="24" />
|
||||
<v-tooltip activator="parent">{{ tt('Refresh Accounts, Categories and Tags') }}</v-tooltip>
|
||||
</v-btn>
|
||||
</div>
|
||||
<v-btn density="comfortable" color="default" variant="text" class="ms-2"
|
||||
:icon="true" :disabled="loading || submitting"
|
||||
@@ -307,6 +318,7 @@ import { generateRandomUUID } from '@/lib/misc.ts';
|
||||
import logger from '@/lib/logger.ts';
|
||||
|
||||
import {
|
||||
mdiRefresh,
|
||||
mdiFilterOutline,
|
||||
mdiCheck,
|
||||
mdiDotsVertical,
|
||||
@@ -674,6 +686,46 @@ function setImportFile(event: Event): void {
|
||||
}
|
||||
}
|
||||
|
||||
function reloadBasisData(): void {
|
||||
loading.value = true;
|
||||
|
||||
Promise.allSettled([
|
||||
accountsStore.loadAllAccounts({ force: true }),
|
||||
transactionCategoriesStore.loadAllCategories({ force: true }),
|
||||
transactionTagsStore.loadAllTags({ force: true })
|
||||
]).then(results => {
|
||||
loading.value = false;
|
||||
|
||||
const isAllUpToDate = results.length === 3
|
||||
&& results[0].status === 'rejected' && results[0].reason?.isUpToDate
|
||||
&& results[1].status === 'rejected' && results[1].reason?.isUpToDate
|
||||
&& results[2].status === 'rejected' && results[2].reason?.isUpToDate;
|
||||
|
||||
// show info if all up to date
|
||||
if (isAllUpToDate) {
|
||||
snackbar.value?.showMessage('Data is up to date');
|
||||
return;
|
||||
}
|
||||
|
||||
// show error if any
|
||||
for (const result of results) {
|
||||
if (result.status === 'rejected' && !result.reason?.isUpToDate) {
|
||||
snackbar.value?.showError(result.reason);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// show info if one of them updated
|
||||
for (const result of results) {
|
||||
if (result.status === 'fulfilled') {
|
||||
snackbar.value?.showMessage('Data has been updated');
|
||||
importTransactionCheckDataTab.value?.updateAllTransactionsIsValid();
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parseData(): void {
|
||||
let uploadFile: File;
|
||||
let type: string = fileType.value;
|
||||
|
||||
@@ -1634,14 +1634,43 @@ function updateTransactionData(transaction: ImportTransaction): void {
|
||||
|
||||
if (transaction.categoryId && allCategoriesMap.value[transaction.categoryId]) {
|
||||
transaction.actualCategoryName = allCategoriesMap.value[transaction.categoryId]!.name;
|
||||
} else {
|
||||
if (transaction.type !== TransactionType.ModifyBalance) {
|
||||
transaction.valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (transaction.sourceAccountId && allAccountsMap.value[transaction.sourceAccountId]) {
|
||||
transaction.actualSourceAccountName = allAccountsMap.value[transaction.sourceAccountId]!.name;
|
||||
} else {
|
||||
transaction.valid = false;
|
||||
}
|
||||
|
||||
if (transaction.destinationAccountId && allAccountsMap.value[transaction.destinationAccountId]) {
|
||||
transaction.actualDestinationAccountName = allAccountsMap.value[transaction.destinationAccountId]!.name;
|
||||
} else {
|
||||
if (transaction.type === TransactionType.Transfer) {
|
||||
transaction.valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (transaction.tagIds && transaction.tagIds.length) {
|
||||
for (const tagId of transaction.tagIds) {
|
||||
if (!tagId || !allTagsMap.value[tagId]) {
|
||||
transaction.valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateAllTransactionsIsValid(): void {
|
||||
if (!props.importTransactions || props.importTransactions.length < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const importTransaction of props.importTransactions) {
|
||||
updateTransactionData(importTransaction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2227,6 +2256,7 @@ defineExpose({
|
||||
toolMenus,
|
||||
isEditing,
|
||||
canImport,
|
||||
updateAllTransactionsIsValid,
|
||||
reset,
|
||||
setCountPerPage
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user