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

Commit

Permalink
feat(app): 1755 title case for data category
Browse files Browse the repository at this point in the history
 - add constant for data categories
 - turn table models into services

Closes #1755
  • Loading branch information
alex-wilmer committed Apr 26, 2016
1 parent 45ffbbf commit 58ca6f7
Show file tree
Hide file tree
Showing 12 changed files with 531 additions and 569 deletions.
2 changes: 1 addition & 1 deletion app/scripts/components/facets/facets.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ module ngApp.components.facets.controllers {
_this.setSelectedIndex(Cycle.Down);
break;
case KeyCode.Esc:
_this.$uibModalStack.dismissAll();
if (_this.$uibModalStack) _this.$uibModalStack.dismissAll();
break;
case KeyCode.Tab:
e.preventDefault();
Expand Down
6 changes: 4 additions & 2 deletions app/scripts/components/facets/facets.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module ngApp.components.facets.services {
/* @ngInject */
constructor(private Restangular: restangular.IService,
private SearchTableFilesModel: TableiciousConfig,
private SearchTableParticipantsModel: TableiciousConfig,
private SearchCasesTableService: TableiciousConfig,
private FacetsConfigService: IFacetsConfigService) {
this.ds = Restangular.all("gql/_mapping");
}
Expand All @@ -234,7 +234,9 @@ module ngApp.components.facets.services {
datum.field !== 'archive.revision' &&
!_.includes(datum.field, "_id") &&
!_.includes(current, datum.field) &&
!_.includes(docType === 'files' ? _.pluck(this.SearchTableFilesModel.facets, "name") : _.pluck(this.SearchTableParticipantsModel.facets, "name"), datum.field);
!_.includes(docType === 'files'
? _.pluck(this.SearchTableFilesModel.facets, "name")
: _.pluck(this.SearchCasesTableService.model().facets, "name"), datum.field);
}), f => f);
});
}
Expand Down
10 changes: 9 additions & 1 deletion app/scripts/core/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@ angular
"core.directives",
"core.services",
"core.filters"
]);
])
.constant('DATA_CATEGORIES', {
SEQ: { full: "Raw Sequencing Data", abbr: "Seq" },
EXP: { full: "Gene Expression", abbr: "Exp" },
SNV: { full: "Simple Nucleotide Variation", abbr: "SNV" },
CNV: { full: "Copy Number Variation", abbr: "CNV" },
CLINICAL: { full: "Clinical", abbr: "Clinical" },
BIOSPECIMEN: { full: "Biospecimen", abbr: "Biospecimen" },
});
4 changes: 2 additions & 2 deletions app/scripts/home/home.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module ngApp.home.controllers {
defaultParams: any;

/* @ngInject */
constructor(private HomeService: IHomeService, private ProjectTableModel: TableiciousConfig,
constructor(private HomeService: IHomeService, private ProjectsTableService: TableiciousConfig,
private CoreService: ICoreService, private $filter: ng.ui.IFilterService) {

CoreService.setPageTitle("Welcome to The Genomics Data Commons Data Portal");
Expand Down Expand Up @@ -90,7 +90,7 @@ module ngApp.home.controllers {
];

this.defaultParams = {
fields: this.ProjectTableModel.fields,
fields: this.ProjectsTableService.model().fields,
facets: [
"disease_type",
"program.name",
Expand Down
11 changes: 6 additions & 5 deletions app/scripts/projects/projects.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module ngApp.projects.controllers {

/* @ngInject */
constructor(private $scope: IProjectScope, private ProjectsService: IProjectsService,
private CoreService: ICoreService, private ProjectTableModel: TableiciousConfig,
private CoreService: ICoreService, private ProjectsTableService: TableiciousConfig,
private $state: ng.ui.IStateService, public ProjectsState: IProjectsState,
private LocationService: ILocationService, private $filter, private ProjectsGithutConfig, private ProjectsGithutColumns, private ProjectsGithut,
private FacetService: IFacetService
Expand All @@ -52,17 +52,18 @@ module ngApp.projects.controllers {

var data = $state.current.data || {};
this.ProjectsState.setActive("tabs", data.tab);
$scope.tableConfig = ProjectTableModel;
$scope.tableConfig = this.ProjectsTableService.model();

this.refresh();
}

refresh() {
this.loading = true;
var projectsTableModel = this.ProjectsTableService.model();
if (!this.tabSwitch) {
this.ProjectsService.getProjects({
fields: this.ProjectTableModel.fields,
facets: this.FacetService.filterFacets(this.ProjectTableModel.facets),
fields: projectsTableModel.fields,
facets: this.FacetService.filterFacets(projectsTableModel.facets),
size: 100
}).then((data) => {
this.loading = false;
Expand Down Expand Up @@ -280,7 +281,7 @@ module ngApp.projects.controllers {
.module("projects.controller", [
"projects.services",
"core.services",
"projects.table.model",
"projects.table.service",
"projects.githut.config",
"annotations.services"
])
Expand Down
276 changes: 0 additions & 276 deletions app/scripts/projects/projects.table.model.ts

This file was deleted.

Loading

0 comments on commit 58ca6f7

Please sign in to comment.