Skip to content
Snippets Groups Projects
Commit 3b7ce0b3 authored by Bhabesh Bhabani Mukhopadhyay's avatar Bhabesh Bhabani Mukhopadhyay
Browse files

Suitable message in Pest drop down when none is available

parent abb7e375
Branches
No related tags found
No related merge requests found
,wildfly,bhabesh-HP-NIBIO-Ubuntu.hitronhub.home,30.07.2021 18:37,file:///home/wildfly/.config/libreoffice/4; ,wildfly,bhabesh-HP-NIBIO-Ubuntu.hitronhub.home,02.08.2021 13:26,file:///home/wildfly/.config/libreoffice/4;
\ No newline at end of file \ No newline at end of file
No preview for this file type
...@@ -564,40 +564,49 @@ export default { ...@@ -564,40 +564,49 @@ export default {
{ {
lstPests.push({"pestId":'', "pestName":'Select Pest'}); lstPests.push({"pestId":'', "pestName":'Select Pest'});
} }
let lstPestList = JSON.parse(localStorage.getItem(CommonUtil.CONST_STORAGE_PEST_LIST)); if(lstPestIds.length===0)
$.each(lstPestIds, function(index, pestId){ {
let jsonDetailPest = lstPestList.find(({organismId}) => organismId === pestId); lstPests.push({"pestId":'', "pestName":'Not found in database'});
let jsonPest = {}; }
if(jsonDetailPest) else{
{ let lstPestList = JSON.parse(localStorage.getItem(CommonUtil.CONST_STORAGE_PEST_LIST));
let pestName = jsonDetailPest.latinName; $.each(lstPestIds, function(index, pestId){
let organismLocaleSet = jsonDetailPest.organismLocaleSet; let jsonDetailPest = lstPestList.find(({organismId}) => organismId === pestId);
let jsonPest = {};
if(organismLocaleSet) if(jsonDetailPest)
{
let strLocale = This.getSystemLocale();
organismLocaleSet.forEach(localObj => {
if(localObj.organismLocalePK.locale === strLocale)
{
if(localObj.localName)
{ {
pestName = localObj.localName; let pestName = jsonDetailPest.latinName;
let organismLocaleSet = jsonDetailPest.organismLocaleSet;
if(organismLocaleSet)
{
let strLocale = This.getSystemLocale();
organismLocaleSet.forEach(localObj => {
if(localObj.organismLocalePK.locale === strLocale)
{
if(localObj.localName)
{
pestName = localObj.localName;
}
return false;
}
});
}
jsonPest = {"pestId":jsonDetailPest.organismId, "pestName":pestName};
} }
return false; else
} {
jsonPest = {"pestId":pestId, "pestName":'Not Available -- '+pestId};
}
lstPests.push(jsonPest);
}); });
}
jsonPest = {"pestId":jsonDetailPest.organismId, "pestName":pestName};
}
else
{
jsonPest = {"pestId":pestId, "pestName":'Not Available -- '+pestId};
} }
lstPests.push(jsonPest);
});
this.pests = lstPests; this.pests = lstPests;
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment