mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
loading switches for cipher and groupings
This commit is contained in:
parent
4ccd9501a8
commit
7a50c0536c
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
.controller('vaultController', function ($scope, $uibModal, apiService, $filter, cryptoService, authService, toastr,
|
.controller('vaultController', function ($scope, $uibModal, apiService, $filter, cryptoService, authService, toastr,
|
||||||
cipherService, $q, $localStorage, $timeout, $rootScope, $state, $analytics, constants, validationService) {
|
cipherService, $q, $localStorage, $timeout, $rootScope, $state, $analytics, constants, validationService) {
|
||||||
$scope.loading = true;
|
$scope.loadingCiphers = true;
|
||||||
|
$scope.loadingGroupings = true;
|
||||||
$scope.ciphers = [];
|
$scope.ciphers = [];
|
||||||
$scope.folders = [];
|
$scope.folders = [];
|
||||||
$scope.collections = [];
|
$scope.collections = [];
|
||||||
@ -29,7 +30,7 @@
|
|||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
if (($rootScope.vaultFolders || $rootScope.vaultCollections) && $rootScope.vaultCiphers) {
|
if (($rootScope.vaultFolders || $rootScope.vaultCollections) && $rootScope.vaultCiphers) {
|
||||||
$scope.loading = false;
|
$scope.loadingCiphers = $scope.loadingGroupings = false;
|
||||||
loadCipherData($rootScope.vaultCiphers);
|
loadCipherData($rootScope.vaultCiphers);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -62,9 +63,10 @@
|
|||||||
var groupingPromise = $q.all([collectionPromise, folderPromise]).then(function () {
|
var groupingPromise = $q.all([collectionPromise, folderPromise]).then(function () {
|
||||||
$rootScope.vaultCollections = decCollections;
|
$rootScope.vaultCollections = decCollections;
|
||||||
$rootScope.vaultFolders = decFolders;
|
$rootScope.vaultFolders = decFolders;
|
||||||
|
$scope.loadingGroupings = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
var cipherPromise = apiService.ciphers.list({}, function (ciphers) {
|
apiService.ciphers.list({}, function (ciphers) {
|
||||||
var decCiphers = [];
|
var decCiphers = [];
|
||||||
|
|
||||||
for (var i = 0; i < ciphers.Data.length; i++) {
|
for (var i = 0; i < ciphers.Data.length; i++) {
|
||||||
@ -76,14 +78,11 @@
|
|||||||
loadCipherData(decCiphers);
|
loadCipherData(decCiphers);
|
||||||
});
|
});
|
||||||
}).$promise;
|
}).$promise;
|
||||||
|
|
||||||
$q.all([cipherPromise, groupingPromise]).then(function () {
|
|
||||||
$scope.loading = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadCipherData(decCiphers) {
|
function loadCipherData(decCiphers) {
|
||||||
$rootScope.vaultCiphers = $scope.ciphers = $filter('orderBy')(decCiphers, ['sort', 'name', 'subTitle']);
|
$rootScope.vaultCiphers = $scope.ciphers = $filter('orderBy')(decCiphers, ['sort', 'name', 'subTitle']);
|
||||||
|
$scope.loadingCiphers = false;
|
||||||
|
|
||||||
var chunks = chunk($rootScope.vaultCiphers, 400);
|
var chunks = chunk($rootScope.vaultCiphers, 400);
|
||||||
if (chunks.length > 0) {
|
if (chunks.length > 0) {
|
||||||
|
@ -40,10 +40,10 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</section>
|
</section>
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div ng-show="loading">
|
<div ng-show="loadingCiphers">
|
||||||
<p>Loading...</p>
|
<p>Loading...</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="box" ng-show="!loading">
|
<div class="box" ng-show="!loadingCiphers">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">
|
<h3 class="box-title">
|
||||||
<i class="fa {{selectedIcon}}"></i>
|
<i class="fa {{selectedIcon}}"></i>
|
||||||
@ -195,10 +195,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="control-sidebar-heading">Folders</h3>
|
<h3 class="control-sidebar-heading">Folders</h3>
|
||||||
<div ng-show="loading && !vaultFolders.length">
|
<div ng-show="loadingGroupings">
|
||||||
<p>Loading...</p>
|
<p>Loading...</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-sidebar-section" ng-show="!loading && vaultFolders.length">
|
<div class="control-sidebar-section" ng-show="!loadingGroupings">
|
||||||
<ul class="control-sidebar-menu">
|
<ul class="control-sidebar-menu">
|
||||||
<li ng-repeat="folder in vaultFolders | orderBy: [groupingSort] track by folder.id"
|
<li ng-repeat="folder in vaultFolders | orderBy: [groupingSort] track by folder.id"
|
||||||
ng-class="{active: selectedFolder && folder.id === selectedFolder.id}">
|
ng-class="{active: selectedFolder && folder.id === selectedFolder.id}">
|
||||||
@ -210,16 +210,16 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="control-sidebar-heading">Collections</h3>
|
<h3 class="control-sidebar-heading">Collections</h3>
|
||||||
<div ng-show="loading && !vaultCollections.length">
|
<div ng-show="loadingGroupings">
|
||||||
<p>Loading...</p>
|
<p>Loading...</p>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="!loading && !vaultCollections.length">
|
<div ng-show="!loadingGroupings && !vaultCollections.length">
|
||||||
<p>No collections are being shared with you. <i class="fa fa-frown-o"></i></p>
|
<p>No collections are being shared with you. <i class="fa fa-frown-o"></i></p>
|
||||||
<a ui-sref="backend.user.settingsCreateOrg" class="btn btn-default btn-lint">
|
<a ui-sref="backend.user.settingsCreateOrg" class="btn btn-default btn-lint">
|
||||||
Create an Organization
|
Create an Organization
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-sidebar-section" ng-show="!loading && vaultCollections.length">
|
<div class="control-sidebar-section" ng-show="!loadingGroupings && vaultCollections.length">
|
||||||
<ul class="control-sidebar-menu">
|
<ul class="control-sidebar-menu">
|
||||||
<li ng-repeat="collection in vaultCollections | orderBy: [groupingSort] track by collection.id"
|
<li ng-repeat="collection in vaultCollections | orderBy: [groupingSort] track by collection.id"
|
||||||
ng-class="{active: selectedCollection && collection.id === selectedCollection.id}">
|
ng-class="{active: selectedCollection && collection.id === selectedCollection.id}">
|
||||||
|
Loading…
Reference in New Issue
Block a user