@@ -217,7 +217,7 @@ export default {
},
methods: {
storeField: function (payload) {
- console.log(payload);
+ // console.log(payload);
if ('location' === payload.field) {
if (true === payload.value.hasMarker) {
this.location = payload.value;
@@ -232,13 +232,13 @@ export default {
e.preventDefault();
this.submitting = true;
let submission = this.getSubmission();
- console.log('Will submit:');
- console.log(submission);
+ // console.log('Will submit:');
+ // console.log(submission);
let url = './api/v1/accounts';
axios.post(url, submission)
.then(response => {
- console.log('success!');
+ // console.log('success!');
this.returnedId = parseInt(response.data.data.id);
this.returnedTitle = response.data.data.attributes.name;
this.successMessage = this.$t('firefly.stored_new_account_js', {ID: this.returnedId, name: this.returnedTitle});
@@ -249,7 +249,7 @@ export default {
}
this.submitting = false;
if (this.resetFormAfter) {
- console.log('reset!');
+ // console.log('reset!');
this.name = '';
this.liability_type = 'Loan';
this.liability_direction = 'debit';
@@ -276,7 +276,7 @@ export default {
},
parseErrors: function (errors) {
this.errors = lodashClonedeep(this.defaultErrors);
- console.log(errors);
+ // console.log(errors);
for (let i in errors.errors) {
if (errors.errors.hasOwnProperty(i)) {
this.errors[i] = errors.errors[i];
diff --git a/frontend/src/components/accounts/Delete.vue b/frontend/src/components/accounts/Delete.vue
index 45c6c6dae9..74370196d4 100644
--- a/frontend/src/components/accounts/Delete.vue
+++ b/frontend/src/components/accounts/Delete.vue
@@ -91,7 +91,7 @@ export default {
},
created() {
let pathName = window.location.pathname;
- console.log(pathName);
+ // console.log(pathName);
let parts = pathName.split('/');
this.accountId = parseInt(parts[parts.length - 1]);
this.getAccount();
@@ -153,7 +153,7 @@ export default {
}
);
// get accounts of the same type.
- console.log('Go for "' + type + '"');
+ // console.log('Go for "' + type + '"');
},
getPiggyBankCount: function (type, currencyCode) {
axios.get('./api/v1/accounts/' + this.accountId + '/piggy_banks')
diff --git a/frontend/src/components/accounts/Index.vue b/frontend/src/components/accounts/Index.vue
index 63a5242060..01695dc1c6 100644
--- a/frontend/src/components/accounts/Index.vue
+++ b/frontend/src/components/accounts/Index.vue
@@ -259,9 +259,9 @@ export default {
this.fields.push({key: 'menu', label: ' ', sortable: false});
},
getAccountList: function () {
- console.log('getAccountList()');
+ // console.log('getAccountList()');
if (this.indexReady && !this.loading && !this.downloaded) {
- console.log('Index ready, not loading and not already downloaded. Reset.');
+ // console.log('Index ready, not loading and not already downloaded. Reset.');
this.loading = true;
this.perPage = this.listPageSize ?? 51;
this.accounts = [];
@@ -269,14 +269,14 @@ export default {
this.downloadAccountList(1);
}
if (this.indexReady && !this.loading && this.downloaded) {
- console.log('Index ready, not loading and not downloaded.');
+ // console.log('Index ready, not loading and not downloaded.');
this.loading = true;
this.filterAccountList();
// TODO filter accounts.
}
},
downloadAccountList: function (page) {
- console.log('downloadAccountList(' + page + ')');
+ // console.log('downloadAccountList(' + page + ')');
axios.get('./api/v1/accounts?type=' + this.type + '&page=' + page)
.then(response => {
let currentPage = parseInt(response.data.meta.pagination.current_page);
@@ -288,7 +288,7 @@ export default {
this.downloadAccountList(nextPage);
}
if (currentPage >= totalPage) {
- console.log('Looks like all downloaded.');
+ // console.log('Looks like all downloaded.');
this.downloaded = true;
this.filterAccountList();
}
@@ -296,7 +296,7 @@ export default {
);
},
filterAccountList: function () {
- console.log('filterAccountList()');
+ // console.log('filterAccountList()');
this.accounts = [];
for (let i in this.allAccounts) {
if (this.allAccounts.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
@@ -304,14 +304,14 @@ export default {
// 2 = inactive only
// 3 = both
if (1 === this.activeFilter && false === this.allAccounts[i].active) {
- console.log('Skip account #' + this.allAccounts[i].id + ' because not active.');
+ // console.log('Skip account #' + this.allAccounts[i].id + ' because not active.');
continue;
}
if (2 === this.activeFilter && true === this.allAccounts[i].active) {
- console.log('Skip account #' + this.allAccounts[i].id + ' because active.');
+ // console.log('Skip account #' + this.allAccounts[i].id + ' because active.');
continue;
}
- console.log('Include account #' + this.allAccounts[i].id + '.');
+ // console.log('Include account #' + this.allAccounts[i].id + '.');
this.accounts.push(this.allAccounts[i]);
}
@@ -330,7 +330,7 @@ export default {
//console.log('Total is now ' + this.total);
},
parseAccounts: function (data) {
- console.log('In parseAccounts()');
+ // console.log('In parseAccounts()');
for (let key in data) {
if (data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
let current = data[key];
@@ -357,7 +357,7 @@ export default {
}
},
getAccountBalanceDifference: function (index, acct) {
- console.log('getAccountBalanceDifference(' + index + ')');
+ // console.log('getAccountBalanceDifference(' + index + ')');
// get account on day 0
let promises = [];
diff --git a/frontend/src/components/dashboard/MainAccount.vue b/frontend/src/components/dashboard/MainAccount.vue
index cfa734faa9..19c65b4ede 100644
--- a/frontend/src/components/dashboard/MainAccount.vue
+++ b/frontend/src/components/dashboard/MainAccount.vue
@@ -116,8 +116,8 @@ export default {
this.drawChart();
})
.catch(error => {
- console.log('Has error!');
- console.log(error);
+ // console.log('Has error!');
+ // console.log(error);
this.error = true;
});
},
diff --git a/frontend/src/components/dashboard/MainBudgetList.vue b/frontend/src/components/dashboard/MainBudgetList.vue
index 74348fad0b..918a579adc 100644
--- a/frontend/src/components/dashboard/MainBudgetList.vue
+++ b/frontend/src/components/dashboard/MainBudgetList.vue
@@ -164,7 +164,7 @@ export default {
spent: spentData.sum
}
);
- console.log('Added budget ' + current.attributes.name + ' (' + spentData.currency_code + ')');
+ //console.log('Added budget ' + current.attributes.name + ' (' + spentData.currency_code + ')');
}
}
}
@@ -192,7 +192,7 @@ export default {
id: currentId,
name: current.attributes.name,
};
- console.log('Collected meta data: budget #' + currentId + ' is named ' + current.attributes.name);
+ //console.log('Collected meta data: budget #' + currentId + ' is named ' + current.attributes.name);
}
}
@@ -250,7 +250,7 @@ export default {
for (let i in this.rawBudgets) {
if (this.rawBudgets.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
if (this.rawBudgets[i].currency_id === currencyId && this.rawBudgets[i].id === budgetId) {
- console.log('Budget ' + this.rawBudgets[i].name + ' with currency ' + this.rawBudgets[i].currency_code + ' will be removed in favor of a budget limit.');
+ //console.log('Budget ' + this.rawBudgets[i].name + ' with currency ' + this.rawBudgets[i].currency_code + ' will be removed in favor of a budget limit.');
this.rawBudgets.splice(parseInt(i), 1);
}
}
diff --git a/frontend/src/components/dashboard/MainCategoryList.vue b/frontend/src/components/dashboard/MainCategoryList.vue
index 88820a320d..156b40ed5b 100644
--- a/frontend/src/components/dashboard/MainCategoryList.vue
+++ b/frontend/src/components/dashboard/MainCategoryList.vue
@@ -136,7 +136,7 @@ export default {
},
methods:
{
- getCategories() {
+ getCategories: function () {
this.categories = [];
this.sortedList = [];
this.spent = 0;
@@ -144,19 +144,32 @@ export default {
this.loading = true;
let startStr = this.start.toISOString().split('T')[0];
let endStr = this.end.toISOString().split('T')[0];
- axios.get('./api/v1/categories?start=' + startStr + '&end=' + endStr)
+ this.getCategoryPage(startStr, endStr, 1);
+ },
+ getCategoryPage: function (start, end, page) {
+ axios.get('./api/v1/categories?start=' + start + '&end=' + end + '&page=' + page)
.then(response => {
- this.parseCategories(response.data);
- this.loading = false;
+ let categories = response.data.data;
+ let currentPage = parseInt(response.data.meta.pagination.current_page);
+ let totalPages = parseInt(response.data.meta.pagination.total_pages);
+ this.parseCategories(categories);
+ if (currentPage < totalPages) {
+ let nextPage = currentPage + 1;
+ this.getCategoryPage(start, end, nextPage);
+ }
+ if (currentPage === totalPages) {
+ this.loading = false;
+ this.sortCategories();
+ }
}
).catch(error => {
this.error = true;
});
},
parseCategories(data) {
- for (let i in data.data) {
- if (data.data.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
- let current = data.data[i];
+ for (let i in data) {
+ if (data.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
+ let current = data[i];
let entryKey = null;
let categoryId = parseInt(current.id);
@@ -207,7 +220,6 @@ export default {
}
}
}
- this.sortCategories();
},
sortCategories() {
// no longer care about keys:
diff --git a/frontend/src/components/transactions/Create.vue b/frontend/src/components/transactions/Create.vue
index 0ddaeb61c6..54db50bfb3 100644
--- a/frontend/src/components/transactions/Create.vue
+++ b/frontend/src/components/transactions/Create.vue
@@ -22,7 +22,7 @@