Skip to content

Commit

Permalink
Merge pull request #298 from harena-lab/development
Browse files Browse the repository at this point in the history
feat (hradm): new administrative functionalities
  • Loading branch information
santanche authored Nov 16, 2021
2 parents b1bb4ba + e62ed4e commit 85e7faf
Show file tree
Hide file tree
Showing 32 changed files with 807 additions and 131 deletions.
8 changes: 4 additions & 4 deletions src/adonisjs/public/author/drafts/category/cases/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<script src="/dccs/base/trigger-dcc.js"></script>
<script src="/dccs/base/property-dcc.js"></script>
<script src="/dccs/base/connect-dcc.js"></script>
<script src="/dccs/base/end-dcc.js"></script>


<script src="/infra/dcc-rest-proxy.js"></script>
<script src="/infra/dcc-basic.js"></script>
Expand Down Expand Up @@ -102,7 +102,7 @@ <h5 class="modal-title">Filter by:</h5>
{{@endfor}}
</select>

<end-dcc></end-dcc>

</dcc-dhtml>
</div>
<div class="pr-3">
Expand Down Expand Up @@ -162,7 +162,7 @@ <h5 class="modal-title">Filter by:</h5>
<option value="{{institution.id}}">{{institution.title}}</option>
{{@endfor}}
</select>
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
</div>
Expand Down Expand Up @@ -275,7 +275,7 @@ <h6>Created by {{c.cases.author_grade}}: {{c.cases.username}} ({{c.cases.institu
</div>
</div>
{{@endfor}}
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/adonisjs/public/author/drafts/category/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<script src="/dccs/base/trigger-dcc.js"></script>
<script src="/dccs/base/property-dcc.js"></script>
<script src="/dccs/base/connect-dcc.js"></script>
<script src="/dccs/base/end-dcc.js"></script>


<script src="/infra/dcc-rest-proxy.js"></script>
<script src="/infra/dcc-basic.js"></script>
Expand Down Expand Up @@ -110,7 +110,6 @@ <h5 class="text-center text-wrap txt-visita-virtual" style="color:#505050 !impor

</div>
{{@endfor}}
<end-dcc></end-dcc>
</dcc-dhtml>

</div>
Expand Down
8 changes: 4 additions & 4 deletions src/adonisjs/public/author/drafts/feedback/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<script src="/dccs/base/trigger-dcc.js"></script>
<script src="/dccs/base/property-dcc.js"></script>
<script src="/dccs/base/connect-dcc.js"></script>
<script src="/dccs/base/end-dcc.js"></script>


<script src="/infra/dcc-rest-proxy.js"></script>
<script src="/infra/dcc-basic.js"></script>
Expand Down Expand Up @@ -117,7 +117,7 @@
<option value="{{institution.id}}">{{institution.title}}</option>
{{@endfor}}
</select>
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
</div>
Expand Down Expand Up @@ -188,7 +188,7 @@ <h5 class="" id="modal-notice-txt"></h5>
{{@endfor}}
</select>
<end-dcc></end-dcc>
</dcc-dhtml> -->
</div>
<div class="pr-3">
Expand Down Expand Up @@ -261,7 +261,7 @@ <h6>Created by: {{c.cases.username}} ({{c.cases.institution_acronym}}) || {{c.ca
</div>
</div>
{{@endfor}}
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/adonisjs/public/author/drafts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<script src="/dccs/base/trigger-dcc.js"></script>
<script src="/dccs/base/property-dcc.js"></script>
<script src="/dccs/base/connect-dcc.js"></script>
<script src="/dccs/base/end-dcc.js"></script>


<script src="/infra/dcc-rest-proxy.js"></script>
<script src="/infra/dcc-basic.js"></script>
Expand Down Expand Up @@ -117,7 +117,7 @@
<option value="{{institution.id}}">{{institution.title}}</option>
{{@endfor}}
</select>
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
</div>
Expand Down Expand Up @@ -161,7 +161,7 @@ <h5 class="modal-title">Filter by:</h5>
{{@endfor}}
</select>

<end-dcc></end-dcc>

</dcc-dhtml>
</div>
<div class="pr-3">
Expand Down Expand Up @@ -231,7 +231,7 @@ <h5 class="" id="modal-notice-txt"></h5>
{{@endfor}}
</select>
<end-dcc></end-dcc>
</dcc-dhtml>
</div>
<div class="pr-2">
Expand Down Expand Up @@ -302,7 +302,7 @@ <h6>Created by {{c.cases.author_grade}}: {{c.cases.username}} ({{c.cases.institu
</div>
</div>
{{@endfor}}
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/adonisjs/public/author/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<script src="/dccs/base/trigger-dcc.js"></script>
<script src="/dccs/base/property-dcc.js"></script>
<script src="/dccs/base/connect-dcc.js"></script>
<script src="/dccs/base/end-dcc.js"></script>


<script src="/dccs/components/data/dcc-model.js"></script>
<script src="/dccs/components/data/dcc-submit.js"></script>
Expand Down Expand Up @@ -208,7 +208,7 @@ <h3>Settings</h3>
</div>
</div>
</div>
<end-dcc></end-dcc>

</dcc-dhtml>
<!-- End of settings modal -->

Expand Down Expand Up @@ -249,7 +249,7 @@ <h3>Settings</h3>
<option value="{{institution.id}}">{{institution.title}}</option>
{{@endfor}}
</select>
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
</div>
Expand All @@ -265,7 +265,7 @@ <h3>Settings</h3>
</div>
<dcc-dhtml id="dhtml-case-id" connect="retrieve:harena-case:service/request/get">
<input type="hidden" id="table_id" name="table_id" value="{{id}}">
<end-dcc></end-dcc>

</dcc-dhtml>
<dcc-submit label="Share" xstyle="btn btn-success" bind="submit-share" data-dismiss="modal" connect="submit:harena-share-cases:service/request/post"></dcc-submit>
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
Expand Down Expand Up @@ -318,7 +318,7 @@ <h5 class="" id="modal-notice-txt"></h5>
<dcc-dhtml subscribe="service/response/get/harena-case:update">
<h1>Edit case - {{title}}</h1>
<h6 style="color:#808080;">Created by {{author_grade}}: {{username}} ({{institution_acronym}}). </h6>
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
<!-- End of page title and description -->
Expand Down
4 changes: 2 additions & 2 deletions src/adonisjs/public/author/partials/case-list-min.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{@endfor}}
</select>

<end-dcc></end-dcc>

</dcc-dhtml>
</div>
<div class="pr-3">
Expand Down Expand Up @@ -78,6 +78,6 @@ <h6>Created by {{c.cases.author_grade}}: {{c.cases.username}} ({{c.cases.institu
</div>
</div>
{{@endfor}}
<end-dcc></end-dcc>

</dcc-dhtml>
</div>
2 changes: 1 addition & 1 deletion src/adonisjs/public/author/partials/template-min.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<script src="/dccs/base/trigger-dcc.js"></script>
<script src="/dccs/base/property-dcc.js"></script>
<script src="/dccs/base/connect-dcc.js"></script>
<script src="/dccs/base/end-dcc.js"></script>


<script src="/dccs/components/data/dcc-model.js"></script>
<script src="/dccs/components/data/dcc-submit.js"></script>
Expand Down
18 changes: 0 additions & 18 deletions src/adonisjs/public/dccs/base/end-dcc.js

This file was deleted.

17 changes: 15 additions & 2 deletions src/adonisjs/public/dccs/components/data/dcc-table-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DCCTableCSV extends DCCVisual {
}

static get observedAttributes () {
return DCCVisual.observedAttributes.concat(['drop', 'view'])
return DCCVisual.observedAttributes.concat(['drop', 'view', 'separator'])
}

get drop () {
Expand All @@ -61,6 +61,14 @@ class DCCTableCSV extends DCCVisual {
else { this.removeAttribute('view') }
}

get separator () {
return this.getAttribute('separator')
}

set separator (newValue) {
this.setAttribute('separator', newValue)
}

_tableDrag (event) {
this._dropZone.innerHTML = 'Drop your file here'
event.preventDefault()
Expand Down Expand Up @@ -93,10 +101,15 @@ class DCCTableCSV extends DCCVisual {
}

_processTable (csv) {
const sep = (this.hasAttribute('separator')) ? this.separator : ','
const lineRE =
new RegExp('(?:^|' + sep + ')[ \\t]*(?:(?:"([^"]*)")|([^' + sep + ']*))',
'g')

let lines = csv.split(/\r\n|\r|\n/)
this._table = []
for (let l of lines) {
let cells = l.matchAll(/(?:^|,)[ \t]*(?:(?:"([^"]*)")|([^,]*))/g)
let cells = l.matchAll(lineRE)
let ln = []
for (const c of cells)
ln.push((c[1] != null) ? c[1] : c[2])
Expand Down
Loading

0 comments on commit 85e7faf

Please sign in to comment.