Skip to content

Commit

Permalink
V3.7.0 (#551)
Browse files Browse the repository at this point in the history
* Google login
  • Loading branch information
AjayDoddapaneni authored Mar 21, 2022
1 parent 9d06480 commit e0f8fc3
Show file tree
Hide file tree
Showing 42 changed files with 4,552 additions and 3,242 deletions.
6,198 changes: 3,357 additions & 2,841 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"@apollo/react-components": "^4.0.0",
"@babel/core": "7.2.2",
"@jbrowse/react-linear-genome-view": "^1.3.0",
"@librpc/web": "^1.1.1",
"@material-ui/core": "^4.10.0",
"@material-ui/data-grid": "*",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "*",
"@svgr/webpack": "4.1.0",
Expand All @@ -18,7 +20,7 @@
"babel-loader": "8.0.5",
"babel-plugin-named-asset-import": "^0.3.4",
"babel-preset-react-app": "^7.0.1",
"bento-components": "^0.1.96",
"bento-components": "^0.1.105",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.2.0",
"classnames": "^2.2.6",
Expand Down Expand Up @@ -60,13 +62,15 @@
"react-dev-utils": "^7.0.3",
"react-dom": "^16.8.2",
"react-loading-skeleton": "^2.1.1",
"react-measure": "^2.5.2",
"react-redux": "^7.2.1",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scroll": "^1.7.16",
"react-swipeable-views": "^0.13.9",
"react-syntax-highlighter": "^10.2.0",
"react-toastify": "^4.5.2",
"react-use-googlelogin": "^0.12.5",
"react-uuid": "^1.0.2",
"react-vis": "^1.11.7",
"react-zoom-pan-pinch": "^1.4.5",
Expand All @@ -76,6 +80,7 @@
"redux-devtools-extension": "^2.13.9",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"reselect": "^4.1.5",
"resolve": "1.10.0",
"sass-loader": "7.1.0",
"style-loader": "0.23.1",
Expand Down
74 changes: 40 additions & 34 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta charset="utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!--

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta charset="utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Poppins|Raleway|Oswald|Inter|Nunito:wght@100;200;300;400;500;600;700;800;900|Inter:wght@100;200;300;400;500;600;700;800;900|Lato&display=swap" rel="stylesheet">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link href="%PUBLIC_URL%/style/graphql.css" rel="stylesheet" />
<!--
<link
href="https://fonts.googleapis.com/css?family=Open+Sans|Poppins|Raleway|Oswald|Inter|Nunito:wght@100;200;300;400;500;600;700;800;900|Inter:wght@100;200;300;400;500;600;700;800;900|Lato&display=swap"
rel="stylesheet">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link href="%PUBLIC_URL%/style/graphql.css" rel="stylesheet" />
<!--
Adding fonts
-->
<link rel="stylesheet" href="%PUBLIC_URL%/index.css">
<!--
<link rel="stylesheet" href="%PUBLIC_URL%/index.css">
<!--
Change line below to update favicon application
Ideal size: 32x32 px.
-->
<link rel="shortcut icon" href="https://raw.githubusercontent.com/CBIIT/bento-frontend/master/public/favicon.ico" />
<link rel="shortcut icon" href="https://raw.githubusercontent.com/CBIIT/bento-frontend/master/public/favicon.ico" />

<!--
<!--
Inject environment variable to windows object.
-->
<script src="./injectEnv.js"></script>
<script src="./js/session.js"></script>
<script src="./injectEnv.js"></script>

<!--
<!--
Change line below to update title for the application.
Ideal Length: <= 33 Characters.
-->
<title>Bento</title>
<title>Bento</title>

<!--
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -46,16 +50,17 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<style type="text/css">
body {
padding-right: 0px !important;
}
</style>
</head>
<body >
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<style type="text/css">
body {
padding-right: 0px !important;
}
</style>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -65,5 +70,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>

</html>
2 changes: 2 additions & 0 deletions public/injectEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ window.injectedEnv = {
REACT_APP_LOGIN_URL:'https://nci-crdc-staging.datacommons.io/user/oauth2/authorize?client_id=82pslYFJqA7auRvKYfTOK67jzQAMb8f6C33tlmZz&response_type=code&redirect_uri=https%3A%2F%2Fk9dc.essential-dev.com%2F&scope=openid%20user',
REACT_APP_USER_LOGOUT_URL:'https://k9dc.essential-dev.com/fence/logout',
REACT_APP_BACKEND_API:'https://bento-dev.bento-tools.org/v1/graphql/',
REACT_APP_AUTH_API:'http://localhost:4010',
REACT_APP_GOOGLE_CLIENT_ID:'',
REACT_APP_APPLICATION_VERSION:'YYYY_MM_DD/HH:MM',
REACT_APP_ABOUT_CONTENT_URL:'https://raw.githubusercontent.com/CBIIT/bento-frontend/master/src/content/dev/aboutPagesContent.yaml',
REACT_APP_FILE_SERVICE_API:'https://bento-dev.bento-tools.org/api/files/',
Expand Down
34 changes: 34 additions & 0 deletions public/js/session.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const sessionStorageTransfer = (event) => {
let $event = event;
if (!$event) {
$event = window.event;
} // ie suq
if (!$event.newValue) return; // do nothing if no value to work with
if ($event.key === 'getSessionStorage') {
// another tab asked for the sessionStorage -> send it
localStorage.setItem('sessionStorage', JSON.stringify(sessionStorage));
// the other tab should now have it, so we're done with it.
localStorage.removeItem('sessionStorage'); // <- could do short timeout as well.
} else if ($event.key === 'sessionStorage' && !sessionStorage.length) {
// another tab sent data <- get it
const data = JSON.parse($event.newValue);
Object.keys(data).forEach((key) => {
sessionStorage.setItem(key, data[key]);
});
} else if ($event.key === 'logout') {
sessionStorage.clear();
}
};

// listen for changes to localStorage
if (window.addEventListener) {
window.addEventListener('storage', sessionStorageTransfer, false);
} else {
window.addEventListener('onstorage', sessionStorageTransfer);
}

// Ask other tabs for session storage (this is ONLY to trigger 'storage' event)
if (!sessionStorage.length) {
localStorage.setItem('getSessionStorage', 'true');
localStorage.removeItem('getSessionStorage');
}
6 changes: 3 additions & 3 deletions src/bento/dashboardData.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,23 @@ export const facetSectionVariables = {
checkBoxColorsOne: '#E8F7DC',
checkBoxColorsTwo: '#F5FDEE',
height: '5px',
isExpanded: false,
isExpanded: true,
},
Samples: {
color: '#10BEFF',
backgroundColor: '#C3EAF5',
checkBoxColorsOne: '#C9EBF7',
checkBoxColorsTwo: '#E8F8FE',
height: '5px',
isExpanded: false,
isExpanded: true,
},
Files: {
color: '#E636E4',
backgroundColor: '#F5C3F1',
checkBoxColorsOne: '#FBE3FB',
checkBoxColorsTwo: '#FFF2FF',
height: '5px',
isExpanded: false,
isExpanded: true,
},
};

Expand Down
4 changes: 4 additions & 0 deletions src/bento/dashboardTabData.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ export const tabContainers = [
documentDownloadProps: {
// Max file size needs to bin Bytes to seperate two support file preview and download
maxFileSize: 315,
// Tool top text for Unauthenticated users
toolTipTextUnauthenticated: 'Login to access this file',
// Tool top text for file download
toolTipTextFileDownload: 'Download a copy of this file',
// Tool top text for file preview
Expand All @@ -326,6 +328,8 @@ export const tabContainers = [
fileFormatColumn: 'file_format',
// datafield where file case id exists in the table which is used to get file information
caseIdColumn: 'subject_id',
// Unauthenticated lock icon
iconUnauthenticated: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/bento/images/icons/svgs/Access_Lock.svg',
// file download icon
iconFileDownload: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/bento/images/icons/svgs/DocumentDownloadPDF.svg',
// file preview icon
Expand Down
17 changes: 0 additions & 17 deletions src/bento/fileCentricCartWorkflowData.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,3 @@ query filesInList($file_ids: [String], $offset: Int = 0, $first: Int = 10, $orde
md5sum
}
}`;

// --------------- GraphQL query - Retrieve selected files info Desc --------------
export const GET_MY_CART_DATA_QUERY_DESC = gql`
query filesInListDesc($file_ids: [String], $offset: Int = 0, $first: Int = 10, $order_by:String ="") {
filesInListDesc(file_ids: $file_ids, offset: $offset,first: $first, order_by: $order_by) {
study_code
subject_id
file_name
file_type
association
file_description
file_format
file_size
file_id
md5sum
}
}`;
4 changes: 0 additions & 4 deletions src/bento/globalData.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/bento/landingPageData.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const landingPageData = {
callToActionTitle: 'Explore, Analyze, Visualize Clinical Trial Data Sets',
callToActionDescription: 'Model, Store and Share your Data Sets using the Bento Framework for Data Sharing Platforms.',
callToActionButtonText: 'EXPLORE THE SITE',
callToActionLink: '/cases',
callToActionLink: '/explore',
landingPageHero: {
alt: 'Alt tag1',
img: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/bento/images/icons/png/landing_Hero_Graphic.png',
Expand Down Expand Up @@ -65,7 +65,7 @@ export const landingPageData = {
titleText: 'Cases',
descriptionText: 'Analyze cases from the TAILORx clinical trial.',
callToActionText: 'Explore',
callToActionLink: '/cases', // This links to the cases dashboard.
callToActionLink: '/explore', // This links to the cases dashboard.
},
};

Expand Down
8 changes: 4 additions & 4 deletions src/bento/navigationBarData.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ export const navBarData = [
link: '/home',
},
{
labelText: 'programs',
labelText: 'explore',
type: 'link',
link: '/programs',
link: '/explore',
},
{
labelText: 'cases',
labelText: 'programs',
type: 'link',
link: '/cases',
link: '/programs',
},
{
labelText: 'about',
Expand Down
2 changes: 1 addition & 1 deletion src/bento/programDetailData.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const breadCrumb = {
const aggregateCount = {
labelText: 'Cases',
dataField: 'num_subjects',
link: '/cases',
link: '/explore',
display: true,
};

Expand Down
8 changes: 8 additions & 0 deletions src/bento/siteWideConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
// Suggested for replaceEmptyValueWith: 'N/A' or '-' or ''
replaceEmptyValueWith: '',
// Enable authenication
enableAuthentication: true,
// List for options for authentication empty array defaults to google
authEndPoint: ['google'], // authEndPoint: []
};
5 changes: 3 additions & 2 deletions src/components/ActiveFiltersQuery/ActiveFiltersQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ const styles = () => ({
queryWrapper: {
height: '120px',
backgroundColor: '#f1f1f1',
padding: '14px 14px 0px 21px',
padding: '14px 14px 0px 35px',
overflowY: 'auto',
},
queryContainer: {
marginLeft: 7,
position: 'relative',
lineHeight: '2.2em',
lineHeight: '2.4em',
letterSpacing: '0.5px',
fontFamily: 'Nunito',
fontSize: '14px',
Expand Down Expand Up @@ -426,6 +426,7 @@ const styles = () => ({
},
clearQueryButton: {
margin: '1px',
marginLeft: -6,
fontWeight: 600,
fontSize: '13px',
color: '#fff',
Expand Down
17 changes: 11 additions & 6 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@ import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import Layout from './Layout/LayoutContainer';
import { CustomThemeProvider } from './ThemeContext';
import { GoogleAuthProvider } from './GoogleAuth/GoogleAuthProvider';

// This is the place to check login ref to https://medium.com/@tomlarge/private-routes-with-react-router-dom-28e9f40c7146 for sample code

const App = () => (
<CustomThemeProvider>
{/* Reminder: Ajay need to replace the ICDC with env variable and
<GoogleAuthProvider>

{/* Reminder: Ajay need to replace the ICDC with env variable and
change build npm to read env variable */}
<BrowserRouter>
<Switch>
<Route path="/" component={Layout} />
</Switch>
</BrowserRouter>
<BrowserRouter>
<Switch>
<Route path="/" component={Layout} />
</Switch>
</BrowserRouter>
</GoogleAuthProvider>

</CustomThemeProvider>
);

Expand Down
Loading

0 comments on commit e0f8fc3

Please sign in to comment.