mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-11 17:39:41 +00:00
Add translations, fix error message.
This commit is contained in:
@@ -66,7 +66,7 @@ let transactions = function () {
|
||||
isSubmitting: false,
|
||||
returnHereButton: false,
|
||||
saveAsNewButton: false, // edit form only
|
||||
resetButton: true,
|
||||
resetButton: false,
|
||||
rulesButton: true,
|
||||
webhooksButton: true,
|
||||
},
|
||||
@@ -89,7 +89,10 @@ let transactions = function () {
|
||||
|
||||
// properties for the entire transaction group
|
||||
groupProperties: {
|
||||
transactionType: 'unknown', title: null, id: null, totalAmount: 0,
|
||||
transactionType: 'unknown',
|
||||
title: null,
|
||||
id: null,
|
||||
totalAmount: 0,
|
||||
},
|
||||
|
||||
// notifications
|
||||
@@ -369,7 +372,8 @@ let transactions = function () {
|
||||
};
|
||||
|
||||
// catch for group title:
|
||||
if (null === this.groupProperties.title && transactions.length > 1) {
|
||||
// TODO later this must be handled with more care (ie use the group title input)
|
||||
if (transactions.length > 1) {
|
||||
submission.group_title = transactions[0].description;
|
||||
}
|
||||
|
||||
@@ -381,6 +385,7 @@ let transactions = function () {
|
||||
// submission was a success!
|
||||
this.groupProperties.id = parseInt(group.id);
|
||||
this.groupProperties.title = group.attributes.group_title ?? group.attributes.transactions[0].description
|
||||
console.log('group title is now: ', this.groupProperties.title);
|
||||
|
||||
// process attachments, if any:
|
||||
const attachmentCount = processAttachments(this.groupProperties.id, group.attributes.transactions);
|
||||
@@ -414,10 +419,12 @@ let transactions = function () {
|
||||
this.notifications.wait.show = false;
|
||||
|
||||
if (this.formStates.returnHereButton) {
|
||||
|
||||
this.notifications.success.show = true;
|
||||
this.notifications.success.url = 'transactions/show/' + this.groupProperties.id;
|
||||
this.notifications.success.text = i18next.t('firefly.stored_journal_js', {description: this.groupProperties.title});
|
||||
this.notifications.success.text = i18next.t('firefly.stored_journal_js', {description: this.groupProperties.title, interpolation: { escapeValue: false }});
|
||||
this.formStates.isSubmitting = false;
|
||||
// reset group title again
|
||||
this.groupProperties.title = null;
|
||||
|
||||
if (this.formStates.resetButton) {
|
||||
this.entries = [];
|
||||
|
||||
@@ -1935,7 +1935,7 @@ return [
|
||||
'deleted_transfer' => 'Successfully deleted transfer ":description"',
|
||||
'deleted_reconciliation' => 'Successfully deleted reconciliation transaction ":description"',
|
||||
'stored_journal' => 'Successfully created new transaction ":description"',
|
||||
'stored_journal_js' => 'Successfully created new transaction "%{description}"',
|
||||
'stored_journal_js' => 'Successfully created new transaction "{{description}}"',
|
||||
'stored_journal_no_descr' => 'Successfully created your new transaction',
|
||||
'updated_journal_no_descr' => 'Successfully updated your transaction',
|
||||
'select_transactions' => 'Select transactions',
|
||||
@@ -2489,8 +2489,9 @@ return [
|
||||
'store_as_new' => 'Store as a new transaction instead of updating.',
|
||||
'reset_after' => 'Reset form after submission',
|
||||
'errors_submission' => 'There was something wrong with your submission. Please check out the errors below.',
|
||||
'errors_submission_v2' => 'There was something wrong with your submission. Please check out the errors below: %{errorMessage}',
|
||||
'errors_submission_v2' => 'There was something wrong with your submission. Please check out the errors below: {{errorMessage}}',
|
||||
'transaction_expand_split' => 'Expand split',
|
||||
'transaction_remove_split' => 'Remove split',
|
||||
'transaction_collapse_split' => 'Collapse split',
|
||||
|
||||
// object groups
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<div :class="{'tab-pane fade pt-2':true, 'show active': index ===0}" :id="'split-'+index+'-pane'" role="tabpanel" :aria-labelledby="'split-'+index+'-tab'" tabindex="0" x-init="addedSplit()">
|
||||
<div :class="{'tab-pane fade pt-2':true, 'show active': index ===0}" :id="'split-'+index+'-pane'" role="tabpanel"
|
||||
:aria-labelledby="'split-'+index+'-tab'" tabindex="0" x-init="addedSplit()">
|
||||
<div class="row mb-2">
|
||||
<div class="col-xl-6 col-lg-6 col-md-12 col-xs-12 mb-2">
|
||||
<!-- BASIC TRANSACTION INFORMATION -->
|
||||
@@ -109,19 +110,23 @@
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-success" :disabled="formStates.isSubmitting" @click="submitTransaction()">Submit</button>
|
||||
<div class="btn-group">
|
||||
<template x-if="1 !== entries.length">
|
||||
<button :disabled="formStates.isSubmitting" class="btn btn-danger text-white"
|
||||
@click="removeSplit(index)">{{ __('firefly.transaction_remove_split') }}</button>
|
||||
</template>
|
||||
<button @click="addSplit()" class="btn btn-info"
|
||||
:disabled="formStates.isSubmitting">{{ __('firefly.add_another_split') }}</button>
|
||||
<button class="btn btn-success text-white" :disabled="formStates.isSubmitting"
|
||||
@click="submitTransaction()">{{ __('firefly.submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<template x-if="0 !== index">
|
||||
<button :disabled="formStates.isSubmitting" class="btn btn-danger" @click="removeSplit(index)">
|
||||
Remove this split
|
||||
</button>
|
||||
</template>
|
||||
<button class="btn btn-info" :disabled="formStates.isSubmitting">Add another split</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
:data-index="index"
|
||||
:class="{'is-invalid': transaction.errors.amount.length > 0, 'input-mask' : true, 'form-control': true}"
|
||||
x-model="transaction.amount"
|
||||
@keyup.enter="submitTransaction()"
|
||||
@change="changedAmount"
|
||||
placeholder="0.00">
|
||||
<template x-if="transaction.errors.amount.length > 0">
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<select class="form-control"
|
||||
:id="'budget_id_' + index"
|
||||
x-model="transaction.budget_id"
|
||||
@keyup.enter="submitTransaction()"
|
||||
>
|
||||
<template x-for="budget in formData.budgets">
|
||||
<option :label="budget.name" :value="budget.id" :selected="budget.id == transaction.budget_id"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<input type="search"
|
||||
class="form-control ac-category"
|
||||
:id="'category_name_' + index"
|
||||
@keyup.enter="submitTransaction()"
|
||||
x-model="transaction.category_name"
|
||||
:data-index="index"
|
||||
placeholder="{{ __('firefly.category') }}">
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<div class="col-sm-10">
|
||||
<input type="datetime-local" class="form-control" :id="'date_' + index"
|
||||
@change="changedDateTime"
|
||||
@keyup.enter="submitTransaction()"
|
||||
x-model="transaction.date"
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<input type="text" class="form-control ac-description"
|
||||
:id="'description_' + index"
|
||||
@change="changedDescription"
|
||||
@keyup.enter="submitTransaction()"
|
||||
x-model="transaction.description"
|
||||
:class="{'is-invalid': transaction.errors.description.length > 0, 'form-control': true}"
|
||||
:data-index="index"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<template x-if="!formStates.loadingPiggyBanks">
|
||||
<select class="form-control"
|
||||
:id="'piggy_bank_id_' + index"
|
||||
@keyup.enter="submitTransaction()"
|
||||
x-model="transaction.piggy_bank_id">
|
||||
<template x-for="group in formData.piggyBanks">
|
||||
<optgroup :label="group.name">
|
||||
|
||||
@@ -34,6 +34,6 @@
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="webhookButton" :checked="formStates.webhookButton">
|
||||
<label class="form-check-label" for="webhookButton">{{ __('firefly.fire_webhooks_checkbox') }}</label>
|
||||
<input class="form-check-input" type="checkbox" id="webhooksButton" :checked="formStates.webhooksButton">
|
||||
<label class="form-check-label" for="webhooksButton">{{ __('firefly.fire_webhooks_checkbox') }}</label>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<template x-if="!formStates.loadingSubscriptions">
|
||||
<select class="form-control"
|
||||
:id="'bill_id_' + index"
|
||||
@keyup.enter="submitTransaction()"
|
||||
x-model="transaction.bill_id">
|
||||
<template x-for="group in formData.subscriptions">
|
||||
<optgroup :label="group.name">
|
||||
|
||||
@@ -18,11 +18,6 @@
|
||||
:optionalDateFields="$optionalDateFields"></x-transaction-split>
|
||||
</template>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-success" :disabled="formStates.isSubmitting" @click="submitTransaction()">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user