Skip to content

Commit

Permalink
feat (inf331): set property and save case
Browse files Browse the repository at this point in the history
HeitorMatt committed Sep 9, 2023
1 parent 082b4a1 commit b244c68
Showing 3 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -304,7 +304,7 @@
if (released == false){
template.innerHTML = labProgressManager.lvlContainerLocked
.replace(/\[difficulty\]/ig, i)
.replace(/\[labRelease\]/ig, `${this.getDateStringthis(this.labRelease[i])}`)
.replace(/\[labRelease\]/ig, `${this.convertToLocalTz(this.labRelease[i],'string')}`)
.replace(/\[labText\]/ig, lateReleaseTxt)

}else{
2 changes: 1 addition & 1 deletion src/adonisjs/public/infra/conditional-layout.js
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@ class LayoutController {
if(userGrade === 'student'){

dccSubmitProp.setAttribute('id','dcc-submit-feedback')
dccSubmitProp.setAttribute('bind','submit-case-property')
dccSubmitProp.setAttribute('bind','submit-save-case-and-property')
dccSubmitProp.setAttribute('xstyle','btn btn-secondary btn-lab-primary m-1')
dccSubmitProp.setAttribute('label', "Entregar")
dccSubmitProp.setAttribute('topic','service/request/post')
24 changes: 23 additions & 1 deletion src/adonisjs/public/infra/dcc-basic-swe.js
Original file line number Diff line number Diff line change
@@ -120,7 +120,6 @@
{
pos: async function (response) {
// console.log('============ pos dcc-submit prop')
// console.log(response)
let propValue = null
if(response['harena-case-property']['case_property']){
propValue = response['harena-case-property']['case_property']['value']
@@ -132,6 +131,29 @@
}
)

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',

0 comments on commit b244c68

Please sign in to comment.