Skip to content

Commit

Permalink
revert impurities changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Newatia authored and Newatia committed Oct 2, 2023
1 parent 3db5949 commit f2da339
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@
<div class="form-row">

<app-substance-text-search class="col-2-1" [searchValue]="impuritiesElution.elutionSolvent"
placeholder="Elution Solvent/Search Substances"
placeholder="Search Substances"
(searchPerformed)="nameSearch($event, impuritiesTestIndex, impuritiesElutionIndex)"
(searchValueOut)="searchValueOutChange($event, impuritiesTestIndex, impuritiesElutionIndex)" eventCategory="selectorSearch">
eventCategory="selectorSearch">
</app-substance-text-search>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,34 +88,23 @@ export class ImpuritiesTestFormComponent implements OnInit, OnDestroy {
}

nameSearch(event: any, impuritiesTestIndex: number, impuritiesElutionIndex: number): void {
// Call this function when user selects the Substance Name from the dropdown or click on the Search button.
this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolvent = event;

// Set the existing Elustion Solvent Code to null
this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolventCode = '';

if (event) {
const substanceSubscribe = this.generalService.getSubstanceByName(event).subscribe(response => {
if (response) {
if (response.content && response.content.length > 0) {
const substance = response.content[0];
if (substance) {
if (substance.approvalID) {
this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolventCode = substance.approvalID;
} else if (substance.uuid) {
this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolventCode = substance.uuid;
}
const substanceSubscribe = this.generalService.getSubstanceByName(event).subscribe(response => {
if (response) {
if (response.content && response.content.length > 0) {
const substance = response.content[0];
if (substance) {
if (substance.approvalID) {
this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolventCode = substance.approvalID;
} else {
this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolventCode = substance.uuid;
}
}
}
}, error => {
});
this.subscriptions.push(substanceSubscribe);
}
}

searchValueOutChange(event: any, impuritiesTestIndex: number, impuritiesElutionIndex: number) {
//this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolventCode = '';
this.impuritiesTest.impuritiesElutionSolventList[impuritiesElutionIndex].elutionSolvent = event;
}
});
this.subscriptions.push(substanceSubscribe);
}

}

0 comments on commit f2da339

Please sign in to comment.