Skip to content
Snippets Groups Projects
Commit 29d35f8d authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch
Browse files

SSDM-13287 : cannot add terms to internal vocabularies in new admin UI

parent 482f26c0
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -45,10 +45,27 @@ class FormUtil {
}
}
getFieldValue(object, path) {
const field = !_.isNil(object) ? _.get(object, path, null) : null
if (!_.isNil(field)) {
const value = field.value
if (_.isNil(value)) {
return null
} else if (_.isString(value) && _.isEmpty(value.trim())) {
return null
} else {
return value
}
} else {
return null
}
}
hasFieldChanged(currentObject, originalObject, path) {
const currentValue = _.get(currentObject, path)
const originalValue = originalObject ? _.get(originalObject, path) : null
return originalValue.value !== currentValue.value
const currentValue = this.getFieldValue(currentObject, path)
const originalValue = this.getFieldValue(originalObject, path)
return originalValue !== currentValue
}
haveFieldsChanged(currentObject, originalObject, paths) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment