Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const state = this.props.state || DEFAULT_STATE;
const props = Object.assign({}, omit(this.props, cmfConnect.INJECTED_PROPS), {
docked: this.props.docked != null ? this.props.docked : state.get(DOCKED_ATTR),
value: this.props.value ? this.props.value : state.get(QUERY_ATTR, ''),
onToggle: this.onToggle,
onFilter: this.onFilter,
});
return ;
}
}
render() {
const { items } = this.props;
const props = {
...omit(this.props, cmfConnect.INJECTED_PROPS),
...this.props.state.toJS(),
onToggle: this.onToggle,
onBlur: this.onBlur,
onSelect: this.onSelect,
onKeyDown: this.onKeyDown,
items: items && items.toJS ? items.toJS() : items,
};
return ;
}
}
render() {
if (!this.props.data) {
return null;
}
const structure = transform(this.props.data.toJS(), this.props);
const props = omit(this.props, cmfConnect.INJECTED_PROPS);
return (
);
}
}
render() {
const state = this.props.state || DEFAULT_STATE;
const props = omit(this.props, cmfConnect.INJECTED_PROPS);
const filterMethod =
this.props.filterMode === SelectObject.FILTER_MODE.ALL ? this.filterAll : this.filter;
const matches = [];
let selectedId = state.get('selectedId') || props.selectedId;
function addMatch(item) {
matches.push(item);
}
if (props.query) {
props.filteredData = filterMethod(
props.sourceData,
props.query,
{
...props,
onMatch: addMatch,
},
}
if (onCancel) {
eventHandlerProps.onCancel = onCancel;
}
if (onSubmit) {
eventHandlerProps.onSubmit = onSubmit;
}
if (onChange) {
eventHandlerProps.onChange = onChange;
}
if (hasGoBack) {
eventHandlerProps.onGoBack = this.onGoBack;
}
const props = Object.assign(
{},
omit(this.props, cmfConnect.INJECTED_PROPS),
eventHandlerProps,
{
...state.toJS(),
},
);
return ;
}
}
render() {
const uiSpecs = this.getUISpec();
if (!uiSpecs.jsonSchema) {
const response = this.props.state.get('response');
if (response) {
return <p>{response.get('statusText')}</p>;
}
return <form loading="">;
}
const props = {
...omit(this.props, cmfConnect.INJECTED_PROPS),
...uiSpecs,
properties: this.state.properties,
onTrigger: this.onTrigger,
onChange: this.onChange,
onSubmit: this.onSubmit,
widgets: { ...this.props.widgets, ...tcompFieldsWidgets },
};
const errors = this.props.state.get('errors');
if (errors) {
props.errors = this.getMemoizedErrors(errors);
}
return ;
}
}</form>
'data-feature': `product.${(product.id || '').toLowerCase()}`,
label: product.name,
icon: `talend-${product.icon}-colored`,
onClickDispatch: openProduct(product),
})),
];
productsProps.products = Object.assign({}, productsFromProps, { items });
productsProps.products.items.sort(productsSort || sortProductsByLabel);
if (prepareProducts) {
productsProps.products.items = prepareProducts(productsProps.products.items);
}
}
return ;
}
}
render() {
const state = this.props.state || DEFAULT_STATE;
const props = Object.assign(
{},
omit(this.props, cmfConnect.INJECTED_PROPS),
{
onEdit: this.onEdit,
onCancel: this.onCancel,
onSubmit: this.onSubmit,
onChange: this.onChange,
},
{
...state.toJS(),
},
);
return ;
}
}
if (props.actionCreator) {
props.dispatchActionCreator(props.actionCreator, event, data);
} else {
props.dispatch({
model: props.model,
...props.payload,
});
}
};
}
const state = props.state || DEFAULT_STATE;
const model = state.has('model') ? state.get('model').toJS() : props.model;
const newProps = {
...omit(props, cmfConnect.INJECTED_PROPS.concat(['getComponent', 'initialState'])),
model,
inProgress: state.get('inProgress', props.inProgress),
loading: state.get('loading', props.loading),
available: state.get('available', props.available),
overlayComponent,
onClick,
};
return ;
}
import { getValue } from '@talend/react-forms/lib/UIForm/utils/properties';
import omit from 'lodash/omit';
import { Map } from 'immutable';
import memoizeOne from 'memoize-one';
import kit from './kit';
import tcompFieldsWidgets from './fields';
const TO_OMIT = [
'definitionURL',
'uiSpecPath',
'submitURL',
'triggerULR',
'lang',
'customTriggers',
'dispatchOnChange',
...cmfConnect.INJECTED_PROPS,
];
export const DEFAULT_STATE = new Map({
dirty: false,
});
/**
* Convert immutable object to js object
*/
export function toJS(immutableObject) {
if (!immutableObject) {
return null;
}
return immutableObject.toJS();
}