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

Commit

Permalink
fix(projects): Fixes searching my project codes.
Browse files Browse the repository at this point in the history
Closes #567
Matthew Schranz committed Mar 16, 2015
1 parent 30134e5 commit ea78b35
Showing 3 changed files with 17 additions and 12 deletions.
8 changes: 3 additions & 5 deletions app/scripts/components/facets/facets.controllers.ts
Original file line number Diff line number Diff line change
@@ -173,11 +173,9 @@ module ngApp.components.facets.controllers {
if (this.actives.indexOf(this.searchTerm) === -1) {
var term = this.searchTerm;

if (typeof term === "object") {
var parts = this.$scope.field.split(".");
var field = parts.length > 1 ? parts[parts.length - 1] : parts[0];
term = term[field].toLowerCase();
}
var parts = this.$scope.field.split(".");
var field = parts.length > 1 ? parts[parts.length - 1] : parts[0];
term = term[field];

this.FacetService.addTerm(this.$scope.field, term);
this.actives.push(this.searchTerm);
19 changes: 13 additions & 6 deletions app/scripts/components/user/user.services.ts
Original file line number Diff line number Diff line change
@@ -113,12 +113,19 @@ module ngApp.components.user.services {
}

userCanDownloadFiles(files) {
return files.every((file) => {
if (file.access === 'open') return true;
if (file.access !== 'open' && !this.currentUser) return false;
if (this.isUserProject(file)) return true;
})
return files.every((file)=>{
if (file.access === "open") {
return true;
}

if (file.access !== "open" && !this.currentUser) {
return false;
}

if (this.isUserProject(file)) {
return true;
}
});
}

addMyProjectsFilter(filters: any, key: string): any {
@@ -147,7 +154,7 @@ module ngApp.components.user.services {
if (!projectFilter) {
filters.content.push(userProjects);
} else {
var projects = _.assign([], this.currentUser.projects.gdc_ids);
var projects = this.currentUser.projects.gdc_ids;

var sharedValues = _.intersection(projectFilter.content.value, projects);

2 changes: 1 addition & 1 deletion app/scripts/participant/participants.controllers.ts
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ module ngApp.participants.controllers {
return file.data_subtype.toLowerCase() === "clinical data";
});

if(clinicalFile) {
if (clinicalFile) {
this.clinicalFileId = clinicalFile.file_id;
}

0 comments on commit ea78b35

Please sign in to comment.