Skip to content

Commit c4b0f62

Browse files
committed
Merge remote-tracking branch 'upstream/main' into production
2 parents 759aab8 + 73577ae commit c4b0f62

File tree

231 files changed

+534056
-127895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+534056
-127895
lines changed

.linkmllint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
extends: recommended
22
rules:
33
standard_naming:
4-
permissible_values_upper_case: true
4+
level: disabled

app/apis/catalog/brc-analytics-catalog/common/entities.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MDXRemoteSerializeResult } from "next-mdx-remote";
2-
import { WorkflowUrlParameter } from "../../../../utils/galaxy-api/entities";
32
import {
43
ORGANISM_PLOIDY,
54
OUTBREAK_PRIORITY,
65
OUTBREAK_RESOURCE_TYPE,
76
WORKFLOW_PARAMETER_VARIABLE,
87
WORKFLOW_PLOIDY,
8+
WorkflowUrlSpec,
99
} from "./schema-entities";
1010

1111
export type BRCCatalog =
@@ -123,8 +123,16 @@ export interface Workflow {
123123
workflowName: string;
124124
}
125125

126+
export interface WorkflowDataRequirements {
127+
description?: string;
128+
library_layout?: string;
129+
library_source?: string[];
130+
library_strategy?: string[];
131+
}
132+
126133
export interface WorkflowParameter {
134+
data_requirements?: WorkflowDataRequirements;
127135
key: string;
128-
url_spec?: WorkflowUrlParameter;
136+
url_spec?: WorkflowUrlSpec;
129137
variable?: WORKFLOW_PARAMETER_VARIABLE;
130138
}

app/apis/catalog/brc-analytics-catalog/common/schema-entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export {
44
OutbreakResourceType as OUTBREAK_RESOURCE_TYPE,
55
WorkflowParameterVariable as WORKFLOW_PARAMETER_VARIABLE,
66
WorkflowPloidy as WORKFLOW_PLOIDY,
7+
type WorkflowUrlSpec,
78
} from "../../../../../catalog/schema/generated/schema";
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import { SectionContent } from "../../../content/content.styles";
2+
import styled from "@emotion/styled";
3+
import { css } from "@emotion/react";
4+
import { PALETTE } from "@databiosphere/findable-ui/lib/styles/common/constants/palette";
5+
import { FONT } from "@databiosphere/findable-ui/lib/styles/common/constants/font";
6+
7+
interface Props {
8+
offset: number;
9+
}
10+
11+
const heading = ({ offset }: Props) => css`
12+
h1,
13+
h2,
14+
h3,
15+
h4,
16+
h5,
17+
h6 {
18+
&:hover {
19+
a {
20+
opacity: 1;
21+
}
22+
}
23+
}
24+
25+
h1 {
26+
font: ${FONT.HEADING_LARGE};
27+
margin: 0 0 8px;
28+
scroll-margin-top: ${offset + 24}px;
29+
}
30+
31+
h2 {
32+
font: ${FONT.HEADING};
33+
margin: 32px 0 16px;
34+
scroll-margin-top: ${offset + 32}px;
35+
}
36+
37+
h3 {
38+
font: ${FONT.HEADING_SMALL};
39+
margin: 32px 0 16px;
40+
scroll-margin-top: ${offset + 32}px;
41+
}
42+
43+
h4 {
44+
font: ${FONT.BODY_LARGE_500};
45+
margin: 24px 0 16px;
46+
scroll-margin-top: ${offset + 24}px;
47+
}
48+
`;
49+
50+
const iframe = css`
51+
iframe {
52+
aspect-ratio: 16/ 9;
53+
border: none;
54+
display: block;
55+
height: auto;
56+
margin: 16px 0;
57+
width: 100%;
58+
}
59+
`;
60+
61+
const image = css`
62+
img {
63+
border: 1px solid ${PALETTE.SMOKE_MAIN};
64+
border-radius: 6px;
65+
margin: 16px 0;
66+
max-width: 100%;
67+
}
68+
69+
figure {
70+
figcaption {
71+
margin-top: 24px;
72+
}
73+
img {
74+
margin: 0;
75+
}
76+
}
77+
`;
78+
79+
const muiAlert = css`
80+
.MuiAlert-root {
81+
margin: 24px 0;
82+
padding: 24px;
83+
84+
.MuiAlert-icon {
85+
padding: 4px 0;
86+
}
87+
88+
.MuiAlert-message {
89+
font: ${FONT.BODY_LARGE_400_2_LINES};
90+
gap: 16px;
91+
92+
.MuiAlertTitle-root {
93+
font: ${FONT.HEADING_SMALL};
94+
}
95+
}
96+
}
97+
`;
98+
99+
// See https://github.com/emotion-js/emotion/issues/1105.
100+
// See https://github.com/emotion-js/emotion/releases/tag/%40emotion%2Fcache%4011.10.2.
101+
const ignoreSsrWarning =
102+
"/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */";
103+
export const StyledSectionContent = styled(SectionContent, {
104+
shouldForwardProp: (prop) => prop !== "offset",
105+
})<Props>`
106+
margin-top: 0;
107+
min-width: 0;
108+
109+
${heading}
110+
${iframe}
111+
${image}
112+
${muiAlert}
113+
114+
> *:first-child:not(style) ${ignoreSsrWarning} {
115+
margin-top: 0;
116+
}
117+
`;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { ReactNode } from "react";
2+
import { StyledSectionContent } from "./content.styles";
3+
import { useLayoutDimensions } from "@databiosphere/findable-ui/lib/providers/layoutDimensions/hook";
4+
5+
export interface ContentProps {
6+
children: ReactNode | ReactNode[];
7+
}
8+
9+
export const Content = ({ children }: ContentProps): JSX.Element => {
10+
const { dimensions } = useLayoutDimensions();
11+
return (
12+
<StyledSectionContent offset={dimensions.header.height}>
13+
{children}
14+
</StyledSectionContent>
15+
);
16+
};
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import {
2+
OutlineGrid,
3+
Positioner,
4+
} from "@databiosphere/findable-ui/lib/components/Layout/components/ContentLayout/contentLayout.styles";
5+
import {
6+
bpDownSm,
7+
bpUp1366,
8+
} from "@databiosphere/findable-ui/lib/styles/common/mixins/breakpoints";
9+
import styled from "@emotion/styled";
10+
import { sectionLayout } from "../../../Layout/components/AppLayout/components/Section/section.styles";
11+
import { ContentLayout } from "@databiosphere/findable-ui/lib/components/Layout/components/ContentLayout/contentLayout.styles";
12+
import {
13+
CONTENT_TYPE,
14+
FrontmatterProps,
15+
} from "../../../../docs/common/frontmatter/types";
16+
import { css } from "@emotion/react";
17+
import { Content } from "@databiosphere/findable-ui/lib/components/Layout/components/ContentLayout/contentLayout.styles";
18+
import { Outline } from "@databiosphere/findable-ui/lib/components/Layout/components/ContentLayout/contentLayout.styles";
19+
20+
export const PADDING_Y = 64;
21+
22+
export const StyledContentLayout = styled(ContentLayout, {
23+
shouldForwardProp: (propName) =>
24+
propName !== "contentType" &&
25+
propName !== "hasNavigation" &&
26+
propName !== "panelColor",
27+
})<Pick<FrontmatterProps, "contentType">>`
28+
${(props) =>
29+
props.contentType !== CONTENT_TYPE.ARTICLE &&
30+
css`
31+
${bpUp1366(props)} {
32+
grid-template-areas: "content";
33+
grid-template-columns: 1fr;
34+
}
35+
36+
${props.theme.breakpoints.up(1728)} {
37+
grid-template-areas: "navigation content outline";
38+
grid-template-columns: 280px 1fr 280px;
39+
}
40+
`}
41+
`;
42+
43+
export const StyledContent = styled(Content, {
44+
shouldForwardProp: (propName) => propName !== "contentType",
45+
})<Pick<FrontmatterProps, "contentType">>`
46+
${(props) =>
47+
props.contentType !== CONTENT_TYPE.ARTICLE &&
48+
css`
49+
${sectionLayout}
50+
padding: ${PADDING_Y}px 16px;
51+
`}
52+
53+
${(props) =>
54+
props.contentType === CONTENT_TYPE.ARTICLE &&
55+
css`
56+
padding: ${PADDING_Y}px 40px;
57+
`}
58+
59+
${bpDownSm} {
60+
padding: ${PADDING_Y}px 16px;
61+
}
62+
`;
63+
64+
export const StyledOutlineGrid = styled(OutlineGrid, {
65+
shouldForwardProp: (propName) =>
66+
propName !== "contentType" &&
67+
propName !== "headerHeight" &&
68+
propName !== "panelColor",
69+
})<Pick<FrontmatterProps, "contentType">>`
70+
${(props) =>
71+
props.contentType !== CONTENT_TYPE.ARTICLE &&
72+
css`
73+
${bpUp1366(props)} {
74+
display: none;
75+
}
76+
77+
${props.theme.breakpoints.up(1728)} {
78+
display: block;
79+
}
80+
`}
81+
`;
82+
83+
export const StyledPositioner = styled(Positioner)`
84+
top: 24px;
85+
`;
86+
87+
export const StyledOutline = styled(Outline)`
88+
padding: ${PADDING_Y}px 0;
89+
`;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { PANEL_BACKGROUND_COLOR } from "@databiosphere/findable-ui/lib/components/Layout/components/ContentLayout/common/entities";
2+
import { ContentViewProps } from "@databiosphere/findable-ui/lib/views/ContentView/contentView";
3+
import {
4+
StyledContent,
5+
StyledOutline,
6+
StyledContentLayout,
7+
StyledOutlineGrid,
8+
StyledPositioner,
9+
} from "./sectionContent.styles";
10+
import { StaticProps } from "../../../../docs/common/staticGeneration/types";
11+
import { Section } from "../../../../components/content/content.styles";
12+
import { ContentGrid } from "@databiosphere/findable-ui/lib/components/Layout/components/ContentLayout/contentLayout.styles";
13+
14+
export const SectionContent = ({
15+
content,
16+
frontmatter,
17+
outline,
18+
slug,
19+
}: Omit<StaticProps, "mdxSource" | "outline"> &
20+
Pick<ContentViewProps, "content" | "outline">): JSX.Element => {
21+
const { contentType } = frontmatter || {};
22+
return (
23+
<Section border>
24+
<StyledContentLayout
25+
contentType={contentType}
26+
hasNavigation={false}
27+
panelColor={PANEL_BACKGROUND_COLOR.DEFAULT}
28+
>
29+
<ContentGrid
30+
headerHeight={0}
31+
panelColor={PANEL_BACKGROUND_COLOR.DEFAULT}
32+
>
33+
<StyledContent contentType={contentType}>{content}</StyledContent>
34+
</ContentGrid>
35+
{outline && (
36+
<StyledOutlineGrid
37+
key={slug.join("")}
38+
contentType={contentType}
39+
headerHeight={0}
40+
panelColor={PANEL_BACKGROUND_COLOR.DEFAULT}
41+
>
42+
<StyledPositioner headerHeight={0}>
43+
<StyledOutline>{outline}</StyledOutline>
44+
</StyledPositioner>
45+
</StyledOutlineGrid>
46+
)}
47+
</StyledContentLayout>
48+
</Section>
49+
);
50+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import styled from "@emotion/styled";
2+
import { PADDING_Y as SECTION_PADDING_Y } from "../../../SectionContent/sectionContent.styles";
3+
import { PADDING_Y_BOTTOM as HERO_SECTION_PADDING_Y_BOTTOM } from "../../sectionHero.styles";
4+
5+
const PADDING_Y = 56;
6+
7+
const MARGIN_TOP =
8+
SECTION_PADDING_Y + HERO_SECTION_PADDING_Y_BOTTOM - 40 + PADDING_Y; // 40px is design space between the hero image and the section content
9+
10+
export const StyledImage = styled("img")`
11+
&& {
12+
margin: -${MARGIN_TOP}px 0 0 0;
13+
padding: ${PADDING_Y}px 0;
14+
position: relative;
15+
width: 100%;
16+
z-index: 2;
17+
18+
+ h1,
19+
+ h2,
20+
+ h3,
21+
+ h4,
22+
+ h5,
23+
+ h6 {
24+
margin-top: 0;
25+
}
26+
}
27+
`;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { FrontmatterProps } from "../../../../../../docs/common/frontmatter/types";
2+
import { StyledImage } from "./heroImage.styles";
3+
4+
export const HeroImage = ({
5+
heroImage,
6+
}: Pick<FrontmatterProps, "heroImage">): JSX.Element | null => {
7+
if (!heroImage) return null;
8+
return <StyledImage {...heroImage} />;
9+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import styled from "@emotion/styled";
2+
import { SectionHero } from "../../../Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero";
3+
import {
4+
Head,
5+
SectionLayout,
6+
} from "../../../Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.styles";
7+
import {
8+
CONTENT_TYPE,
9+
FrontmatterProps,
10+
} from "../../../../docs/common/frontmatter/types";
11+
import { css } from "@emotion/react";
12+
13+
export const PADDING_Y_BOTTOM = 90;
14+
15+
export const StyledSectionHero = styled(SectionHero, {
16+
shouldForwardProp: (prop) => prop !== "contentType",
17+
})<Pick<FrontmatterProps, "contentType">>`
18+
${SectionLayout} {
19+
min-height: unset;
20+
padding: 56px 16px 72px;
21+
}
22+
23+
${(props) =>
24+
props.contentType === CONTENT_TYPE.ARTICLE &&
25+
css`
26+
${SectionLayout} {
27+
max-width: 756px;
28+
padding: 80px 16px ${PADDING_Y_BOTTOM}px;
29+
}
30+
31+
${Head} {
32+
font-family: "Inter", sans-serif;
33+
font-size: 32px;
34+
font-weight: 500;
35+
letter-spacing: normal;
36+
line-height: 40px;
37+
}
38+
`}
39+
`;

0 commit comments

Comments
 (0)