1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Frank Celler 2014-01-30 17:23:32 +01:00
commit 9e251487c1
29 changed files with 173 additions and 117 deletions

View File

@ -8422,6 +8422,10 @@ bool ExtractDocumentHandle (v8::Handle<v8::Value> val,
return false;
}
if (! obj->Has(v8g->_RevKey)) {
return true;
}
rid = TRI_ObjectToUInt64(obj->Get(v8g->_RevKey), true);
if (rid == 0) {

View File

@ -79,11 +79,3 @@
margin: 11px 10px 0 0 !important;
}
#resources > li:nth-child(even) {
background-color: #FFFFFF !important;
}
#resources > li:nth-child(odd) {
background-color: #F1F0EE !important;
}

View File

@ -9,13 +9,21 @@
font-size: 20px;
color: #8AA050;
margin-top: 2px;
cursor: pointer;
}
.deleteButton {
color: #B30000;
/*color: #B30000;*/
color: #DA4F49;
font-size: 20px;
padding-right: 3px;
top: 3px;
position: relative;
cursor: pointer;
}
.deleteButton:hover {
color: #BE342E;
}
ul.headerButtonList {

View File

@ -51,14 +51,6 @@
padding:12px 18px;
}
#databaseTable tr:nth-child(odd) {
background-color: #F1F0EE;
}
#databaseTable tr:nth-child(even) {
background-color: #FFFFFF;
}
#createDatabaseModal table {
width: 100%;
}

View File

@ -6,14 +6,6 @@
padding:12px 18px !important;
}
#logContent .odd {
background-color: #F1F0EE;
}
#logContent .even {
background-color: #FFFFFF;
}
table.dataTable thead th {
border-bottom:none;
@ -31,8 +23,6 @@ table.arangoDataTable.dataTable td {
}
.arangoDataTable {
padding-left: 5px !important;
padding-right: 5px !important;
width: 100% !important;
position: relative;
table-layout:fixed !important;
@ -43,14 +33,25 @@ table.arangoDataTable.dataTable td {
border-bottom: 1px solid #C2C2C2;
}
.arangoDataTable .odd:hover,
.arangoDataTable .even:hover,
#logContent .odd:hover,
#logContent .even:hover {
table.arangoDataTable tr {
cursor: pointer;
}
table.arangoDataTable.noPointer tr {
cursor: default;
}
.arangoDataTable .key {
margin-top: 4px;
}
/* Odd / Even coloring */
.api-container ul#resources > li.resource:nth-child(even),
table.arangoDataTable tr.even {
background-color: #FFFFFF;
}
.api-container ul#resources > li.resource:nth-child(odd),
table.arangoDataTable tr.odd {
background-color: #F1F0EE;
}

View File

@ -5,7 +5,6 @@
#sourceFooter {
margin-top: 0;
background: none;
margin-bottom: 0;
padding-right: 0;
padding-top: 30px;

View File

@ -148,7 +148,6 @@ table.dataTable thead th {
}
#documentTableID.dataTable thead tr {
/* background-color: #F1F0EE;*/
background-color: #FFFFFF;
}
@ -159,23 +158,6 @@ table.dataTable thead th {
box-shadow: none;
}
#documentTableID .odd,
table.dataTable.arangoDataTable tr.odd {
background:#F1F0EE;
}
#documentTableID .even,
table.dataTable.arangoDataTable tr.even {
background:#FFFFFF;
}
#documentTableID tr.odd td.sorting_1 {
background:#F1F0EE;/* #fdf6df*/
}
#documentTableID tr.even td.sorting_1 {
background:#FFFFFF; /*#fdfaec*/
}
.arangoTab > li > a,
.arangoTab > li:hover > a {
border-radius: 0 !important;

View File

@ -401,14 +401,6 @@
min-width: 100% !important;
}
#collectionEditIndexTable tr:nth-child(even) {
background-color: white !important;
}
#collectionEditIndexTable tr:nth-child(odd) {
background-color: #F1F0EE !important;
}
#collectionEditIndexTable th {
padding-top: 5px;
padding-bottom: 5px;

View File

@ -131,8 +131,8 @@ body {
.form-actions {
margin-top: -10px !important;
background-color: rgba(0,0,0,0.05);
border:none;
background: none;
}
/* ICONS */

View File

@ -25,20 +25,6 @@
word-break: break-all;
}
#logContent .sorting_1 {
background-color: #FBFBFB !important;
}
/*.odd .sorting_1 {
background-color: none !important;
}
.even .sorting_1 {
background-color: #F1F0EE !important;
}*/
#logToolbar {
padding-top: 10px;
padding-bottom: 15px;

View File

@ -1,8 +1,6 @@
pre{
margin: 0 0 0 0;
}
.form-actions {
}
.swagger-ui-wrap .container {
width: auto;
margin: 20px;

View File

@ -377,7 +377,7 @@ var modalDialogHelper = modalDialogHelper || {};
buttonDismiss.className = "close";
buttonDismiss.dataDismiss = "modal";
buttonDismiss.ariaHidden = "true";
buttonDismiss.appendChild(document.createTextNode("x"));
buttonDismiss.appendChild(document.createTextNode("×"));
header.appendChild(document.createTextNode(title));

View File

@ -29,7 +29,8 @@
"application/documentation/:key" : "appDocumentation",
"graph" : "graph",
"graphManagement" : "graphManagement",
"graphManagement/add" : "graphAddNew"
"graphManagement/add" : "graphAddNew",
"graphManagement/delete/:name" : "graphDelete"
},
initialize: function () {
@ -281,6 +282,16 @@
this.naviView.selectMenuItem('graphviewer-menu');
},
graphDelete: function(name) {
if (!this.deleteGraphView) {
this.deleteGraphView = new window.DeleteGraphView({
collection: this.graphs
});
}
this.deleteGraphView.render(name);
this.naviView.selectMenuItem('graphviewer-menu');
},
applications: function() {
if (this.applicationsView === undefined) {
this.applicationsView = new window.ApplicationsView({

View File

@ -13,12 +13,12 @@
<tr>
<th class="collectionTh">Vertices:</th>
<th class="collectionTh"><input type="text" id="newGraphVertices" placeholder="Vertex Collection"></input></th>
<th><a class="modalTooltips" title="The path name of the document collection that should be used as vertices. If this does not exists it will be created."><i class="icon-info-sign"></i></a></th>
<th><a class="modalTooltips" title="The path name of the document collection that should be used as vertices. If this does not exist it will be created."><i class="icon-info-sign"></i></a></th>
</tr>
<tr>
<th class="collectionTh">Edges:</th>
<th class="collectionTh"><input type="text" id="newGraphEdges" placeholder="Edge Collection"></input></th>
<th><a class="modalTooltips" title="The path name of the edge collection that should be used as edges. If this does not exists it will be created."><i class="icon-info-sign"></i></a></th>
<th><a class="modalTooltips" title="The path name of the edge collection that should be used as edges. If this does not exist it will be created."><i class="icon-info-sign"></i></a></th>
</tr>
</table>
</div>

View File

@ -5,7 +5,7 @@
</ul>
<div id="databaseDiv" class="thumbnails">
<table id="databaseTable">
<table id="databaseTable" class="arangoDataTable">
<thead>
<tr>
<td class="dbThFirst">Name</td>

View File

@ -0,0 +1,15 @@
<div id="delete-graph" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<a class="arangoHeader">Delete Graph</a>
</div>
<div class="modal-body">
<span class="deleteConfirm">
Do you really want to to delete graph <%=name%>?
</span>
</div>
<div class="modal-footer">
<button id="cancel" class="btn btn-warning">Cancel</button>
<button id="confirmDelete" class="btn btn-danger pull-right">Delete</button>
</div>
</div>

View File

@ -13,7 +13,7 @@
</li>
</ul>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="documentTableID" width="100%">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable" id="documentTableID" width="100%">
<thead>
<tr>
<th>Attribute</th>

View File

@ -66,7 +66,7 @@
<div class="contentIn" id="indexHeaderContent">
<div id="indexEditView">
<a>Indexes:</a>
<table id="collectionEditIndexTable">
<table id="collectionEditIndexTable" class="arangoDataTable">
<tr class="figuresHeader">
<th class="collectionInfoTh">ID</th>
<th class="collectionInfoTh">Type</th>

View File

@ -74,11 +74,11 @@ gs = _.sortBy(gs, sortF);
<%}); %>
</select>
</div>
</div>
<div class="controls gv_manageButtonContainer">
<button type="submit" class="btn btn-primary" id="manageGraphs">Manage Graphs</button>
</div>
</div>
</div>
</fieldset>

View File

@ -15,7 +15,7 @@
<div class="tab-content">
<div class="tab-pane active" id="all">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="logTableID">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable" id="logTableID">
<thead>
<tr>
<th>Loglevel</th>
@ -27,7 +27,7 @@
</div>
<div class="tab-pane" id="info">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="infoTableID" width="100%">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable" id="infoTableID" width="100%">
<thead>
<tr>
<th>Loglevel</th>
@ -39,7 +39,7 @@
</div>
<div class="tab-pane" id="error">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="critTableID" width="100%">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable" id="critTableID" width="100%">
<thead>
<tr>
<th>Loglevel</th>
@ -51,7 +51,7 @@
</div>
<div class="tab-pane" id="warning">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="warnTableID" width="100%">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable" id="warnTableID" width="100%">
<thead>
<tr>
<th>Loglevel</th>
@ -63,7 +63,7 @@
</div>
<div class="tab-pane" id="debug">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="debugTableID" width="100%">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable" id="debugTableID" width="100%">
<thead>
<tr>
<th>Loglevel</th>

View File

@ -30,14 +30,16 @@
<div id="graphManagementDiv" class="thumbnails">
<div id="graphTable_wrapper" class="dataTables_wrapper" role="grid">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable dataTable" id="graphsTable">
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable dataTable noPointer" id="graphsTable">
<thead>
<tr>
<th>Name</th>
<th>Vertices</th>
<th>Edges</th>
<th>
<a id="addGraphButton" class="pull-right addButton"><span class="arangoicon icon_arangodb_roundplus" title="Add a graph"></span></a>
<a id="addGraphButton" class="pull-right addButton">
<span class="arangoicon icon_arangodb_roundplus" title="Add a graph"></span>
</a>
</th>
</tr>
</thead>

View File

@ -0,0 +1,59 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global Backbone, $, _, window, templateEngine, arangoHelper*/
(function() {
"use strict";
window.DeleteGraphView = Backbone.View.extend({
el: '#modalPlaceholder',
template: templateEngine.createTemplate("deleteGraphView.ejs"),
events: {
"click #cancel": "hide",
"hidden": "hidden",
"click #confirmDelete": "deleteGraph"
},
deleteGraph: function() {
var self = this;
this.collection.get(this.name).destroy({
success: function() {
self.hide();
},
error: function(xhr, err) {
var response = JSON.parse(err.responseText),
msg = response.errorMessage;
arangoHelper.arangoError(msg);
self.hide();
}
});
},
hide: function() {
$('#delete-graph').modal('hide');
},
hidden: function () {
this.undelegateEvents();
window.App.navigate("graphManagement", {trigger: true});
},
render: function(name) {
if (!name) {
window.App.navigate("graphManagement", {trigger: true});
}
this.name = name;
$(this.el).html(this.template.render({
name: name
}));
this.delegateEvents();
$('#delete-graph').modal('show');
return this;
}
});
}());

View File

@ -221,7 +221,6 @@
}
});
this.makeEditable();
$(this.table).dataTable().fnSort([ [0, 'asc'] ]);
},
addLine: function (event) {
@ -265,7 +264,7 @@
initTable: function () {
$(this.table).dataTable({
"aaSorting": [[ 1, "asc" ]],
"bSortClasses": false,
"bAutoWidth": false,
"bFilter": false,
"bPaginate":false,

View File

@ -477,7 +477,7 @@
initTable: function (colid, pageid) {
$('#documentsTableID').dataTable({
"aaSorting": [[ 1, "asc" ]],
"bSortClasses": false,
"bFilter": false,
"bPaginate":false,
"bRetrieve": true,

View File

@ -18,14 +18,8 @@
},
deleteGraph: function(e) {
var key = $(e.target).closest("a").attr("id"),
self = this;
// Ask user for permission
this.collection.get(key).destroy({
success: function() {
self.render();
}
});
var key = $(e.target).closest("a").attr("id");
window.App.navigate("graphManagement/delete/" + key, {trigger: true});
},
render: function() {

View File

@ -114,6 +114,7 @@
"bFilter": false,
"bPaginate": false,
"bSort" : false,
"bSortClasses": false,
"bLengthChange": false,
"bDeferRender": true,
"bProcessing": true,

View File

@ -167,6 +167,7 @@ module.exports = function(karma) {
'frontend/js/views/graphView.js',
'frontend/js/views/graphManagementView.js',
'frontend/js/views/addNewGraphView.js',
'frontend/js/views/deleteGraphView.js',
'frontend/js/views/dbSelectionView.js',
'frontend/js/views/editListEntryView.js',
'frontend/js/views/loginView.js',

View File

@ -243,6 +243,7 @@
"shell",
"graphManagement",
"graphManagement/add",
"graphManagement/delete/:name",
"applications",
"applications/installed",
"applications/available"
@ -373,6 +374,24 @@
);
});
it("should offer the delete graph view", function() {
var name = "testGraph";
simpleNavigationCheck(
{
url: "graphManagement/delete/:name",
params: [name]
},
"DeleteGraphView",
"graphviewer-menu",
{
collection: graphsDummy
},
{
render: name
}
);
});
it("should route to the applications tab", function() {
simpleNavigationCheck(
"applications",

View File

@ -95,15 +95,16 @@
});
it("should be able to delete", function() {
it("should navigate to graph delete view", function() {
spyOn(window.App, "navigate");
var lg = graphs.get("g3");
spyOn(lg, "destroy").andCallFake(function(opt) {
opt.success();
});
spyOn(view, "render");
$("#" + g3._key + " > span").click();
expect(lg.destroy).toHaveBeenCalled();
expect(view.render).toHaveBeenCalled();
expect(window.App.navigate).toHaveBeenCalledWith(
"graphManagement/delete/" + g3._key,
{
trigger: true
}
);
});
});