Skip to content

Commit

Permalink
feat (comments/save): additional 'save comments' button
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorMatt committed Feb 11, 2021
1 parent 6356ac5 commit 7457ee2
Show file tree
Hide file tree
Showing 18 changed files with 138 additions and 14 deletions.
15 changes: 9 additions & 6 deletions src/adonisjs/public/author/css/author.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@
}

.sty-message-space {
flex: 25%;
max-width: 25%;
max-height: 48px;
font-size: 20pt;
font-weight: bold;
color: blue;
position: absolute;
font-size: 30pt;
font-weight: bold;
color: #c5c5ca;
height: 100vh;
width: 100vw;
background-color: #040404ab;
z-index: 3000;
vertical-align: middle;
}

.sty-work-panel {
Expand Down
10 changes: 8 additions & 2 deletions src/adonisjs/public/author/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@
</head>

<body onload="AuthorManager.author.start()">
<!-- message div -->
<div id="message-space" class="sty-message-space vh-100 vw-100 text-center invisible" style="overflow:hidden; !important">
<span style="vertical-align: middle;top: 50%;position: absolute;"
class="rounded"></span>
</div>
<!-- Login/logout header -->
<dcc-include src="/author/partials/header.html"></dcc-include>
<!-- Start of settings modal -->
Expand Down Expand Up @@ -183,6 +188,7 @@ <h3>Settings</h3>

<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
</form>

</div>
</div>
</div>
Expand Down Expand Up @@ -235,7 +241,7 @@ <h1>Edit case</h1>
<button type="button" class="btn btn-secondary m-1" data-toggle="modal" data-target="#settings-modal">
Settings
</button>
<span class="sty-message-space" id="message-space"></span>


<div id="advanced-mode" style="display:none">
<dcc-button topic="control/case/markdown" label="MARKDOWN" xstyle="in"></dcc-button>
Expand Down Expand Up @@ -331,8 +337,8 @@ <h1>Edit case</h1>
</div>
<!-- End of container displaying the properties/comments of the case -->
</div>

</div>

</main>
<!-- end of div /.container -->

Expand Down
9 changes: 6 additions & 3 deletions src/adonisjs/public/author/js/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ class AuthorManager {
* ACTION: control-save
*/
async caseSave () {
this._messageSpace.classList.remove('invisible')
document.getElementById('btn-save-draft').innerHTML = 'SAVING...'
this._messageSpace.firstElementChild.innerHTML = 'SAVING...'
await Properties.s.closePreviousProperties()
await this._updateActiveComments()
if (Basic.service.currentCaseId != null && this._compiledCase != null) {
Expand All @@ -369,13 +371,14 @@ class AuthorManager {

Basic.service.authorPropertyStore('caseId', Basic.service.currentCaseId)

this._messageSpace.innerHTML = 'Saved'
setTimeout(this._clearMessage, 500)
this._messageSpace.firstElementChild.innerHTML = 'SAVED!'
setTimeout(this._clearMessage, 800)
// this._messageSpace.classList.add('invisible')
const promise = new Promise((resolve, reject) => {
setTimeout(() => resolve('done!'), 500)
})
const result = await promise
this._messageSpace.innerHTML = ''
this._messageSpace.classList.add('invisible')
document.getElementById('btn-save-draft').innerHTML = 'SAVE'
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/adonisjs/public/infra/token-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class TokenController {
sessionStorage.setItem('harena-user-grade', endpointResponse.data.grade)
sessionStorage.setItem('harena-user-institution', endpointResponse.data.institution)
sessionStorage.setItem('harena-user-institution-id', endpointResponse.data.institutionId)
// localStorage.setItem('harena-user-grade', endpointResponse.data.grade)
// localStorage.setItem('harena-user-institution', endpointResponse.data.institution)
// localStorage.setItem('harena-user-institution-id', endpointResponse.data.institutionId)
MessageBus.int.publish('data/user/info', endpointResponse.data)
TokenController.instance.changeHeaderButtons(endpointResponse.data)
})
Expand Down Expand Up @@ -105,6 +108,10 @@ class TokenController {
TokenController.instance.tokenChecked = true
sessionStorage.setItem('harena-user-grade', endpointResponse.data.grade)
sessionStorage.setItem('harena-user-institution', endpointResponse.data.institution)
sessionStorage.setItem('harena-user-institution-id', endpointResponse.data.institutionId)
// localStorage.setItem('harena-user-grade', endpointResponse.data.grade)
// localStorage.setItem('harena-user-institution', endpointResponse.data.institution)
// localStorage.setItem('harena-user-institution-id', endpointResponse.data.institutionId)
MessageBus.int.publish('data/user/info', endpointResponse.data)

TokenController.instance.changeHeaderButtons(endpointResponse.data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>
</div>
<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,9 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>

<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,8 @@ <h4>7. Medical decision making</h4>
</div>
</div>
<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
44 changes: 41 additions & 3 deletions src/adonisjs/public/templates/simple/knot/comments/pt_heart.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,23 @@ <h5 class="mt-1"> Achados</h5>
</div>
</div>

<div class="d-flex row" style="margin-left:-7px;">
<div class="form-check form-check-inline">

<input class="form-check-input invisible" type="radio" name="video_para_estern_long_achados_disfunc_ventric_esq_acentuada"
id="video_para_estern_long_achados_disfunc_ventric_esq_acentuada0" value="0" style="position:absolute !important"
{{checked?video_para_estern_long_achados_disfunc_ventric_esq_acentuada0:0}} checked>
<input class="form-check-input" type="radio" name="video_para_estern_long_achados_disfunc_ventric_esq_acentuada"
id="video_para_estern_long_achados_disfunc_ventric_esq_acentuada1" value="1"
{{checked?video_para_estern_long_achados_disfunc_ventric_esq_acentuada1:1}}>

<label class="form-check-label" for="video_para_estern_long_achados_disfunc_ventric_esq_acentuada1">
4. Disfunção Ventricular Esquerda Acentuada
</label>
</div>
</div>


<div class="d-flex row" style="margin-left:-7px;">
<div class="form-check form-check-inline">

Expand All @@ -306,7 +323,7 @@ <h5 class="mt-1"> Achados</h5>
{{checked?video_para_estern_long_achados_normal1:1}}>

<label class="form-check-label" for="video_para_estern_long_achados_normal1">
4. Normal
5. Normal
</label>
</div>
</div>
Expand Down Expand Up @@ -554,6 +571,22 @@ <h5 class="mt-1"> Achados</h5>
</div>
</div>

<div class="d-flex row" style="margin-left:-7px;">
<div class="form-check form-check-inline">

<input class="form-check-input invisible" type="radio" name="video_para_estern_curta_achados_disfunc_ventric_esq_acentuada"
id="video_para_estern_curta_achados_disfunc_ventric_esq_acentuada0" value="0" style="position:absolute !important"
{{checked?video_para_estern_curta_achados_disfunc_ventric_esq_acentuada0:0}} checked>
<input class="form-check-input" type="radio" name="video_para_estern_curta_achados_disfunc_ventric_esq_acentuada"
id="video_para_estern_curta_achados_disfunc_ventric_esq_acentuada1" value="1"
{{checked?video_para_estern_curta_achados_disfunc_ventric_esq_acentuada1:1}}>

<label class="form-check-label" for="video_para_estern_curta_achados_disfunc_ventric_esq_acentuada1">
4. Disfunção Ventricular Esquerda Acentuada
</label>
</div>
</div>

<div class="d-flex row" style="margin-left:-7px;">
<div class="form-check form-check-inline">

Expand All @@ -566,7 +599,7 @@ <h5 class="mt-1"> Achados</h5>
{{checked?video_para_estern_curta_achados_dilataca_ventric_direito1:1}}>

<label class="form-check-label" for="video_para_estern_curta_achados_dilataca_ventric_direito1">
4. Dilatação de Ventrículo Direito
5. Dilatação de Ventrículo Direito
</label>
</div>
</div>
Expand All @@ -583,7 +616,7 @@ <h5 class="mt-1"> Achados</h5>
{{checked?video_para_estern_curta_achados_normal1:1}}>

<label class="form-check-label" for="video_para_estern_curta_achados_normal1">
5. Normal
6. Normal
</label>
</div>
</div>
Expand Down Expand Up @@ -768,3 +801,8 @@ <h5 class="mt-1"> Achados</h5>
</div>
</div>
<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -593,3 +593,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -3252,3 +3252,8 @@ <h5 class="mt-1"> Achados</h5>


<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
<textarea class="form-control" id="details" name="details" placeholder="Enter the comments">
{{details}}
</textarea>
<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -594,3 +594,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,8 @@ <h4 class="mt-1">Anatomical References</h4>
</div>

<hr>
<div class="text-center">
<button type="button" class="btn btn-secondary" id="btn-save-comments" >SAVE COMMENTS</button>
<dcc-button topic="control/case/save" label="SAVE COMMENTS" location="btn-save-comments" xstyle="out"></dcc-button>
</div>
<hr>

0 comments on commit 7457ee2

Please sign in to comment.