Skip to content

Commit

Permalink
Merge pull request #448 from harena-lab/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
santanche authored Sep 19, 2023
2 parents 5346bb2 + 7f20775 commit 5c2666e
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 20 deletions.
8 changes: 4 additions & 4 deletions src/adonisjs/public/author/edit/inplace-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ class EditDCC {
const ep = await this._extendedPanel(
EditDCC.imageBrowseTemplate, mtype, ftypes)
let path = null
if (ep.select != null &&
ep.select.options[ep.select.selectedIndex].value.length > 0)
path = ep.select.options[ep.select.selectedIndex].value
else {
if (ep.select != null) {
if (ep.select.options[ep.select.selectedIndex].value.length > 0)
path = ep.select.options[ep.select.selectedIndex].value
} else if (ep.browse != null) {
console.log('===== files selected')
for (let f of ep.browse.files)
console.log(f)
Expand Down
19 changes: 11 additions & 8 deletions src/adonisjs/public/author/env/inf331_2023/js/lab-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
// 3:new Date('2023/09/06'),4:new Date('2023/09/13'),
// 5:new Date('2023/09/20'),6:new Date('2023/09/27')}
this.labRelease = {1:this.setDateToISO(hourExpiration(new Date('2023/09/05 GMT-0300'),13)),2:this.setDateToISO(hourExpiration(new Date('2023/09/05 GMT-0300'),14)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/11 GMT-0300'),14)),4:this.setDateToISO(hourExpiration(new Date('2023/09/13 GMT-0300'),18)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/11 GMT-0300'),14)),4:this.setDateToISO(hourExpiration(new Date('2023/09/16 GMT-0300'),18)),
5:this.setDateToISO(hourExpiration(new Date('2023/09/20 GMT-0300'),18)),6:this.setDateToISO(hourExpiration(new Date('2023/09/27 GMT-0300'),18))}
this.labExpiration = {1:this.setDateToISO(hourExpiration(new Date('2023/09/09 GMT-0300'),23)), 2:this.setDateToISO(hourExpiration(new Date('2023/09/16 GMT-0300'),23)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/16 GMT-0300'),23)),4:this.setDateToISO(hourExpiration(new Date('2023/09/23 GMT-0300'),23)),
this.labExpiration = {1:this.setDateToISO(hourExpiration(new Date('2023/09/18 GMT-0300'),23)), 2:this.setDateToISO(hourExpiration(new Date('2023/09/18 GMT-0300'),23)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/18 GMT-0300'),23)),4:this.setDateToISO(hourExpiration(new Date('2023/09/23 GMT-0300'),23)),
5:this.setDateToISO(hourExpiration(new Date('2023/09/30 GMT-0300'),23)),6:this.setDateToISO(hourExpiration(new Date('2023/10/06 GMT-0300'),23))}
this.start = this.start.bind(this)
MessageBus.i.subscribe('control/html/ready', this.start)
Expand Down Expand Up @@ -225,13 +225,14 @@
const highestLab = Object.keys(labList).length
// let nLabReleased = 0
const currentDate = new Date()
// console.log(labProgressManager.i.lab);
console.log(labProgressManager.i.lab)
console.log(highestLab);

let createdBtn = false
let released = true
const lateReleaseTxt = 'Não publicado...(atraso)'
progressWrapper.innerHTML = ''
for (var i = 1; i <= Object.keys(this.labRelease).length; i++) {
for (let i = 1; i <= Object.keys(this.labRelease).length; i++) {
labCompleted = false
labDelivered = false
labExtended = false
Expand All @@ -248,7 +249,7 @@
}

if (labExpired){
if (Object.keys(labList).length > i){
if (Object.keys(labList).includes(String(i))){
if (labList[i]['extendPeriod'] != null){
if((this.setDateToISO((labList[i]['extendPeriod'])) > this.setDateToISO(currentDate))){
labExtended = true
Expand All @@ -268,8 +269,9 @@
let template = document.createElement('template')
// console.log('============ current greater then release',pastRelease)
// console.log('============ current date greater then expiration',labExpired)

if (pastRelease && highestLab > i){
// console.log('keys',Object.keys(labList));
// console.log(Object.keys(labList).includes(String(i)));
if (pastRelease && Object.keys(labList).includes(String(i))){
if (labProgressManager.i.lab[i]['property'] != null && labProgressManager.i.lab[i]['property'] == '0'){
labDelivered = true
}
Expand Down Expand Up @@ -355,6 +357,7 @@
.replace(/\[labText\]/ig, lateReleaseTxt)

}else{
console.log('heere',i);
createdBtn = true
if (!labExpired || (pastRelease && labExpired && labExtended)){
if (labExtended){
Expand Down
105 changes: 99 additions & 6 deletions src/adonisjs/public/hradm/js/dcc-rest-proxy-adm.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ DCC.component(
)

DCC.component(
'harena-hradm-groups',
'harena-hradm-roles',
'dcc-rest',
{
environment: {
'url-manager': HarenaConfig.manager.url + HarenaConfig.manager.api,
},
oas: {
paths: {
'{url-manager}/admin/groups': {
'{url-manager}/admin/roles': {
'get': {
operationId: 'groups-list',
operationId: 'roles-list',
parameters: [
{name: 'url-manager',
in: 'path'}
Expand All @@ -161,18 +161,19 @@ DCC.component(
}
)

//Retrieves all groups from database
DCC.component(
'harena-hradm-roles',
'harena-admin-groups',
'dcc-rest',
{
environment: {
'url-manager': HarenaConfig.manager.url + HarenaConfig.manager.api,
},
oas: {
paths: {
'{url-manager}/admin/roles': {
'{url-manager}/admin/groups': {
'get': {
operationId: 'roles-list',
operationId: 'admin-group-list',
parameters: [
{name: 'url-manager',
in: 'path'}
Expand All @@ -184,4 +185,96 @@ DCC.component(
}
)

DCC.component(
'harena-admin-users',
'dcc-rest',
{
environment: {
'url-manager': HarenaConfig.manager.url + HarenaConfig.manager.api,
'fInstitution': new URL(document.location).searchParams.get('fInstitution'),
'fUserType': new URL(document.location).searchParams.get('fUserType'),
'fGroup': new URL(document.location).searchParams.get('fGroup'),
'fSearchStr': new URL(document.location).searchParams.get('fSearchStr'),
'page': new URL(document.location).searchParams.get('page'),
'nItems': new URL(document.location).searchParams.get('limit'),
},
oas: {
paths: {
'{url-manager}/admin/users': {
'get': {
operationId: 'admin-users-list',
parameters: [
{name: 'url-manager',
in: 'path'},
{name: 'fInstitution',
in: 'query'},
{name: 'fUserType',
in: 'query'},
{name: 'fGroup',
in: 'query'},
{name: 'fSearchStr',
in: 'query'},
{name: 'page',
in: 'query'},
{name: 'nItems',
in: 'query'},
]
}
}
}
}
}
)

DCC.component(
'harena-admin-gen-login-token',
'dcc-rest',
{
environment: {
'url-manager': HarenaConfig.manager.url + HarenaConfig.manager.api,
},
oas: {
paths: {
'{url-manager}/admin/user/temp_login': {
'put': {
operationId: 'admin-gen-login-token',
parameters: [
{name: 'url-manager',
in: 'path'},
{name: 'userId',
in: 'query'},

]
}
}
}
}
}
),

DCC.component(
'harena-admin-user-info',
'dcc-rest',
{
environment: {
'url-manager': HarenaConfig.manager.url + HarenaConfig.manager.api,
},
oas: {
paths: {
'{url-manager}/user/{userId}': {
'get': {
operationId: 'admin-user-info',
parameters: [
{name: 'url-manager',
in: 'path'},
{name: 'userId',
in: 'path'},
]
}
}
}
}
}
)

})()
4 changes: 2 additions & 2 deletions src/adonisjs/public/hradm/users-csv/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ <h3 class="ml-3 text-secondary">Users settings:</h3>
</dcc-dhtml>
</div>
<div class="pr-2">
<dcc-rest id="harena-hradm-groups" bind="harena-hradm-groups"></dcc-rest>
<dcc-dhtml id="harena-dhtml-groups" connect="retrieve:harena-hradm-groups:service/request/get">
<dcc-rest id="harena-admin-groups" bind="harena-admin-groups"></dcc-rest>
<dcc-dhtml id="harena-dhtml-groups" connect="retrieve:harena-admin-groups:service/request/get">
<select id="group" name="group" class="custom-select custom-select-sm">
<option selected value="">Group</option>
{{@foreach . group}}
Expand Down

0 comments on commit 5c2666e

Please sign in to comment.