Skip to content

Commit

Permalink
Merge pull request #275 from harena-lab/development
Browse files Browse the repository at this point in the history
fix (author/saveCase): Infinite 'saving' screen
  • Loading branch information
HeitorMatt authored Feb 21, 2021
2 parents e27e0a1 + 197be30 commit a1144a0
Show file tree
Hide file tree
Showing 16 changed files with 623 additions and 266 deletions.
23 changes: 22 additions & 1 deletion src/adonisjs/public/author/js/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,19 @@ class AuthorManager {
this._messageSpace.classList.remove('invisible')
document.getElementById('btn-save-draft').innerHTML = 'SAVING...'
this._messageSpace.firstElementChild.innerHTML = 'SAVING...'
let timeoutExceeded
new Promise((resolve, reject) => {
timeoutExceeded = setTimeout(() => {resolve()}, 5000)

})
.then(function (rej) {
AuthorManager.author._messageSpace.firstElementChild.innerHTML = 'Error ocurred. Trying again...'
setTimeout(() => {AuthorManager.author.caseSave()}, 3000)
})
await Properties.s.closePreviousProperties()
await this._updateActiveComments()
clearTimeout(timeoutExceeded)

if (Basic.service.currentCaseId != null && this._compiledCase != null) {
this._checkKnotModification(this._renderState)

Expand All @@ -373,13 +384,23 @@ class AuthorManager {

this._messageSpace.firstElementChild.innerHTML = 'SAVED!'
setTimeout(this._clearMessage, 800)
// this._messageSpace.classList.add('invisible')
// let timeoutExceeded
// new Promise((resolve, reject) => {
// timeoutExceeded = setTimeout(() => {resolve()}, 5000)
//
// })
// .then((res) => {this._messageSpace.firstElementChild.innerHTML = 'Error!'})
// clearTimeout(timeoutExceeded)
const promise = new Promise((resolve, reject) => {
setTimeout(() => resolve('done!'), 500)
})
const result = await promise
this._messageSpace.classList.add('invisible')
document.getElementById('btn-save-draft').innerHTML = 'SAVE'
} else{
this._messageSpace.firstElementChild.innerHTML = 'Error...try again.'
setTimeout(this._messageSpace.classList.add('invisible'), 1500)
document.getElementById('btn-save-draft').innerHTML = 'SAVE'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Write here the history.
* problem 2
}}

{{hypothesis
**Main Hypothesis**

Write here the **Main Hypothesis**.
}}

{{questions
**POCUS Questions**

Expand Down
118 changes: 20 additions & 98 deletions src/adonisjs/public/templates/simple/knot/comments/pt_cava.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,126 +131,48 @@ <h5 class="mt-1"> Achados</h5>
<hr>
<h3>Image 1</h3>
<hr>
<h4 class="mt-1">Gain</h4>

<div class="bg-light border border-secondary rounded pl-2">
<div class="form-check">
<input type="radio" id="image1_gain1"
name="image1_gain" value="1" class="form-check-input" {{checked?image1_gain1:1}}>
<label for="image1_gain1" class="form-check-label">1. little</label>
</div>
<div class="form-check">
<input type="radio" id="image1_gain2"
name="image1_gain" value="2" class="form-check-input" {{checked?image1_gain2:2}}>
<label for="image1_gain2" class="form-check-label">2. excessive</label>
</div>
<div class="form-check">
<input type="radio" id="image1_gain3"
name="image1_gain" value="3" class="form-check-input" {{checked?image1_gain3:3}}>
<label for="image1_gain3" class="form-check-label">3. appropriate</label>
</div>
</div>

<h4 class="mt-1">Depth</h4>

<div class="bg-light border border-secondary rounded pl-2">
<div class="form-check">
<input type="radio" id="image1_depth1"
name="image1_depth" value="1" class="form-check-input" {{checked?image1_depth1:1}}>
<label for="image1_depth1" class="form-check-label">1. little</label>
</div>
<div class="form-check">
<input type="radio" id="image1_depth2"
name="image1_depth" value="2" class="form-check-input" {{checked?image1_depth2:2}}>
<label for="image1_depth2" class="form-check-label">2. excessive</label>
</div>
<div class="form-check">
<input type="radio" id="image1_depth3"
name="image1_depth" value="3" class="form-check-input" {{checked?image1_depth3:3}}>
<label for="image1_depth3" class="form-check-label">3. appropriate</label>
</div>
</div>

<h4 class="mt-1">Anatomical References</h4>
<h4 class="mt-1">Measurement</h4>

<div class="bg-light border border-secondary rounded pl-2">
<div class="form-check">
<input type="radio" id="image1_anatomical1"
name="image1_anatomical" value="1" class="form-check-input" {{checked?image1_anatomical1:1}}>
<label for="image1_anatomical1" class="form-check-label">1. absent</label>
<input type="radio" id="image1_measurement_not_performed"
name="image1_measurement" value="not_performed" class="form-check-input" {{checked?image1_measurement_not_performed:not_performed}}>
<label for="image1_measurement_not_performed" class="form-check-label">1. not performed</label>
</div>
<div class="form-check">
<input type="radio" id="image1_anatomical2"
name="image1_anatomical" value="2" class="form-check-input" {{checked?image1_anatomical2:2}}>
<label for="image1_anatomical2" class="form-check-label">2. partially present</label>
<input type="radio" id="image1_measurement_correct"
name="image1_measurement" value="correct" class="form-check-input" {{checked?image1_measurement_correct:correct}}>
<label for="image1_measurement_correct" class="form-check-label">2. correct</label>
</div>
<div class="form-check">
<input type="radio" id="image1_anatomical3"
name="image1_anatomical" value="3" class="form-check-input" {{checked?image1_anatomical3:3}}>
<label for="image1_anatomical3" class="form-check-label">3. present</label>
<input type="radio" id="image1_measurement_incorrect"
name="image1_measurement" value="incorrect" class="form-check-input" {{checked?image1_measurement_incorrect:incorrect}}>
<label for="image1_measurement_incorrect" class="form-check-label">3. incorrect</label>
</div>
</div>

<hr>
<h3>Image 2</h3>
<hr>
<h4 class="mt-1">Gain</h4>

<div class="bg-light border border-secondary rounded pl-2">
<div class="form-check">
<input type="radio" id="image2_gain1"
name="image2_gain" value="1" class="form-check-input" {{checked?image2_gain1:1}}>
<label for="image2_gain1" class="form-check-label">1. little</label>
</div>
<div class="form-check">
<input type="radio" id="image2_gain2"
name="image2_gain" value="2" class="form-check-input" {{checked?image2_gain2:2}}>
<label for="image2_gain2" class="form-check-label">2. excessive</label>
</div>
<div class="form-check">
<input type="radio" id="image2_gain3"
name="image2_gain" value="3" class="form-check-input" {{checked?image2_gain3:3}}>
<label for="image2_gain3" class="form-check-label">3. appropriate</label>
</div>
</div>

<h4 class="mt-1">Depth</h4>

<div class="bg-light border border-secondary rounded pl-2">
<div class="form-check">
<input type="radio" id="image2_depth1"
name="image2_depth" value="1" class="form-check-input" {{checked?image2_depth1:1}}>
<label for="image2_depth1" class="form-check-label">1. little</label>
</div>
<div class="form-check">
<input type="radio" id="image2_depth2"
name="image2_depth" value="2" class="form-check-input" {{checked?image2_depth2:2}}>
<label for="image2_depth2" class="form-check-label">2. excessive</label>
</div>
<div class="form-check">
<input type="radio" id="image2_depth3"
name="image2_depth" value="3" class="form-check-input" {{checked?image2_depth3:3}}>
<label for="image2_depth3" class="form-check-label">3. appropriate</label>
</div>
</div>

<h4 class="mt-1">Anatomical References</h4>
<h4 class="mt-1">Measurement</h4>

<div class="bg-light border border-secondary rounded pl-2">
<div class="form-check">
<input type="radio" id="image2_anatomical1"
name="image2_anatomical" value="1" class="form-check-input" {{checked?image2_anatomical1:1}}>
<label for="image2_anatomical1" class="form-check-label">1. absent</label>
<input type="radio" id="image2_measurement_not_performed"
name="image2_measurement" value="not_performed" class="form-check-input" {{checked?image2_measurement_not_performed:not_performed}}>
<label for="image2_measurement_not_performed" class="form-check-label">1. not performed</label>
</div>
<div class="form-check">
<input type="radio" id="image2_anatomical2"
name="image2_anatomical" value="2" class="form-check-input" {{checked?image2_anatomical2:2}}>
<label for="image2_anatomical2" class="form-check-label">2. partially present</label>
<input type="radio" id="image2_measurement_correct"
name="image2_measurement" value="correct" class="form-check-input" {{checked?image2_measurement_correct:correct}}>
<label for="image2_measurement_correct" class="form-check-label">2. correct</label>
</div>
<div class="form-check">
<input type="radio" id="image2_anatomical3"
name="image2_anatomical" value="3" class="form-check-input" {{checked?image2_anatomical3:3}}>
<label for="image2_anatomical3" class="form-check-label">3. present</label>
<input type="radio" id="image2_measurement_incorrect"
name="image2_measurement" value="incorrect" class="form-check-input" {{checked?image2_measurement_incorrect:incorrect}}>
<label for="image2_measurement_incorrect" class="form-check-label">3. incorrect</label>
</div>
</div>

Expand Down
Loading

0 comments on commit a1144a0

Please sign in to comment.