1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-22 16:29:09 +01:00

collapse no folder over 100. remove addtl' sorting

This commit is contained in:
Kyle Spearrin 2018-03-16 12:13:37 -04:00
parent 46e3628fd4
commit c7e819b24b
6 changed files with 19 additions and 21 deletions

View File

@ -12,7 +12,7 @@
<div class="list">
<div class="list-grouped">
<a href="" ng-click="$ctrl.editFolder(folder)" class="list-grouped-item" title="{{::$ctrl.i18n.edit}}"
ng-repeat="folder in theFolders = ($ctrl.folders | orderBy: ['name']) track by $index">
ng-repeat="folder in $ctrl.folders track by $index">
<span class="text">{{folder.name}}</span>
</a>
</div>

View File

@ -16,9 +16,9 @@ export class FoldersController {
load() {
this.folderService.getAllDecrypted().then((folders: any) => {
if (folders.length > 0 && folders[0].id === null) {
if (folders.length > 0 && folders[folders.length - 1].id === null) {
// remove the "none" folder
this.folders = folders.slice(1);
this.folders = folders.slice(0, folders.length - 1);
} else {
this.folders = folders;
}

View File

@ -34,6 +34,9 @@ angular
if (!$rootScope.vaultCollections || !$rootScope.vaultCollections.length) {
$scope.noFolderCiphers = $filter('filter')($rootScope.vaultCiphers, { folderId: null });
if ($scope.noFolderCiphers.length >= 100) {
$scope.noFolderCiphers = null;
}
}
}
@ -83,9 +86,13 @@ angular
if (!$rootScope.vaultCollections || !$rootScope.vaultCollections.length) {
$scope.noFolderCiphers = $filter('filter')($rootScope.vaultCiphers, { folderId: null });
if ($scope.noFolderCiphers.length >= 100) {
$scope.noFolderCiphers = null;
}
if ($rootScope.vaultFolders && $rootScope.vaultFolders.length && !$rootScope.vaultFolders[0].id) {
$rootScope.vaultFolders = $rootScope.vaultFolders.slice(1);
if ($scope.noFolderCiphers && $rootScope.vaultFolders && $rootScope.vaultFolders.length &&
!$rootScope.vaultFolders[$rootScope.vaultFolders.length - 1].id) {
$rootScope.vaultFolders = $rootScope.vaultFolders.slice(0, $rootScope.vaultFolders.length - 1);
}
}
@ -134,14 +141,6 @@ angular
$scope.searchText = state.searchText || $stateParams.searchText;
}
$scope.folderSort = function (item) {
if (!item.id) {
return '';
}
return item.name.toLowerCase();
};
$scope.searchCiphers = function () {
if (!$scope.searchText || $scope.searchText.length < 2) {
return;

View File

@ -20,7 +20,7 @@
<div class="list-section-items">
<a href="#" stop-click ng-click="viewCipher(cipher)" class="list-section-item condensed"
title="{{::i18n.view}}"
ng-repeat="cipher in favoriteCiphers | orderBy: ['name', 'subTitle'] track by $index">
ng-repeat="cipher in favoriteCiphers track by $index">
<action-buttons cipher="cipher"></action-buttons>
<icon cipher="cipher"></icon>
<span class="text">
@ -39,7 +39,7 @@
</div>
<div class="list-section-items">
<a href="#" stop-click ng-click="viewGrouping(folder, true)" class="list-section-item"
ng-repeat="folder in vaultFolders | orderBy: folderSort track by $index">
ng-repeat="folder in vaultFolders track by $index">
<div class="pull-right">
<i class="fa fa-chevron-right fa-lg"></i>
<span class="item-sub-label" ng-if="showGroupingCounts">{{folder.itemCount}}</span>
@ -61,7 +61,7 @@
</div>
<div class="list-section-items">
<a href="#" stop-click ng-click="viewGrouping(collection, false)" class="list-section-item"
ng-repeat="collection in vaultCollections | orderBy: ['name'] track by $index">
ng-repeat="collection in vaultCollections track by $index">
<div class="pull-right">
<i class="fa fa-chevron-right fa-lg"></i>
<span class="item-sub-label" ng-if="showGroupingCounts">{{collection.itemCount}}</span>
@ -83,7 +83,7 @@
<div class="list-section-items">
<a href="#" stop-click ng-click="viewCipher(cipher)" class="list-section-item condensed"
title="{{::i18n.view}}"
ng-repeat="cipher in noFolderCiphers | orderBy: ['name', 'subTitle'] track by $index">
ng-repeat="cipher in noFolderCiphers track by $index">
<action-buttons cipher="cipher"></action-buttons>
<icon cipher="cipher"></icon>
<span class="text">
@ -103,8 +103,7 @@
<div class="list-section" style="padding-top: 0; padding-bottom: 0;">
<a href="#" stop-click ng-click="viewCipher(cipher)"
class="list-section-item condensed" title="{{::i18n.view}}"
ng-repeat="cipher in searchResults = (vaultCiphers | filter: searchCiphers() | orderBy: ['name', 'subTitle'])
track by $index">
ng-repeat="cipher in searchResults = (vaultCiphers | filter: searchCiphers() track by $index">
<action-buttons cipher="cipher"></action-buttons>
<icon cipher="cipher"></icon>
<span class="text">

View File

@ -242,7 +242,7 @@
<div class="list-section-item">
<label for="folder" class="item-label">{{i18n.folder}}</label>
<select id="folder" name="FolderId" ng-model="cipher.folderId">
<option ng-repeat="folder in folders | orderBy: ['name'] track by $index" value="{{folder.id}}">
<option ng-repeat="folder in folders track by $index" value="{{folder.id}}">
{{folder.name}}
</option>
</select>

View File

@ -235,7 +235,7 @@
<div class="list-section-item">
<label for="folder" class="item-label">{{i18n.folder}}</label>
<select id="folder" name="FolderId" ng-model="cipher.folderId">
<option ng-repeat="folder in folders | orderBy: ['name'] track by $index" value="{{folder.id}}">
<option ng-repeat="folder in folders track by $index" value="{{folder.id}}">
{{folder.name}}
</option>
</select>