-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from harena-lab/development
Development
- Loading branch information
Showing
40 changed files
with
3,337 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule dccs
updated
12 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
(function () { | ||
DCC.component( | ||
'submit-login', | ||
'dcc-submit', | ||
{ | ||
pre: function (message, form, schema) { | ||
// console.log('============ logging') | ||
if (form.checkValidity() === false) { | ||
for ( i = 0; i < form.elements.length; i++){ | ||
if(form[i].required && form[i].validity.valid){ | ||
form[i].classList.add('is-valid') | ||
form[i].classList.remove('is-invalid') | ||
}else{ | ||
form[i].classList.add('is-invalid') | ||
form[i].classList.remove('is-valid') | ||
} | ||
} | ||
// console.log('form invalid') | ||
return false | ||
} | ||
// console.log('form valid') | ||
for ( i = 0; i < form.elements.length; i++){ | ||
// form[i].classList.add('is-valid') | ||
form[i].classList.remove('is-invalid') | ||
} | ||
// form.classList.add('was-validated') | ||
return true | ||
|
||
}, | ||
pos: function (response) { | ||
// console.log(response['harena-login']['response']) | ||
if(response['harena-login']['response'] === 'Login successful'){ | ||
// console.log('login successful'); | ||
if(document.querySelector('#login-message-alert')){ | ||
document.querySelector('#btn-submit-login').firstElementChild.innerHTML = 'Logging...' | ||
document.querySelector('#login-message-alert').innerHTML = response['harena-login']['response'] | ||
document.querySelector('#login-message-alert').classList.add('alert-success') | ||
document.querySelector('#login-message-alert').classList.remove('alert-danger') | ||
|
||
} | ||
|
||
setTimeout(function(){ | ||
if(new URL(document.location).searchParams.get('redirected')){ | ||
let redirectTo = sessionStorage.getItem('redirectBack') | ||
if(redirectTo == null || redirectTo == '') | ||
redirectTo = '/index-jacinto.html' | ||
sessionStorage.removeItem('redirectBack') | ||
window.location.href = redirectTo | ||
}else{ | ||
sessionStorage.removeItem('redirectBack') | ||
window.location.href = '/index-jacinto.html' | ||
} | ||
|
||
}, 2000) | ||
}else if (response['harena-login']['response'] === 'Email or password incorrect'){ | ||
// console.log('login failed, password or email incorrect'); | ||
if(document.querySelector('#login-message-alert')){ | ||
document.querySelector('#login-message-alert').innerHTML = response['harena-login']['response'] | ||
document.querySelector('#login-message-alert').classList.add('alert-danger') | ||
document.querySelector('#login-message-alert').classList.remove('alert-success') | ||
|
||
document.querySelector('#email').classList.add('is-invalid') | ||
document.querySelector('#password').classList.add('is-invalid') | ||
|
||
} | ||
} | ||
} | ||
} | ||
) | ||
DCC.component( | ||
'submit-logout', | ||
'dcc-submit', | ||
{ | ||
pre: async function (message, form, schema) { | ||
if(MessageBus.progn && MessageBus.progn.hasSubscriber('user/#')){ | ||
// console.log('============ if logout') | ||
MessageBus.progn.publish(`user/logout/${sessionStorage.getItem('harena-user-id')}`) | ||
// console.log(await MessageBus.progn.waitMessage('system/logout/ready')) | ||
// console.log('============ true') | ||
return true | ||
}else{ | ||
// console.log('============ else logout') | ||
return true | ||
} | ||
}, | ||
pos: function (response) { | ||
// console.log(response) | ||
window.location.href = '/index-jacinto.html' | ||
} | ||
} | ||
) | ||
|
||
DCC.component( | ||
'submit-change-password', | ||
'dcc-submit', | ||
{ | ||
pos: async function (response) { | ||
// console.log(response['harena-change-password']) | ||
const responseContainer = document.querySelector('#updatePasswordResponse') | ||
responseContainer.innerHTML = response['harena-change-password'] | ||
if(response['harena-change-password'] === 'Password changed successfully.'){ | ||
// console.log('if') | ||
responseContainer.classList.remove('text-danger') | ||
responseContainer.classList.add('text-success') | ||
const promise = new Promise((resolve, reject) => { | ||
setTimeout(() => resolve(window.location.href = '/index-jacinto.html'), 1000) | ||
}) | ||
}else { | ||
// console.log('else') | ||
responseContainer.classList.remove('text-success') | ||
responseContainer.classList.add('text-danger') | ||
} | ||
} | ||
} | ||
) | ||
|
||
DCC.component( | ||
'submit-case-property', | ||
'dcc-submit', | ||
{ | ||
pos: async function (response) { | ||
// console.log('============ pos dcc-submit prop') | ||
let propValue = null | ||
if(response['harena-case-property']['case_property']){ | ||
propValue = response['harena-case-property']['case_property']['value'] | ||
}else{ | ||
propValue = response['harena-case-property']['value'] | ||
} | ||
LayoutController.instance.feedbackButtonCaseState(propValue) | ||
} | ||
} | ||
) | ||
|
||
DCC.component( | ||
'submit-save-case-and-property', | ||
'dcc-submit', | ||
{ | ||
pre: function (message, form, schema) { | ||
const saveCase = document.querySelector(`button[id="btn-save-draft"]`) | ||
saveCase.click() | ||
return true | ||
}, | ||
pos: async function (response) { | ||
|
||
// console.log(response) | ||
let propValue = null | ||
if(response['harena-case-property']['case_property']){ | ||
propValue = response['harena-case-property']['case_property']['value'] | ||
}else{ | ||
propValue = response['harena-case-property']['value'] | ||
} | ||
LayoutController.instance.labDeliverButtonCaseState(propValue) | ||
} | ||
} | ||
) | ||
|
||
DCC.component( | ||
'submit-filter', | ||
'dcc-submit', | ||
{ | ||
pre: function (message, form, schema) { | ||
// console.log('============ pre submit-filter') | ||
// console.log(message['value']) | ||
// console.log('============ form') | ||
// console.log(form) | ||
var url = new URL(document.location) | ||
for(_info in message['value']){ | ||
url.searchParams.set(_info,message['value'][_info]) | ||
} | ||
document.location = url | ||
return true | ||
|
||
}, | ||
pos: function (response) { | ||
|
||
} | ||
} | ||
) | ||
|
||
DCC.component( | ||
'submit-share', | ||
'dcc-submit', | ||
{ | ||
pre: function (message, form, schema) { | ||
$('#notice-modal').modal('show') | ||
var txt = document.querySelector('#modal-notice-txt') | ||
var modalBody = document.querySelector('#modal-notice-body') | ||
txt.innerHTML = 'Sharing cases...' | ||
|
||
modalBody.classList.remove('bg-danger') | ||
modalBody.classList.remove('bg-success') | ||
txt.classList.remove('text-white') | ||
modalBody.classList.add('bg-white') | ||
txt.classList.add('text-secondary') | ||
|
||
return true | ||
}, | ||
pos: async function (response) { | ||
|
||
// console.log(response['harena-share-cases'].message) | ||
var txt = document.querySelector('#modal-notice-txt') | ||
var modalBody = document.querySelector('#modal-notice-body') | ||
|
||
txt.innerHTML = response['harena-share-cases'].message | ||
if(response['harena-share-cases'].message.includes('Error')){ | ||
modalBody.classList.remove('bg-success') | ||
modalBody.classList.remove('bg-white') | ||
txt.classList.remove('text-secondary') | ||
modalBody.classList.add('bg-danger') | ||
txt.classList.add('text-white') | ||
}else if(response['harena-share-cases'].message.includes("Cannot read property 'split'")){ | ||
txt.innerHTML = 'Error. Please select at least one case to share.' | ||
|
||
modalBody.classList.remove('bg-success') | ||
modalBody.classList.remove('bg-white') | ||
txt.classList.remove('text-secondary') | ||
modalBody.classList.add('bg-danger') | ||
txt.classList.add('text-white') | ||
}else{ | ||
modalBody.classList.remove('bg-danger') | ||
modalBody.classList.remove('bg-white') | ||
txt.classList.remove('text-secondary') | ||
modalBody.classList.add('bg-success') | ||
txt.classList.add('text-white') | ||
} | ||
|
||
setTimeout(function(){ | ||
$('#notice-modal').modal('hide') | ||
}, 7000) | ||
|
||
} | ||
} | ||
) | ||
|
||
})() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.04 KB
src/adonisjs/public/player/case/images/heart/images/4segmentoSTECG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
src/adonisjs/public/player/case/images/heart/images/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Image Sources | ||
|
||
* `heart1.svg` - https://pixabay.com/vectors/human-heart-blood-flow-1700453/ | ||
* `heart2.svg` - https://pixabay.com/vectors/anatomical-healthcare-heart-human-2023188/ | ||
|
||
* `character-2023874.svg` - https://pixabay.com/vectors/character-creature-robot-2023874/ |
Oops, something went wrong.