Skip to content

Commit

Permalink
clears the json on "Cancel" click in merit dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrwins committed Aug 10, 2023
1 parent 73b2f50 commit d6d6edd
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions CSETWebNg/src/app/services/ncua.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,20 @@ let headers = {
// goes through subcategories
for (let j = 0; j < domain.components?.length; j++) {
let subcat = domain?.components[j];
let childResponses ={"title": subcat?.questions[0].title, //uses parent's title
"parentNumber": this.getParentQuestionTitleNumber(subcat?.questions[0].title),
"category": subcat?.title,
"examLevel": '',
"issues":
{
"dors": 0,
"examinerFindings": 0,
"supplementalFacts": 0,
"nonReportables": 0
},
"children":[]
};
let childResponses = {
"title": subcat?.questions[0].title, //uses parent's title
"parentNumber": this.getParentQuestionTitleNumber(subcat?.questions[0].title),
"category": subcat?.title,
"examLevel": '',
"issues":
{
"dors": 0,
"examinerFindings": 0,
"supplementalFacts": 0,
"nonReportables": 0
},
"children":[]
};
// goes through questions
for (let k = 0; k < subcat?.questions?.length; k++) {
let question = subcat?.questions[k];
Expand Down Expand Up @@ -583,7 +584,8 @@ let headers = {
<p>Please make sure the directory exists and is viewable.</p>`;
this.dialog.open(MeritCheckComponent, {
disableClose: true, data: { title: "Submission Error", messageText: msg }
})
});
this.jsonStringReset();
}
else if (exists === true){
this.acetSvc.doesMeritFileExist(fileValue).subscribe(
Expand Down Expand Up @@ -615,11 +617,11 @@ let headers = {
this.jsonStringReset();
},
error => {
let msg = "<br><p>Could not overwrite the file. "+error.error+"</p>";
this.dialog.open(MeritCheckComponent, {
disableClose: true, data: { title: "Submission Error", messageText: msg }
});
this.jsonStringReset();
let msg = "<br><p>Could not overwrite the file. "+error.error+"</p>";
this.dialog.open(MeritCheckComponent, {
disableClose: true, data: { title: "Submission Error", messageText: msg }
});
this.jsonStringReset();
}
);
} else if (overrideChoice == 'overwrite') {
Expand All @@ -633,13 +635,15 @@ let headers = {
this.jsonStringReset();
},
error => {
let msg = "<br><p>Could not write the file."+error+"</p>";
this.dialog.open(MeritCheckComponent, {
disableClose: true, data: { title: "Submission Error", messageText: msg }
});
this.jsonStringReset();
let msg = "<br><p>Could not write the file."+error+"</p>";
this.dialog.open(MeritCheckComponent, {
disableClose: true, data: { title: "Submission Error", messageText: msg }
});
this.jsonStringReset();
}
);
} else {
this.jsonStringReset();
}
});
}
Expand All @@ -649,19 +653,14 @@ let headers = {
}
},
error => {
console.log(error);
let msg = "<br><p>"+error.error+"</p>";
this.dialog.open(MeritCheckComponent, {
disableClose: true, data: { title: "Submission Error", messageText: msg }
});
this.jsonStringReset();
console.log(error);
let msg = "<br><p>"+error.error+"</p>";
this.dialog.open(MeritCheckComponent, {
disableClose: true, data: { title: "Submission Error", messageText: msg }
});
this.jsonStringReset();
}
)




this.submitInProgress = false;
}

newMeritFileSteps (fileValue: MeritFileExport) {
Expand All @@ -688,6 +687,7 @@ let headers = {
"creationDate": '',
"examLevel": '',
"region": 0,
"stateLed": false,
"guid": ''
},
"issuesTotal": {
Expand All @@ -699,6 +699,8 @@ let headers = {
"examProfileData": [],
"questionData": []
};

this.submitInProgress = false;
}

doesDirectoryExist() {
Expand Down

0 comments on commit d6d6edd

Please sign in to comment.