function getPropertiesChanges()

in entity-browser-frontend/app/service/entity.js [161:191]


            function getPropertiesChanges(propertiesBefore, propertiesAfter) {
                function getPropertyItemKey(item) {
                    return item.name;
                }

                var result = [];
                var joined = join(propertiesBefore, propertiesAfter, getPropertyItemKey);
                angular.forEach(joined.uniqueNames, function (name) {
                    var initialProperty = findByKey(propertiesBefore, name, getPropertyItemKey);
                    var currentProperty = findByKey(propertiesAfter, name, getPropertyItemKey);
                    if (initialProperty && currentProperty) {
                        if (initialProperty.value !== currentProperty.value || initialProperty.type.clazz !== currentProperty.type.clazz) {
                            result.push({
                                name: currentProperty.name,
                                newValue: currentProperty
                            });
                        }
                    } else if (initialProperty) {
                        result.push({
                            name: initialProperty.name,
                            newValue: null
                        });
                    } else if (currentProperty) {
                        result.push({
                            name: currentProperty.name,
                            newValue: currentProperty
                        });
                    }
                });
                return result;
            }