Skip to content

Commit

Permalink
Merge pull request #244 from NCIEVS/update/EVSREPEXP-508
Browse files Browse the repository at this point in the history
Update/evsrepexp 508
  • Loading branch information
amoore2020 authored Apr 2, 2024
2 parents bcd2e61 + 97eed88 commit 2c59251
Showing 1 changed file with 152 additions and 7 deletions.
159 changes: 152 additions & 7 deletions clientui/src/components/ReadCodeEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,29 @@
<center><VueSpinner id = "waitTimeIndicator" size="40" color="blue" /></center>
<br>
<br>
<div id = "Templating">
<center>
<div>Use Templating (Yes/No)</div>
<select v-model="selected" id = "TemplateDropDown" class = "OptTemplateDropdown" @change="addTemplating($event)">
<option disabled value="">Optional Available Templates</option>
<option value="Yes">Yes</option>
<option value="No" selected>No</option>
</select>
</center>
</div>
<br>
<br>
<center>
<div id = "TemplateOption">
<u><div>Select a Template</div></u>
<div class = "templateSelection">Selected Template: <strong>{{ templateSelectedValue }}</strong></div>
<tr>
<input type="radio" id="html" name="fav_language" :value= this.templateCodeDesc v-model="templateSelectedValue" @change="changeTemplateSelectedVal(3)">
<label for="html">{{ this.templateCodeDesc }}</label>
</tr>
</div>
</center>


<!-- Summary Information -->
<div id="accordion" class="pb-3 pt-3">
Expand Down Expand Up @@ -189,10 +212,10 @@
<div class="card bg-light border-dark mb-3">
<div class="card-header">
Selected Properties
<span class="badge badge-secondary">{{Object.keys(this.rightOptions).length}}</span>
<span class="badge badge-secondary">{{this.selectedPropertiesWindowCt}}</span>
</div>
<div class="card-body">
<span class="list-group" id="selectedPropertyList">{{ this.rightOptions }}</span>
<span class="list-group" id="selectedPropertyList">{{ this.selectedPropertiesWindow }}</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -307,6 +330,9 @@ export default {
templateYesNoFlag: '',
selectedPropertiesWindow: '',
selectedPropertiesWindowCt: 0,
typeValue: [],
templatePropertiesValue: 'FULL SYN, ALT_DEFINITION, DEFINITION',
templateCodeDesc: ''
};
},
Expand Down Expand Up @@ -381,6 +407,7 @@ export default {
this.newTag = ""; // Vue 3 reset newTag
this.tagCounter = this.tagCounter + 1;
this.newTagCounter = this.newTagCounter + 1;
this.loadTemplateValues(this.tags)
}
} else {
tempStatus = data[x].queryStatus
Expand All @@ -396,6 +423,7 @@ export default {
duration: 6000,
position: "left bottom"
});
this.loadTemplateValues(this.tags)
}
}
} else {
Expand All @@ -416,6 +444,7 @@ export default {
duration: 6000,
position: "left bottom"
});
this.loadTemplateValues(this.tags)
}
}
})
Expand Down Expand Up @@ -448,6 +477,7 @@ export default {
this.rightOptions.splice(idx, 1);
this.availableProperties.push(this.rightSelectedOptions[i - 1])
this.rightSelectedOptions.pop();
this.selectedPropertiesWindowCt = Object.keys(this.selectedPropertiesWindow).length
}
},
Expand All @@ -460,6 +490,8 @@ export default {
this.rightOptions.push(this.leftSelectedOptions[i - 1]);
this.tempListClear.push(this.leftSelectedOptions[i - 1]);
this.leftSelectedOptions.pop();
this.selectedPropertiesWindow = this.rightOptions
this.selectedPropertiesWindowCt = Object.keys(this.selectedPropertiesWindow).length
}
},
Expand Down Expand Up @@ -519,6 +551,9 @@ export default {
document.getElementById("backButton").style.display = "none";
document.getElementById("exportStep").style.display = "none";
document.getElementById("exportButton").style.display = "none";
document.getElementById("Templating").style.display = "none";
document.getElementById("TemplateOption").style.display = "none";
api.getProperties(this.$baseURL)
.then((data)=> {
Expand Down Expand Up @@ -549,15 +584,15 @@ export default {
document.getElementById("exportStep").style.display = ""; //Show Export dropdown
document.getElementById("SelectProperties1").style.display = "none"; //Hide list boxes from step 2
document.getElementById("exportButton").style.display = ""; //Show Export button
document.getElementById("nextButton").style.display = ""; //Hides next button
document.getElementById("nextButton").style.display = ""; //Shows next button
this.WaitTimeIndicatorPause()
}
if (selectNextOptionBTN_counter === 2) {
this.validatePropertyStep();
}
//Vue 3 (Builds screen on step 2)
//Vue 3 (Shows second screen with properties windows and template dropdown)
if (selectNextOptionBTN_counter === 1) {
if (this.tags.length > 0) { // checks to make sure that a code was entered before proceeding to next screen
document.getElementById("waitTimeIndicator").style.display = ""; //Show wait time indicator
Expand All @@ -566,6 +601,29 @@ export default {
document.getElementById("entityLabelId").style.display = "none"; //Hides label on main screen
document.getElementById("SelectProperties1").style.display = ""; //Shows listboxs on second screen
document.getElementById("backButton").style.display = ""; //Shows back button
document.getElementById("TemplateOption").style.display = "none"; //Hides Template options radio buttons
document.getElementById("Templating").style.display = ""; // Shows Template dropdown
//Refreshes the template options when a selection is made
if (this.templateYesNoFlag === "Yes")
{
document.getElementById("TemplateOption").style.display = ""; //shows Template option
document.getElementById("SelectProperties1").style.display = "none";
this.templateCodeDesc = this.tags + ", " + this.templatePropertiesValue
this.selectedPropertiesWindow = this.templateCodeDesc
if (this.templateSelectedValue != "") {
this.templateSelectedValue = this.templateCodeDesc
}
}
if (this.templateYesNoFlag === "No" && this.rightOptions.length < 1)
{
this.templateCodeDesc = this.tags + ", " + this.templatePropertiesValue
this.templateSelectedValue = this.templateCodeDesc
this.selectedPropertiesWindow = ""
this.selectedPropertiesWindowCt = 0
}
selectNextOptionBTN_counter = selectNextOptionBTN_counter + 1 // Counter controls navigating between steps 1 -3
this.WaitTimeIndicatorPause()
}
Expand All @@ -576,18 +634,26 @@ export default {
validatePropertyStep() {
// make sure the user has selected at least one property
//Hides objects on screen that shouldn't appear in step 2
if (this.rightOptions.length > 0) {
//(Shows 3rd screen export functionality)
if ((this.rightOptions.length > 0) || ((this.templateValueCount > 0) && (this.templateYesNoFlag === "Yes"))) {
document.getElementById("waitTimeIndicator").style.display = ""; //Show wait time indicator
document.getElementById("exportStep").style.display = ""; //Show Export dropdown
document.getElementById("SelectProperties1").style.display = "none"; //Hide list boxes from step 2
document.getElementById("exportButton").style.display = ""; //Show Export button
document.getElementById("nextOption").style.display = "none"; //Hides next option button
document.getElementById("Templating").style.display = "none"; //Hides Templating dropdown
document.getElementById("TemplateOption").style.display = "none"; //Hides Template option
this.WaitTimeIndicatorPause()
if (Object.keys(this.rightOptions).length > 0) {
selectNextOptionBTN_counter = selectNextOptionBTN_counter + 1;
return Object.keys(this.rightOptions).length > 0
}
if (this.templateValueCount > 0)
{
selectNextOptionBTN_counter = selectNextOptionBTN_counter + 1;
}
}
},
Expand All @@ -602,6 +668,8 @@ export default {
document.getElementById("entityLabelId").style.display = ""; //Shows label on main screen
document.getElementById("backButton").style.display = "none"; //Hides back button on main screen
document.getElementById("nextOption").style.display = ""; //Shows next button
document.getElementById("Templating").style.display = "none"; //Hides Templating dropdown
document.getElementById("TemplateOption").style.display = "none"; //Hides Template options radio buttons
selectNextOptionBTN_counter = selectNextOptionBTN_counter - 1;
this.WaitTimeIndicatorPause()
}
Expand All @@ -614,6 +682,27 @@ export default {
document.getElementById("exportButton").style.display = "none"; //Hides Export button
document.getElementById("nextOption").style.display = ""; //Shows next button
document.getElementById("exportStep").style.display = "none"; //Hides Export Step
document.getElementById("Templating").style.display = ""; //Show Templating dropdown
document.getElementById("TemplateOption").style.display = ""; //Hides Template options radio buttons
if (this.templateYesNoFlag === "Yes")
{
document.getElementById("TemplateOption").style.display = ""; //shows Template option
document.getElementById("SelectProperties1").style.display = "none"; //Hides listboxes on second screen
// refreshes selected template if changes to the selected codes were made
if (this.templateSelectedValue != "")
{
this.templateSelectedValue = this.tags + ", " + this.templatePropertiesValue
}
}
if ((this.templateYesNoFlag === "No") || (this.templateYesNoFlag === ""))
{
document.getElementById("SelectProperties1").style.display = ""; //Hides listboxes on second screen
document.getElementById("TemplateOption").style.display = "none"; //hides Template option
}
selectNextOptionBTN_counter = selectNextOptionBTN_counter - 1;
this.WaitTimeIndicatorPause()
}
Expand Down Expand Up @@ -662,6 +751,47 @@ export default {
}
},
//function controls template dropdown on second screen and would allow the properties list boxes
//to appear and be removed depending on what option was selected from the list box
addTemplating(event){
this.templateYesNoFlag = event.target.value
if (event.target.value === "Yes")
{
document.getElementById("SelectProperties1").style.display = "none";
document.getElementById("TemplateOption").style.display = "";
if (this.templateSelectedOptions.length > 0) {
this.selectedPropertiesWindow = this.tags + ", " + this.templatePropertiesValue
this.selectedPropertiesWindowCt = this.templateValueCount
this.templateCodeDesc = this.tags + ", " + this.templatePropertiesValue
this.templateSelectedValue = this.templateCodeDesc
}
}
if (event.target.value === "No")
{
document.getElementById("SelectProperties1").style.display = "";
document.getElementById("TemplateOption").style.display = "none";
if (this.rightOptions.length > 0){
this.selectedPropertiesWindow = this.rightOptions
this.selectedPropertiesWindowCt = Object.keys(this.selectedPropertiesWindow).length
}
if (this.rightOptions.length < 1){
this.selectedPropertiesWindow = ""
this.selectedPropertiesWindowCt = 0
}
}
},
changeTemplateSelectedVal(selectionLength){
this.templateValueCount = selectionLength
this.templateSelectedOptions = this.templateCodeDesc
this.selectedPropertiesWindow = this.templateCodeDesc
this.selectedPropertiesWindowCt = selectionLength
},
// Vue 3 method to download file
downloadFile() {
Expand Down Expand Up @@ -694,13 +824,20 @@ export default {
//alert("SelectedFormat: " + this.fileFormat);
//alert("filename: " + this.filename);
//alert("selectedFormat Extension: " + this.userSelectedFormat);
//alert (this.queryEntitySelection);
if ((this.rightOptions.length > 0) && (this.templateYesNoFlag === "No" || this.templateYesNoFlag === ""))
{
this.selectedExportOptions = this.rightOptions
}
else
{
this.selectedExportOptions = this.templatePropertiesValue
}
axios({
url: this.$baseURL + 'download/get-file-for-readCodes/' +
this.userEnteredCodes + '/' +
this.rightOptions + '/' +
this.selectedExportOptions + '/' +
this.fileFormat + '/'+
this.filename + '.' +
this.userSelectedFormat,
Expand All @@ -721,6 +858,10 @@ export default {
//.finally(function() { loader.hide()});
this.WaitTimeIndicatorPause()
},
loadTemplateValues(codeDesc){
this.templateCodeDesc = codeDesc
this.templateCodeDesc = this.templateCodeDesc + ", " + this.templatePropertiesValue
}
},
created() {
Expand Down Expand Up @@ -904,4 +1045,8 @@ ul {
margin-left: 277px;
width: 158px;
}

.templateSelection {
color: rgb(0, 125, 188);
}
</style>

0 comments on commit 2c59251

Please sign in to comment.