Commit 5468dcc5 authored by PiTrem's avatar PiTrem
Browse files

when updating sample/reaction refresh selecteds tabs

parent d8fa1f45
......@@ -218,9 +218,13 @@ class ElementStore {
handleGetMoleculeCas: DetailActions.getMoleculeCas,
handleUpdateMoleculeNames: DetailActions.updateMoleculeNames,
handleUpdateMoleculeCas: DetailActions.updateMoleculeCas,
handleUpdateElement: [
handleUpdateLinkedElement: [
ElementActions.updateReaction,
ElementActions.updateSample,
],
handleUpdateElement: [
// ElementActions.updateReaction,
// ElementActions.updateSample,
ElementActions.updateWellplate,
ElementActions.updateScreen,
ElementActions.updateResearchPlan
......@@ -573,6 +577,11 @@ class ElementStore {
this.handleUpdateElement(sample);
}
handleUpdateLinkedElement(element) {
this.changeCurrentElement(element);
this.handleUpdateElement(element);
}
handleUpdateSampleForWellplate(wellplate) {
// UserActions.fetchCurrentUser()
this.state.currentElement = null;
......@@ -951,7 +960,7 @@ class ElementStore {
this.state.activeKey = index;
this.state.selecteds = this.updateElement(nextEl, index);
}
// this.synchronizeElements(this.state.currentElement);
this.state.currentElement = nextEl;
}
......@@ -1019,14 +1028,6 @@ class ElementStore {
break;
}
this.state.selecteds = this.state.selecteds.map((e) => {
if (SameEleTypId(e, updatedElement)) {
return updatedElement;
}
return e;
});
this.synchronizeElements(updatedElement);
return true;
}
......@@ -1036,7 +1037,7 @@ class ElementStore {
if (previous instanceof Sample) {
const rId = previous.tag && previous.tag.taggable_data
&& previous.tag.taggable_data.reaction_id;
const openedReaction = selecteds.find(el => (el.type === 'reaction' && el.id === rId));
const openedReaction = selecteds.find(el => SameEleTypId(el, { type: 'reaction', id: rId }));
if (openedReaction) {
openedReaction.updateMaterial(previous);
if (previous.isPendingToSave) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment