How to use the @talend/react-cmf.actions.collections 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 / data-prep / dataprep-webapp / src / app / next / sagas / search.saga.js View on Github external
yield takeLatest(SEARCH_RESET, function* () {
		yield put(actions.collections.addOrReplace('search', null));
	});
}
github Talend / data-prep / dataprep-webapp / src / app / next / sagas / effects / bootstrap.effects.js View on Github external
export function* fetch() {
	const data = yield store.get('settings');
	yield put(actions.collections.addOrReplace('settings', data));
}
github Talend / data-prep / dataprep-webapp / src / app / next / sagas / effects / search.effects.js View on Github external
const providers = Object.keys(categories);
	const service = new SearchService(categories);
	const batches = providers.map(
		provider => service.build(
			provider,
			payload,
		)
	);
	const results = (
			yield all(batches.map(request => call(...request)))
		).map(
			(result, index) => service.transform(providers[index], result)
		);

	yield put(Typeahead.setStateAction({ searching: false }, 'headerbar:search'));
	yield put(actions.collections.addOrReplace(
		'search',
		[].concat(...results).filter(s => s.suggestions.length),
	));
}
github Talend / ui / packages / containers / .storybook / config.js View on Github external
function* sagaPhotoGet3() {
	const answer = yield call(sagas.http.get, 'https://jsonplaceholder.typicode.com/photos/');
	yield put(actions.collections.addOrReplace('photos3', answer.data));
}
github Talend / data-prep / dataprep-webapp / src / app / next / sagas / preparation.saga.js View on Github external
function* setTitleEditionMode() {
	while (true) {
		const { payload } = yield take(SET_TITLE_EDITION_MODE);
		const preparations = yield select(state => state.cmf.collections.get('preparations'));
		const updated = preparations.update(
			preparations.findIndex(val => val.get('id') === payload),
			val => val.set('display', 'input'),
		);
		yield put(actions.collections.addOrReplace('preparations', updated));
	}
}
github Talend / data-prep / dataprep-webapp / src / app / next / sagas / effects / preparation.effects.js View on Github external
export function* create(payload) {
	const folderId = (payload && payload.folderId) || DEFAULT_FOLDER_ID;
	yield put(actions.collections.addOrReplace('currentFolderId', folderId));
	const uris = yield select(state => state.cmf.collections.getIn(['settings', 'uris']));
	const response = yield call(
		http.post,
		`${uris.get('apiPreparations')}?folder=${folderId}`,
		{
			dataSetId: payload.id || payload.datasetId || payload.model.id,
		},
	);
	if (!(response instanceof Error)) {
		const preparationId = response.data;
		yield put({
			type: REDIRECT_WINDOW,
			payload: { url: `/#/playground/preparation?prepid=${preparationId}` },
		});
	}
}
github Talend / data-prep / dataprep-webapp / src / app / next / sagas / bootstrap.saga.js View on Github external
function* fetchSettings() {
	const { data } = yield call(http.get, '/api/settings');
	yield put(actions.collections.addOrReplace('settings', data));
}