-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove tab buttons. * Remove other orange button references. * Refactor, remove style. * Remove style tag. * Remove unused states. * Remove hanging div. * Add conditional for dataset 2. * Move analysis tab to it's own partial. * Move details tab to own partial. * Move files to own partial. * Tab views. * Fix unit test. * Move display into own component. * Set default to files. * Add unit test. * Remove unused code. * Render pivotMatrixView call from within directive. * Unwrap provenance-view-tab watcher. * Add watchers to directive. * Remove console.log. * Correct description. * Update label. * New launch analysis component. * Add disable button conditionals. * Add unit test. * Add save directive. * Move save and reset buttons. * Add unit tests. * Move selected nodes text. * Move file display and config to new layout. * Add view and remove partial. * Add comments. * Adjust popover location. * Move save funtion to node_group partial. * Rename reset to better reflect purpose. * Rename partial. * Move analyses tab into own feature. * Column adjustments. * Parent controller. * Move file to view folder. * Keep only table view. * Fix typo in address. * Change buttons size. * Fix hidden popover. * Add css styling. * Fix padding. * Fix padding * Fix unit test. * Fix reset button. * Remove console. * Fix reset selection count. * Fix scoping issue. * Remove console.log * Fix run analysis ui. * Update color scheme. * Add IGV directory. * Add directive. * Include partial in tab. * Add css. * Disable if no nodes are selected. * Add error handling and code to accomodate data set2. * Fix unit test and adjust css. * Add modal for launching igv * Add modal script. * Add visualization directory. * Add module. * Update partials. * Remove unused code. * Add script to partial and launch modal when igv selected. * Remove inline script. * Restructure modals to launch when visualization is selected. * Remove unused service. * Remove ununeccessary ctrl. * Clean up responsibilities. * Add conditions to launching igv. * Add factory. * Add comments. * Controller unit test. * Add visualization ctrl test. * Add directive unit tests. * Add factory unit test. * Comments. * Fix filter bug. * Fix description. * Remove duplicate id. * Add method comment. * Fix unit test. * Remove unused dependency. * Fix logger error message. * Clafity variable name.
- Loading branch information
Showing
26 changed files
with
721 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,5 @@ angular | |
'ui.grid.infiniteScroll', | ||
'ui.grid.resizeColumns', | ||
'dndLists', | ||
'ui.select', | ||
'ngSanitize' | ||
'ui.select' | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
'use strict'; | ||
|
||
function IGVCtrl ( | ||
$scope, | ||
$window, | ||
$log, | ||
$resource, | ||
$httpParamSerializer, | ||
$uibModalInstance, | ||
selectedNodesService, | ||
IGVFactory | ||
) { | ||
var vm = this; | ||
// includes unused fields to accomodate current igv backend | ||
vm.igvConfig = { | ||
query: null, | ||
annotation: null, | ||
node_selection: [], | ||
node_selection_blacklist_mode: true | ||
}; | ||
vm.speciesList = []; | ||
vm.selectedSpecies = { select: vm.speciesList[0] }; | ||
vm.message = null; | ||
vm.messageType = 'info'; | ||
vm.isLoadingSpecies = true; | ||
|
||
// Helper method to set alert message in modal | ||
var generateAlertMessage = function (infoType) { | ||
vm.messageType = infoType; | ||
if (infoType === 'error') { | ||
vm.message = 'Sorry! Unable to configure IGV for the selected file set.'; | ||
} else if (vm.speciesList.length === 0) { | ||
vm.message = 'Please select the correct genome and launch IGV.'; | ||
} else if (vm.speciesList.length === 1) { | ||
vm.message = null; | ||
vm.selectedSpecies.select = vm.speciesList[0]; | ||
} else { | ||
vm.message = 'Multiple species detected. Please select a ' + | ||
'genome and launch IGV. You may repeat this step multiple times.'; | ||
} | ||
}; | ||
|
||
// Helper method set igvConfig based on selected nodes | ||
var setIGVConfig = function () { | ||
if (selectedNodesService.selectedAllFlag) { | ||
vm.igvConfig.node_selection = selectedNodesService.complementSelectedNodesUuids; | ||
vm.igvConfig.node_selection_blacklist_mode = true; | ||
vm.igvConfig.assay_uuid = $window.externalAssayUuid; | ||
} else { | ||
vm.igvConfig.node_selection = selectedNodesService.selectedNodesUuids; | ||
vm.igvConfig.node_selection_blacklist_mode = false; | ||
vm.igvConfig.assay_uuid = $window.externalAssayUuid; | ||
} | ||
}; | ||
|
||
// Upon launch modal, method retrives species list | ||
vm.retrieveSpecies = function () { | ||
setIGVConfig(); | ||
|
||
IGVFactory.getSpeciesList(vm.igvConfig).then(function () { | ||
vm.isLoadingSpecies = false; | ||
// update species list | ||
vm.speciesList = IGVFactory.speciesList; | ||
generateAlertMessage('info'); | ||
}, function () { | ||
vm.isLoadingSpecies = false; | ||
generateAlertMessage('error'); | ||
$log.error('Error creating IGV session URLs.'); | ||
}); | ||
}; | ||
|
||
// Launches web based IGV and dismissed modal | ||
vm.launchIgvJs = function () { | ||
var params = $httpParamSerializer({ | ||
species: vm.selectedSpecies.select.name, | ||
node_ids: vm.igvConfig.node_selection | ||
}); | ||
// close modal | ||
$uibModalInstance.dismiss(); | ||
$window.open('/visualize/genome?' + params); | ||
}; | ||
|
||
// Modal method to cancel | ||
vm.cancel = function () { | ||
$uibModalInstance.dismiss('cancel'); | ||
}; | ||
|
||
vm.retrieveSpecies(); | ||
} | ||
|
||
angular | ||
.module('refineryIGV') | ||
.controller('IGVCtrl', [ | ||
'$scope', | ||
'$window', | ||
'$log', | ||
'$resource', | ||
'$httpParamSerializer', | ||
'$uibModalInstance', | ||
'selectedNodesService', | ||
'IGVFactory', | ||
IGVCtrl | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
'use strict'; | ||
|
||
describe('Controller: IGV Ctrl', function () { | ||
var ctrl; | ||
var scope; | ||
var factory; | ||
var $controller; | ||
var $uibModalInstance = { open: function () {}, dismiss: function () {} }; | ||
|
||
beforeEach(module('refineryApp')); | ||
beforeEach(module('refineryIGV')); | ||
beforeEach(inject(function ( | ||
$rootScope, | ||
_$controller_, | ||
_IGVFactory_ | ||
) { | ||
scope = $rootScope.$new(); | ||
$controller = _$controller_; | ||
ctrl = $controller('IGVCtrl', { | ||
$scope: scope, | ||
$uibModalInstance: $uibModalInstance | ||
}); | ||
factory = _IGVFactory_; | ||
})); | ||
|
||
it('IGVCtrl ctrl should exist', function () { | ||
expect(ctrl).toBeDefined(); | ||
}); | ||
|
||
it('Data & UI displays variables should exist for views', function () { | ||
expect(ctrl.igvConfig.node_selection).toEqual([]); | ||
expect(ctrl.speciesList).toEqual([]); | ||
expect(ctrl.selectedSpecies.select).toEqual(); | ||
expect(ctrl.message).toEqual(null); | ||
expect(ctrl.messageType).toEqual('info'); | ||
expect(ctrl.isLoadingSpecies).toEqual(true); | ||
}); | ||
|
||
it('Helper Methods exist', function () { | ||
expect(angular.isFunction(ctrl.launchIgvJs)).toBe(true); | ||
expect(angular.isFunction(ctrl.cancel)).toBe(true); | ||
}); | ||
|
||
describe('Test RetrieveSpecies', function () { | ||
it('refreshNodeGroupList is method', function () { | ||
expect(angular.isFunction(ctrl.retrieveSpecies)).toBe(true); | ||
}); | ||
|
||
it('getSpeciesList calls on correct factory method', function () { | ||
var mockResponse = false; | ||
spyOn(factory, 'getSpeciesList').and.callFake(function () { | ||
return { | ||
then: function () { | ||
mockResponse = true; | ||
} | ||
}; | ||
}); | ||
expect(mockResponse).toEqual(false); | ||
ctrl.retrieveSpecies(); | ||
expect(mockResponse).toEqual(true); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
function rpIGVLaunchModalDetail () { | ||
return { | ||
restrict: 'AE', | ||
templateUrl: '/static/partials/igv/partials/modal-detail.html' | ||
}; | ||
} | ||
|
||
angular | ||
.module('refineryIGV') | ||
.directive('rpIGVLaunchModalDetail', [ | ||
rpIGVLaunchModalDetail | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Unit test for visualization spec | ||
'use strict'; | ||
|
||
describe('rpIGVLaunchModalDetail directive unit test', function () { | ||
beforeEach(module('refineryApp')); | ||
beforeEach(module('refineryVisualization')); | ||
|
||
var compile; | ||
var rootScope; | ||
var scope; | ||
var template; | ||
var directiveElement; | ||
|
||
beforeEach(inject(function ( | ||
_$compile_, | ||
_$rootScope_, | ||
$templateCache | ||
) { | ||
$templateCache.put( | ||
'/static/partials/igv/partials/modal-detail.html', | ||
'<div id="modal-header">igv</div>' | ||
); | ||
compile = _$compile_; | ||
rootScope = _$rootScope_; | ||
scope = rootScope.$new(); | ||
template = '<rp-i-g-v-launch-modal-detail></rp-i-g-v-launch-modal-detail>'; | ||
directiveElement = compile(template)(scope); | ||
scope.$digest(); | ||
})); | ||
|
||
it('generates the appropriate HTML', function () { | ||
expect(directiveElement.html()).toContain('modal-header'); | ||
expect(directiveElement.html()).toContain('igv'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'use strict'; | ||
|
||
angular | ||
.module('refineryIGV', ['ui.select']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
describe('RefineryIGV.module: unit tests', function () { | ||
var module; | ||
|
||
beforeEach(function () { | ||
module = angular.module('refineryIGV'); | ||
}); | ||
|
||
describe('Module', function () { | ||
it('should be registered', function () { | ||
expect(!!module).toEqual(true); | ||
}); | ||
}); | ||
|
||
describe('Dependencies:', function () { | ||
var deps; | ||
var hasModule = function (m) { | ||
return deps.indexOf(m) >= 0; | ||
}; | ||
|
||
beforeEach(function () { | ||
deps = module.value('refineryIGV').requires; | ||
}); | ||
|
||
it('should have "ui-select" as a dependency', function () { | ||
expect(hasModule('ui.select')).toEqual(true); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.