Skip to content
Snippets Groups Projects

Fix: Set fixed values correctly (coscine/issues#1146)

Merged Marcel Nellesen requested to merge Hotfix/1142-fixFixedValues into master
2 files
+ 24
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -299,6 +299,9 @@ export default Vue.extend({
checkDataField(data: any, nodename: string, property: string = 'value') {
return FieldReader.isDataValueAssignedToKey(data, nodename, property);
},
checkFixedField(data: any, nodename: string, property: string = 'value') {
return FieldReader.isFixedValueAssignedToKey(data, nodename, property);
},
checkField(data: any, nodename: string, property: string = 'value') {
return FieldReader.isValueAssignedToKey(data, nodename, property);
},
@@ -321,8 +324,8 @@ export default Vue.extend({
return this.checkDataField(this.formData, this.nodeName);
},
removeEmptyEntry(){
if ((this.checkDataField(this.fixedValues[this.idForFixedValues],'https://purl.org/coscine/fixedValue') && this.fixedValues[this.idForFixedValues]['https://purl.org/coscine/fixedValue'][0]['value'] === '') ||
this.checkDataField(this.fixedValues[this.idForFixedValues],'https://purl.org/coscine/defaultValue') && this.fixedValues[this.idForFixedValues]['https://purl.org/coscine/defaultValue'][0]['value'] === '') {
if ((this.checkFixedField(this.fixedValues[this.idForFixedValues],'https://purl.org/coscine/fixedValue') && this.fixedValues[this.idForFixedValues]['https://purl.org/coscine/fixedValue'][0]['value'] === '') ||
this.checkFixedField(this.fixedValues[this.idForFixedValues],'https://purl.org/coscine/defaultValue') && this.fixedValues[this.idForFixedValues]['https://purl.org/coscine/defaultValue'][0]['value'] === '') {
this.$delete(this.fixedValues[this.idForFixedValues],'https://purl.org/coscine/defaultValue');
this.$delete(this.fixedValues[this.idForFixedValues],'https://purl.org/coscine/fixedValue');
this.locked = false;
Loading