mirror of
https://github.com/xodio/xod.git
synced 2026-03-14 20:56:52 +01:00
fix(xod-client): attach an implementation when adding not-implemented-in-xod node
Closes #998
This commit is contained in:
@@ -5,6 +5,7 @@ import { getLibName } from 'xod-pm';
|
||||
|
||||
import * as AT from './actionTypes';
|
||||
import { PASTE_ENTITIES, INSTALL_LIBRARIES_COMPLETE } from '../editor/actionTypes';
|
||||
import { IMPL_TEMPLATE } from '../editor/constants';
|
||||
|
||||
import {
|
||||
addPoints,
|
||||
@@ -278,7 +279,16 @@ export default (state = {}, action) => {
|
||||
|
||||
return R.over(
|
||||
XP.lensPatch(patchPath), // TODO: can we have a situation where patch does not exist?
|
||||
XP.assocNode(newNode),
|
||||
R.compose(
|
||||
XP.assocNode(newNode),
|
||||
R.when(
|
||||
R.both(
|
||||
() => typeId === XP.NOT_IMPLEMENTED_IN_XOD_PATH,
|
||||
R.complement(XP.hasImpl)
|
||||
),
|
||||
XP.setImpl(IMPL_TEMPLATE)
|
||||
)
|
||||
),
|
||||
state
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user