implemented frontend save

master
Malar Kannan 2017-07-28 11:29:50 +05:30
parent b7bb5da857
commit e5f203d4b8
3 changed files with 19 additions and 13 deletions

View File

@ -183,7 +183,15 @@ const fieldMetaMap = {
_.negate(_.isEqual) _.negate(_.isEqual)
)) ))
}, },
groups: {
type: 'list',
...listAttrAccessor(attrPredGen(
'groups[0].property',
'id',
'frame',
_.negate(_.isEqual)
))
},
}; };
const xmlToEntries = (xmlData: any) => { const xmlToEntries = (xmlData: any) => {

View File

@ -86,7 +86,7 @@ function imagePreview(params: any) {
let imageSrc = '/png/' + value; let imageSrc = '/png/' + value;
return value !== '' ? ( return value !== '' ? (
<LexSingleInput key={field} label={changedLabel(changed, field)}> <LexSingleInput key={field} label={changedLabel(changed, field)}>
<Image src={imageSrc} size="tiny" bordered={true} /> <Image src={imageSrc} size="large" bordered={true} />
</LexSingleInput> </LexSingleInput>
) : textInput(params); ) : textInput(params);
} }

View File

@ -20,17 +20,15 @@ function updateXMLState(state: any = {}, action: any) {
return action.xmlData; return action.xmlData;
} }
if (action.type === 'ACTION_SAVE_LEXITEM') { if (action.type === 'ACTION_SAVE_LEXITEM') {
// debugger; let newState = _.cloneDeep(state);
// let guid = action.lexSelector.guid.get(action.lexItem); let guid = action.lexSelector.guid.get(action.lexItem);
// let lang = action.lexSelector.lang.get(action.lexItem); let lang = action.lexSelector.lang.get(action.lexItem);
// // action.lexItem; let entries = _.get<any>(newState, 'document.lexicon[0].item');
// _.findIndex(_.get<any>(state,'document.lexicon[0].item'),(o)=>{ let entGuid = _.find(entries, (o) => _.isEqual(_.get<any>(o, '$.guid'), guid));
// return _.isEqual(_.get(o,'$.guid'),guid) && _.isEqual(_.get(o,'entry[0].lang'),lang) let entLang = _.get<any>(entGuid, 'entry');
// }); let entlang = _.find(entLang, (o) => _.isEqual(_.get<any>(o, 'lang[0].$.id'), lang));
_.noop(); _.set(entlang, 'lang[0]', action.lexItem);
return { return newState;
...state
};
} }
return state; return state;
} }