Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let label = inventory.type;
if (categories) {
label = categories.find(category => category.type === inventory.type).label;
}
return {
title: label,
icon: {
name: 'fixme', // inventory.iconName,
title: label,
},
suggestions,
};
});
yield put(actions.components.mergeState('Container(Typeahead)', 'headerbar:search', { searching: false }));
yield put(actions.collections.addOrReplace('search', items));
}
export function setError(event, error) {
return actions.components.mergeState('Translate(FolderCreatorModal)', 'default', {
error,
});
}
export function* removeFolder() {
const uris = yield select(state => state.cmf.collections.getIn(['settings', 'uris']));
const folderId = yield select(state =>
state.cmf.components.getIn(['CMFContainer(ConfirmDialog)', 'ConfirmDialog', 'folderId']),
);
yield put(
actions.components.mergeState(
'CMFContainer(ConfirmDialog)',
'ConfirmDialog',
new Map({ loading: true }),
),
);
const { response } = yield call(http.delete, `${uris.get('apiFolders')}/${folderId}`);
if (response.ok) {
yield call(refreshCurrentFolder);
const folderName = yield select(state =>
state.cmf.components.getIn(['CMFContainer(ConfirmDialog)', 'ConfirmDialog', 'folderName']),
);
yield put(
creators.notification.success(null, {
title: i18next.t('tdp-app:FOLDER_REMOVE_NOTIFICATION_TITLE'),
message: i18next.t('tdp-app:FOLDER_REMOVE_NOTIFICATION_MESSAGE', {
name: folderName,
function* openAbout() {
while (true) {
yield take(OPEN_PREPARATION_CREATOR);
yield put(actions.components.mergeState('PreparationCreatorModal', 'default', { show: true }));
}
}
function* openAbout() {
while (true) {
yield take(OPEN_ABOUT);
yield put(actions.components.mergeState('AboutModal', 'default', { show: true }));
}
}
yield call(refreshCurrentFolder);
const folderName = yield select(state =>
state.cmf.components.getIn(['CMFContainer(ConfirmDialog)', 'ConfirmDialog', 'folderName']),
);
yield put(
creators.notification.success(null, {
title: i18next.t('tdp-app:FOLDER_REMOVE_NOTIFICATION_TITLE'),
message: i18next.t('tdp-app:FOLDER_REMOVE_NOTIFICATION_MESSAGE', {
name: folderName,
}),
}),
);
}
yield call(closeRemoveFolderModal);
yield put(
actions.components.mergeState(
'CMFContainer(ConfirmDialog)',
'ConfirmDialog',
new Map({ loading: false }),
),
);
}
export function* openPreparationCreatorModal() {
yield put(actions.components.mergeState('PreparationCreatorModal', 'default', { show: true }));
}