diff --git a/biodatacatalyst-ui/Dockerfile b/biodatacatalyst-ui/Dockerfile index bc6eed02..209198b5 100644 --- a/biodatacatalyst-ui/Dockerfile +++ b/biodatacatalyst-ui/Dockerfile @@ -15,9 +15,6 @@ FROM httpd:2.4.53-alpine as base ARG FILE_SUFFIX ENV FILE_SUFFIX=${FILE_SUFFIX} -# Replace virtual host config file with ours -COPY httpd-vhosts.conf ${HTTPD_PREFIX}/conf/extra/httpd-vhosts.conf - # Enable virtual hosting config file RUN sed -i '/^#Include conf.extra.httpd-vhosts.conf/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf diff --git a/biodatacatalyst-ui/httpd-vhosts-dev.conf b/biodatacatalyst-ui/httpd-vhosts-dev.conf deleted file mode 100644 index faefee38..00000000 --- a/biodatacatalyst-ui/httpd-vhosts-dev.conf +++ /dev/null @@ -1,101 +0,0 @@ -Listen 0.0.0.0:80 -Listen 0.0.0.0:443 - -## -## SSL Global Context -## -## All SSL configuration in this context applies both to -## the main server and all SSL-enabled virtual hosts. -## - -# -# Some MIME-types for downloading Certificates and CRLs -# -AddType application/x-x509-ca-cert .crt -AddType application/x-pkcs7-crl .crl - -SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES -SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES - - -SSLHonorCipherOrder on - -SSLProtocol all -SSLv2 -SSLv3 -SSLProxyProtocol all -SSLv2 -SSLv3 -SSLPassPhraseDialog builtin - -SSLSessionCache "shmcb:${HTTPD_PREFIX}/logs/ssl_scache(512000)" -SSLSessionCacheTimeout 300 - -Mutex "file:${HTTPD_PREFIX}/logs/ssl_mutex" - -ServerTokens Prod - - - ServerName localhost - RewriteEngine On - ProxyPreserveHost On - RewriteCond %{HTTPS} off [OR] - RewriteCond %{HTTP_HOST} ^(?:)?(.+)$ [NC] - RewriteRule ^ https://%{SERVER_NAME}/picsureui/ [L,NE,R=301] - - - - SSLProxyEngine on - SSLProxyCheckPeerCN off - - SSLCertificateFile "${HTTPD_PREFIX}/cert/server.crt" - SSLCertificateKeyFile "${HTTPD_PREFIX}/cert/server.key" - SSLCertificateChainFile "${HTTPD_PREFIX}/cert/server.chain" - - # Content security policy: - # frame-ancestors 'none' - Stops our application from being loaded in an iframe - # default-src - Restricts loading resources to the same origin - # script-src - Allows inline scripts but only from the same origin and unsafe-eval and unsafe-inline - # unsafe-eval - Allows eval() and similar constructs - # unsafe-inline - Allows inline JavaScript, CSS, and event handlers - # style-src - Allows inline styles but only from the same origin - # img-src - Allows images from the same origin and data: URIs - Header always set Content-Security-Policy "frame-ancestors 'none'; default-src 'self'; style-src 'self' 'unsafe-inline'; worker-src 'self' blob:; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://www.googletagmanager.com; img-src 'self' data: https://public.era.nih.gov blob:;" - - # A fall back for legacy browsers that don't yet support CSP frame-ancestors. - Header always set X-Frame-Options "DENY" - - # Attempt to prevent some MIME-type confusion attacks. There is no perfect solution to this problem. - Header always set X-Content-Type-Options "nosniff" - - # Enables built-in XSS protection in modern web browsers. - # If a XSS is detected mode=block will block the entire page. - Header always set X-XSS-Protection "1; mode=block;" - - # Unset the Server header. Removes 1 approach to getting information about our server. - Header always unset Server - - RewriteEngine On - ProxyPreserveHost On - - RewriteRule ^/picsure/(.*)$ "https://biodatacatalyst.integration.hms.harvard.edu.actual/picsure/$1" [P] - RewriteRule ^/psama/(.*)$ "https://biodatacatalyst.integration.hms.harvard.edu.actual/psama/$1" [P] - - RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f - RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d - - RewriteRule /picsureui/(.*) /picsureui/index.html [C] - RewriteRule ^/static/(.*)$ /static/$1 [L] - RewriteRule ^/psamaui/(.*)$ /picsureui/index.html [C] - - RedirectMatch ^/$ /picsureui/ - ErrorDocument 404 /index.html - - DocumentRoot "${HTTPD_PREFIX}/htdocs" - - ErrorLog "${HTTPD_PREFIX}/logs/error_log" - TransferLog "${HTTPD_PREFIX}/logs/access_log" - CustomLog "${HTTPD_PREFIX}/logs/ssl_request_log" \ - "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" - - BrowserMatch "MSIE [2-5]" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - - diff --git a/biodatacatalyst-ui/httpd-vhosts.conf b/biodatacatalyst-ui/httpd-vhosts.conf deleted file mode 100644 index 911fe284..00000000 --- a/biodatacatalyst-ui/httpd-vhosts.conf +++ /dev/null @@ -1,113 +0,0 @@ -Listen 0.0.0.0:80 -Listen 0.0.0.0:443 - -## -## SSL Global Context -## -## All SSL configuration in this context applies both to -## the main server and all SSL-enabled virtual hosts. -## - -# -# Some MIME-types for downloading Certificates and CRLs -# -AddType application/x-x509-ca-cert .crt -AddType application/x-pkcs7-crl .crl - -SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-SHA256 ECDHE-RSA-AES128-SHA256 ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES256-SHA384 ECDHE-RSA-AES256-SHA384 AES128-GCM-SHA256 AES128-SHA256 AES256-GCM-SHA384 AES256-SHA256 -SSLProxyCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-SHA256 ECDHE-RSA-AES128-SHA256 ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES256-SHA384 ECDHE-RSA-AES256-SHA384 AES128-GCM-SHA256 AES128-SHA256 AES256-GCM-SHA384 AES256-SHA256 - - -SSLHonorCipherOrder on - -SSLProtocol all -TLSv1.2 -SSLProxyProtocol all -TLSv1.2 -SSLPassPhraseDialog builtin - -SSLSessionCache "shmcb:${HTTPD_PREFIX}/logs/ssl_scache(512000)" -SSLSessionCacheTimeout 300 - -Mutex "file:${HTTPD_PREFIX}/logs/ssl_mutex" - -ServerTokens Prod - - - ServerName localhost - RewriteEngine On - ProxyPreserveHost On - - #Dont allow httpd debug methods - RewriteCond %{REQUEST_METHOD} ^TRACK - RewriteRule .* - [F] - RewriteCond %{REQUEST_METHOD} ^TRACE - RewriteRule .* - [F] - - RewriteCond %{HTTPS} off [OR] - RewriteCond %{HTTP_HOST} ^(?:)?(.+)$ [NC] - RewriteRule ^ https://%{SERVER_NAME}/picsureui/ [L,NE,R=301] - - - - SSLProxyEngine on - SSLProxyCheckPeerCN off - - SSLCertificateFile "${HTTPD_PREFIX}/cert/server.crt" - SSLCertificateKeyFile "${HTTPD_PREFIX}/cert/server.key" - SSLCertificateChainFile "${HTTPD_PREFIX}/cert/server.chain" - - Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" - - # Content security policy: - # frame-ancestors 'none' - Stops our application from being loaded in an iframe - # default-src - Restricts loading resources to the same origin - # script-src - Allows inline scripts but only from the same origin and unsafe-eval and unsafe-inline - # unsafe-eval - Allows eval() and similar constructs - # unsafe-inline - Allows inline JavaScript, CSS, and event handlers - # style-src - Allows inline styles but only from the same origin - # img-src - Allows images from the same origin and data: URIs - Header always set Content-Security-Policy "frame-ancestors 'none'; default-src 'self'; style-src 'self' 'unsafe-inline'; worker-src 'self' blob:; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.googletagmanager.com; img-src 'self' data: https://public.era.nih.gov blob: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com;" - - # A fall back for legacy browsers that don't yet support CSP frame-ancestors. - Header always set X-Frame-Options "DENY" - - # Attempt to prevent some MIME-type confusion attacks. There is no perfect solution to this problem. - Header always set X-Content-Type-Options "nosniff" - - # Enables built-in XSS protection in modern web browsers. - # If a XSS is detected mode=block will block the entire page. - Header always set X-XSS-Protection "1; mode=block;" - - RewriteEngine On - ProxyPreserveHost On - - #Dont allow httpd debug methods - RewriteCond %{REQUEST_METHOD} ^TRACK - RewriteRule .* - [F] - RewriteCond %{REQUEST_METHOD} ^TRACE - RewriteRule .* - [F] - - RewriteRule ^/picsure/(.*)$ "http://wildfly:8080/pic-sure-api-2/PICSURE/$1" [P] - RewriteRule ^/psama/(.*)$ "http://wildfly:8080/pic-sure-auth-services/auth/$1" [P] - - RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f - RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d - - RewriteRule /picsureui/(.*) /picsureui/index.html [C] - RewriteRule ^/static/(.*)$ /static/$1 [L] - RewriteRule ^/psamaui/(.*)$ /picsureui/index.html [C] - - RedirectMatch ^/$ /picsureui/ - ErrorDocument 404 /index.html - - DocumentRoot "${HTTPD_PREFIX}/htdocs" - - ErrorLog "${HTTPD_PREFIX}/logs/error_log" - TransferLog "${HTTPD_PREFIX}/logs/access_log" - CustomLog "${HTTPD_PREFIX}/logs/ssl_request_log" \ - "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" - - BrowserMatch "MSIE [2-5]" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - - diff --git a/biodatacatalyst-ui/pom.xml b/biodatacatalyst-ui/pom.xml index 725377eb..c430b235 100644 --- a/biodatacatalyst-ui/pom.xml +++ b/biodatacatalyst-ui/pom.xml @@ -19,7 +19,7 @@ junit junit - 4.12 + 4.13.2 test diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/common/terms-of-use.hbs b/biodatacatalyst-ui/src/main/webapp/picsureui/common/terms-of-use.hbs new file mode 100644 index 00000000..26a4eaf9 --- /dev/null +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/common/terms-of-use.hbs @@ -0,0 +1,119 @@ + +

NHLBI BioData Catalyst® (BDC) + Powered by PIC-SURE Terms of Use

+

Terms as of 22 November 2023

+

These Terms of Service constitute a legally binding agreement + made between you, whether personally or on behalf of an entity (“you”, “your”) + and Harvard Medical School (“University”, “we”, + “our”), concerning your access to and use of BDC Powered by PIC-SURE + (“PIC-SURE”). You agree to access and use PIC-SURE for lawful purposes only. By accessing + PIC-SURE, you expressly consent to the monitoring of your actions, content, data transiting and storage + therein

+

+

By accessing and using PIC-SURE, you agree that you + must:

+ + + + + + + +

+

By agreeing to the Terms of Service you understand and agree to + the following:

+ +

By accessing and using PIC-SURE, you agree that you must + NOT:

+ +

+

PIC-SURE is hosted on a FISMA (Federal Information Security + Management Act) website. You are accessing a secure and restricted system that is provided for FISMA + authorized use only.

+

By accepting these Terms of Service, you acknowledge:

+

+ diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/common/terms-of-use.js b/biodatacatalyst-ui/src/main/webapp/picsureui/common/terms-of-use.js new file mode 100644 index 00000000..a667b45a --- /dev/null +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/common/terms-of-use.js @@ -0,0 +1,16 @@ +define([ + 'backbone', + 'handlebars', + 'text!common/terms-of-use.hbs', +], function(BB, HBS, template) { + var TosView = BB.View.extend({ + initialize: function(){ + this.tosTemplate = HBS.compile(template); + }, + events: {}, + render: function(){ + this.$el.html(this.tosTemplate()); + } + }); + return TosView; +}); \ No newline at end of file diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/header/header.hbs b/biodatacatalyst-ui/src/main/webapp/picsureui/header/header.hbs index 65a2f5f1..97e1d10d 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/header/header.hbs +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/header/header.hbs @@ -108,6 +108,7 @@ {{#if jupyterExampleLink}}{{/if}} {{#if documentationLink}}{{/if}} {{#if helpLink}}{{/if}} + Log Out {{/contains}} diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/header.js b/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/header.js index 25fca6b8..a3a9851a 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/header.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/header.js @@ -3,13 +3,15 @@ define([ "common/pic-dropdown", "common/menu-nav-controls", "common/modal", - "common/redirect-modal" + "common/redirect-modal", + "common/terms-of-use" ],function ( keyboardNav, dropdown, menuNavControls, modal, - redirectModal + redirectModal, + tos, ) { let headerTabs = undefined; @@ -47,6 +49,19 @@ define([ redirect.render(event); }; + let openTermsOfUse = function(event) { + event.preventDefault(); + const tosView = new tos(); + modal.displayModal( + tosView, + "BDC PIC-SURE Terms of Use", + () => { + $('#help-dropdown-toggle').focus(); + }, + {isHandleTabs: true} + ); + } + return { /* * The path to a logo image incase you don't want the default PrecisionLink one. @@ -81,6 +96,7 @@ define([ } view.events['click #open-access-btn'] = goToOpen; + view.events['click #terms-of-use-option'] = openTermsOfUse; view.delegateEvents(); }, diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/styles.css b/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/styles.css index 1e5dcc5d..ad21fd29 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/styles.css +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/overrides/styles.css @@ -269,8 +269,8 @@ body { #studies-access { margin-top: 30px; - margin-left: 15px; - width: fit-content; + margin-left: 8px; + margin-right: 4px; border: 1px solid #aaa; border-radius: 8px; padding: 8px 0px; @@ -298,7 +298,7 @@ body { margin: 20px 0px; } -#studies-access > div > div { +#studies-access > div > div:not(#data-access-table_wrapper) { margin: 5px 20px } @@ -327,6 +327,16 @@ body { #data-access-table { width: 100%; + font-size: 14px; +} + +#data-access-table_filter { + margin: 0 8px; +} + +#data-access-table td, #data-access-table th { + padding: 8px 0px; + vertical-align: middle; } .btn-blue { diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-util.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-util.js index 81a32314..fc482d89 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-util.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-util.js @@ -91,6 +91,15 @@ define(["jquery", "underscore", "text!studyAccess/studies-data.json", "text!sett } }, + /* + This function detects if the user should see the dcc tag and variables in search results. + */ + shouldShowDCCDataSets: function() { + const queryScopes = JSON.parse(sessionStorage.getItem("session"))?.queryScopes; + const harmonizedStudies = queryScopes.filter(scope => this.isStudyHarmonized(scope.replace(/\\/g, ''))); + return harmonizedStudies?.length > 1; + }, + /** * This function returns the study id from the study abbreviation or study name. If the study id is not found * then the study abbreviation is returned. @@ -99,7 +108,6 @@ define(["jquery", "underscore", "text!studyAccess/studies-data.json", "text!sett */ getAntiScopeTags: function() { let queryScopes = JSON.parse(sessionStorage.getItem("session")).queryScopes; - // tell the back end to exclude concepts from studies not in the user's scope' let antiScopeStudies = _.filter(studiesData.bio_data_catalyst, function(studyData){ //if this study is NOT in the query scopes, _.find will return NULL @@ -115,6 +123,8 @@ define(["jquery", "underscore", "text!studyAccess/studies-data.json", "text!sett antiScopeTags.add(study.study_identifier.toUpperCase()); antiScopeTags.add((study.study_identifier + "." + study.study_version).toLowerCase()); }); + // add dcc harmonized tag if user does not have access to more than one harmonized study + !this.shouldShowDCCDataSets() && antiScopeTags.add(dccHarmonizedTag) // convert set to array return Array.from(antiScopeTags); diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/seven-bridges-export-view.hbs b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/seven-bridges-export-view.hbs index a6b01ff9..dbc93f6a 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/seven-bridges-export-view.hbs +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/seven-bridges-export-view.hbs @@ -41,14 +41,13 @@
-

After copying the PIC-SURE API Public Project to your own workspace in Seven Bridges, you will need the - following to export the data:

+

After copying the Data Export from the PIC-SURE UI Public Project to your own workspace in Seven Bridges, you can copy and paste the following into fields of the “Data Export from PIC-SURE UI” task:

    -
  1. Save the personalized user token to a file called “token.txt” in your copied PIC-SURE API project in Seven Bridges. +

  2. -
  3. Copy the query ID and paste in the “0_Export_from_UI.ipynb” notebook where instructed. +
  4. @@ -56,11 +55,11 @@
-

Run the “0_Export_from_UI.ipynb” notebook to export the dataframe.

+

Run the “Data Export from PIC-SURE UI” task to export the dataframe into your project.


- Go to Seven Bridges + Go to Seven Bridges
\ No newline at end of file diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/tag-filter-view.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/tag-filter-view.js index 925e071f..dcf5e633 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/tag-filter-view.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/tag-filter-view.js @@ -221,7 +221,7 @@ function(BB, HBS, _, tagFilterViewTemplate, tagFilterModel, filterModel, keyboar render: function(){ let unusedTags = this.model.get("unusedTags").toArray(); let filteredTags = _.filter(unusedTags, function(tag){ - return ! (tag.get('tag')===dccHarmonizedTag || studyVersionRegex.test(tag.get('tag'))) && ! tableVersionRegex.test(tag.get('tag')); + return ! (tag.get('tag')===dccHarmonizedTag || searchUtil.isStudy(tag.get('tag'))) && ! tableVersionRegex.test(tag.get('tag')); }).map(function(tag){return tag.toJSON();}) let tags = filteredTags.slice(0,this.model.get('tagLimit')); let studyTags = this.determineStudyTags(unusedTags); diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/studyAccess/studyAccess.js b/biodatacatalyst-ui/src/main/webapp/picsureui/studyAccess/studyAccess.js index ac6d1427..aee8273e 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/studyAccess/studyAccess.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/studyAccess/studyAccess.js @@ -5,7 +5,7 @@ define(["jquery", "backbone", "handlebars", "text!studyAccess/studyAccess.hbs", transportErrors, queryBuilder, settings, spinner, outputPanelOverrides, search, studyUtility){ var studyAccess = { - freezeMsg: "(Current TOPMed data is Freeze5b)", + freezeMsg: "(Current TOPMed data is Freeze9)", }; // build view diff --git a/biodatacatalyst-ui/src/main/webapp/psamaui/login/not_authorized.hbs b/biodatacatalyst-ui/src/main/webapp/psamaui/login/not_authorized.hbs index 64e90e25..ef4f9290 100644 --- a/biodatacatalyst-ui/src/main/webapp/psamaui/login/not_authorized.hbs +++ b/biodatacatalyst-ui/src/main/webapp/psamaui/login/not_authorized.hbs @@ -3,7 +3,7 @@

Your user account is not yet authorized to use this system.

Please contact the - administrator @@ -11,6 +11,6 @@ if you believe this is an error.

If you believe you logged in using the wrong account, please Click Here to try logging in again.

+ href="{{loginLink}}">Click Here to try logging in again.

\ No newline at end of file