Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
kne42 committed Nov 29, 2023
1 parent 635db76 commit 4a22d63
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useMemo } from 'react'
import { KeyPhoto } from 'app/components/KeyPhoto'
import { Link } from 'app/components/Link'
import { Table, TableCell } from 'app/components/Table'
import { EMPIAR_ID } from 'app/constants/external-links'
import { EMPIAR_ID } from 'app/constants/external-dbs'
import { ANNOTATED_OBJECTS_MAX, MAX_PER_PAGE } from 'app/constants/pagination'
import { Dataset, useDatasets } from 'app/hooks/useDatasets'
import { useIsLoading } from 'app/hooks/useIsLoading'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
LABEL_MAP,
REGEX_MAP,
URL_MAP,
} from 'app/constants/external-links'
} from 'app/constants/external-dbs'
import { TableDataValue } from 'app/types/table'
import { cns } from 'app/utils/cns'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Button } from '@czi-sds/components'
import { useState } from 'react'

import { DatabaseEntry } from 'app/components/DatabaseEntry'
import { DOI_ID } from 'app/constants/external-links'
import { DOI_ID } from 'app/constants/external-dbs'
import { useDatasetById } from 'app/hooks/useDatasetById'
import { i18n } from 'app/i18n'
import { cns, cnsNoMerge } from 'app/utils/cns'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Dataset_Funding } from 'app/__generated__/graphql'
import { AccordionMetadataTable } from 'app/components/AccordionMetadataTable'
import { DatabaseEntry } from 'app/components/DatabaseEntry'
import { Link } from 'app/components/Link'
import { DOI_ID } from 'app/constants/external-links'
import { DOI_ID } from 'app/constants/external-dbs'
import { i18n } from 'app/i18n'
import { getTableData } from 'app/utils/table'

Expand Down
19 changes: 11 additions & 8 deletions frontend/packages/data-portal/app/components/Index/IndexCTA.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Button } from '@czi-sds/components'

import { I18n } from 'app/components/I18n'
import { Link } from 'app/components/Link'
import { i18n } from 'app/i18n'
import { useI18n } from 'app/hooks/useI18n'

function CTA({
title,
Expand Down Expand Up @@ -34,23 +35,25 @@ function CTA({
}

export function IndexCTA() {
const { t } = useI18n()

return (
<div className="py-sds-xxl flex flex-col gap-sds-xl relative after:h-full after:w-[200vw] after:bg-sds-primary-100 after:absolute after:top-0 after:-translate-x-1/2 after:-z-10">
<h3 className="font-sds-semibold font-semibold text-sds-header-xl leading-sds-header-xl">
Help us achieve this vision
<I18n i18nKey="helpUsAchieveThisVision" />
</h3>
<div className="w-full grid grid-cols-[1fr_auto_1fr] grid-rows-[1fr_auto] grid-flow-col gap-y-sds-xl gap-x-sds-xxl">
<CTA
title={i18n.viewAndDownloadDatasets}
text={i18n.viewDatasetsCta}
buttonText={i18n.browseData}
title={t('viewAndDownloadDatasets')}
text={t('viewDatasetsCta')}
buttonText={t('browseData')}
url="/browse-data/datasets"
/>
<div className="bg-sds-gray-200 w-sds-xxxs row-span-2" />
<CTA
title={i18n.contributeYourData}
text={i18n.contributeCta}
buttonText={i18n.tellUsMore}
title={t('contributeYourData')}
text={t('contributeCta')}
buttonText={t('tellUsMore')}
// TODO: fill this out when form page created
url="/"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import { Link } from 'app/components/Link'
import { CZ_URL, CZII_URL, EMPIAR_URL } from 'app/constants/external-links'
import { EMPIAR_URL } from 'app/constants/external-dbs'
import { I18n } from 'app/components/I18n'
import { useI18n } from 'app/hooks/useI18n'

import { IndexContributors } from './IndexContributors'
import { IndexCTA } from './IndexCTA'

export function IndexContent() {
const { t } = useI18n()

return (
<div className="px-sds-xl w-[100vw] overflow-x-clip flex flex-col items-center">
<div className="flex flex-col max-w-content-small py-sds-xxl gap-sds-xxl">
<div className="flex flex-col gap-sds-xl">
<h2 className="font-sds-semibold font-semibold text-sds-header-xl leading-sds-header-xl">
Welcome to the CryoET Data Portal, a project built by the{' '}
<Link to={CZII_URL} className="text-sds-info-400">
Chan Zuckerberg Imaging Institute
</Link>{' '}
and the{' '}
<Link to={CZ_URL} className="text-sds-info-400">
Chan Zuckerberg Initiative
</Link>
.
<I18n i18nKey="landingPageWelcomeBlurb" />
</h2>
<div className="font-sds-regular text-sds-body-s leading-sds-body-s flex flex-col gap-sds-l">
<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { I18n } from 'app/components/I18n'

const CONTRIBUTORS = `
David Agard
Ben Barad
Expand Down Expand Up @@ -33,7 +35,7 @@ export function IndexContributors() {
return (
<div className="flex flex-col gap-sds-xl h-full">
<h3 className="font-sds-semibold font-semibold text-sds-header-xl leading-sds-header-xl">
Thank You to our Data Contributors…
<I18n i18nKey="thankYouToOurDataContributors" />
</h3>
<ul className="grid grid-flow-col grid-rows-[repeat(7,_minmax(0,_1fr))] grid-cols-4 gap-y-sds-xxs gap-x-sds-xl">
{contributors.map((name) => (
Expand Down
18 changes: 10 additions & 8 deletions frontend/packages/data-portal/app/components/Index/IndexHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { styled } from '@mui/material/styles'
import { useTypedLoaderData } from 'remix-typedjson'

import { LandingPageDataQuery } from 'app/__generated__/graphql'
import { I18n } from 'app/components/I18n'
import { Link } from 'app/components/Link'
import { i18n } from 'app/i18n'
import { useI18n } from 'app/hooks/useI18n'
import { theme } from 'app/theme'
import { cns, cnsNoMerge } from 'app/utils/cns'

Expand Down Expand Up @@ -42,6 +43,7 @@ const DIVIDER = (
)

export function IndexHeader() {
const { t } = useI18n()
const data = useTypedLoaderData<LandingPageDataQuery>()

const datasets = data.datasets_aggregate.aggregate?.count
Expand All @@ -67,24 +69,24 @@ export function IndexHeader() {
<div className="flex flex-col items-center gap-sds-m text-white">
<div className="flex flex-col gap-sds-xl items-center">
<h1 className="text-[32px] leading-[34px] font-sds-semibold font-semibold drop-shadow-landing-header">
{i18n.landingHeaderTitle}
<I18n i18nKey="landingHeaderTitle" />
</h1>
<div className="flex flex-row justify-center w-full">
<MetricField title={i18n.datasets} count={datasets ?? 0} />
<MetricField title={t('datasets')} count={datasets ?? 0} />
{DIVIDER}
<MetricField title={i18n.species} count={species ?? 0} />
<MetricField title={t('species')} count={species ?? 0} />
{DIVIDER}
<MetricField title={i18n.tomograms} count={tomograms ?? 0} />
<MetricField title={t('tomograms')} count={tomograms ?? 0} />
</div>
<Link to="/browse-data/datasets">
<CTAButton sdsType="primary" sdsStyle="rounded">
{i18n.browseData}
<I18n i18nKey="browseData" />
</CTAButton>
</Link>
</div>
<Link to="https://chanzuckerberg.github.io/cryoet-data-portal/">
<Link to={t('apiDocLink')}>
<p className="underline underline-offset-1 decoration-1 text-sds-body-xxs leading-none drop-shadow-landing-header">
{i18n.orExploreViaApi}
<I18n i18nKey="orExploreViaApi" />
</p>
</Link>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export const CZII_URL = 'https://www.czimaginginstitute.org/'
export const CZ_URL = 'https://chanzuckerberg.com/'

export const EMPIAR_ID = /EMPIAR-([\d]+)/
export const EMDB_ID = /EMD-([\d]+)/
export const DOI_ID = /(10\..+\/.+)/
Expand Down
4 changes: 2 additions & 2 deletions frontend/packages/data-portal/app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MetaFunction } from '@remix-run/node'
import { json } from '@remix-run/server-runtime'
import { json, LoaderFunctionArgs } from '@remix-run/server-runtime'

import { gql } from 'app/__generated__'
import { apolloClient } from 'app/apollo.server'
Expand All @@ -25,7 +25,7 @@ const LANDING_PAGE_DATA_QUERY = gql(`
}
`)

export async function loader() {
export async function loader({ params, request }: LoaderFunctionArgs) {
const { data } = await apolloClient.query({
query: LANDING_PAGE_DATA_QUERY,
})
Expand Down
25 changes: 19 additions & 6 deletions frontend/packages/data-portal/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"annotationMethod": "Annotation Method",
"annotationObject": "Annotation Object",
"annotationOverview": "Annotation Overview",
"annotationSoftware": "Annotation Software",
"annotations": "Annotations",
"annotationSoftware": "Annotation Software",
"api": "API",
"apiDocLink": "https://chanzuckerberg.github.io/cryoet-data-portal",
"apply": "Apply",
Expand Down Expand Up @@ -45,6 +45,8 @@
"close": "Close",
"confidence": "confidence",
"configureDownload": "Configure Download",
"contributeCta": "We encourage you to share datasets and/or annotations to existing data. Click below to fill out the inquiry form.",
"contributeYourData": "Contribute your Data",
"cookiePolicy": "Cookie Policy",
"copy": " Copy",
"copyAndRunAwsS3Command": "Copy and run AWS S3 command in your terminal",
Expand All @@ -53,15 +55,16 @@
"curatorRecommended": "Curator Recommended",
"curlSetupLink": "https://everything.curl.dev/get",
"currentDirectory": "Current Directory (default)",
"landingPageWelcomeBlurb": "Welcome to the CryoET Data Portal, a project built by the <url to='$t(urlCZII)'>Chan Zuckerberg Imaging Institute</url> and the <url to='$t(urlCZ)'>Chan Zuckerberg Initiative</url>. ",
"dataAcquisitionSoftware": "Data Acquisition Software",
"dataset": "Dataset",
"datasetDetails": "Dataset Details",
"datasetId": "Dataset ID",
"datasetIds": "Dataset IDs",
"datasetMetadata": "Dataset Metadata",
"datasetTitle": "Dataset Title",
"datasets": "Datasets",
"datasetsTab": "Datasets {{count}}",
"datasetTitle": "Dataset Title",
"depositionDate": "Deposition Date",
"description": "Description",
"directDownload": "Direct Download",
Expand Down Expand Up @@ -95,8 +98,8 @@
"fundingAgency": "Funding Agency",
"github": "GitHub",
"goId": "GO ID",
"goToDocs": "Go to Documentation",
"good": "Good",
"goToDocs": "Go to Documentation",
"grantID": "Grant ID",
"gridPreparation": "Grid Preparation",
"groundTruth": "Ground Truth",
Expand All @@ -105,11 +108,13 @@
"groundTruthUsed": "Ground Truth Used",
"hardware": "Hardware",
"helpAndReport": "Help & Report",
"helpUsAchieveThisVision": "Help us achieve this vision",
"howToCite": "How to cite",
"ifYouEncounterIssuesWithDownloadTime": "If you encounter issues with download time, we recommend downloading larger files via API.",
"imageCorrector": "Image Corrector",
"includedContents": "Included Contents",
"keyPhoto": "key photo",
"landingHeaderTitle": "Open access to annotated cryoET tomograms",
"lastModified": "Last Modified: {{date}}",
"lastModifiedBlank": "Last Modified",
"license": "License",
Expand All @@ -121,11 +126,11 @@
"moderate": "Moderate",
"moreInfo": "More Info",
"mrcFormat": ".mrc format",
"nMoreObjects": "{{count}} More Objects",
"na": "NA",
"nameOrId": "Name/ID",
"napariPlugin": "napari Plugin",
"next": "Next",
"nMoreObjects": "{{count}} More Objects",
"no": "No",
"notApplicable": "Not Applicable",
"notSubmitted": "Not Submitted",
Expand All @@ -136,6 +141,7 @@
"objectShapeType": "Object Shape Type",
"objectState": "Object State",
"optional": "Optional",
"orExploreViaApi": "or explore via API",
"organism": "Organism",
"organismName": "Organism Name",
"otherSetup": "Other Setup",
Expand Down Expand Up @@ -178,12 +184,16 @@
"showLess": "Show Less",
"size": "Size",
"smallestAvailableVoxelSpacing": "Smallest Available Voxel Spacing",
"species": "Species",
"sphericalAberrationConstant": "Spherical Aberration Constant",
"stepCount": "Step {{count} of {max}}",
"submitFeedback": "Submit Feedback",
"tellUsMore": "Tell us More",
"terms": "Terms",
"termsOfUse": "Terms of Use",
"thankYouToOurDataContributors": "Thank You to our Data Contributors…",
"tiltAxis": "Tilt Axis",
"tiltingScheme": "Tilting Scheme",
"tiltQuality": "Tilt Quality",
"tiltRange": "Tilt Range",
"tiltRangeFilterDescription": "Angle is in degrees (°). Tilt range is the difference between the max tilt angle and the min tilt angle.",
Expand All @@ -194,27 +204,30 @@
"tiltSeriesMetadata": "Tilt-Series Metadata",
"tiltSeriesQualityScore": "Tilt-Series Quality Score",
"tiltStep": "Tilt Step",
"tiltingScheme": "Tilting Scheme",
"tissueName": "Tissue Name",
"title": "CryoET Data Portal",
"tomogram": "Tomogram",
"tomogramId": "Tomogram ID",
"tomogramMetadata": "Tomogram Metadata",
"tomogramProcessing": "Tomogram Processing",
"tomogramSampling": "Tomogram Sampling",
"tomograms": "Tomograms",
"tomogramSampling": "Tomogram Sampling",
"tools": "Tools",
"totalFlux": "Total Flux",
"true": "True",
"unitAngstrom": "{{value}}Å",
"unitDegree": "{{value}}°",
"unitMillimeter": "{{value}} mm",
"unitVolts": "{{value}} V",
"urlCZ": "https://chanzuckerberg.com/",
"urlCZII": "https://www.czimaginginstitute.org/",
"valueToValue": "{{value1} to {value2}}",
"veryPoor": "Very Poor",
"viaApi": "via API",
"viaAwsS3": "via AWS S3",
"viaCurl": "via cURL",
"viewAndDownloadDatasets": "View and Download Datasets",
"viewDatasetsCta": "Find and visualize cryoET datasets in the portal and download to use for your own work.",
"viewTomogram": "View Tomogram",
"voxelSpacingId": "Voxel Spacing ID",
"yes": "Yes",
Expand Down

0 comments on commit 4a22d63

Please sign in to comment.