fix saving branch prefix, fixes #260

This commit is contained in:
azivner 2018-12-29 10:35:44 +01:00
parent e02eca87b0
commit 3f8e8f8561
2 changed files with 24 additions and 19 deletions

View File

@ -2,6 +2,7 @@ import treeService from '../services/tree.js';
import server from '../services/server.js'; import server from '../services/server.js';
import treeCache from "../services/tree_cache.js"; import treeCache from "../services/tree_cache.js";
import treeUtils from "../services/tree_utils.js"; import treeUtils from "../services/tree_utils.js";
import infoService from "../services/info.js";
const $dialog = $("#branch-prefix-dialog"); const $dialog = $("#branch-prefix-dialog");
const $form = $("#branch-prefix-form"); const $form = $("#branch-prefix-form");
@ -35,6 +36,8 @@ async function savePrefix() {
await treeService.setPrefix(branchId, prefix); await treeService.setPrefix(branchId, prefix);
$dialog.modal('hide'); $dialog.modal('hide');
infoService.showMessage("Branch prefix has been saved.");
} }
$form.submit(() => { $form.submit(() => {

View File

@ -1,31 +1,33 @@
<div id="branch-prefix-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog"> <div id="branch-prefix-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <form id="branch-prefix-form">
<div class="modal-header"> <div class="modal-content">
<h5 class="modal-title mr-auto">Edit branch prefix</h5> <div class="modal-header">
<h5 class="modal-title mr-auto">Edit branch prefix</h5>
<button class="help-button" type="button" data-help-page="Tree-concepts#prefix" title="Help on Tree prefix">?</button> <button class="help-button" type="button" data-help-page="Tree-concepts#prefix" title="Help on Tree prefix">?</button>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;"> <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <div class="form-group">
<label for="branch-prefix-input">Prefix: </label> &nbsp; <label for="branch-prefix-input">Prefix: </label> &nbsp;
<div class="input-group"> <div class="input-group">
<input id="branch-prefix-input" class="form-control"> <input id="branch-prefix-input" class="form-control">
<div class="input-group-append"> <div class="input-group-append">
<div id="branch-prefix-note-title" class="input-group-text"></div> <div id="branch-prefix-note-title" class="input-group-text"></div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer">
<button class="btn btn-primary btn-sm">Save</button>
</div>
</div> </div>
<div class="modal-footer"> </form>
<button class="btn btn-primary btn-sm">Save</button>
</div>
</div>
</div> </div>
</div> </div>