Closed craigyu closed 3 months ago
Spotted that bug again, when trying to edit the seedlot on the review form.
frontend/src/views/Seedlot/ContextContainerClassA/utils.ts
convertParentTree
function, inside Object.keys, when pushing to the parentTreePayload, at this line: parentTreeId: parentTreeData.allParentTreeData[key].parentTreeId,
(here: https://github.com/bcgov/nr-spar/blob/main/frontend/src/views/Seedlot/ContextContainerClassA/utils.ts#L942)Logging from the application Condition:
if (!parentTreeData.allParentTreeData[key]) {
console.log('no parentTreeData.allParentTreeData[key] for key', key);
console.log('parentTreeData.tableRowData', JSON.stringify(parentTreeData.tableRowData));
console.log('parentTreeData.allParentTreeData', JSON.stringify(parentTreeData.allParentTreeData));
console.log('Object.keys(parentTreeData.tableRowData)', JSON.stringify(Object.keys(parentTreeData.tableRowData)));
}
Result
no parentTreeData.allParentTreeData[key] for key 37
parentTreeData.tableRowData {"37": ...} (added file Log-line-two.txt)
parentTreeData.allParentTreeData {}
Object.keys(parentTreeData.tableRowData) ["37","69","101","129","192","202","212","239","241","300","327","508","568","760","969","970","3141","3144","3169","3171","3210","3245","3247","3400","3427","3428","3431","3432","3455","3500","3518","3524","3552","3846","3847","3848","3849","3853","3856","3887","3915","3941","3942","3947","3948","3949","3950","3951","3954","3955","3957","3958","3959","3960","3961","3983","3986","3987","3988","3989","3990","5004","5005","5014","5016","5019","5027","5030","5032","5033","5036","5037","5040","5041","5046","5049","5050","5051","5055","5057","5058","5059","5065","5068","5077","5078","5086","5087","5090","5094","5100","5104","5110","5112","5113","5114","5118","5119","5126","5128","5134","5136","5137","5139","5142","5143","5149","5153","5154","5302","5306","5307","5312","5314","5325","5328","5331"]
Attachment file:
Implementation done in #1491, needs to add/modify tests still
need tests still
investigate the get parent tree by vegcode endpoint and its sql query, find out why the gw values for certain trees are different
example from SX PG LOW
Investigation complete
Task:
/orchards/vegetation-code/{vegCode}
on postgres api, which calls the same endpoint on Oracle, but adds the spu to that object