Skip to content

Commit

Permalink
Merge branch 'master' into snyk-fix-66646c6d6d40244903616a664e35a8c4
Browse files Browse the repository at this point in the history
  • Loading branch information
ocshawn authored Jan 6, 2025
2 parents ad03420 + cc60674 commit 411845b
Show file tree
Hide file tree
Showing 379 changed files with 24,295 additions and 7,588 deletions.
2 changes: 0 additions & 2 deletions .github/labeler.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
ci:
name: Build Image and Push
uses: uc-cdis/.github/.github/workflows/image_build_push.yaml@master
with:
BUILD_PLATFORMS: "linux/amd64"
secrets:
ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
ECR_AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Integration Tests

on: pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
integration_tests:
name: Integration tests
uses: uc-cdis/.github/.github/workflows/integration_tests.yaml@master
with:
SERVICE_TO_TEST: portal
secrets:
CI_AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
CI_AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }}
JENKINS_API_TOKEN: ${{ secrets.JENKINS_API_TOKEN }}
QA_DASHBOARD_S3_PATH: ${{ secrets.QA_DASHBOARD_S3_PATH }}
CI_TEST_ORCID_USERID: ${{ secrets.CI_TEST_ORCID_USERID }}
CI_TEST_ORCID_PASSWORD: ${{ secrets.CI_TEST_ORCID_PASSWORD }}
CI_TEST_RAS_USERID: ${{ secrets.CI_TEST_RAS_USERID }}
CI_TEST_RAS_PASSWORD: ${{ secrets.CI_TEST_RAS_PASSWORD }}
CI_TEST_RAS_2_USERID: ${{ secrets.CI_TEST_RAS_2_USERID }}
CI_TEST_RAS_2_PASSWORD: ${{ secrets.CI_TEST_RAS_2_PASSWORD }}
CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }}
CI_SLACK_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }}
13 changes: 0 additions & 13 deletions .github/workflows/labeler.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data/schema.graphql
data/schema.json
src/params.js
src/css/themeoverrides.css
public/*
src/img/sponsors/gitops-sponsors/
__generated__/
*.log
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "package-lock.json|.*/dictionary.json|.*/schema.json",
"lines": ".*integrity.*"
},
"generated_at": "2021-10-08T03:14:20Z",
"generated_at": "2024-11-19T16:49:52Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -81,7 +81,7 @@
"hashed_secret": "abd9c7ed80fd61f97a190e059555269a6ff69b94",
"is_secret": false,
"is_verified": false,
"line_number": 16,
"line_number": 17,
"type": "Secret Keyword"
}
],
Expand Down
6 changes: 1 addition & 5 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ module.exports = {
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions"
],
"addons": [],
"framework": "@storybook/react"
}
66 changes: 31 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
# To run: docker run -d --name=dataportal -p 80:80 quay.io/cdis/data-portal
# To check running container: docker exec -it dataportal /bin/bash

FROM quay.io/cdis/ubuntu:20.04
FROM quay.io/cdis/nodejs-base:master

ENV DEBIAN_FRONTEND=noninteractive
ENV REACT_APP_PROJECT_ID=search

# disable npm 7's brand new update notifier to prevent Portal from stuck at starting up
# see https://github.com/npm/cli/issues/3163
ENV NPM_CONFIG_UPDATE_NOTIFIER=false

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libssl1.1 \
libgnutls30 \
ca-certificates \
curl \
git \
nginx \
python3 \
time \
vim \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& npm install -g [email protected]
# Install nginx
RUN yum install nginx -y && \
# allows nginx to run on port 80 without being root user
setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx && \
chown -R gen3:gen3 /var/log/nginx && \
# pipe nginx logs to stdout/stderr
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log && \
mkdir -p /var/lib/nginx/tmp/client_body && \
chown -R gen3:gen3 /var/lib/nginx/ && \
mkdir -p /var/cache/nginx && \
chown -R gen3:gen3 /var/cache/nginx \
&& touch /var/run/nginx.pid \
&& chown -R gen3:gen3 /var/run/nginx.pid

ARG APP=dev
ARG BASENAME

RUN mkdir -p /data-portal
COPY . /data-portal
RUN cp /data-portal/nginx.conf /etc/nginx/conf.d/nginx.conf \
&& chown -R gen3:gen3 /etc/nginx/conf.d \
&& chown -R gen3:gen3 /data-portal

# In standard prod these will be overwritten by volume mounts
# Provided here for ease of use in development and
# non-standard deployment environments

RUN mkdir /mnt/ssl \
&& openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /mnt/ssl/nginx.key -out /mnt/ssl/nginx.crt -subj '/countryName=US/stateOrProvinceName=Illinois/localityName=Chicago/organizationName=CDIS/organizationalUnitName=PlanX/commonName=localhost/[email protected]' \
&& chmod 755 /mnt/ssl/nginx.crt \
&& chmod 755 /mnt/ssl/nginx.key

WORKDIR /data-portal
USER gen3
RUN COMMIT=`git rev-parse HEAD` && echo "export const portalCommit = \"${COMMIT}\";" >src/versions.js \
&& VERSION=`git describe --always --tags` && echo "export const portalVersion =\"${VERSION}\";" >>src/versions.js \
&& /bin/rm -rf .git \
Expand All @@ -44,15 +49,6 @@ RUN npm config set unsafe-perm=true \
&& npm run relay \
&& npm run params
# see https://stackoverflow.com/questions/48387040/nodejs-recommended-max-old-space-size
RUN NODE_OPTIONS=--max-old-space-size=3584 NODE_ENV=production time npx webpack build
RUN cp nginx.conf /etc/nginx/conf.d/nginx.conf \
&& rm /etc/nginx/sites-enabled/default

# In standard prod these will be overwritten by volume mounts
# Provided here for ease of use in development and
# non-standard deployment environments

RUN mkdir /mnt/ssl \
&& openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /mnt/ssl/nginx.key -out /mnt/ssl/nginx.crt -subj '/countryName=US/stateOrProvinceName=Illinois/localityName=Chicago/organizationName=CDIS/organizationalUnitName=PlanX/commonName=localhost/[email protected]'
RUN NODE_OPTIONS=--max-old-space-size=3584 NODE_ENV=production npx webpack build

CMD bash ./dockerStart.sh
CMD [ "bash", "./dockerStart.sh" ]
6 changes: 0 additions & 6 deletions Jenkinsfile

This file was deleted.

11 changes: 1 addition & 10 deletions boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,9 @@
scriptNode.src = buildSrc;
scriptNode.type = 'text/javascript';
document.body.appendChild(scriptNode);
// create theme override node in body
const themeOverridesSrc = (basename && basename !== '/') ? `${basename}/src/css/themeoverrides.css?_=${cssVersion}` : `/src/css/themeoverrides.css?_=${cssVersion}`;
let linkNode = document.createElement('link');
linkNode.href = themeOverridesSrc;
linkNode.type = 'text/css';
linkNode.id = 'gen3-theme-overrides';
linkNode.rel = 'stylesheet';
document.body.appendChild(linkNode);
// create local theme override node in body
const localThemeOverridesSrc = (basename && basename !== '/') ? `https://localhost:9443${basename}/src/css/themeoverrides.css` : 'https://localhost:9443/src/css/themeoverrides.css';
linkNode = document.createElement('link');
linkNode.href = localThemeOverridesSrc;
linkNode.href = 'https://localhost:9443/src/css/themeoverrides.css';
linkNode.type = 'text/css';
linkNode.rel = 'stylesheet';
document.body.appendChild(linkNode);
Expand Down
3 changes: 3 additions & 0 deletions custom/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ fi

if [ -f custom/css/$APP.css ]; then
cp custom/css/$APP.css src/css/themeoverrides.css
mkdir -p public/src/css/
cp custom/css/$APP.css public/src/css/themeoverrides.css
else
rm -rf public/src
echo "/* generated file - see customize.sh */" > src/css/themeoverrides.css
fi

Expand Down
2 changes: 1 addition & 1 deletion data/config/acct.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"title": "ACCOuNT Data Commons",
"subTitle": "Explore, Analyze, and Share Data",
"text": "This website provides a centralized, cloud-based discovery portal for African American pharmacogenomics data and aims to accelerate discovery of novel genetic variants in African Americans related to clinically actionable cardiovascular phenotypes.",
"contact": "If you have any questions about access or the registration process, please contact support@datacommons.io"
"contact": "If you have any questions about access or the registration process, please contact support@gen3.org"
}
},
"featureFlags": {
Expand Down
2 changes: 1 addition & 1 deletion data/config/anvil.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "This website supports the management, analysis and sharing of human disease data for the research community and aims to advance basic understanding of the genetic basis of complex traits and accelerate discovery and development of therapies, diagnostic tests, and other technologies for diseases like cancer.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
},
"categorical9Colors": [
"#035C94",
Expand Down
2 changes: 1 addition & 1 deletion data/config/bpa.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "This website combines liquid biopsy data from academic, government, and industry partners and aims to accelerate discovery and development of therapies, diagnostic tests, and other technologies for the treatment and prevention of cancer.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "bpa-support@datacommons.io"
"email": "bpa-support@gen3.org"
},
"certs": {
"security_quiz": {
Expand Down
2 changes: 1 addition & 1 deletion data/config/canine.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"subTitle": "explore, analyze, and share research data",
"text": "This website analyzes and shares genomic architecture of modern dog breeds and runs analysis for canine cancer to create clean, easy to navigate visualizations for data-driven discovery for canine cancer.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
}
},
"featureFlags": {
Expand Down
2 changes: 1 addition & 1 deletion data/config/dcf.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "This website supports the management, analysis and sharing of human disease data for the research community and aims to advance basic understanding of the genetic basis of complex traits and accelerate discovery and development of therapies, diagnostic tests, and other technologies for diseases like cancer.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
}
},
"featureFlags": {
Expand Down
6 changes: 3 additions & 3 deletions data/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "This website supports the management, analysis and sharing of human disease data for the research community and aims to advance basic understanding of the genetic basis of complex traits and accelerate discovery and development of therapies, diagnostic tests, and other technologies for diseases like cancer.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
},
"certs": {
"security_quiz": {
Expand Down Expand Up @@ -187,7 +187,7 @@
"explorer": true,
"analysis": false
},
"dataExplorerConfig": {
"explorerConfig": [{
"charts": {
"project": {
"chartType": "count",
Expand Down Expand Up @@ -277,7 +277,7 @@
"file_format"
]
}
},
}],
"useArboristUI": false,
"showArboristAuthzOnProfile": false,
"showFenceAuthzOnProfile": true,
Expand Down
2 changes: 1 addition & 1 deletion data/config/gtex.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "This website supports the management, analysis and sharing of human disease data for the research community and aims to advance basic understanding of the genetic basis of complex traits and accelerate discovery and development of therapies, diagnostic tests, and other technologies for diseases like cancer.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io",
"email": "support@gen3.org",
"image": "stage-icons/stage-gene"
},
"footerLogos": [
Expand Down
2 changes: 1 addition & 1 deletion data/config/ibdgc.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "The Inflammatory Bowel Disease Genetics Consortium Data Commons supports the management, analysis, and sharing of genetic data to support the vision and mission of the IBD genetics consortium.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
}
},
"featureFlags": {
Expand Down
2 changes: 1 addition & 1 deletion data/config/ncrdc-demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"subTitle": "explore, analyze, and share research data",
"text": "The Data Common Frameworks (DCF) supports the management, analysis and sharing of many different types of biomedical data for the research community with the goal of accelerating research in the molecular basis for disease and matching targeted therapies that factor in each patient's unique biology.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
}
},
"featureFlags": {
Expand Down
2 changes: 1 addition & 1 deletion data/config/ndh.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "The website combines government datasets from 3 divisions of NIAID to create clean, easy to navigate visualizations for data-driven discovery within Allergy and Infectious Diseases.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
},
"footerLogos": [
{
Expand Down
2 changes: 1 addition & 1 deletion data/config/va.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"subTitle": "Explore, Analyze, and Share Data",
"text": "The Veterans Data Commons supports the management, analysis and sharing of veteran oncologic data for the research community and aims to accelerate discovery and development of therapies, diagnostic tests, and other technologies for precision oncology.",
"contact": "If you have any questions about access or the registration process, please contact ",
"email": "support@datacommons.io"
"email": "support@gen3.org"
},
"footerLogos": [
{
Expand Down
13 changes: 11 additions & 2 deletions data/getTexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function doStringify(value, variables, indent = 0, spaces = 0) {
const objs = value.map(
(item) => `${insertSpace(indent + spaces)}${doStringify(item, variables, indent + spaces, spaces)}`,
).join(`,${ending}`);
// console.log(doWrapping(objs, '[', ']', indent, spaces));
return doWrapping(objs, '[', ']', indent, spaces);
}
if (typeof value === 'string') {
Expand Down Expand Up @@ -102,15 +103,23 @@ function buildConfig(appIn, data) {
const app = appIn || process.env.APP || 'default';
const appConfig = data[app] || {};
const defaultConfig = data.default || {};
// don't copy 'explorerConfig' over from default config since that is a non-working example
delete defaultConfig.explorerConfig;
const result = { ...defaultConfig, ...appConfig };
delete result.components;
Object.keys(result).forEach(
(k) => {
if (typeof result[k] === 'object') {
const defaultVal = defaultConfig[k];
const appVal = appConfig[k];
if (defaultVal && appVal && typeof defaultVal === 'object' && typeof appVal === 'object') {
result[k] = { ...defaultVal, ...appVal };
if (defaultVal && appVal) {
if (typeof defaultVal === 'object' && typeof appVal === 'object') {
if (Array.isArray(defaultVal) && Array.isArray(appVal)) {
result[k] = defaultVal.concat(appVal);
} else if (!Array.isArray(defaultVal) && !Array.isArray(appVal)) {
result[k] = { ...defaultVal, ...appVal };
}
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- https://atlas.qa-mickey.planx-pla.net for Atlas iframe in VHDC qa-mickey
- https://*.quicksight.aws.amazon.com for loading AWS Quicksight dashboards into COVID-19 Home page
-->
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://login.bionimbus.org https://wayf.incommonfederation.org; child-src blob:; connect-src 'self' blob: localhost https://localhost:9443 wss://localhost:9443 https://*.s3.amazonaws.com https://*.mapbox.com https://opendata.datacommons.io https://static.planx-pla.net https://*.logs.datadoghq.com https://classic.clinicaltrials.gov https://*.google-analytics.com https://*.analytics.google.com; img-src 'self' https://opendata.datacommons.io https://static.planx-pla.net https://www.google-analytics.com data: https://*.s3.amazonaws.com https://www.google-analytics.com; script-src 'self' 'unsafe-eval' https://*.google-analytics.com https://www.googletagmanager.com localhost https://localhost:9443; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com localhost https://localhost:9443; object-src 'none'; font-src 'self' data: https://fonts.googleapis.com https://fonts.gstatic.com; frame-src 'self' https://auspice.planx-pla.net https://auspice.pandemicresponsecommons.org https://atlas.qa-mickey.planx-pla.net https://*.quicksight.aws.amazon.com; ">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://login.bionimbus.org https://wayf.incommonfederation.org; child-src blob:; connect-src 'self' blob: localhost https://localhost:9443 wss://localhost:9443 https://*.s3.amazonaws.com https://*.mapbox.com https://opendata.datacommons.io https://static.planx-pla.net https://faro.planx-pla.net https://*.logs.datadoghq.com https://clinicaltrials.gov https://*.google-analytics.com https://*.analytics.google.com https://*.zendesk.com; img-src 'self' https://opendata.datacommons.io https://static.planx-pla.net https://www.google-analytics.com data: https://*.s3.amazonaws.com https://www.google-analytics.com; script-src 'self' 'unsafe-eval' https://*.google-analytics.com https://www.googletagmanager.com localhost https://localhost:9443; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com localhost https://localhost:9443; object-src 'none'; font-src 'self' data: https://fonts.googleapis.com https://fonts.gstatic.com; frame-src 'self' https://auspice.planx-pla.net https://auspice.pandemicresponsecommons.org https://atlas.qa-mickey.planx-pla.net https://*.quicksight.aws.amazon.com; ">
<meta name="viewport" content="width=device-width" />
<link href="https://fonts.googleapis.com/icon?family=Source+Sans+Pro" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,700&display=swap" rel="stylesheet">
Expand Down
Loading

0 comments on commit 411845b

Please sign in to comment.