This commit is contained in:
James Cole
2020-07-23 19:40:10 +02:00
parent 93a0338678
commit e1f4cd7565
85 changed files with 233 additions and 23 deletions

View File

@@ -644,6 +644,7 @@
internal_reference: [],
notes: [],
attachments: [],
external_uri: [],
},
};
}
@@ -740,6 +741,7 @@
internal_reference: [],
notes: [],
attachments: [],
external_uri: [],
},
},
budget: 0,
@@ -753,7 +755,8 @@
"invoice_date": "",
"internal_reference": "",
"notes": "",
"attachments": []
"attachments": [],
"external_uri": "",
},
foreign_amount: {
amount: "",

View File

@@ -49,6 +49,10 @@
:error="error.attachments"
v-model="value.attachments" v-if="this.fields.attachments" name="attachments[]" v-bind:title="$t('firefly.attachments')" v-bind:is="attachmentComponent"></component>
<component
:error="error.external_uri"
v-model="value.external_uri" v-if="this.fields.external_uri" name="external_uri[]" v-bind:title="$t('firefly.external_uri')" v-bind:is="uriComponent"></component>
<component
:error="error.notes"
v-model="value.notes" v-if="this.fields.notes" name="notes[]" v-bind:title="$t('firefly.notes')" v-bind:is="textareaComponent"></component>
@@ -75,7 +79,8 @@
"invoice_date": false,
"internal_reference": false,
"notes": false,
"attachments": false
"attachments": false,
"external_uri": false
}
]
};
@@ -93,6 +98,9 @@
},
textareaComponent () {
return 'custom-textarea';
},
uriComponent () {
return 'custom-uri';
}
},
methods: {
@@ -116,4 +124,4 @@
<style scoped>
</style>
</style>

View File

@@ -0,0 +1,77 @@
<!--
- CustomString.vue
- Copyright (c) 2019 james@firefly-iii.org
-
- This file is part of Firefly III (https://github.com/firefly-iii).
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<template>
<div class="form-group"
v-bind:class="{ 'has-error': hasError()}"
>
<div class="col-sm-12 text-sm">
{{ title }}
</div>
<div class="col-sm-12">
<div class="input-group">
<input type="url" class="form-control" :name="name"
:title="title" autocomplete="off"
ref="uri"
:value="value" @input="handleInput"
:placeholder="title">
<span class="input-group-btn">
<button
tabIndex="-1"
v-on:click="clearField"
class="btn btn-default"
type="button"><i class="fa fa-trash-o"></i></button>
</span>
</div>
<ul class="list-unstyled" v-for="error in this.error">
<li class="text-danger">{{ error }}</li>
</ul>
</div>
</div>
</template>
<script>
export default {
name: "CustomString",
props: {
title: String,
name: String,
value: String,
error: Array
},
methods: {
handleInput(e) {
this.$emit('input', this.$refs.uri.value);
},
clearField: function () {
this.name = '';
this.$refs.uri.value = '';
this.$emit('input', this.$refs.uri.value);
},
hasError: function () {
return this.error.length > 0;
}
}
}
</script>
<style scoped>
</style>

View File

@@ -416,6 +416,7 @@
internal_reference: [],
notes: [],
attachments: [],
external_uri: [],
},
},
budget: transaction.budget_id,
@@ -428,7 +429,8 @@
payment_date: transaction.payment_date,
invoice_date: transaction.invoice_date,
internal_reference: transaction.internal_reference,
notes: transaction.notes
notes: transaction.notes,
external_uri: transaction.external_uri
},
foreign_amount: {
amount: this.roundNumber(this.positiveAmount(transaction.foreign_amount), transaction.foreign_currency_decimal_places),
@@ -608,6 +610,7 @@
payment_date: row.custom_fields.payment_date,
invoice_date: row.custom_fields.invoice_date,
internal_reference: row.custom_fields.internal_reference,
external_uri: row.custom_fields.external_uri,
notes: row.custom_fields.notes,
tags: tagList
};
@@ -830,6 +833,7 @@
internal_reference: [],
notes: [],
attachments: [],
external_uri: [],
},
},
budget: 0,
@@ -843,7 +847,8 @@
"invoice_date": "",
"internal_reference": "",
"notes": "",
"attachments": []
"attachments": [],
"external_uri": "",
},
foreign_amount: {
amount: "",
@@ -903,6 +908,10 @@
case 'tags':
this.transactions[transactionIndex].errors[fieldName] = errors.errors[key];
break;
case 'external_uri':
console.log('Found ext error in field "'+fieldName+'": ' + errors.errors[key]);
this.transactions[transactionIndex].errors.custom_errors[fieldName] = errors.errors[key];
break;
case 'source_name':
case 'source_id':
this.transactions[transactionIndex].errors.source_account =
@@ -954,6 +963,7 @@
internal_reference: [],
notes: [],
attachments: [],
external_uri: [],
},
};
}