Skip to content

Commit

Permalink
Merge branch 'develop' into feature/dccprtl-99-debowerize
Browse files Browse the repository at this point in the history
  • Loading branch information
SidSyrus committed Jan 9, 2017
2 parents 284b8be + 5f25c7a commit 525cab9
Show file tree
Hide file tree
Showing 19 changed files with 184 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ <h3 data-ng-if="!AdvancedCtrl.Gene.genes" class="loading loading-icon">
</li>

<li data-location-facet data-type="gene" data-facet-name="location" data-label="{{'Location' | translate}}"
data-placeholder="{{'Enter gene location' | translate}}" data-example="{{'e.g. chr12:43566-3457633' | translate}}"></li>
data-placeholder="{{'e.g. chr12:43566-3457633' | translate}}"></li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
data-facet="AdvancedCtrl.Mutation.mutations.facets.verificationStatus"></terms>

<li data-location-facet data-type="mutation" data-facet-name="location" data-label="{{'Location' | translate}}"
data-placeholder="{{'Enter mutation location' | translate}}" data-example="{{'e.g. chr12:43566-3457633' | translate}}"></li>
data-placeholder="{{'e.g. chr12:43566-3457633' | translate}}" ></li>
</ul>

4 changes: 2 additions & 2 deletions dcc-portal-ui/app/scripts/app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@
if (response.status !== 401 && response.status !== -1) {
console.error('Response Error: ', toJson (response));
}

if (response.status === 500) {
Notify.setMessage ('' + response.data.message || response.statusText);
Notify.setParams(response);
Notify.showErrors();
} else if (response.status === 404) {
console.error(response.data.message);
Expand Down
10 changes: 2 additions & 8 deletions dcc-portal-ui/app/scripts/common/js/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,14 @@
this.projectSNP = function() {
return 'http://www.ncbi.nlm.nih.gov/SNP/';
};
this.projectTCGA = function() {
return 'http://cancergenome.nih.gov/';
};
this.projectGDCLegacy = () => 'https://gdc-portal.nci.nih.gov/legacy-archive';
this.projectGEO = function() {
return 'http://www.ncbi.nlm.nih.gov/geo/';
};
this.projectEGA = function() {
return 'https://ega-archive.org/';
};
this.projectCGHub = function(diseasesCode) {
return 'https://browser.cghub.ucsc.edu/search/?disease_abbr=' + diseasesCode;
};


this.projectGDCActive = () => 'https://gdc-portal.nci.nih.gov';
});


Expand Down
84 changes: 62 additions & 22 deletions dcc-portal-ui/app/scripts/common/js/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
error = false,
message = '',
theme = '';

let params = {};

function isVisible() {
return !!visible;
Expand Down Expand Up @@ -71,6 +73,16 @@
message = m;
}

const setParams = (response) => {
if(!_.isEmpty(response)){
params.headers = response.headers();
params.source = response.config.url;
params.message = response.data.message || response.statusText;
}
};

const getParams = () => params;

function getMessage() {
return message;
}
Expand All @@ -95,22 +107,26 @@
}

return {
isVisible: isVisible,
show: show,
showErrors: showErrors,
hide: hide,
redirectHome: redirectHome,
setMessage: setMessage,
getMessage: getMessage,
setRemovable: setRemovable,
isRemovable: isRemovable,
setTheme: setTheme,
getTheme: getTheme
isVisible,
show,
showErrors,
hide,
redirectHome,
setParams,
getParams,
setMessage,
getMessage,
setRemovable,
isRemovable,
setTheme,
getTheme
};
});

module.controller('NotifyCtrl', function ($scope, Page, Notify) {
$scope.notify = Notify;
$scope.responseParams = $scope.notify.getParams();

$scope.$on('$locationChangeSuccess', function() {
if (Notify.isVisible() && Page.page() !== 'error') {
Notify.hide();
Expand All @@ -124,17 +140,41 @@
replace: true,
controller: 'NotifyCtrl',
scope: true,
template: '<div><div data-ng-if="notify.isVisible()" class="t_notify_popup {{notify.getTheme()}}">' +
'<div class="t_notify_body pull-left" data-ng-bind-html="notify.getMessage()"></div>' +
'<div class="pull-right">' +
'<a class="t_notify_link" data-ng-href="" data-ng-click="notify.redirectHome()">'+
'<i data-ng-if="notify.isRemovable()" class="icon-home"></i>Home</a>' +
'<span>&nbsp;&nbsp;</span>' +
'<a class="t_notify_link" data-ng-href="" data-ng-click="notify.hide()">' +
'<i data-ng-if="notify.isRemovable()" class="icon-cancel"></i>Close</a>' +
'</div>' +
'</div>' +
'</div>'
template: `<div>
<div data-ng-if="notify.isVisible()" class="t_notify_popup {{notify.getTheme()}}">
<div class="t_notify_body pull-left">
<span>
An error occured while performing the requested operation.
<a class="t_notify_link" href="" data-ng-click="showMessage = !showMessage">See details</a>
for more information.
</span>
<div data-ng-if="showMessage">
<pre><code data-ng-bind="responseParams.message || notify.getMessage()"></code></pre>
<span data-ng-if="responseParams.source && responseParams.headers">
We have created an error report that you can send to help us improve ICGC Portal.
<a class="t_notify_link"
href="mailto:dcc-support@icgc.org?Subject=ICGC DCC Portal - Error Report
&body=An error occured while {{responseParams.source}} operation.%0A
Error: {{responseParams.message || notify.getMessage()}}%0A
Portal Information: %0A
API Version: {{responseParams.headers['x-icgc-api-version']}}%0A
Index Commit Id: {{responseParams.headers['x-icgc-index-commitid']}}%0A
Index Name: {{responseParams.headers['x-icgc-index-name']}}%0A
Portal Commit Id: {{responseParams.headers['x-icgc-portal-commitid']}}">Email error report.</a>
</span>
</div>
</div>
<div class="pull-right">
<a class="t_notify_link" data-ng-href="" data-ng-click="notify.redirectHome()">
<i data-ng-if="notify.isRemovable()" class="icon-home"></i>Home
</a>
<span>&nbsp;&nbsp;</span>
<a class="t_notify_link" data-ng-href="" data-ng-click="notify.hide()">
<i data-ng-if="notify.isRemovable()" class="icon-cancel"></i>Close
</a>
</div>
</div>
</div>`
};
});
})();
11 changes: 5 additions & 6 deletions dcc-portal-ui/app/scripts/downloader/js/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
$scope.dlTotal = 0;

// Compute the total number of donors
Donors.handler.get('count', {filters: filters}).then(function (data) {
Donors.handler.get('count', {filters: filters}).then( (data) => {
$scope.totalDonor = data;
});

Expand All @@ -133,13 +133,12 @@

// Re-order it based on importance
$scope.params.dataTypes = $filter('orderBy')($scope.params.dataTypes, sortFunc);

$scope.params.processing = false;
},function (error) {
}, (error) => {
if(error.status === 503){
$scope.params.processing = false;
$scope.params.downloadEnabled = false;
}
}
}).finally(() => {
$scope.params.processing = false;
});
};

Expand Down
6 changes: 5 additions & 1 deletion dcc-portal-ui/app/scripts/facets/js/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
function ($scope, $filter, Facets, HighchartsService, ProjectCache, ValueTranslator, LocationService) {

$scope.resetPaginationOnChange = _.isUndefined($scope.resetPaginationOnChange) ? true : $scope.resetPaginationOnChange;
$scope.search = {};

// Translation on UI is slow, do in here
function addTranslations (terms, facetName, missingText) {
Expand Down Expand Up @@ -180,7 +181,10 @@
iconGetter: '&iconGetter',
showWhenEmpty: '<',

resetPaginationOnChange: '<'
resetPaginationOnChange: '<',

//Search Config
searchIconShowLimit : '@'
},
transclude: true,
templateUrl: '/scripts/facets/views/terms.html',
Expand Down
17 changes: 16 additions & 1 deletion dcc-portal-ui/app/scripts/facets/styles/_facets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,25 @@ $foregroundRed: #ff654b;
size: 1.1rem;
weight: 300;
}

.t_facets_facet_search_icon{
i{
font-size: 1.5rem;
}
}

.t_facets__facet__search{
input{
font-size: 1rem;
}
}
}

.t_facets__facet__title_active {
border-left-color: $orangeLight;
.t_facets_facet_search_icon{
margin-right: -.5rem;
}
}

.t_facets__facet__title__label {
Expand Down Expand Up @@ -317,5 +332,5 @@ $togglerFontSize: 10px;
}

.t_facet_location_search{
margin: 0px 0px 10px 0px;
margin: 10px 0px 10px 0px;
}
19 changes: 16 additions & 3 deletions dcc-portal-ui/app/scripts/facets/views/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
<span data-ng-if="actives.length" class="t_facets__facet__terms__inactive__reset t_tools">
<span data-ng-click="removeFacet()" class="t_tools__tool"><i class="icon-undo"></i></span>
</span>
<span class="t_tools t_facets_facet_search_icon"
data-ng-show="(inactives.length > (searchIconShowLimit || 5)) && !collapsed">
<span data-ng-click="showSearch = !showSearch" class="t_tools__tool"><i class="icon-search"></i></span>
</span>
<div class="t_facets__facet__search t_facets__facet__input" data-ng-if="showSearch && !collapsed">
<input class="t_input__block" type="search" placeholder="Filter values" ng-model="search.query" autofocus>
<i class="t_suggest__embedded t_suggest__embedded__right t_suggest__embedded__clear icon-cancel"
data-ng-click="search.query = ''"
data-ng-show="search.query"></i>
</div>
</li>
<li class="t_facets__facet__search" data-ng-show="showSearch">

</li>
<li class="t_facets__facet__terms">
<ul class="t_facets__facet__terms__active">
Expand Down Expand Up @@ -41,7 +54,7 @@
</ul>

<ul data-ng-hide="collapsed || inactives.length == 0" class="t_facets__facet__terms__inactive">
<li data-ng-repeat="item in inactives | limitTo: (collapsed? 0 : displayLimit)"
<li data-ng-repeat="item in inactives | filter: search.query | limitTo: (collapsed? 0 : displayLimit)"
class="t_facets__facet__terms__inactive__term">

<span data-ng-hide="hideCount" data-ng-style="bar(item.count)" class="t_facets__facet__terms__inactive__term__bar"></span>
Expand All @@ -58,11 +71,11 @@
<span data-ng-if="hideCount" class="t_facets__facet__terms__inactive__term__count t_facets__facet__term__na">{{hideText}}</span>

</li>
<li data-ng-show="inactives.length > displayLimit || expanded" class="t_sh__toggle">
<li data-ng-show="(inactives | filter: search.query).length > displayLimit || expanded" class="t_sh__toggle">
<a data-ng-click="toggle()" href="" class="t_tools__tool">
<span>
<i class="{{ expanded? 'icon-caret-up': 'icon-caret-down' }}"></i>
{{ expanded? "less" : (inactives.length - displayLimit) + " more" }}
{{ expanded? "less" : ((inactives | filter: search.query).length - displayLimit) + " more" }}
</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions dcc-portal-ui/app/scripts/genomemaps/js/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ angular.module('icgc.modules.genomeviewer').directive('genomeViewer', function (
title: 'ICGC Genes',
minHistogramRegionSize: 20000000,
maxLabelRegionSize: 10000000,
minTranscriptRegionSize: 300000,
minTranscriptRegionSize: 500000,
height: 100,
renderer: new GeneRenderer({
tooltipContainerID: '#genomic',
Expand Down Expand Up @@ -633,7 +633,7 @@ angular.module('icgc.modules.genomeviewer').directive('gvembed', function (GMSer
title: 'ICGC Genes',
minHistogramRegionSize: 20000000,
maxLabelRegionSize: 10000000,
minTranscriptRegionSize: 300000,
minTranscriptRegionSize: 500000,
height: 100,
functional_impact: _.get(LocationService.filters(), 'mutation.functionalImpact.is', ''),
renderer: new GeneRenderer({
Expand Down
3 changes: 2 additions & 1 deletion dcc-portal-ui/app/scripts/pancancer/views/pancancer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ <h1>
data-y-label="{{'Donors' | translate}}"
data-alternate-brightness="true"
data-items="primarySites"
data-is-loading="false">
data-is-loading="false"
data-current-page="pcawg">
</stacked>

<section class="well" style="padding-top:0.5rem; padding-bottom:0.5rem">
Expand Down
34 changes: 26 additions & 8 deletions dcc-portal-ui/app/scripts/projects/views/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ <h3><translate>Raw data is available at</translate></h3>
<a data-ng-switch-when="dbSNP" target="_blank" href="{{ProjectCtrl.ExternalLinks.projectSNP()}}">
<i class="icon-external-link"></i><translate>NCBI dbSNP</translate></a>

<a data-ng-switch-when="TCGA" target="_blank" href="{{ProjectCtrl.ExternalLinks.projectTCGA()}}">
<i class="icon-external-link"></i><translate>The Cancer Genome Atlas</translate></a>
<a data-ng-switch-when="TCGA" target="_blank" href="{{ProjectCtrl.ExternalLinks.projectGDCLegacy()}}">
<i class="icon-external-link"></i><translate>Genomic Data Commons (Legacy)</translate></a>

<a data-ng-switch-when="CGHub" target="_blank" href="{{ProjectCtrl.ExternalLinks.projectCGHub(ProjectCtrl.project.id.split('-')[0])}}">
<i class="icon-external-link"></i><translate>Cancer Genomics Hub</translate></a>
<a data-ng-switch-when="CGHub" target="_blank" href="{{ProjectCtrl.ExternalLinks.projectGDCActive()}}">
<i class="icon-external-link"></i><translate>Genomic Data Commons (Active)</translate></a>

<a data-ng-switch-when="GEO" target="_blank" href="{{ProjectCtrl.ExternalLinks.projectGEO()}}">
<i class="icon-external-link"></i><translate>Gene Expression Omnibus</translate></a>
Expand Down Expand Up @@ -310,10 +310,28 @@ <h3><translate>Available Data Types:</translate></h3>
</tr>
</table>
<div>
<span class="open-in"><translate>Open in</translate></span>
<a href="{{:: ProjectCtrl.dataReleasesUrl }}/current/Projects/{{ProjectCtrl.project.id}}">
<i class="icon-database"></i>{{:: ProjectCtrl.dataReleasesTitle }}
</a>
<span class="action-toolbar">
<span class="action-item">
<span>
<i class="icon-database"></i>
<span>
<a href='{{:: ProjectCtrl.dataReleasesUrl }}/current/Projects/{{ProjectCtrl.project.id}}'>
<translate>Open in {{:: ProjectCtrl.dataReleasesTitle }}</translate>
</a>
</span>
</span>
</span>
<span class="action-item">
<span>
<i class="icon-download-cloud"></i>
<span>
<a href='/repositories?filters={"file":{"projectCode":{"is":["{{ProjectCtrl.project.id}}"]}}}'>
<translate>View in Data Repositories</translate>
</a>
</span>
</span>
</span>
</span>
</div>
</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
selected-project-count="ProjectsCtrl.numberOfSelectedProjectsInFilter()"
data-title="{{'Top 20 Mutated Genes with High Functional Impact SSMs' | translate}}"
data-y-label="{{'Donors Affected' | translate}}"
data-subtitle="{{ProjectsCtrl.ssmTotalDonors | number}} Unique SSM-Tested Donors">
data-subtitle="{{ProjectsCtrl.ssmTotalDonors | number}} Unique SSM-Tested Donors"
data-current-page="projects">
</stacked>
</div>
</section>
Expand Down
Loading

0 comments on commit 525cab9

Please sign in to comment.