Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches-ignore:
- main
- staging
- staging-debug
pull_request:
jobs:
build:
Expand Down
99 changes: 52 additions & 47 deletions Eplant/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,59 @@ import { Config, defaultConfig } from './config'
import Eplant from './Eplant'

import './css/index.css'
const router = createBrowserRouter([
const router = createBrowserRouter(
[
{
path: '/',
element: <Eplant />,
children: [
{
element: <Navigate to={'gene-info/'} replace={true}></Navigate>,
},
{
path: 'cell-efp/:geneid?',
element: <CellEFPView></CellEFPView>,
},
{
path: 'publications/:geneid?',
element: <PublicationsViewer></PublicationsViewer>,
},
{
path: 'chromosome/:geneid?',
element: <ChromosomeView></ChromosomeView>,
},
{
path: 'plant-efp/:geneid?',
element: <PlantEFPView></PlantEFPView>,
},
{
path: 'experiment-efp/:geneid?',
element: <ExperimentEFPView></ExperimentEFPView>,
},
{
path: 'gene-info/:geneid?',
element: <GeneInfoView></GeneInfoView>,
},
{
path: 'get-started/:geneid?',
element: <GetStartedView></GetStartedView>,
},
{
path: 'navigator-view/:geneid?',
element: <NavigatorViewObject></NavigatorViewObject>,
},
{
path: 'interactions-view/:geneid?',
element: <InteractionsViewObject></InteractionsViewObject>,
},
],
errorElement: <ErrorBoundary></ErrorBoundary>,
},
],
{
path: '/',
element: <Eplant />,
children: [
{
element: <Navigate to={'gene-info/'} replace={true}></Navigate>,
},
{
path: 'cell-efp/:geneid?',
element: <CellEFPView></CellEFPView>,
},
{
path: 'publications/:geneid?',
element: <PublicationsViewer></PublicationsViewer>,
},
{
path: 'chromosome/:geneid?',
element: <ChromosomeView></ChromosomeView>,
},
{
path: 'plant-efp/:geneid?',
element: <PlantEFPView></PlantEFPView>,
},
{
path: 'experiment-efp/:geneid?',
element: <ExperimentEFPView></ExperimentEFPView>,
},
{
path: 'gene-info/:geneid?',
element: <GeneInfoView></GeneInfoView>,
},
{
path: 'get-started/:geneid?',
element: <GetStartedView></GetStartedView>,
},
{
path: 'navigator-view/:geneid?',
element: <NavigatorViewObject></NavigatorViewObject>,
},
{
path: 'interactions-view/:geneid?',
element: <InteractionsViewObject></InteractionsViewObject>,
},
],
errorElement: <ErrorBoundary></ErrorBoundary>,
},
])
basename: import.meta.env.BASE_URL ?? '/',
}
)

export const queryClient = new QueryClient()

Expand Down
27 changes: 25 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,30 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="Eplant/index.css" />
<script type="text/javascript">
// Github pages deployment workaround https://github.com/rafgraph/spa-github-pages
// Only run on GitHub Pages (not localhost)
;(function (l) {
if (
l.hostname !== 'localhost' &&
l.hostname !== '127.0.0.1' &&
l.search[1] === '/'
) {
var decoded = l.search
.slice(1)
.split('&')
.map(function (s) {
return s.replace(/~and~/g, '&')
})
.join('?')
window.history.replaceState(
null,
null,
l.pathname.slice(0, -1) + decoded + l.hash
)
}
})(window.location)
</script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
Expand All @@ -21,7 +44,7 @@
<link rel="icon" type="image/svg+xml" href="static/favicon.svg" />
<link rel="icon" type="image/png" href="static/favicon.png" />
<link rel="manifest" href="static/site.webmanifest" />
<script type="module" src="Eplant/main.tsx"></script>
<script type="module" src="/Eplant/main.tsx"></script>
<title>Eplant</title>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Eplant",
"main": "index.ts",
"type": "module",
"homepage": "https://bioanalyticresource.github.io/ePlant/",
"scripts": {
"test": "jest --passWithNoTests",
"dev": "vite",
Expand Down
35 changes: 35 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Redirecting…</title>
<script type="text/javascript">
// Taken from https://github.com/rafgraph/spa-github-pages
// Workaround for Github Pages deployment
var pathSegmentsToKeep = 1

var l = window.location
l.replace(
l.protocol +
'//' +
l.hostname +
(l.port ? ':' + l.port : '') +
l.pathname
.split('/')
.slice(0, 1 + pathSegmentsToKeep)
.join('/') +
'/?/' +
l.pathname
.slice(1)
.split('/')
.slice(pathSegmentsToKeep)
.join('/')
.replace(/&/g, '~and~') +
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash
)
</script>
</head>
<body></body>
</html>