Skip to content
Snippets Groups Projects
Commit fda108d3 authored by Janis Streib's avatar Janis Streib :owl:
Browse files

FIX: filter at correct places to improve displayed informtaion

parent 04ac28e5
No related branches found
No related tags found
No related merge requests found
Pipeline #273658 passed with warnings
......@@ -95,11 +95,12 @@ export default {
}
ta['parameters'] = {
'new': transactionutil.remove_empty_data(this.object_functions[this.object_function].parameters, new_params),
'old': transactionutil.filer_old_data(this.object_functions[this.object_function].parameters, this.old_data)
'old': this.old_data
}
ta['old_uuid'] = this.old_uuid
ta['uuid'] = uuidv4()
ta['object_fq_name'] = this.object_fq_name
ta['object_functions'] = this.object_functions
ta['object_function'] = this.object_function
ta['input_reducer'] = this.input_reducer
ta['non_optionals_order'] = this.non_optionals_order
......
import transactionutil from "@/util/transactionutil";
export default {
dict_by_value_of_array(arr, val) {
let res = {}
......@@ -30,10 +32,10 @@ export default {
for (let i = 0; i < obj.length; i++) {
let app = {name: `${obj[i].object_fq_name}.${obj[i].object_function}`}
if (Object.keys(obj[i].parameters.old).length > 0) {
app['old'] = obj[i].parameters.old
app['old'] = transactionutil.filter_old_data(obj[i].object_functions[obj[i].object_function].parameters, obj[i].parameters.old)
}
if (Object.keys(obj[i].parameters.new).length > 0) {
app['new'] = obj[i].parameters.new
app['new'] = transactionutil.filter_unchanged_data(obj[i].parameters.new, obj[i].parameters.old)
}
res.push(app)
}
......
......@@ -28,7 +28,13 @@ export default {
return function_name
}
},
filer_old_data(params_list, old_data) {
filter_unchanged_data(d1, d2) {
return Object.keys(d1).reduce(function (filtered, key) {
if (!(key in d2) || d1[key] != d2[key]) filtered[key] = d1[key];
return filtered;
}, {})
},
filter_old_data(params_list, old_data) {
return Object.keys(old_data).reduce(function (filtered, key) {
if (key in params_list && 'old' in params_list[key]) filtered[key] = old_data[key];
return filtered;
......
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