Commit ed0f69e4 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: clean up logging

parent 7387bddb
......@@ -230,7 +230,6 @@ var edit_mode = new function() {
}
this.insert_entity = async function(ent_element) {
console.log(getProperties(ent_element));
var xml = createEntityXML(
getEntityRole(ent_element),
getEntityName(ent_element),
......@@ -242,7 +241,6 @@ var edit_mode = new function() {
getEntityDescription(ent_element),
getEntityUnit(ent_element),
);
console.log(xml);
return await insert(xml);
}
......@@ -257,7 +255,6 @@ var edit_mode = new function() {
this.getProperties = function(ent_element) {
var properties = [];
for (var element of $(ent_element).find('.caosdb-property-row')) {
console.log(element);
var valfield = $(element).find(".caosdb-property-value");
var editfield = $(element).find(".caosdb-property-edit-value");
......@@ -296,8 +293,6 @@ var edit_mode = new function() {
}
this.update_entity = async function(ent_element) {
console.log(ent_element);
var xml = createEntityXML(
getEntityRole(ent_element),
getEntityName(ent_element),
......@@ -309,7 +304,6 @@ var edit_mode = new function() {
getEntityDescription(ent_element),
getEntityUnit(ent_element),
);
console.log(xml);
return await update(xml);
}
......@@ -456,7 +450,6 @@ var edit_mode = new function() {
select.append('<option data-has-refid="' + (dt == "REFERENCE") + '" data-has-unit="' + datatypes[dt] + '" value="' + dt + '" ' + (dt == datatype ? 'selected="true"' : '') + '>' + dt + '</option>');
}
console.log(select.html());
return [
$('<div class="form-group"><label class="col-sm-2 control-label caosdb-f-entity-datatype-label">datatype</label><div class="col-sm-3"><select class="form-control caosdb-f-entity-datatype">' + select.html() + '</select></div><label class="col-sm-2 control-label caosdb-f-entity-reference-label">reference</label><div class="col-sm-3"><input readonly="true" class="form-control caosdb-f-entity-reference" value="" placeholder="Drop a RT"></input></div><label class="col-sm-1 control-label caosdb-f-entity-is-list-label">list</label><div class="col-sm-1"><input class="caosdb-f-entity-is-list" type="checkbox" ' + (is_list ? 'checked="true" ' : "") + '/></div>')[0],
$('<div class="form-group"><label class="col-sm-2 control-label caosdb-f-entity-unit-label">unit</label><div class="col-sm-2"><input type="text" class="form-control caosdb-f-entity-unit" value="' + (typeof unit == 'undefined' ? "" : unit) + '"></input></div></div>')[0],
......@@ -468,13 +461,11 @@ var edit_mode = new function() {
}
this.smooth_replace = function(from, to) {
console.log(from);
$(to).hide();
$(from).fadeOut();
$(from).after(to);
$(from).detach();
$(to).fadeIn();
console.log(from);
}
/**
......@@ -491,7 +482,6 @@ var edit_mode = new function() {
var editfield = $(element).find(".caosdb-property-edit-value");
var property = getPropertyFromElement(element);
console.log(property);
valfield.hide();
editfield.show();
editfield.text("");
......@@ -544,7 +534,6 @@ var edit_mode = new function() {
}], true);
var doc = str2xml("<Response/>");
doc.firstElementChild.appendChild(newrecord.firstElementChild);
console.log(doc);
// TODO I dunno whats wrong here: xml -> str -> xml ???
var x = await transformation.transformEntities(str2xml(xml2str(doc)));
return x[0];
......@@ -608,9 +597,6 @@ var edit_mode = new function() {
button.hide();
var input = button.parent().find("input");
input.on("input", function(e) {
console.log(e);
console.log(button);
console.log(input);
if (input.val() == '') {
button.fadeOut();
} else {
......@@ -677,7 +663,6 @@ var edit_mode = new function() {
console.log(response);
return transformation.transformEntities(response);
}, edit_mode.handle_error).then(entities => {
console.log(entities);
edit_mode.smooth_replace(app.waiting, entities[0]);
app.entity = entities[0];
if (edit_mode.has_errors(app.entity)) {
......@@ -733,6 +718,7 @@ var edit_mode = new function() {
new_buttons.attr("disabled", true);
};
app.onBeforeStartEdit = function(e, entity) {
console.log(e);
edit_mode.unhighlight();
app.old = entity;
app.entity = $(entity).clone(true)[0];
......@@ -744,10 +730,12 @@ var edit_mode = new function() {
edit_mode.freeze_but(app.entity);
};
app.onBeforeCancel = function(e) {
console.log(e);
edit_mode.smooth_replace(app.entity, app.old);
edit_mode.unfreeze();
};
app.onUpdate = function(e, entity) {
console.log(e);
edit_mode.update_entity(entity).then(response => {
console.log(response);
return transformation.transformEntities(response);
......@@ -768,14 +756,15 @@ var edit_mode = new function() {
}
}
app.onEnterWait = function(e) {
edit_mode.smooth_replace(app.entity, app.waiting);
console.log(e);
edit_mode.smooth_replace(app.entity, app.waiting);
}
app.onLeaveWait = function(e) {
console.log(e);
edit_mode.smooth_replace(app.waiting, app.entity);
}
app.onBeforeNewEntity = function(e, entity) {
console.log(e);
if (typeof entity == "undefined") {
throw new TypeError("entity is undefined");
}
......@@ -804,7 +793,6 @@ var edit_mode = new function() {
console.log(response);
return transformation.transformEntities(response);
}, edit_mode.handle_error).then(entities => {
console.log(entities);
edit_mode.smooth_replace(app.entity, entities[0]);
app.entity = entities[0];
app.showResults();
......@@ -814,16 +802,15 @@ var edit_mode = new function() {
console.log(e);
edit_mode.unhighlight();
if (app.old) {
console.log(app.old);
edit_mode.smooth_replace(app.entity, app.old);
}
edit_mode.unfreeze();
}
app.onShowResults = function(e) {
console.log(e);
if (!edit_mode.has_errors(app.entity)) {
app.old = false;
}
console.log(e);
hintMessages.hintMessages(app.entity);
edit_mode.unfreeze();
if (!edit_mode.has_errors(app.entity)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment