Skip to content

Commit 5bd53d0

Browse files
authored
Merge branch 'main' into yash/ref-constructor-params
2 parents 9309120 + 46b2071 commit 5bd53d0

File tree

117 files changed

+4210
-412
lines changed

Some content is hidden

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

117 files changed

+4210
-412
lines changed

.github/workflows/issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, edited]
66

77
env:
8-
VALID_ISSUE_PREFIXES: "CNCT|DASH|PROT"
8+
VALID_ISSUE_PREFIXES: "CNCT|DASH|PROT|INSIGHT"
99

1010
jobs:
1111
linear:

apps/dashboard/.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,7 @@ NEXT_PUBLIC_TURNSTILE_SITE_KEY=""
9494
TURNSTILE_SECRET_KEY=""
9595
REDIS_URL=""
9696

97-
ANALYTICS_SERVICE_URL=""
97+
ANALYTICS_SERVICE_URL=""
98+
99+
# Required for Nebula Chat
100+
NEXT_PUBLIC_NEBULA_URL=""

apps/dashboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"color": "^4.2.3",
6161
"compare-versions": "^6.1.0",
6262
"date-fns": "4.1.0",
63+
"fetch-event-stream": "0.1.5",
6364
"flat": "^6.0.1",
6465
"framer-motion": "11.13.3",
6566
"fuse.js": "7.0.0",

apps/dashboard/src/@/api/team.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ import "server-only";
22
import { API_SERVER_URL } from "@/constants/env";
33
import { getAuthToken } from "../../app/api/lib/getAuthToken";
44

5+
type EnabledTeamScope =
6+
| "pay"
7+
| "storage"
8+
| "rpc"
9+
| "bundler"
10+
| "insight"
11+
| "embeddedWallets"
12+
| "relayer"
13+
| "chainsaw"
14+
| "nebula";
15+
516
export type Team = {
617
id: string;
718
name: string;
@@ -15,6 +26,7 @@ export type Team = {
1526
billingStatus: "validPayment" | (string & {}) | null;
1627
billingEmail: string | null;
1728
growthTrialEligible: boolean | null;
29+
enabledScopes: EnabledTeamScope[];
1830
};
1931

2032
export async function getTeamBySlug(slug: string) {

apps/dashboard/src/@/components/blocks/DangerSettingCard.stories.tsx

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,34 @@ export const Mobile: Story = {
2828

2929
function Story() {
3030
return (
31-
<div className="min-h-screen bg-background py-4 text-foreground">
32-
<div className="container flex max-w-[1000px] flex-col gap-8 lg:p-10">
33-
<BadgeContainer label="Base">
34-
<DangerSettingCard
35-
title="This is a title"
36-
description="This is a description"
37-
buttonLabel="Some Action"
38-
buttonOnClick={() => {}}
39-
isPending={false}
40-
confirmationDialog={{
41-
title: "This is confirmation title",
42-
description: "This is confirmation description",
43-
}}
44-
/>
45-
</BadgeContainer>
31+
<div className="container flex max-w-[1000px] flex-col gap-8 lg:p-10">
32+
<BadgeContainer label="Base">
33+
<DangerSettingCard
34+
title="This is a title"
35+
description="This is a description"
36+
buttonLabel="Some Action"
37+
buttonOnClick={() => {}}
38+
isPending={false}
39+
confirmationDialog={{
40+
title: "This is confirmation title",
41+
description: "This is confirmation description",
42+
}}
43+
/>
44+
</BadgeContainer>
4645

47-
<BadgeContainer label="Loading">
48-
<DangerSettingCard
49-
title="This is a title"
50-
description="This is a description"
51-
buttonLabel="Some Action"
52-
buttonOnClick={() => {}}
53-
isPending={true}
54-
confirmationDialog={{
55-
title: "This is confirmation title",
56-
description: "This is confirmation description",
57-
}}
58-
/>
59-
</BadgeContainer>
60-
</div>
46+
<BadgeContainer label="Loading">
47+
<DangerSettingCard
48+
title="This is a title"
49+
description="This is a description"
50+
buttonLabel="Some Action"
51+
buttonOnClick={() => {}}
52+
isPending={true}
53+
confirmationDialog={{
54+
title: "This is confirmation title",
55+
description: "This is confirmation description",
56+
}}
57+
/>
58+
</BadgeContainer>
6159
</div>
6260
);
6361
}

apps/dashboard/src/@/components/blocks/NetworkSelectors.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ export function MultiNetworkSelector(props: {
7272
onSelectedValuesChange={(chainIds) => {
7373
props.onChange(chainIds.map(Number));
7474
}}
75-
placeholder="Select Chains"
75+
placeholder={
76+
allChains.length === 0 ? "Loading Chains..." : "Select Chains"
77+
}
78+
disabled={allChains.length === 0}
7679
overrideSearchFn={searchFn}
7780
renderOption={renderOption}
7881
/>

apps/dashboard/src/@/components/blocks/multi-select.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(
5959
maxCount = Number.POSITIVE_INFINITY,
6060
className,
6161
selectedValues,
62+
overrideSearchFn,
63+
renderOption,
64+
searchPlaceholder,
6265
...props
6366
},
6467
ref,
@@ -105,8 +108,6 @@ export const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(
105108
// show 50 initially and then 20 more when reaching the end
106109
const { itemsToShow, lastItemRef } = useShowMore<HTMLButtonElement>(50, 20);
107110

108-
const { overrideSearchFn } = props;
109-
110111
const optionsToShow = useMemo(() => {
111112
const filteredOptions: {
112113
label: string;
@@ -152,7 +153,7 @@ export const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(
152153
}, [searchValue]);
153154

154155
return (
155-
<Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>
156+
<Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen} modal>
156157
<PopoverTrigger asChild>
157158
<Button
158159
ref={ref}
@@ -238,7 +239,7 @@ export const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(
238239
{/* Search */}
239240
<div className="relative">
240241
<Input
241-
placeholder={props.searchPlaceholder || "Search"}
242+
placeholder={searchPlaceholder || "Search"}
242243
value={searchValue}
243244
onChange={(e) => setSearchValue(e.target.value)}
244245
className="!h-auto rounded-b-none border-0 border-border border-b py-4 pl-10 focus-visible:ring-0 focus-visible:ring-offset-0"
@@ -285,9 +286,7 @@ export const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(
285286
</div>
286287

287288
<div className="min-w-0 grow">
288-
{props.renderOption
289-
? props.renderOption(option)
290-
: option.label}
289+
{renderOption ? renderOption(option) : option.label}
291290
</div>
292291
</Button>
293292
);

apps/dashboard/src/@/components/ui/ScrollShadow/ScrollShadow.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export function ScrollShadow(props: {
1111
scrollableClassName?: string;
1212
disableTopShadow?: boolean;
1313
shadowColor?: string;
14+
shadowClassName?: string;
1415
}) {
1516
const scrollableEl = useRef<HTMLDivElement>(null);
1617
const shadowTopEl = useRef<HTMLDivElement>(null);
@@ -94,29 +95,45 @@ export function ScrollShadow(props: {
9495
}
9596
>
9697
<div
97-
className={cn(styles.scrollShadowTop, styles.scrollShadowY)}
98+
className={cn(
99+
styles.scrollShadowTop,
100+
styles.scrollShadowY,
101+
props.shadowClassName,
102+
)}
98103
ref={shadowTopEl}
99104
style={{
100105
opacity: "0",
101106
display: props.disableTopShadow ? "none" : "block",
102107
}}
103108
/>
104109
<div
105-
className={cn(styles.scrollShadowBottom, styles.scrollShadowY)}
110+
className={cn(
111+
styles.scrollShadowBottom,
112+
styles.scrollShadowY,
113+
props.shadowClassName,
114+
)}
106115
ref={shadowBottomEl}
107116
style={{
108117
opacity: "0",
109118
}}
110119
/>
111120
<div
112-
className={cn(styles.scrollShadowLeft, styles.scrollShadowX)}
121+
className={cn(
122+
styles.scrollShadowLeft,
123+
styles.scrollShadowX,
124+
props.shadowClassName,
125+
)}
113126
ref={shadowLeftEl}
114127
style={{
115128
opacity: "0",
116129
}}
117130
/>
118131
<div
119-
className={cn(styles.scrollShadowRight, styles.scrollShadowX)}
132+
className={cn(
133+
styles.scrollShadowRight,
134+
styles.scrollShadowX,
135+
props.shadowClassName,
136+
)}
120137
ref={shadowRightEl}
121138
style={{
122139
opacity: "0",

apps/dashboard/src/@/components/ui/code/code.client.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type CodeProps = {
1212
scrollableClassName?: string;
1313
keepPreviousDataOnCodeChange?: boolean;
1414
copyButtonClassName?: string;
15+
ignoreFormattingErrors?: boolean;
1516
};
1617

1718
export const CodeClient: React.FC<CodeProps> = ({
@@ -21,10 +22,14 @@ export const CodeClient: React.FC<CodeProps> = ({
2122
scrollableClassName,
2223
keepPreviousDataOnCodeChange = false,
2324
copyButtonClassName,
25+
ignoreFormattingErrors,
2426
}) => {
2527
const codeQuery = useQuery({
2628
queryKey: ["html", code],
27-
queryFn: () => getCodeHtml(code, lang),
29+
queryFn: () =>
30+
getCodeHtml(code, lang, {
31+
ignoreFormattingErrors: ignoreFormattingErrors,
32+
}),
2833
placeholderData: keepPreviousDataOnCodeChange
2934
? keepPreviousData
3035
: undefined,

apps/dashboard/src/@/components/ui/code/getCodeHtml.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,28 @@ function isPrettierSupportedLang(lang: BundledLanguage) {
1616
);
1717
}
1818

19-
export async function getCodeHtml(code: string, lang: BundledLanguage) {
19+
export async function getCodeHtml(
20+
code: string,
21+
lang: BundledLanguage,
22+
options?: {
23+
ignoreFormattingErrors?: boolean;
24+
},
25+
) {
2026
const formattedCode = isPrettierSupportedLang(lang)
2127
? await format(code, {
2228
parser: "babel-ts",
2329
plugins: [parserBabel, estree],
2430
printWidth: 60,
2531
}).catch((e) => {
26-
console.error(e);
27-
console.error("Failed to format code");
32+
if (!options?.ignoreFormattingErrors) {
33+
console.error(e);
34+
console.error("Failed to format code");
35+
console.log({
36+
code,
37+
lang,
38+
});
39+
}
40+
2841
return code;
2942
})
3043
: code;

0 commit comments

Comments
 (0)