How to use the @talend/react-cmf.cmfConnect.INJECTED_PROPS function in @talend/react-cmf

To help you get started, we’ve selected a few @talend/react-cmf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Talend / ui / packages / containers / src / FilterBar / FilterBar.container.js View on Github external
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 ;
	}
}
github Talend / ui / packages / containers / src / Typeahead / Typeahead.container.js View on Github external
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 ;
	}
}
github Talend / ui / packages / containers / src / TreeView / TreeView.container.js View on Github external
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 (
			
		);
	}
}
github Talend / ui / packages / containers / src / SelectObject / SelectObject.container.js View on Github external
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,
				},
github Talend / ui / packages / containers / src / SubHeaderBar / SubHeaderBar.container.js View on Github external
}
		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 ;
	}
}
github Talend / ui / packages / components-kit / src / components / ComponentForm / ComponentForm.component.js View on Github external
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>
github Talend / ui / packages / containers / src / HeaderBar / HeaderBar.container.js View on Github external
'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 ;
	}
}
github Talend / ui / packages / containers / src / EditableText / EditableText.container.js View on Github external
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 ;
	}
}
github Talend / ui / packages / containers / src / PieChartButton / PieChartButton.connect.js View on Github external
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 ;
}
github Talend / ui / packages / containers / src / ComponentForm / ComponentForm.component.js View on Github external
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();
}