Skip to content

Commit e061b8b

Browse files
h4rklSatoshi-Shwaldruupi
authored
feat: Support external databricks dashboard (#1460)
* Added data to the developer navigation * Added developers/data page with databricks dashboard iframe * Registered databricks to content-security-policy * Add support for external databricks dashboard * feat: integrate Databricks dashboard with environment configuration and error handling * feat: enhance Databricks dashboard with color scheme support and improved layout * feat: add time series chart component and Databricks API integration - Implemented TimeSeriesChart component for visualizing time series data with interactive features. - Created API route for fetching data from Databricks, including error handling and response formatting. - Developed server-side functions to manage Databricks configuration and data retrieval. - Added utility functions for date and value formatting to enhance data presentation. * feat: update styling and layout for Solana Data Dashboard and Time Series Chart components * feat: update provider colors and refactor dashboard controls for improved UI * feat: enhance Databricks integration with caching and configuration updates * feat: add responsive provider controls and custom hook for media query handling * Refactor code structure for improved readability and maintainability * Update Databricks turbo env vars * feat: improve value domain calculation in getValueDomain function * style: update InlineControl button styles for improved UI consistency * feat(data-dashboard): add Solana data dashboard with metrics and charts - Updated theme provider to include new data routes. - Modified URL configuration to handle new data route. - Created data configuration file for managing metrics and providers. - Implemented data dashboard page with loading states and metadata generation. - Developed Solana data dashboard component with dynamic charts and KPIs. - Added time series chart component for visualizing metrics over time. - Included utility functions for formatting values and handling tooltips. * fix: address Databricks dashboard review items * feat(data-dashboard): enhance DeFi metrics and update dashboard descriptions * feat(data-dashboard): refactor dashboard controls and enhance query state management * feat: migrate data to web and add i18n * fix: update InlineControl styles for improved visual consistency * fix(header): handle undefined router paths in pathname calculation * fix(header): remove unnecessary conditions for showing secondary developers nav * feat: implement developer route utilities and update navigation logic * fix(developer-routes): remove redundant route checks for developers nav and theme routes * feat: enhance SolanaDataDashboard with tab switching functionality and improved accessibility * feat(i18n): add locale handling functions and corresponding tests * feat(chart): add dashed patterns for coincident series and implement corresponding tests * feat(time-series-chart): add select/deselect all functionality and update legend messages * feat(dashboard): enhance provider selection with select/deselect all functionality and improve footer labels * feat: update dashboard and data handling with new metrics, improved caching, and enhanced UI elements * fix: adjust layout and styling in KpiCell component for improved alignment * fix: adjust line height in KpiCell component for better readability * fix: update provider colors and SQL query to use production database * feat: add clarification text for dashboard tabs in localization * feat: add compareTooltipValues function and integrate sorting in tooltip display * Refactor code structure for improved readability and maintainability * fix: adjust padding in DataResourceCarousel section for better layout * feat: normalize provider names and enhance data dashboard functionality with new features and improved localization * feat: enhance footer layout and add metadata items for improved user experience * feat: add DeFiLlama to stablecoin count providers and enhance chart provider tests * fix: simplify Content-Security-Policy by removing unnecessary frame ancestors * Add new background images for SDP solutions - Added feat-bg-1.webp, feat-bg-2.webp, and feat-bg-3.webp to enhance the visual appeal of the SDP solutions section. * refactor: remove deprecated data redirects from middleware and rewrites * fix: simplify pathname normalization by using getPathnameWithoutLocale utility --------- Co-authored-by: satoshi-sh <satoss1108@gmail.com> Co-authored-by: waddahAldrobi <aldrobiwaddah@gmail.com>
1 parent 12cfb37 commit e061b8b

51 files changed

Lines changed: 6276 additions & 1666 deletions

Some content is hidden

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

apps/docs/next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const securityHeaders: Array<{ key: string; value: string }> = [
1919
},
2020
{
2121
key: "Content-Security-Policy",
22-
value: "frame-ancestors 'self'",
22+
value: `frame-ancestors 'self'`,
2323
},
2424
];
2525

apps/media/content/posts/money-gram-joins-solana-developer-platform.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: MoneyGram Joins Solana Developer Platform
33
status: published
4-
heroImage: /uploads/posts/money-gram-joins-solana-developer-platform/heroImage.png
4+
heroImage: /uploads/posts/money-gram-joins-solana-developer-platform/heroImage.webp
55
description: >-
66
MoneyGram joins Solana Developer Platform as an infrastructure partner and
77
validator, advancing blockchain-powered global payments with compliant,
Binary file not shown.
41.2 KB
Loading

apps/web/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ TXTX_SURFNET_URL=
2828
NEXT_PUBLIC_MEDIA_APP_URL=
2929
# Breakpoint app URL
3030
NEXT_PUBLIC_BREAKPOINT_APP_URL=
31+
32+
# Databricks SQL data route
33+
DATABRICKS_SERVER_HOSTNAME=<databricks-workspace-hostname>
34+
DATABRICKS_HTTP_PATH=/sql/1.0/warehouses/<warehouse-id>
35+
DATABRICKS_TOKEN=

apps/web/next.config.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import type { Redirect, Rewrite } from "next/dist/lib/load-custom-routes";
66
import withBundleAnalyzer from "@next/bundle-analyzer";
77
import { withSentryConfig } from "@sentry/nextjs";
88

9+
const frameAncestors = ["'self'", ...getDatabricksFrameAncestors()];
10+
911
const securityHeaders: Array<{ key: string; value: string }> = [
1012
{
1113
key: "X-Frame-Options",
@@ -21,10 +23,49 @@ const securityHeaders: Array<{ key: string; value: string }> = [
2123
},
2224
{
2325
key: "Content-Security-Policy",
24-
value: "frame-ancestors 'self'",
26+
value: `frame-ancestors ${frameAncestors.join(" ")}`,
2527
},
2628
];
2729

30+
function getDatabricksFrameAncestors() {
31+
const hostname = normalizeDatabricksHostname(
32+
process.env.DATABRICKS_SERVER_HOSTNAME,
33+
);
34+
35+
return hostname ? [`https://${hostname}`] : [];
36+
}
37+
38+
function normalizeDatabricksHostname(value?: string) {
39+
const rawValue = value?.trim();
40+
41+
if (!rawValue || isPlaceholderValue(rawValue)) {
42+
return undefined;
43+
}
44+
45+
try {
46+
const url =
47+
rawValue.startsWith("http://") || rawValue.startsWith("https://")
48+
? new URL(rawValue)
49+
: new URL(`https://${rawValue}`);
50+
const hostname = url.hostname;
51+
52+
return hostname.endsWith(".cloud.databricks.com") ? hostname : undefined;
53+
} catch {
54+
return undefined;
55+
}
56+
}
57+
58+
function isPlaceholderValue(value: string) {
59+
const lowerValue = value.toLowerCase();
60+
61+
return (
62+
value.startsWith("<") ||
63+
lowerValue.startsWith("your_") ||
64+
lowerValue === "changeme" ||
65+
lowerValue === "todo"
66+
);
67+
}
68+
2869
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "preview") {
2970
securityHeaders.push({
3071
key: "X-Robots-Tag",
@@ -37,6 +78,7 @@ const nextConfig: NextConfig = {
3778
productionBrowserSourceMaps: false,
3879
trailingSlash: false,
3980
transpilePackages: ["gsap"],
81+
serverExternalPackages: ["@databricks/sql", "lz4"],
4082

4183
async rewrites() {
4284
const baseRewrites = rewritesAndRedirectsJson.rewrites as {

apps/web/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"url": "https://github.com/solana-foundation/solana-com"
99
},
1010
"dependencies": {
11+
"@databricks/sql": "^1.15.0",
1112
"@inkeep/cxkit-react": "^0.5.117",
1213
"@mdx-js/react": "^3.1.1",
1314
"@radix-ui/react-accordion": "^1.2.12",
@@ -28,6 +29,14 @@
2829
"@typeform/embed": "^5.1.0",
2930
"@vercel/og": "^0.8.6",
3031
"@vercel/related-projects": "^1.0.1",
32+
"@visx/axis": "3.12.0",
33+
"@visx/event": "3.12.0",
34+
"@visx/grid": "3.12.0",
35+
"@visx/group": "3.12.0",
36+
"@visx/responsive": "3.12.0",
37+
"@visx/scale": "3.12.0",
38+
"@visx/shape": "3.12.0",
39+
"@visx/tooltip": "3.12.0",
3140
"@workspace/ecosystem-data": "workspace:*",
3241
"@workspace/i18n": "workspace:*",
3342
"@workspace/sentry": "workspace:*",
8.21 KB
Loading
-105 KB
Binary file not shown.
19.2 KB
Loading

0 commit comments

Comments
 (0)