Skip to content

Commit

Permalink
Merge pull request #274 from harena-lab/development
Browse files Browse the repository at this point in the history
feat (POCUS/findings): template changes
  • Loading branch information
HeitorMatt authored Feb 17, 2021
2 parents 6d09bda + 7457ee2 commit e27e0a1
Show file tree
Hide file tree
Showing 21 changed files with 3,518 additions and 466 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
33 changes: 33 additions & 0 deletions src/adonisjs/public/author/js/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Comments {
this.commentsConfirm = this.commentsConfirm.bind(this)
MessageBus.ext.subscribe('control/comments/edit/confirm',
this.commentsConfirm)
this.toggleRadioFindings()

/*
let cKnot = -1
Expand Down Expand Up @@ -133,13 +134,45 @@ class Comments {
*/
}

toggleRadioFindings(){

const radioList = document.querySelectorAll(`input[id*="achados"][id$="1"]`)
if(radioList){
radioList.forEach(function(el) {

if(el.hasAttribute('checked')){
el.setAttribute('pastcheck','true')
el.previousElementSibling.setAttribute('pastcheck','false')
}else{
el.setAttribute('pastcheck','false')
el.previousElementSibling.setAttribute('pastcheck','true')
}
el.addEventListener("click", function(){

if(el.getAttribute('pastcheck') == 'true'){
el.previousElementSibling.checked = true
el.previousElementSibling.setAttribute('pastcheck','true')
el.setAttribute('pastcheck','false')
}else if(el.getAttribute('pastcheck') == 'false'){
el.checked = true
el.previousElementSibling.setAttribute('pastcheck','false')
el.setAttribute('pastcheck','true')
}
})
})
}
}

commentsConfirm(topic, message) {
console.log('============')
console.log('confirming comments')
let content = this._compiledCase.knots[this._knotid].content
let commentElement
for (let v in message.value)
if (typeof message.value[v] === 'string')
message.value[v] = message.value[v].trim()
if (this._comments > -1) {
console.log('greater that -1')
commentElement = content[this._comments]
commentElement.value = message.value
} else {
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>
68 changes: 68 additions & 0 deletions src/adonisjs/public/templates/simple/knot/comments/pt_cava.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,69 @@ <h4 class="mt-1">Anatomical References</h4>
</div>
</div>

<hr>
<h4 class="mt-1"> Lista de achados - Video</h4>
<!-- Button toggles dropdown list -->
<div class="btn-group dropup w-100">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Abrir
</button>
<div class="dropdown-menu p-2 bg-dark">
<div class="bg-light border border-secondary rounded pl-2">

<h5 class="mt-1"> Achados</h5>
<hr>

<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="video1_achados_normal"
id="video1_achados_normal0" value="0" style="position:absolute !important"
{{checked?video1_achados_normal0:0}} checked>
<input class="form-check-input" type="radio" name="video1_achados_normal"
id="video1_achados_normal1" value="1"
{{checked?video1_achados_normal1:1}}>
<label class="form-check-label" for="video1_achados_normal1">
1. Normal
</label>
</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="video1_achados_dilatada"
id="video1_achados_dilatada0" value="0" style="position:absolute !important"
{{checked?video1_achados_dilatada0:0}} checked>
<input class="form-check-input" type="radio" name="video1_achados_dilatada"
id="video1_achados_dilatada1" value="1"
{{checked?video1_achados_dilatada1:1}}>
<label class="form-check-label" for="video1_achados_dilatada1">
2. Dilatada
</label>
</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="video1_achados_colabada"
id="video1_achados_colabada0" value="0" style="position:absolute !important"
{{checked?video1_achados_colabada0:0}} checked>
<input class="form-check-input" type="radio" name="video1_achados_colabada"
id="video1_achados_colabada1" value="1"
{{checked?video1_achados_colabada1:1}}>

<label class="form-check-label" for="video1_achados_colabada1">
3. Colabada
</label>
</div>
</div>


</div>
</div>
</div>

<hr>
<h3>Image 1</h3>
<hr>
Expand Down Expand Up @@ -192,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>
Loading

0 comments on commit e27e0a1

Please sign in to comment.