Commit 286afa15 authored by Sascha's avatar Sascha

Merge branch 'develop' into 'master'

Preparing v1.8.1

Closes #79, #76, and #75

See merge request !98
parents 92e506d2 7d45fa43
......@@ -19,9 +19,9 @@
* Main Controller for the shareusers widget
*/
angular.module('psonocli').controller('ShareusersCtrl', ["$scope", "$interval", "managerSecret", "managerDatastoreUser",
"$uibModal", "shareBlueprint", "managerWidget", "$timeout", "dropDownMenuWatcher", 'cryptoLibrary',
"$uibModal", "shareBlueprint", "managerWidget", "$timeout", "dropDownMenuWatcher", 'cryptoLibrary', 'managerDatastorePassword',
function ($scope, $interval, managerSecret, managerDatastoreUser, $uibModal, shareBlueprint,
managerWidget, $timeout, dropDownMenuWatcher, cryptoLibrary) {
managerWidget, $timeout, dropDownMenuWatcher, cryptoLibrary, managerDatastorePassword) {
$scope.contextMenuOnShow = contextMenuOnShow;
$scope.contextMenuOnClose = contextMenuOnClose;
......@@ -154,6 +154,21 @@
});
}
/**
* all about the datastore search:
*/
$scope.$watch('tosearchTreeFilter', function(newValue) {
managerDatastorePassword.modifyTreeForSearch(newValue, $scope.structure.data);
});
/**
* clears the input field for the tree search
*/
$scope.clearSearchTreeForm = function () {
$scope.tosearchTreeFilter = '';
};
function contextMenuOnShow(div_id) {
dropDownMenuWatcher.on_open(div_id);
}
......@@ -192,6 +207,12 @@
},
path: function () {
return path;
},
hide_advanced: function () {
return true
},
hide_history: function () {
return true
}
}
});
......@@ -235,9 +256,29 @@
user_object.data[content.fields[i].name] = content.fields[i].value;
}
parent.items.push(user_object);
// check if we do not already have the user in our trusted user datastore
// skip if we already have it
var existing_locations = managerDatastorePassword.search_in_datastore(user_object, $scope.structure.data, function(a, b) {
if (!a.hasOwnProperty('data')) {
return false
}
if (!b.hasOwnProperty('data')) {
return false
}
if (!a['data'].hasOwnProperty('user_public_key')) {
return false
}
if (!b['data'].hasOwnProperty('user_public_key')) {
return false
}
return a['data']['user_public_key'] === b['data']['user_public_key']
});
if (existing_locations.length < 1) {
parent.items.push(user_object);
managerDatastoreUser.save_datastore_content($scope.structure.data);
}
managerDatastoreUser.save_datastore_content($scope.structure.data);
}, function () {
// cancel triggered
......@@ -271,7 +312,6 @@
* @param size
*/
function open_edit_item(node, path, size) {
var modalInstance = $uibModal.open({
templateUrl: 'view/modal-edit-entry.html',
controller: 'ModalShareEditEntryCtrl',
......@@ -285,6 +325,12 @@
},
data: function () {
return node.data;
},
hide_advanced: function () {
return true
},
hide_history: function () {
return true
}
}
});
......
......@@ -81,7 +81,6 @@
}
}
if (field.hasOwnProperty("validationType")) {
console.log(field);
if (field['validationType'].toLowerCase() === 'url' && field['value'] && !helper.is_valid_url(field['value'])) {
$scope.errors.push('Invalid URL in ' + field['title']);
}
......
......@@ -107,6 +107,12 @@
},
path: function () {
return [];
},
hide_advanced: function () {
return true
},
hide_history: function () {
return true
}
}
});
......
......@@ -11,8 +11,8 @@
* @description
* Controller for the "Edit Entry" modal
*/
angular.module('psonocli').controller('ModalShareEditEntryCtrl', ['$scope', '$uibModalInstance', 'shareBlueprint', 'node', 'path', 'data',
function ($scope, $uibModalInstance, shareBlueprint, node, path, data) {
angular.module('psonocli').controller('ModalShareEditEntryCtrl', ['$scope', '$uibModalInstance', 'shareBlueprint', 'node', 'path', 'data', 'hide_advanced', 'hide_history',
function ($scope, $uibModalInstance, shareBlueprint, node, path, data, hide_advanced, hide_history) {
$scope.reset = reset;
$scope.save = save;
......@@ -21,12 +21,13 @@
$scope.node = node;
$scope.path = path;
$scope.name = node.name;
$scope.hide_advanced = hide_advanced;
$scope.hide_history = hide_history;
$scope.content = '';
$scope.isCollapsed = true;
$scope.errors = [];
activate();
function activate() {
$scope.bp = {
all: shareBlueprint.get_blueprints(),
......
......@@ -139,6 +139,12 @@
},
path: function () {
return [];
},
hide_advanced: function () {
return true
},
hide_history: function () {
return true
}
}
});
......
......@@ -15,9 +15,9 @@
* Controller for the "New Entry" modal
*/
angular.module('psonocli').controller('ModalShareNewEntryCtrl', ['$scope', '$uibModalInstance', 'managerHost',
'shareBlueprint', 'browserClient', 'helper', 'parent', 'path',
'shareBlueprint', 'browserClient', 'helper', 'parent', 'path', 'hide_advanced', 'hide_history',
function ($scope, $uibModalInstance, managerHost,
shareBlueprint, browserClient, helper, parent, path) {
shareBlueprint, browserClient, helper, parent, path, hide_advanced, hide_history) {
$scope.reset = reset;
$scope.save = save;
......@@ -28,6 +28,8 @@
$scope.name = '';
$scope.content = '';
$scope.isCollapsed = true;
$scope.hide_advanced = hide_advanced;
$scope.hide_history = hide_history;
$scope.errors = [];
$scope.bp = {
all: shareBlueprint.get_blueprints(),
......
......@@ -1486,6 +1486,12 @@
}
if (searchTree.items[i].name.toLowerCase().indexOf(searchStrings[ii]) > -1) {
containCounter++
} else if(searchTree.items[i].hasOwnProperty('id') && searchTree.items[i]['id'] === searchStrings[ii]) {
containCounter++
} else if(searchTree.items[i].hasOwnProperty('secret_id') && searchTree.items[i]['secret_id'] === searchStrings[ii]) {
containCounter++
} else if(searchTree.items[i].hasOwnProperty('share_id') && searchTree.items[i]['share_id'] === searchStrings[ii]) {
containCounter++
}
}
if (containCounter === searchStrings.length) {
......@@ -1502,6 +1508,10 @@
for (ii = searchStrings.length - 1; ii >= 0; ii--) {
if (searchTree.name.toLowerCase().indexOf(searchStrings[ii]) > -1) {
containCounter++
} else if(searchTree.hasOwnProperty('id') && searchTree['id'] === searchStrings[ii]) {
containCounter++
} else if(searchTree.hasOwnProperty('share_id') && searchTree['share_id'] === searchStrings[ii]) {
containCounter++
}
}
if (containCounter === searchStrings.length) {
......
{
"ENTRY_LINK": "Link zum Eintrag",
"FOLDER_LINK": "Link zum Ordner",
"CALLBACK_PASS": "Callback Passwort",
"CALLBACK_USER": "Callback Benutzer",
"CALLBACK_URL": "Callback URL",
......
{
"ENTRY_LINK": "Link to the entry",
"FOLDER_LINK": "Link to the folder",
"CALLBACK_PASS": "Callback Password",
"CALLBACK_USER": "Callback User",
"CALLBACK_URL": "Callback URL",
......
......@@ -251,8 +251,8 @@
<!-- Advanced -->
<div class="text-right">
<a href="" ng-click="isCollapsed = !isCollapsed">{{'ADVANCED' | translate}}</a>
<a href="" ng-click="show_history(node)" ng-if="!offline">{{'SHOW_HISTORY' | translate}}</a>
<a href="" ng-click="isCollapsed = !isCollapsed" ng-show="!hide_advanced">{{'ADVANCED' | translate}}</a>
<a href="" ng-click="show_history(node)" ng-if="!offline" ng-show="!hide_history">{{'SHOW_HISTORY' | translate}}</a>
</div>
......@@ -316,6 +316,9 @@
</span>
</div>
</div>
<div class="form-group">
{{'ENTRY_LINK' | translate}}: <a href="{{ 'index.html#!/datastore/search/' + node.id }}">{{ node.id }}</a>
</div>
</div>
......
<div class="container-fluid">
<div class="navi row">
<div class="location col-sm-8">
<!--
<span> <a href="#!/share/users">/share/users</a> </span>
-->
</div>
<div class="title col-sm-4">
<h1>{{'LIST_OF_TRUSTED_USERS' | translate}}</h1>
</div>
</div>
<div ng-controller="ShareusersCtrl" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{'TRUSTED_USERS' | translate}}</h3>
</div>
<div class="panel-body">
<div data-target="menu-shareusers-main" context-menu="contextMenuOnShow('menu-shareusers-main')" context-menu-close="contextMenuOnClose('menu-shareusers-main')" class="expand15">
<div class="dropdown position-fixed dropdown-rightclick" id="menu-shareusers-main">
<ul class="dropdown-menu" role="menu">
<li role="menuitem" ng-click="openNewFolder($event)"><a href="#!/share/users"><i class="fa fa-folder"></i>{{'NEW_FOLDER' | translate}}</a></li>
<li role="menuitem" ng-click="openNewItem($event)"><a href="#!/share/users"><i class="fa fa-user-plus"></i>{{'NEW_USER' | translate}}</a></li>
</ul>
</div>
<!--
<div>
<span ng-repeat="b in breadcrumbs track by $index">
&gt; {{b}}
</span>
</div>
-->
<div tree-view="structure" tree-view-options="options" ng-if="structure.loaded && (structure.data.folders || structure.data.items)">
</div>
<div ng-if="structure.loaded && !(structure.data.folders || structure.data.items)">
<div class="big-font-icon-and-msg">
<i class="fa fa-plus-circle" aria-hidden="true"></i>
<div>{{'YOUR_TRUSTED_USER_LIST_IS_EMPTY' | translate}}</div>
</div>
</div>
<div ng-if="!structure.loaded">
<div class="big-font-icon-and-msg">
<i style="
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
text-rendering: auto;
font-size: 3em;
text-align: center;
animation: fa-spin 2s infinite linear;
vertical-align: middle;">&#xf110;</i>
{{'LOADING' | translate}}
</div>
</div>
<!--
<pre>{{ node | json }}</pre>
<pre>{{ structure.data | json }}</pre>
-->
</div>
</div>
</div>
<div class="container-fluid">
<div class="navi row">
<div class="location col-sm-8">
<!--
<span> <a href="#!/share/users">/share/users</a> </span>
-->
</div>
<div class="title col-sm-4">
<h1>{{'LIST_OF_TRUSTED_USERS' | translate}}</h1>
</div>
</div>
<div ng-controller="ShareusersCtrl" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{'TRUSTED_USERS' | translate}}</h3>
</div>
<div class="panel-body">
<form name="searchTreeForm" class="widget-searchform">
<div class="row">
<div class="expandable" ng-class="{'col-xs-offset-4 col-xs-8 col-sm-offset-6 col-sm-6 col-md-offset-8 col-md-4': !focused, 'col-xs-12 col-sm-12 col-md-offset-6 col-md-6 focused': focused}">
<div class="input-group">
<input type="text" class="form-control" id="tosearchTreeForm" placeholder="{{'SEARCH' | translate}}"
ng-focus="focused = true" ng-blur="focused = false"
ng-model="tosearchTreeFilter">
<span class="input-group-btn">
<button class="btn btn-default" ng-disabled="!tosearchTreeFilter"
ng-click="clearSearchTreeForm()" type="button"><i class="fa fa-ban"></i></button>
<div class="btn-group" uib-dropdown is-open="status.isopen" ng-if="!offline">
<button id="dropdownMenuRightTop" type="button" class="btn btn-primary" uib-dropdown-toggle>
<i class="fa fa-cogs"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu role="menu" aria-labelledby="dropdownMenuRightTop">
<li role="menuitem" ng-click="openNewFolder($event)"><a href=""><i class="fa fa-folder"></i>{{'NEW_FOLDER' | translate}}</a></li>
<li role="menuitem" ng-click="openNewItem($event)"><a href=""><i class="fa fa-plus"></i>{{'NEW_USER' | translate}}</a></li>
</ul>
</div>
</span>
</div>
</div>
</div>
</form>
<div data-target="menu-shareusers-main" context-menu="contextMenuOnShow('menu-shareusers-main')" context-menu-close="contextMenuOnClose('menu-shareusers-main')" class="expand15">
<div class="dropdown position-fixed dropdown-rightclick" id="menu-shareusers-main">
<ul class="dropdown-menu" role="menu">
<li role="menuitem" ng-click="openNewFolder($event)"><a href="#!/share/users"><i class="fa fa-folder"></i>{{'NEW_FOLDER' | translate}}</a></li>
<li role="menuitem" ng-click="openNewItem($event)"><a href="#!/share/users"><i class="fa fa-user-plus"></i>{{'NEW_USER' | translate}}</a></li>
</ul>
</div>
<!--
<div>
<span ng-repeat="b in breadcrumbs track by $index">
&gt; {{b}}
</span>
</div>
-->
<div tree-view="structure" tree-view-options="options" ng-if="structure.loaded && (structure.data.folders || structure.data.items)">
</div>
<div ng-if="structure.loaded && !(structure.data.folders || structure.data.items)">
<div class="big-font-icon-and-msg">
<i class="fa fa-plus-circle" aria-hidden="true"></i>
<div>{{'YOUR_TRUSTED_USER_LIST_IS_EMPTY' | translate}}</div>
</div>
</div>
<div ng-if="!structure.loaded">
<div class="big-font-icon-and-msg">
<i style="
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
text-rendering: auto;
font-size: 3em;
text-align: center;
animation: fa-spin 2s infinite linear;
vertical-align: middle;">&#xf110;</i>
{{'LOADING' | translate}}
</div>
</div>
<!--
<pre>{{ node | json }}</pre>
<pre>{{ structure.data | json }}</pre>
-->
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -143,8 +143,8 @@
<!-- Advanced -->
<div class="text-right">
<a href="" ng-click="isCollapsed = !isCollapsed">{{'ADVANCED' | translate}}</a>
<a href="" ng-click="show_history(node)" ng-if="!offline">{{'SHOW_HISTORY' | translate}}</a>
<a href="" ng-click="isCollapsed = !isCollapsed" ng-show="!hide_advanced">{{'ADVANCED' | translate}}</a>
<a href="" ng-click="show_history(node)" ng-if="!offline" ng-show="!hide_history">{{'SHOW_HISTORY' | translate}}</a>
</div>
......@@ -199,9 +199,17 @@
ng-model="data.callback_user">
</div>
<div class="form-group">
<input type="password" name="callback_pass" class="form-control"
id="editEntryForm-callback_pass" placeholder="{{ 'CALLBACK_PASS' | translate}}"
ng-model="data.callback_pass">
<div class="input-group">
<input type="password" class="form-control" id="callback_pass" placeholder="{{ 'CALLBACK_PASS' | translate}}" ng-model="data.callback_pass">
<span class="input-group-btn">
<button class="btn btn-default" type="button" ng-click="toggle_input_type('callback_pass')">
<i class="fa fa-eye-slash"></i>
</button>
</span>
</div>
</div>
<div class="form-group">
{{'ENTRY_LINK' | translate}}: <a href="{{ 'index.html#!/datastore/search/' + node.id }}">{{ node.id }}</a>
</div>
<!--
<div class="form-group">
......
<form name="editFolderForm" novalidate>
<div class="modal-header">
<button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">{{'EDIT_FOLDER' | translate}}</h3>
</div>
<div class="modal-body">
<div class="form-group" ng-class="{true: 'has-error'}[submitted && newFolderForm.name.$invalid]">
<input type="text" name="name" class="form-control" id="folderName" placeholder="{{'FOLDER_NAME' | translate}}" ng-model="name" required>
<p class="help-block" ng-show="submitted && newFolderForm.name.$error.required">{{'FOLDER_NAME_IS_REQUIRED' | translate}}</p>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="submit" ng-click="save()">{{'SAVE' | translate}}</button>
<button class="btn" type="button" ng-click="cancel();">{{'CLOSE' | translate}}</button>
</div>
</form>
\ No newline at end of file
<form name="editFolderForm" novalidate>
<div class="modal-header">
<button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">{{'EDIT_FOLDER' | translate}}</h3>
</div>
<div class="modal-body">
<div class="form-group" ng-class="{true: 'has-error'}[submitted && newFolderForm.name.$invalid]">
<input type="text" name="name" class="form-control" id="folderName" placeholder="{{'FOLDER_NAME' | translate}}" ng-model="name" required>
<p class="help-block" ng-show="submitted && newFolderForm.name.$error.required">{{'FOLDER_NAME_IS_REQUIRED' | translate}}</p>
</div>
<div class="form-group">
{{'FOLDER_LINK' | translate}}: <a href="{{ 'index.html#!/datastore/search/' + node.id }}">{{ node.id }}</a>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="submit" ng-click="save()">{{'SAVE' | translate}}</button>
<button class="btn" type="button" ng-click="cancel();">{{'CLOSE' | translate}}</button>
</div>
</form>
......@@ -168,7 +168,7 @@
</div>
<!-- Advanced -->
<div class="text-right">
<div class="text-right" ng-show="!hide_advanced">
<a href="" ng-click="isCollapsed = !isCollapsed">{{'ADVANCED' | translate}}</a>
</div>
......
......@@ -142,7 +142,7 @@
</div>
<!-- Advanced -->
<div class="text-right">
<div class="text-right" ng-show="!hide_advanced">
<a href="" ng-click="isCollapsed = !isCollapsed">{{'ADVANCED' | translate}}</a>
</div>
......
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