Skip to content

Commit c22dc18

Browse files
fix(frontend,workflow): address Copilot review comments on PR #218
- Create-Release..yml: drop misleading ref override on push trigger (github.event.workflow_run.head_sha is empty on push events; let actions/checkout default to the pushed SHA) - batchView.tsx: register SQL language for the Light SyntaxHighlighter so getFileLanguageAndType()='sql' renders correctly - modernizationPage.tsx: register SQL language for the Light SyntaxHighlighter so translated SQL is highlighted instead of potentially erroring on the unregistered language - processPage.tsx: fix comment typo (missing space before hyphen) - package.json: declare highlight.js as a direct dependency since the Light highlighter imports highlight.js/lib/languages/* directly; pinned to ^10.7.3 to match the version already resolved transitively via react-syntax-highlighter Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7361f42 commit c22dc18

6 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/Create-Release..yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v6
18-
with:
19-
ref: ${{ github.event.workflow_run.head_sha }}
2018

2119
- uses: codfish/semantic-release-action@v5
2220
id: semantic

src/frontend/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"axios": "^1.15.0",
2626
"class-variance-authority": "^0.7.1",
2727
"clsx": "^2.1.1",
28+
"highlight.js": "^10.7.3",
2829
"js-yaml": "^4.1.1",
2930
"lottie-react": "^2.4.1",
3031
"lucide-react": "^1.7.0",

src/frontend/src/pages/batchView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { Light as SyntaxHighlighter } from "react-syntax-highlighter"
2828
import yamlLang from "highlight.js/lib/languages/yaml"
2929
import markdownLang from "highlight.js/lib/languages/markdown"
3030
import jsonLang from "highlight.js/lib/languages/json"
31+
import sqlLang from "highlight.js/lib/languages/sql"
3132
import { vs } from "react-syntax-highlighter/dist/esm/styles/hljs"
3233
import ReactMarkdown from "react-markdown"
3334
import remarkGfm from "remark-gfm"
@@ -45,6 +46,7 @@ const unwrap = (mod: any) => (typeof mod === "function" ? mod : mod.default);
4546
SyntaxHighlighter.registerLanguage("yaml", unwrap(yamlLang))
4647
SyntaxHighlighter.registerLanguage("markdown", unwrap(markdownLang))
4748
SyntaxHighlighter.registerLanguage("json", unwrap(jsonLang))
49+
SyntaxHighlighter.registerLanguage("sql", unwrap(sqlLang))
4850

4951

5052

src/frontend/src/pages/modernizationPage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ import {
2626
ArrowDownload24Regular,
2727
} from "@fluentui/react-icons"
2828
import { Light as SyntaxHighlighter } from "react-syntax-highlighter"
29+
import sqlLang from "highlight.js/lib/languages/sql"
2930
import { vs } from "react-syntax-highlighter/dist/esm/styles/hljs"
31+
32+
const unwrapHljs = (mod: any) => (typeof mod === "function" ? mod : mod.default);
33+
SyntaxHighlighter.registerLanguage("sql", unwrapHljs(sqlLang))
3034
import { useNavigate, useParams } from "react-router-dom"
3135
import { useState, useEffect, useCallback, useRef } from "react"
3236
import { getApiUrl, headerBuilder } from '../api/config';

src/frontend/src/pages/processPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const ProcessPage: React.FC = () => {
132132
details: '',
133133
});
134134

135-
// Helper function to clean phase name- removes "PHASE X - " prefix
135+
// Helper function to clean phase name - removes "PHASE X - " prefix
136136
const cleanPhaseName = (phase: string): string => {
137137
if (!phase) return "";
138138
// Remove "PHASE X - " prefix (e.g., "PHASE 3 - SOURCE PLATFORM REVIEW" -> "SOURCE PLATFORM REVIEW")

0 commit comments

Comments
 (0)