From ef111c0f6e5006535428f87cb6a11c559a522b17 Mon Sep 17 00:00:00 2001 From: Esteban Lombeyda Date: Thu, 26 Jun 2014 14:57:01 +0200 Subject: [PATCH 1/3] changeMode test is execute only in noncluster environoments --- .../tests/{shell-changeMode.js => shell-changeMode-noncluster.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename js/client/tests/{shell-changeMode.js => shell-changeMode-noncluster.js} (100%) diff --git a/js/client/tests/shell-changeMode.js b/js/client/tests/shell-changeMode-noncluster.js similarity index 100% rename from js/client/tests/shell-changeMode.js rename to js/client/tests/shell-changeMode-noncluster.js From 99e2aac9a8f29c88a949a83df320d59398677ab7 Mon Sep 17 00:00:00 2001 From: Esteban Lombeyda Date: Thu, 26 Jun 2014 14:57:57 +0200 Subject: [PATCH 2/3] avoiding segmentation fault in cluster --- arangod/Cluster/ClusterMethods.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arangod/Cluster/ClusterMethods.cpp b/arangod/Cluster/ClusterMethods.cpp index 5989946c1d..80c6c8f3df 100644 --- a/arangod/Cluster/ClusterMethods.cpp +++ b/arangod/Cluster/ClusterMethods.cpp @@ -898,7 +898,7 @@ int getDocumentOnCoordinator ( } if (res->status == CL_COMM_ERROR) { // This could be a broken connection or an Http error: - if (!res->result->isComplete()) { + if (!res->result || !res->result->isComplete()) { delete res; return TRI_ERROR_CLUSTER_CONNECTION_LOST; } From d610cf9107015c651a7b5770bd9b4999f56fb757 Mon Sep 17 00:00:00 2001 From: scottashton Date: Thu, 26 Jun 2014 15:10:23 +0200 Subject: [PATCH 3/3] finally managed to disable the enter button in create graph modal --- .../js/templates/edgeDefinitionTable.ejs | 6 +++--- .../frontend/js/templates/modalGraphTable.ejs | 16 ++++++---------- .../frontend/js/views/graphManagementView.js | 9 +++++---- .../aardvark/frontend/js/views/modalView.js | 7 ++++--- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs b/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs index 6a3d157a86..717292f8f3 100644 --- a/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs @@ -2,7 +2,7 @@ Edge definitions*: - + @@ -13,7 +13,7 @@ fromCollections*: - + @@ -23,7 +23,7 @@ toCollections*: - + diff --git a/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs b/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs index 9bd000af6a..3adad2515b 100644 --- a/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs @@ -6,10 +6,6 @@ mandatory = '*'; } - var disableSubmitOnEnterString = ''; - if (disableSubmitOnEnter) { - disableSubmitOnEnterString = 'onkeypress="event.stopPropagation()"'; - } %> <%=row.label%><%=mandatory%>: @@ -18,12 +14,12 @@ switch(row.type) { case "text": %> - type="text" id="<%=row.id%>" value="<%=row.value||''%>" placeholder="<%=row.placeholder||''%>"> + <% break; case "password": %> - type="password" id="<%=row.id%>" value="<%=row.value||''%>" placeholder="<%=row.placeholder||''%>"> + <% break; case "readonly": @@ -41,7 +37,7 @@ disabled = 'disabled'; } %> - type="checkbox" id="<%=row.id%>" value="<%=row.value%>" <%=checked%> <%=disabled%>> + <%=disabled%>> <% break; case "select": @@ -59,7 +55,7 @@ break; case "select2": %> - type="hidden" id="<%=row.id%>" value="<%=row.value||''%>" placeholder="<%=row.placeholder||''%>"> + <% if (row.addAdd) {%> <% } %> @@ -89,7 +85,7 @@ <% _.each(content, function(row) { - createTR(row, disableSubmitOnEnter); + createTR(row); }); %> @@ -111,7 +107,7 @@ <% _.each(advancedContent.content, function(row) { - createTR(row, disableSubmitOnEnter); + createTR(row); }); %> diff --git a/js/apps/system/aardvark/frontend/js/views/graphManagementView.js b/js/apps/system/aardvark/frontend/js/views/graphManagementView.js index 02c2214527..ddb0b1df98 100644 --- a/js/apps/system/aardvark/frontend/js/views/graphManagementView.js +++ b/js/apps/system/aardvark/frontend/js/views/graphManagementView.js @@ -75,6 +75,7 @@ this.events["click .tableRow"] = this.showHideDefinition.bind(this); this.events['change [id*="newEdgeDefinitions"]'] = this.setFromAndTo.bind(this); this.events["click .graphViewer-icon-button"] = this.addRemoveDefinition.bind(this); + return this; }, @@ -89,7 +90,7 @@ } else { id = e.currentTarget.id.split("row_newEdgeDefinitions")[1]; $('#s2id_fromCollections'+id).select2("val", null); - $('#newFCollections'+id).attr('disabled', false); + $('#fromCollections'+id).attr('disabled', false); $('#s2id_toCollections'+id).select2("val", null); $('#toCollections'+id).attr('disabled', false); } @@ -181,8 +182,8 @@ index = index.replace("s2id_newEdgeDefinitions", ""); collection = _.pluck($('#s2id_newEdgeDefinitions' + index).select2("data"), "text")[0]; if (collection && collection !== "") { - from = _.pluck($('#s2id_newFromCollections' + index).select2("data"), "text"); - to = _.pluck($('#s2id_newToCollections' + index).select2("data"), "text"); + from = _.pluck($('#s2id_fromCollections' + index).select2("data"), "text"); + to = _.pluck($('#s2id_toCollections' + index).select2("data"), "text"); if (from !== 1 && to !== 1) { edgeDefinitions.push( { @@ -456,7 +457,7 @@ } }); this.counter = 0; - window.modalView.disableSubmitOnEnter = true; + window.modalView.enableHotKeys = false; tableContent.push( window.modalView.createTextEntry( diff --git a/js/apps/system/aardvark/frontend/js/views/modalView.js b/js/apps/system/aardvark/frontend/js/views/modalView.js index cba992c8b4..69a214e9aa 100644 --- a/js/apps/system/aardvark/frontend/js/views/modalView.js +++ b/js/apps/system/aardvark/frontend/js/views/modalView.js @@ -64,8 +64,8 @@ yes: "#modal-confirm-delete", no: "#modal-abort-delete" }, - disableSubmitOnEnter : false, enabledHotkey: false, + enableHotKeys : true, buttons: { SUCCESS: "success", @@ -272,7 +272,6 @@ var template = templateEngine.createTemplate(templateName), model = {}; - model.disableSubmitOnEnter = this.disableSubmitOnEnter; model.content = tableContent || []; model.advancedContent = advancedContent || false; $(".modal-body").html(template.render(model)); @@ -320,7 +319,9 @@ this.createInitModalHotkeys(); this.enabledHotkey = true; } - this.createModalHotkeys(); + if (this.enableHotKeys) { + this.createModalHotkeys(); + } }, hide: function() {