Skip to content

chore: bump the react group across 2 directories with 2 updates #14895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
2 changes: 1 addition & 1 deletion offlinedocs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@types/lodash": "4.14.196",
"@types/node": "20.14.8",
"@types/react": "18.3.3",
"@types/react": "18.3.10",
"@types/react-dom": "18.3.0",
"eslint": "8.57.0",
"eslint-config-next": "14.2.13",
Expand Down
409 changes: 202 additions & 207 deletions offlinedocs/pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@
"@types/jest": "29.5.12",
"@types/lodash": "4.17.9",
"@types/node": "20.14.8",
"@types/react": "18.2.6",
"@types/react": "18.3.10",
"@types/react-color": "3.0.6",
"@types/react-date-range": "1.4.4",
"@types/react-dom": "18.2.4",
"@types/react-dom": "18.3.0",
"@types/react-syntax-highlighter": "15.5.13",
"@types/react-virtualized-auto-sizer": "1.0.4",
"@types/react-window": "1.8.8",
Expand Down
441 changes: 222 additions & 219 deletions site/pnpm-lock.yaml

Large diffs are not rendered by default.

30 changes: 20 additions & 10 deletions site/src/modules/resources/ResourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CopyableValue } from "components/CopyableValue/CopyableValue";
import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
import { MemoizedInlineMarkdown } from "components/Markdown/Markdown";
import { Stack } from "components/Stack/Stack";
import { Children, type FC, type PropsWithChildren, useState } from "react";
import { Children, type FC, useState } from "react";
import { ResourceAvatar } from "./ResourceAvatar";
import { SensitiveValue } from "./SensitiveValue";

Expand Down Expand Up @@ -75,14 +75,6 @@ export interface ResourceCardProps {
agentRow: (agent: WorkspaceAgent) => JSX.Element;
}

const p: FC<PropsWithChildren> = ({ children }) => {
const childrens = Children.toArray(children);
if (childrens.every((child) => typeof child === "string")) {
return <CopyableValue value={childrens.join("")}>{children}</CopyableValue>;
}
return <>{children}</>;
};

export const ResourceCard: FC<ResourceCardProps> = ({ resource, agentRow }) => {
const [shouldDisplayAllMetadata, setShouldDisplayAllMetadata] =
useState(false);
Expand Down Expand Up @@ -146,7 +138,25 @@ export const ResourceCard: FC<ResourceCardProps> = ({ resource, agentRow }) => {
{meta.sensitive ? (
<SensitiveValue value={meta.value} />
) : (
<MemoizedInlineMarkdown components={{ p }}>
<MemoizedInlineMarkdown
components={{
p: ({ children }) => {
const childrens = Children.toArray(children);
if (
childrens.every(
(child) => typeof child === "string",
)
) {
return (
<CopyableValue value={childrens.join("")}>
{children}
</CopyableValue>
);
}
return <>{children}</>;
},
}}
>
{meta.value}
</MemoizedInlineMarkdown>
)}
Expand Down
37 changes: 20 additions & 17 deletions site/src/pages/WorkspacePage/ResourceMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import type { WorkspaceResource } from "api/typesGenerated";
import { CopyableValue } from "components/CopyableValue/CopyableValue";
import { MemoizedInlineMarkdown } from "components/Markdown/Markdown";
import { SensitiveValue } from "modules/resources/SensitiveValue";
import {
Children,
type FC,
type HTMLAttributes,
type PropsWithChildren,
} from "react";
import { Children, type FC, type HTMLAttributes } from "react";

type ResourceMetadataProps = Omit<HTMLAttributes<HTMLElement>, "resource"> & {
resource: WorkspaceResource;
Expand Down Expand Up @@ -41,7 +36,25 @@ export const ResourceMetadata: FC<ResourceMetadataProps> = ({
{meta.sensitive ? (
<SensitiveValue value={meta.value} />
) : (
<MemoizedInlineMarkdown components={{ p: MetaValue }}>
<MemoizedInlineMarkdown
components={{
p: ({ children }) => {
const childrenArray = Children.toArray(children);
if (
childrenArray.every(
(child) => typeof child === "string",
)
) {
return (
<CopyableValue value={childrenArray.join("")}>
{children}
</CopyableValue>
);
}
return <>{children}</>;
},
}}
>
{meta.value}
</MemoizedInlineMarkdown>
)}
Expand All @@ -54,16 +67,6 @@ export const ResourceMetadata: FC<ResourceMetadataProps> = ({
);
};

const MetaValue: FC<PropsWithChildren> = ({ children }) => {
const childrenArray = Children.toArray(children);
if (childrenArray.every((child) => typeof child === "string")) {
return (
<CopyableValue value={childrenArray.join("")}>{children}</CopyableValue>
);
}
return <>{children}</>;
};

const styles = {
root: (theme) => ({
padding: 24,
Expand Down
Loading