Skip to content

Commit

Permalink
Merge pull request #219 from datasci4health/development
Browse files Browse the repository at this point in the history
New feedback - save case
  • Loading branch information
HeitorMatt authored Sep 3, 2020
2 parents 2576d30 + ccdbbd4 commit 91d5c62
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 68 deletions.
8 changes: 5 additions & 3 deletions src/adonisjs/public/author/js/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class AuthorManager {
.addEventListener("shown.bs.modal", this.updateSourceField);
*/
$('#settings-modal').on('shown.bs.modal', this.updateSourceField)
$('#btn-save-settings').on('click', await this.caseSave)
// this.caseLoadSelect();
}

Expand Down Expand Up @@ -312,6 +311,7 @@ class AuthorManager {
*/
async caseSave () {
console.log('=== case save')
document.getElementById('btn-save-draft').innerHTML = 'SAVING...';
console.log(Basic.service.currentCaseId)
console.log(this._compiledCase)
if (Basic.service.currentCaseId != null && this._compiledCase != null) {
Expand Down Expand Up @@ -344,8 +344,10 @@ class AuthorManager {
const promise = new Promise((resolve, reject) => {
setTimeout(() => resolve('done!'), 2000)
})
const result = await promise
this._messageSpace.innerHTML = ''
const result = await promise;
this._messageSpace.innerHTML = '';
document.getElementById('btn-save-draft').innerHTML = 'SAVE';

}
}

Expand Down
73 changes: 10 additions & 63 deletions src/adonisjs/resources/views/author/author.edge
Original file line number Diff line number Diff line change
Expand Up @@ -79,60 +79,6 @@
<body onload="AuthorManager.author.start()">

@include('layout.partials.settings-modal')
<!-- Modal -->
<!--
<div class="modal fade" id="settings-modal" tabindex="-1" role="dialog" aria-labelledby="settings-modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<h3>Settings</h3>
<form>
<div class="form-group">
<label for="case-title">Title</label>
<input type="text" class="form-control" id="case-title" placeholder="Enter the title">
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control" id="description"></textarea>
</div>
<div class="form-group">
<label for="language">Language</label>
<select name="language" id="language">
<option value="pt-BR">Portuguese (Brazil)</option>
<option value="pt-BR">Portuguese (Portugal)</option>
<option value="en">English</option>
</select>
</div>
<div class="form-group">
<label for="created">Creation Date</label>
<input type="date" class="form-control" id="created">
</div>
<div class="form-group">
<label for="institution">Institution</label>
<input type="text" class="form-control" id="institution" placeholder="Enter your institution">
</div>
<div class="form-group">
<label for="keywords">Domain</label>
<input type="text" class="form-control" id="domain" placeholder="Inform the case domain">
</div>
<div class="form-group">
<label for="keywords">Specialty</label>
<input type="text" class="form-control" id="specialty" placeholder="Inform the case specialty">
</div>
<div class="form-group">
<label for="keywords">Keywords</label>
<textarea class="form-control" id="keywords" aria-describedby="keywords-help"></textarea>
<small id="keywords-help" class="form-text text-muted">Inform your keywords separated by semicolon.</small>
</div>
<button type="button" class="btn btn-secondary" id="btn-save-settings">Save</button>
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
</form>
</div>
</div>
</div>
</div>
-->
<!--end of modal -->

<!-- Create a section to place page content -->

Expand Down Expand Up @@ -170,29 +116,30 @@
style="position:relative">
<nav class="navbar navbar-light">
<div class="col-6">
<dcc-trigger action="control/case/save" label="SAVE" xstyle="in"></dcc-trigger>
<!--
<dcc-trigger action="control/case/settings" label="SETTINGS" xstyle="in"></dcc-trigger>
-->
<button type="button" class="btn btn-secondary" id="btn-save-draft">Save</button>
<dcc-trigger action="control/case/save" location="btn-save-draft" label="SAVE" xstyle="out"></dcc-trigger>

<!-- Settings button activates a modal -->
<button type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#settings-modal"
id="btn-save-settings">Settings</button>
<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-trigger action="control/case/markdown" label="MARKDOWN" xstyle="in"></dcc-trigger>
</div>
<div class="sty-message-space" id="message-space"></div>


</div>
<div class="navbar-sub col-2">
<!-- <div class="navbar-sub col-2">
<div class="custom-control custom-switch" data-on="success" data-off="default">
<input type="checkbox" class="custom-control-input" id="preview-switch">
<label class="custom-control-label" for="preview-switch">Preview mode</label>
</div>
</div>
-->
<div class="col-2">

</div>
</nav>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/adonisjs/resources/views/layout/partials/header.edge
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
--}}

@loggedIn
<span class="inline-flex mr-4 rounded-md shadow">
<!--<span class="inline-flex mr-4 rounded-md shadow">
<a href="{{route('player_home')}}" class="inline-flex items-center px-4 py-2 text-base font-medium leading-6 text-indigo-600 transition duration-150 ease-in-out bg-white border border-transparent rounded-md hover:text-indigo-500 focus:outline-none focus:shadow-outline-blue active:bg-gray-50 active:text-indigo-700">
Play
</a>
</span>
</span>-->
<span class="inline-flex rounded-md shadow">
<a href="{{route('logout')}}" class="inline-flex items-center px-4 py-2 text-base font-medium leading-6 text-indigo-600 transition duration-150 ease-in-out bg-white border border-transparent rounded-md hover:text-indigo-500 focus:outline-none focus:shadow-outline-blue active:bg-gray-50 active:text-indigo-700">
Logout
Expand Down

0 comments on commit 91d5c62

Please sign in to comment.