2018-04-02 19:01:53 +00:00
|
|
|
import {
|
|
|
|
forEach
|
|
|
|
} from 'min-dash';
|
|
|
|
|
2017-01-11 14:22:32 +00:00
|
|
|
|
2017-01-19 15:12:25 +00:00
|
|
|
/**
|
|
|
|
* These are the properties that should be ignored when cloning elements.
|
|
|
|
*
|
|
|
|
* @type {Array}
|
|
|
|
*/
|
2018-04-02 19:01:53 +00:00
|
|
|
export var IGNORED_PROPERTIES = [
|
2017-01-19 15:12:25 +00:00
|
|
|
'lanes',
|
|
|
|
'incoming',
|
|
|
|
'outgoing',
|
|
|
|
'artifacts',
|
|
|
|
'default',
|
2017-12-07 22:12:00 +00:00
|
|
|
'flowElements',
|
|
|
|
'dataInputAssociations',
|
|
|
|
'dataOutputAssociations'
|
2017-01-19 15:12:25 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
2018-04-02 19:01:53 +00:00
|
|
|
export function getProperties(descriptor, keepDefault) {
|
2017-01-11 14:22:32 +00:00
|
|
|
var properties = [];
|
|
|
|
|
|
|
|
forEach(descriptor.properties, function(property) {
|
|
|
|
|
|
|
|
if (keepDefault && property.default) {
|
|
|
|
return;
|
|
|
|
}
|
2017-01-19 15:12:25 +00:00
|
|
|
|
2017-01-11 14:22:32 +00:00
|
|
|
properties.push(property.ns.name);
|
|
|
|
});
|
|
|
|
|
|
|
|
return properties;
|
2018-04-02 19:01:53 +00:00
|
|
|
}
|