Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { getAllObjectsWithFields } from './data-helpers';
const organisationUnitGroupSelectorProps$ = Observable.fromPromise(getAllObjectsWithFields('organisationUnitGroup'))
.map(organisationUnitGroups => ({
source: organisationUnitGroups.map(model => ({ value: model.id, label: model.displayName })),
onItemDoubleClick(value) {
const ougFormula = ['OUG{', value, '}'].join('');
// `this` is the react component props object
if (isFunction(this.onSelect)) {
this.onSelect(ougFormula);
}
},
}));
export default withPropsFromObservable(organisationUnitGroupSelectorProps$, ListSelectWithLocalSearch);
import { getAllObjectsWithFields } from './data-helpers';
const constantSelectorProps$ = Observable.fromPromise(getAllObjectsWithFields('constant'))
.map(constants => ({
source: constants.map(model => ({ value: model.id, label: model.displayName })),
onItemDoubleClick(value) {
const constFormula = ['C{', value, '}'].join('');
// `this` is the react component props object
if (isFunction(this.onSelect)) {
this.onSelect(constFormula);
}
},
}));
export default withPropsFromObservable(constantSelectorProps$, ListSelectWithLocalSearch);