Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
chore(user): Files in cart aren't filtered.
Browse files Browse the repository at this point in the history
- Files displayed in cart aren't filtered by logged in user.
- When user logged in, column is always visible.

Closes #213
  • Loading branch information
Matthew Schranz committed Jan 15, 2015
1 parent e8579df commit cdaa865
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions app/scripts/cart/cart.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module ngApp.cart.services {
import IFile = ngApp.files.models.IFile;
import IFilesService = ngApp.files.services.IFilesService;
import IGDCWindowService = ngApp.models.IGDCWindowService;
import IUserService = ngApp.components.user.services.IUserService;
import INotifyService = ng.cgNotify.INotifyService;

export interface ICartService {
Expand Down Expand Up @@ -38,7 +37,6 @@ module ngApp.cart.services {

/* @ngInject */
constructor(private $window: IGDCWindowService,
private UserService: IUserService,
private notify: INotifyService) {
var local_files = $window.localStorage.getItem(CartService.GDC_CART_KEY);
var local_time = $window.localStorage.getItem(CartService.GDC_CART_UPDATE);
Expand All @@ -48,10 +46,7 @@ module ngApp.cart.services {
}

getFiles(): IFile[] {
var filtered: boolean = this.UserService.currentUser && this.UserService.currentUser.isFiltered;
return filtered ? _.filter(this.files, (file: IFile) : boolean => {
return this.UserService.currentUser.projects.indexOf(file.archive.disease_code) !== -1;
}) : this.files;
return this.files;
}

getSelectedFiles(): IFile[] {
Expand Down Expand Up @@ -189,7 +184,6 @@ module ngApp.cart.services {
angular
.module("cart.services", [
"ngApp.files",
"user.services",
"cgNotify"
])
.service("CartService", CartService);
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/cart/templates/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h3 class="panel-title pull-left" data-translate>Cart Items</h3>
</button>
</th>
<th scope="col" class="text-center"
data-ng-if="cc.UserService.currentUser && !cc.UserService.currentUser.isFiltered"
data-ng-if="cc.UserService.currentUser"
data-translate>
My Projects
</th>
Expand Down Expand Up @@ -187,7 +187,7 @@ <h3 class="panel-title pull-left" data-translate>Cart Items</h3>
</div>
</td>
<td scope="col" class="text-center"
data-ng-if="cc.UserService.currentUser && !cc.UserService.currentUser.isFiltered">
data-ng-if="cc.UserService.currentUser">
<i data-ng-if="cc.isUserProject(file)" class="fa fa-check fa-lg"></i>
<i data-ng-if="!cc.isUserProject(file)" class="fa fa-close fa-lg"></i>
</td>
Expand Down

0 comments on commit cdaa865

Please sign in to comment.