diff --git a/__tests__/Literature/GenerativeQAInput.spec.tsx b/__tests__/Literature/GenerativeQAInput.spec.tsx index 8b390abeb..98b501a1d 100644 --- a/__tests__/Literature/GenerativeQAInput.spec.tsx +++ b/__tests__/Literature/GenerativeQAInput.spec.tsx @@ -151,8 +151,8 @@ describe('GenerativeQAInput', () => { await selectSuggestion('Paper'); await selectSuggestion('Journal Paper'); - expectOptionsToBeSelected(['paper', 'journal paper'].map(startCase)); - expectOptionsNotToBeSelected(['abstract'].map(startCase)); + expectOptionsToBeSelected(['paper', 'journal-paper']); + expectOptionsNotToBeSelected(['abstract']); }); test('shows journal suggestions even if user has not started typing', async () => { @@ -379,7 +379,12 @@ describe('GenerativeQAInput', () => { const expectOptionsToBeSelected = (options: string[]) => { options.forEach((option) => { - expect(screen.getByText(option, { selector: selectedOptionsSelector })).toBeVisible(); + expect( + // Exact match for "option" but ignore case. + screen.getByText(new RegExp(`^${option}$`, 'i'), { + selector: selectedOptionsSelector, + }) + ).toBeVisible(); }); }; diff --git a/public/downloads/biological_fidelity_Model_validations.pdf b/public/downloads/biological_fidelity_Model_validations.pdf new file mode 100644 index 000000000..dd2175a86 Binary files /dev/null and b/public/downloads/biological_fidelity_Model_validations.pdf differ diff --git a/public/downloads/intro_to_digital_brains.pdf b/public/downloads/intro_to_digital_brains.pdf new file mode 100644 index 000000000..98a765c67 Binary files /dev/null and b/public/downloads/intro_to_digital_brains.pdf differ diff --git a/public/downloads/open_blue_brain_platform_introduction.pdf b/public/downloads/open_blue_brain_platform_introduction.pdf new file mode 100644 index 000000000..3a1862f47 Binary files /dev/null and b/public/downloads/open_blue_brain_platform_introduction.pdf differ diff --git a/public/images/about/timeline/bbp_timeline_step-hippocampus.png b/public/images/about/timeline/bbp_timeline_step-hippocampus.png deleted file mode 100644 index d804a24f7..000000000 Binary files a/public/images/about/timeline/bbp_timeline_step-hippocampus.png and /dev/null differ diff --git a/public/images/about/timeline/bbp_timeline_step-hippocampus.webp b/public/images/about/timeline/bbp_timeline_step-hippocampus.webp new file mode 100644 index 000000000..76d7e2d45 Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-hippocampus.webp differ diff --git a/public/images/about/timeline/bbp_timeline_step-microcircuit.png b/public/images/about/timeline/bbp_timeline_step-microcircuit.png deleted file mode 100644 index 779312327..000000000 Binary files a/public/images/about/timeline/bbp_timeline_step-microcircuit.png and /dev/null differ diff --git a/public/images/about/timeline/bbp_timeline_step-microcircuit.webp b/public/images/about/timeline/bbp_timeline_step-microcircuit.webp new file mode 100644 index 000000000..9a6570457 Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-microcircuit.webp differ diff --git a/public/images/about/timeline/bbp_timeline_step-neocortex.png b/public/images/about/timeline/bbp_timeline_step-neocortex.png deleted file mode 100644 index 528165516..000000000 Binary files a/public/images/about/timeline/bbp_timeline_step-neocortex.png and /dev/null differ diff --git a/public/images/about/timeline/bbp_timeline_step-neocortex.webp b/public/images/about/timeline/bbp_timeline_step-neocortex.webp new file mode 100644 index 000000000..c9a171d48 Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-neocortex.webp differ diff --git a/public/images/about/timeline/bbp_timeline_step-ngv_system.png b/public/images/about/timeline/bbp_timeline_step-ngv_system.png deleted file mode 100644 index 0d2db9bff..000000000 Binary files a/public/images/about/timeline/bbp_timeline_step-ngv_system.png and /dev/null differ diff --git a/public/images/about/timeline/bbp_timeline_step-ngv_system.webp b/public/images/about/timeline/bbp_timeline_step-ngv_system.webp new file mode 100644 index 000000000..b0a4b57a9 Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-ngv_system.webp differ diff --git a/public/images/about/timeline/bbp_timeline_step-point_neuron.png b/public/images/about/timeline/bbp_timeline_step-point_neuron.png deleted file mode 100644 index 7df64a55d..000000000 Binary files a/public/images/about/timeline/bbp_timeline_step-point_neuron.png and /dev/null differ diff --git a/public/images/about/timeline/bbp_timeline_step-point_neuron.webp b/public/images/about/timeline/bbp_timeline_step-point_neuron.webp new file mode 100644 index 000000000..dff8ec3d2 Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-point_neuron.webp differ diff --git a/public/images/about/timeline/bbp_timeline_step-somatosensorycortex.png b/public/images/about/timeline/bbp_timeline_step-somatosensorycortex.png deleted file mode 100644 index 1b624a3dd..000000000 Binary files a/public/images/about/timeline/bbp_timeline_step-somatosensorycortex.png and /dev/null differ diff --git a/public/images/about/timeline/bbp_timeline_step-somatosensorycortex.webp b/public/images/about/timeline/bbp_timeline_step-somatosensorycortex.webp new file mode 100644 index 000000000..83563260d Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-somatosensorycortex.webp differ diff --git a/public/images/about/timeline/bbp_timeline_step-thalamus.png b/public/images/about/timeline/bbp_timeline_step-thalamus.png deleted file mode 100644 index deee10554..000000000 Binary files a/public/images/about/timeline/bbp_timeline_step-thalamus.png and /dev/null differ diff --git a/public/images/about/timeline/bbp_timeline_step-thalamus.webp b/public/images/about/timeline/bbp_timeline_step-thalamus.webp new file mode 100644 index 000000000..fe2076351 Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-thalamus.webp differ diff --git a/public/images/about/timeline/bbp_timeline_step-whole_brain_last.webp b/public/images/about/timeline/bbp_timeline_step-whole_brain_last.webp new file mode 100644 index 000000000..3aa658f9f Binary files /dev/null and b/public/images/about/timeline/bbp_timeline_step-whole_brain_last.webp differ diff --git a/public/images/logo.png b/public/images/logo.png new file mode 100644 index 000000000..00ac0b6d9 Binary files /dev/null and b/public/images/logo.png differ diff --git a/src/app/about/layout.tsx b/src/app/about/layout.tsx index 5b209cdb4..6cc2bad9e 100644 --- a/src/app/about/layout.tsx +++ b/src/app/about/layout.tsx @@ -1,6 +1,8 @@ 'use client'; import { ReactNode } from 'react'; +import { Alert } from 'antd'; +import { useQueryState } from 'nuqs'; import { Gabarito } from 'next/font/google'; @@ -19,6 +21,10 @@ const gabarito = Gabarito({ }); export default function AboutPageLayout({ children }: Props) { + const [warning, setWarning] = useQueryState('warning', { + clearOnDefault: true, + defaultValue: '', + }); return (
-
+ } + onClose={() => setWarning('')} + /> + )} + diff --git a/src/components/About/About.tsx b/src/components/About/About.tsx index 4c125388b..b82e48372 100644 --- a/src/components/About/About.tsx +++ b/src/components/About/About.tsx @@ -34,23 +34,23 @@ const ABOUT_ARTICLES: Array = [ title: 'Adapting to Change', text: ` Neuroplasticity, also known as brain plasticity, is the ability of the brain to reorganize itself by forming new neural connections throughout life. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Aenean lacinia bibendum nulla sed consectetur. - Nulla vitae elit libero, a pharetra augue. Maecenas sed diam eget risus varius blandit sit amet non magna. - Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. + Nulla vitae elit libero, a pharetra augue. Maecenas sed diam eget risus varius blandit sit amet non magna. + Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Etiam porta sem malesuada magna mollis euismod. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. - Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam id dolor id nibh ultricies vehicula ut id elit. - Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras mattis consectetur purus sit amet fermentum. + Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam id dolor id nibh ultricies vehicula ut id elit. + Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras mattis consectetur purus sit amet fermentum. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. `, }, { title: 'The Power of Learning', text: ` - Learning a new skill or acquiring knowledge can lead to structural changes in the brain. + Learning a new skill or acquiring knowledge can lead to structural changes in the brain. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. `, @@ -71,20 +71,13 @@ const ABOUT_ARTICLES: Array = [ { title: 'Chemical Messengers', text: ` - Neurotransmitters play a crucial role in transmitting signals between nerve cells. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nulla vitae elit libero, a pharetra augue. - Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. - Aenean lacinia bibendum nulla sed consectetur. + Neurotransmitters play a crucial role in transmitting signals between nerve cells. `, }, { title: 'Emotional Harmony', text: ` - Maintaining a balance of neurotransmitters is essential for emotional stability. - Maecenas sed diam eget risus varius blandit sit amet non magna. Aenean lacinia bibendum nulla sed consectetur. - Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. - Cras mattis consectetur purus sit amet fermentum. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. + Maintaining a balance of neurotransmitters is essential for emotional stability. `, alt: 'Neurotransmitter Molecules', image: `${basePath}/images/topological-neuron-synthesis.png`, @@ -103,21 +96,14 @@ const ABOUT_ARTICLES: Array = [ { title: 'Early Stages of Development', text: ` - The human brain undergoes significant changes during the early stages of development. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. - Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. - Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. - Aenean lacinia bibendum nulla sed consectetur. + The human brain undergoes significant changes during the early stages of development. `, }, { title: 'Adolescence and Beyond', text: ` - The adolescent brain continues to develop, shaping cognitive abilities and decision-making processes. + The adolescent brain continues to develop, shaping cognitive abilities and decision-making processes. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. - Nulla vitae elit libero, a pharetra augue. Maecenas sed diam eget risus varius blandit sit amet non magna. - Aenean lacinia bibendum nulla sed consectetur. `, alt: 'Brain Development Stages', image: `${basePath}/images/topological-neuron-synthesis.png`, diff --git a/src/components/AboutSFN/About.tsx b/src/components/AboutSFN/About.tsx index 12b3efcae..1298c031d 100644 --- a/src/components/AboutSFN/About.tsx +++ b/src/components/AboutSFN/About.tsx @@ -1,6 +1,8 @@ 'use client'; import { useState } from 'react'; +import { useQueryState } from 'nuqs'; + import DownloadDocument from './Blocs/DownloadDocument'; import Footer from './Blocs/Footer'; import Gallery from './Blocs/Gallery'; @@ -24,11 +26,14 @@ import { classNames } from '@/util/utils'; export default function AboutSFN() { const [activeSection, setActiveSection] = useState('introduction'); const [showSteps, setShowSteps] = useState(true); + const [warning] = useQueryState('warning', { clearOnDefault: true, defaultValue: '' }); + return (
@@ -61,7 +66,7 @@ export default function AboutSFN() { id="inshort" /> void; }) { return ( - <> -
-
+ setFormOpen(false)} + title={null} + footer={null} + styles={{ + mask: { + background: '#002766ba', + }, + body: { padding: '20px' }, + }} + closeIcon={} className={classNames( - 'fixed left-1/2 top-1/2 z-[99999] flex h-screen w-screen -translate-x-1/2 -translate-y-1/2 items-center justify-center bg-[rgba(0,39,102,0.8)] text-primary-8 md:h-3/4 md:w-3/4 xl:h-2/3 xl:w-2/3', - formOpen ? 'pointer-events-auto' : 'pointer-events-none' + '!m-0 h-full w-full !max-w-full md:h-auto md:!w-[700px]', + '[&_.ant-modal-body]:flex [&_.ant-modal-body]:h-full [&_.ant-modal-body]:items-center [&_.ant-modal-body]:justify-center md:[&_.ant-modal-body]:h-auto', + '[&_.ant-modal-confirm-body]:!w-full [&_.ant-modal-confirm-paragraph]:max-w-full [&_.ant-modal-content]:h-full [&_.ant-modal-content]:!rounded-none' )} > -
- + + ); } diff --git a/src/components/AboutSFN/Blocs/Gallery.tsx b/src/components/AboutSFN/Blocs/Gallery.tsx index acd0460ba..7abf16440 100644 --- a/src/components/AboutSFN/Blocs/Gallery.tsx +++ b/src/components/AboutSFN/Blocs/Gallery.tsx @@ -44,12 +44,17 @@ export default function Gallery({ return (
-

{title}

+

+ {title} +

{subtitle}

@@ -47,10 +47,10 @@ export default function RichContent({

{paragraph}

))}
-
+
{title}(false); const handleClick = () => { - if (content.access === 'restricted') { - openModal(content); - } else { - downloadFileByHref(`${basePath}${content.url}`, content.name); - } - }; - - const cardHeight = 440; - - const cardStyle = { - background: 'radial-gradient(circle at 110% 110%, rgba(77,194,237,1) 0%, rgba(33,36,77,1) 70%)', - // clipPath: 'polygon(0% 0%, 0% 100%, 100% 100%, 100% 19%, 72% 0)', - // height: `${cardHeight}px`, + if (content.access === 'restricted') openModal(content); + else downloadFileByHref(content.url, `${content.file}.pdf`); }; - // TODO: for loris to decide when he return back - // const cornerStyle = { - // clipPath: 'polygon(80% 0, 80% 18%, 100% 18%)', - // background: 'linear-gradient(50deg, rgba(77,194,237,1) 80%, rgba(33,36,77,1) 100%)', - // }; return (
setOnMouseHover(true)} onFocus={() => setOnMouseHover(true)} onMouseOut={() => setOnMouseHover(false)} @@ -59,7 +42,10 @@ export default function SingleDocumentDownloadCard({ />

@@ -69,9 +55,6 @@ export default function SingleDocumentDownloadCard({ {content.description}

- - {/* Button DESKTOP */} - {/* Made to avoid using a library especially for this component */}
-
Download {content.name}
-

{content.description}

+
Download {content.name}
+

+ {content.description} +

- + First name + * + + } + rules={[{ required: true, message: 'Please provide the first name!' }]} + validateTrigger="onBlur" name="firstName" - label="First Name" - type="text" - placeholder="Enter your first name..." - error={errors.includes('firstName')} - /> - + + + + label={ + + Last name + * + + } + > + +
- + label={ + + Last name + * + + } + > + +
-

+

By submitting this form, you agree to receive information from the Blue Brain Project.

- + ); } diff --git a/src/components/Entrypoint/segments/Splash.tsx b/src/components/Entrypoint/segments/Splash.tsx index 28601d370..4cd769da9 100644 --- a/src/components/Entrypoint/segments/Splash.tsx +++ b/src/components/Entrypoint/segments/Splash.tsx @@ -51,10 +51,7 @@ export function OBPLogo({ className )} > -
- Blue Brain - Open Platform -
+ bbop ); } diff --git a/src/components/build-section/cell-model-assignment/e-model/EModelView/Mechanism.tsx b/src/components/build-section/cell-model-assignment/e-model/EModelView/Mechanism.tsx index d828ede18..19f6d49b5 100644 --- a/src/components/build-section/cell-model-assignment/e-model/EModelView/Mechanism.tsx +++ b/src/components/build-section/cell-model-assignment/e-model/EModelView/Mechanism.tsx @@ -1,20 +1,43 @@ import { useAtomValue, useSetAtom } from 'jotai'; +import { loadable } from 'jotai/utils'; import { useEffect } from 'react'; import { StandardFallback } from './ErrorMessageLine'; import Header from './Header'; +import CentralLoadingSpinner from '@/components/CentralLoadingSpinner'; + import { eModelEditModeAtom, - eModelMechanismsAtom, eModelUIConfigAtom, } from '@/state/brain-model-config/cell-model-assignment/e-model'; +import { eModelMechanismsAtomFamily } from '@/state/e-model'; +import { detailFamily } from '@/state/explore-section/detail-view-atoms'; import { EModelConfigurationMechanism, MechanismForUI, MechanismLocation } from '@/types/e-model'; import { mechanismLocations } from '@/constants/cell-model-assignment/e-model'; import DocumentationIcon from '@/components/icons/Documentation'; +import { useUnwrappedValue } from '@/hooks/hooks'; +import useResourceInfoFromPath from '@/hooks/useResourceInfoFromPath'; + +type Params = { + id: string; + projectId: string; + virtualLabId: string; +}; + +export default function Mechanism({ params }: { params: Params }) { + const info = useResourceInfoFromPath(); + const detail = useUnwrappedValue(detailFamily(info)); + const mechanisms = useAtomValue( + loadable( + eModelMechanismsAtomFamily({ + eModelId: detail?.['@id'] || '', + projectId: params.projectId, + virtualLabId: params.virtualLabId, + }) + ) + ); -export default function Mechanism() { - const mechanisms = useAtomValue(eModelMechanismsAtom); const eModelEditMode = useAtomValue(eModelEditModeAtom); const setEModelUIConfig = useSetAtom(eModelUIConfigAtom); @@ -29,16 +52,32 @@ export default function Mechanism() { const title = 'Mechanisms'; - if (!mechanisms) { - return {title}; + if (mechanisms.state === 'loading') { + return ( +
+
{title}
+ +
+ ); } - return ( -
-
{title}
- -
- ); + if (mechanisms.state === 'hasError') { + return ( +
+
{title}
+ {title}; +
+ ); + } + + if (mechanisms.state === 'hasData') { + return ( +
+
{title}
+ +
+ ); + } } type MechanismTableProps = { diff --git a/src/components/build-section/cell-model-assignment/e-model/EModelView/index.tsx b/src/components/build-section/cell-model-assignment/e-model/EModelView/index.tsx index 8d31cdfc6..57a6d24b1 100644 --- a/src/components/build-section/cell-model-assignment/e-model/EModelView/index.tsx +++ b/src/components/build-section/cell-model-assignment/e-model/EModelView/index.tsx @@ -64,7 +64,7 @@ export default function EModelView({ - + diff --git a/src/components/explore-section/Literature/components/AutoCompleteSearch.tsx b/src/components/explore-section/Literature/components/AutoCompleteSearch.tsx index a4426bf8d..53137a982 100644 --- a/src/components/explore-section/Literature/components/AutoCompleteSearch.tsx +++ b/src/components/explore-section/Literature/components/AutoCompleteSearch.tsx @@ -111,7 +111,7 @@ export default function AutoCompleteSearch({ /> ) } - defaultValue={defaultValues} + value={defaultValues} className="min-w-[128px] rounded" variant="borderless" size="middle" diff --git a/src/components/simulate/SimulationDetails/AnalysisTab.tsx b/src/components/simulate/SimulationDetails/AnalysisTab.tsx index 86bd1b323..555bcfa6d 100644 --- a/src/components/simulate/SimulationDetails/AnalysisTab.tsx +++ b/src/components/simulate/SimulationDetails/AnalysisTab.tsx @@ -17,7 +17,7 @@ export default function AnalysisTab({ meModel }: { meModel: NexusMEModel | null if (!image || meModel?.status !== 'done') { return ( -
+
No ME-Model analysis yet
); diff --git a/src/constants/about/about-content.ts b/src/constants/about/about-content.ts index 0c8adf863..6f9d8749f 100644 --- a/src/constants/about/about-content.ts +++ b/src/constants/about/about-content.ts @@ -115,64 +115,66 @@ export const BBP_TIMELINE = [ { title: 'microcircuits', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + 'A cortical microcircuit model comprises all six cortical layers with a horizontal extent that captures the entire dendritic tree of the most central neurons. Neurons within have the same anatomical and physiological level of detail as single neuron models. All synapses between the contained neurons are included, plus more abstract models of thalamo-cortical axons that serve as user-controlled inputs. This setup can be used to study the local processing of thalamic inputs, and the roles of individual subpopulations during that process.', neurons: '31k', synapses: '37M', - image: `${basePath}/images/about/timeline/bbp_timeline_step-microcircuit.png`, + image: `${basePath}/images/about/timeline/bbp_timeline_step-microcircuit.webp`, }, { title: 'thalamus', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + 'This model of the thalamus comprises three thalamic nuclei. It is constructed in a volumetric atlas and hence takes the shape of the modeled regions into account. Neurons are placed according to experimentally measured cell densities. The entirety of the model can be simulated, or user-specified parts of it. The model can be used to study the anatomy and activity of this pivotal brain region.', neurons: '331k', synapses: '40M', - image: `${basePath}/images/about/timeline/bbp_timeline_step-thalamus.png`, + image: `${basePath}/images/about/timeline/bbp_timeline_step-thalamus.webp`, }, { title: 'hippocampus', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + 'This model of the CA1 regions of the rodent hippocampus is constructed in a volumetric atlas. It takes the shape of the modeled regions into account. Neurons within are placed according to experimentally measured cell densities. The entirety of the model, or only user-specified parts, can be simulated. The hippocampal CA1 model facilitates the study of both the anatomical structure and neural activity in this brain region.', neurons: '460k', synapses: '800M', - image: `${basePath}/images/about/timeline/bbp_timeline_step-hippocampus.png`, + image: `${basePath}/images/about/timeline/bbp_timeline_step-hippocampus.webp`, }, { - title: 'somatosensory cortex', + title: 'Non Barrel Somatosensory Cortex', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + 'This model of the non-barrel somatosensory regions of rodent cortex is constructed in a volumetric atlas and takes the shape of the modeled regions into account. Neurons are placed according to experimentally measured cell densities. Both the entirety or user-specified parts of the model can be simulated in order to facilitate the study of both the anatomical structure and neural activity in this brain region.', neurons: '1.7M', synapses: '4.7B', - image: `${basePath}/images/about/timeline/bbp_timeline_step-somatosensorycortex.png`, + image: `${basePath}/images/about/timeline/bbp_timeline_step-somatosensorycortex.webp`, }, { title: 'Neocortex', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + 'Building upon the somatosensory cortex model, this extends the model to cover all regions of the mouse neocortex. It can be analyzed or simulated in its entirety, or selected regions only; as such, it can be used to study the dynamic interactions between the various regions.', neurons: '10.7M', synapses: '88B', - image: `${basePath}/images/about/timeline/bbp_timeline_step-neocortex.png`, + image: `${basePath}/images/about/timeline/bbp_timeline_step-neocortex.webp`, }, { - title: 'NGV system', + title: 'Neuro-glia vascular System', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + 'This enhanced model of the neuro-glia-vascular system combines a microcircuit model with models of astrocytes in biological densities as well as blood vessels innervating the volume. The dynamic interactions between neurons, the astrocytes and the vascular system are also modeled and can be readily simulated to gain a deep insight into their functionalities.', neurons: '88K', astrocytes: '14K', - image: `${basePath}/images/about/timeline/bbp_timeline_step-ngv_system.png`, + image: `${basePath}/images/about/timeline/bbp_timeline_step-ngv_system.webp`, }, { - title: 'Point neuron-based framework', + title: 'Whole Brain with Olfactory Bulb and Cerebellum', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', - neurons: '70M', - image: `${basePath}/images/about/timeline/bbp_timeline_step-point_neuron.png`, + 'This extremely large model combines the neocortex model with models for the various other parts of the brain. The models for the olfactory bulb and cerebellum were constructed in collaboration with experts from the community to accurately capture their specific anatomy and their physiology.', + neurons: '71.5M', + image: `${basePath}/images/about/timeline/bbp_timeline_step-point_neuron.webp`, }, { - title: 'Whole brain', + title: 'Brain vascular system', description: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + 'This version of the model of the neuro-glia-vascular system has been scaled up to encompass the whole brain.', neurons: '71.5M', - image: `${basePath}/images/about/timeline/bbp_timeline_step-whole_brain.png`, + image: `${basePath}/images/about/timeline/bbp_timeline_step-whole_brain_last.webp`, + width: 1200, + height: 675, }, ]; @@ -182,23 +184,26 @@ export const DOWNLOADABLE_DOCUMENTS = [ id: 'openPlatformBrochure', description: 'The Blue Brain Open Platform offers the capability of exploring, building and simulating brain models. Discover a brief overview in this introduction to the platform.', - url: `${basePath}/downloads/BBOP_Users_Brochure_Capabilities_AA_Digital.pdf`, + url: `${basePath}/downloads/open_blue_brain_platform_introduction.pdf`, access: 'public', + file: 'open_blue_brain_platform_introduction', }, { name: 'Introduction to Digital Brain Models', id: 'digitalBrainModels', description: 'The Blue Brain Open Platform uses digital brain models developed by the Blue Brain Project. Learn about the different models in this brief overview.', - url: `${basePath}/downloads/BBOP_Users_Brochure_Capabilities_AA_Digital.pdf`, + url: `${basePath}/downloads/intro_to_digital_brains.pdf`, access: 'restricted', + file: 'intro_to_digital_brains', }, { name: 'Biological Fidelity', id: 'biologicalFidelity', description: 'The Blue Brain Open Platform is a fully integrated tool for simulation neuroscience using a series of algorithms and models. In this overview, the structural and functional validations of the models are described.', - url: `${basePath}/downloads/BBOP_Users_Brochure_Capabilities_AA_Digital.pdf`, + url: `${basePath}/downloads/biological_fidelity_Model_validations.pdf`, access: 'restricted', + file: 'biological_fidelity_Model_validations', }, ]; diff --git a/src/middleware.ts b/src/middleware.ts index dfbb70397..6af95c154 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,4 +1,4 @@ -import { NextResponse, NextRequest } from 'next/server'; +import { NextResponse, NextRequest, userAgent } from 'next/server'; import { getToken } from 'next-auth/jwt'; import nextAuthMiddleware, { NextRequestWithAuth } from 'next-auth/middleware'; @@ -8,6 +8,7 @@ const FREE_ACCESS_PAGES = [ '/getting-started', '/about*', '/images*', + '/downloads*', '/api/marketing', ]; @@ -31,6 +32,23 @@ export async function middleware(request: NextRequest) { const session = await getToken({ req: request }); const sessionValid = session && Date.now() < session.accessTokenExpires; const requestUrl = request.nextUrl.pathname; + const { device } = userAgent(request); + + if (device.type === 'mobile') { + const allowedPathsRegex = /^\/_next\/(static|image)|^\/api|^\/images|^\/downloads/; + + // If the URL matches the allowed paths, proceed to the next middleware or handler (for assets and static files) + if (allowedPathsRegex.test(requestUrl)) { + return NextResponse.next(); + } + // Redirect to /about for any other url + if (!requestUrl.startsWith('/about')) { + const url = request.nextUrl.clone(); + url.pathname = '/about'; + url.searchParams.set('warning', 'yes'); + return NextResponse.redirect(url); + } + } // If the user is authenticated and wants to access the home page or log-in page // then redirect to the main page diff --git a/src/state/e-model.ts b/src/state/e-model.ts index fe96f62d4..aa5b2bcd2 100644 --- a/src/state/e-model.ts +++ b/src/state/e-model.ts @@ -1,15 +1,18 @@ import esb from 'elastic-builder'; +import groupBy from 'lodash/groupBy'; import isEqual from 'lodash/isEqual'; import { Atom, atom } from 'jotai'; import { atomFamily } from 'jotai/utils'; -import { fetchResourceById, fetchResourceByIdUsingResolver } from '@/api/nexus'; +import { fetchJsonFileByUrl, fetchResourceById, fetchResourceByIdUsingResolver } from '@/api/nexus'; import { EModelConfiguration, + EModelConfigurationPayload, EModelWorkflow, ExemplarMorphologyDataType, ExperimentalTracesDataType, ExtractionTargetsConfiguration, + MechanismForUI, } from '@/types/e-model'; // TODO: Confirm these types import { EModelResource } from '@/types/explore-section/delta-model'; @@ -209,3 +212,53 @@ export const experimentalTracesAtomFamily = atomFamily< }), isEqual ); + +export const eModelConfigurationDistributionFamily = atomFamily< + ModelResourceInfo, + Atom> +>( + (resourceInfo) => + atom(async (get) => { + const session = get(sessionAtom); + const eModelConfiguration = await get(eModelConfigurationFamily(resourceInfo)); + + if (!session || !eModelConfiguration) return null; + + const contentUrl = ensureArray(eModelConfiguration.distribution).find( + ({ encodingFormat }) => encodingFormat === 'application/json' + )?.contentUrl; + + if (!contentUrl) return null; + + const json = await fetchJsonFileByUrl(contentUrl, session); + + return json; + }), + isEqual +); + +// TODO: +// This whole MechanismForUI stuff is kind of garbage. +// Should be thrown-out. +// Same for convertDeltaMorphologyForUI and convertESTraceForUI. +export const eModelMechanismsAtomFamily = atomFamily< + ModelResourceInfo, + Atom> +>( + (resourceInfo) => + atom(async (get) => { + const session = get(sessionAtom); + const configurationDistribution = await get( + eModelConfigurationDistributionFamily(resourceInfo) + ); + + if (!session || !configurationDistribution) return null; + + const { mechanisms } = configurationDistribution; + + const mechanismsByLocation = groupBy(mechanisms, 'location'); + + return { processed: mechanismsByLocation, raw: {} } as MechanismForUI; + }), + isEqual +); diff --git a/src/state/explore-section/detail-view-atoms.ts b/src/state/explore-section/detail-view-atoms.ts index 79c8ccfbe..0c5255501 100644 --- a/src/state/explore-section/detail-view-atoms.ts +++ b/src/state/explore-section/detail-view-atoms.ts @@ -265,7 +265,7 @@ export const subjectAgeDataFamily = atomFamily( diff --git a/src/types/about/document-download.ts b/src/types/about/document-download.ts index 1c514ae1a..cbf61eb3d 100644 --- a/src/types/about/document-download.ts +++ b/src/types/about/document-download.ts @@ -4,4 +4,5 @@ export type SingleDocumentProps = { description: string; access: string; url: string; + file: string; }; diff --git a/src/util/downloadFileByHref.ts b/src/util/downloadFileByHref.ts index c002b828c..41ab52745 100644 --- a/src/util/downloadFileByHref.ts +++ b/src/util/downloadFileByHref.ts @@ -1,7 +1,7 @@ export default function downloadFileByHref(fileUrl: string, name: string) { const link = document.createElement('a'); link.href = fileUrl; - link.setAttribute('download', fileUrl.split('/').pop() ?? name); + link.download = name; document.body.appendChild(link); link.click(); document.body.removeChild(link);