Skip to content

Commit b25ff8f

Browse files
Merge branch 'main' into lint_workflow
2 parents 5d55a64 + e666fbc commit b25ff8f

File tree

9 files changed

+41
-220
lines changed

9 files changed

+41
-220
lines changed

website/src/common/Navbar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ const navItems: NavItem[] = [
4545
{ to: "/status", title: "Status" },
4646
{ to: "/daily", title: "Daily" },
4747
{ to: "/compare", title: "Compare" },
48-
{ to: "/search", title: "Search" },
49-
{ to: "/macro", title: "Macro" },
5048
{ to: "/fk", title: "Foreign Keys" },
5149
{ to: "/pr", title: "PR" },
5250
{ to: "/history", title: "History" },

website/src/hooks/useModal.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

website/src/pages/ForeignKeysPage/ForeignKeysPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const formatTitle = (gitRef: string, vitessRefs: VitessRefs): string => {
4545
export default function ForeignKeys() {
4646
const urlParams = new URLSearchParams(window.location.search);
4747

48-
const [gitRef, setGitRef] = useState<string>(urlParams.get("tag") || "");
48+
const [gitRef, setGitRef] = useState<string>(urlParams.get("sha") || "");
4949
const [workload, setWorkload] = useState<{ old: string; new: string }>({
5050
old: urlParams.get("oldWorkload") || "",
5151
new: urlParams.get("newWorkload") || "",
@@ -71,7 +71,7 @@ export default function ForeignKeys() {
7171

7272
useEffect(() => {
7373
navigate(
74-
`?tag=${gitRef}&oldWorkload=${workload.old}&newWorkload=${workload.new}`,
74+
`?sha=${gitRef}&oldWorkload=${workload.old}&newWorkload=${workload.new}`
7575
);
7676
}, [gitRef, workload.old, workload.new]);
7777

website/src/pages/HomePage/components/HeroMobile.tsx

Lines changed: 0 additions & 89 deletions
This file was deleted.

website/src/pages/Layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ limitations under the License.
1616

1717
import CompareActionsWrapper from "@/common/CompareActionsWrapper";
1818
import Footer from "@/common/Footer";
19-
import Modal from "@/common/Modal";
2019
import Navbar from "@/common/Navbar";
2120
import { ThemeProvider } from "@/components/theme-provider";
2221
import { CompareProvider } from "@/contexts/CompareContext";
@@ -34,7 +33,6 @@ export default function Layout() {
3433
</div>
3534
<Footer />
3635
</div>
37-
<Modal />
3836
</CompareProvider>
3937
</ThemeProvider>
4038
);

website/src/pages/PRPage/PRPage.tsx

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,29 +110,40 @@ export default function PRPage() {
110110
<div className="grid w-full items-center gap-4">
111111
<div className="flex flex-col gap-3">
112112
<Label className="md:text-xl font-semibold">Base</Label>
113-
<Link
114-
target="_blank"
115-
to={`https://github.com/vitessio/vitess/commit/${prData?.Base}`}
116-
>
117-
<p className="text-xs md:text-lg text-primary">
118-
{prData?.Base}
119-
</p>
120-
</Link>
113+
{prData?.Base ? (
114+
<Link
115+
target="_blank"
116+
to={`https://github.com/vitessio/vitess/commit/${prData?.Base}`}
117+
>
118+
<p className="text-xs md:text-lg text-primary">
119+
{prData?.Base}
120+
</p>
121+
</Link>
122+
) : (
123+
<p className="text-xs md:text-lg text-red-500">No base</p>
124+
)}
121125
<Separator />
122126
<Label className="md:text-xl font-semibold">Head</Label>
123-
<Link
124-
target="_blank"
125-
to={`https://github.com/vitessio/vitess/commit/${prData?.Head}`}
126-
>
127-
<p className="text-xs md:text-lg text-primary">
128-
{prData?.Head}
129-
</p>
130-
</Link>{" "}
127+
{prData?.Head ? (
128+
<Link
129+
target="_blank"
130+
to={`https://github.com/vitessio/vitess/commit/${prData?.Head}`}
131+
>
132+
<p className="text-xs md:text-lg text-primary">
133+
{prData?.Head}
134+
</p>
135+
</Link>
136+
) : (
137+
<p className="text-xs md:text-lg text-red-500">No head</p>
138+
)}
131139
</div>
132140
</div>
133141
</CardContent>
134142
<CardFooter className="flex justify-end">
135-
<Button className="p-4 md:p-8">
143+
<Button
144+
className="p-4 md:p-8"
145+
disabled={!prData?.Base || !prData?.Head}
146+
>
136147
<Link
137148
to={`/compare?old=${prData?.Base}&new=${prData?.Head}`}
138149
className="text-lg"

website/src/pages/PublicRoute.tsx

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,19 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import React from "react";
18-
import { Routes, Route } from "react-router-dom";
17+
import { Route, Routes } from "react-router-dom";
1918

20-
import Error from "../utils/Error";
21-
import Layout from "../pages/Layout";
22-
import MacroPage from "./MacroPage/MacroPage";
19+
import Layout from "@/pages/Layout";
20+
import Error from "@/utils/Error";
2321
import ComparePage from "./ComparePage/ComparePage";
24-
import PRsPage from "./PRsPage/PRsPage";
25-
import HomePage from "./HomePage/HomePage";
26-
import StatusPage from "./StatusPage/StatusPage";
2722
import DailyPage from "./DailyPage/DailyPage";
28-
import SearchPage from "./SearchPage/SearchPage";
29-
import PRPage from "./PRPage/PRPage";
30-
import MacroQueriesComparePage from "./MacroQueriesComparePage/MacroQueriesComparePage";
31-
import MicroPage from "./MicroPage/MicroPage";
3223
import ForeignKeysPage from "./ForeignKeysPage/ForeignKeysPage";
3324
import HistoryPage from "./HistoryPage/HistoryPage";
25+
import HomePage from "./HomePage/HomePage";
26+
import MacroQueriesComparePage from "./MacroQueriesComparePage/MacroQueriesComparePage";
27+
import PRPage from "./PRPage/PRPage";
28+
import PRsPage from "./PRsPage/PRsPage";
29+
import StatusPage from "./StatusPage/StatusPage";
3430

3531
const PublicRoute = () => {
3632
return (
@@ -41,14 +37,8 @@ const PublicRoute = () => {
4137
<Route path="/home" element={<HomePage />} />
4238
<Route path="/status" element={<StatusPage />} />
4339
<Route path="/Daily" element={<DailyPage />} />
44-
<Route path="/search" element={<SearchPage />} />
4540
<Route path="/compare" element={<ComparePage />} />
46-
<Route path="/macro" element={<MacroPage />} />
47-
<Route
48-
path="/macrobench/queries/compare"
49-
element={<MacroQueriesComparePage />}
50-
/>
51-
<Route path="/micro" element={<MicroPage />} />
41+
<Route path="/macrobench/queries/compare" element={<MacroQueriesComparePage />} />
5242
<Route path="/pr" element={<PRsPage />} />
5343
<Route path="/pr/:pull_nb" element={<PRPage />} />
5444
<Route path="/fk" element={<ForeignKeysPage />} />

website/src/utils/Error.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import React from "react";
18-
import { Link } from "react-router-dom";
19-
import ErrorImage from "../assets/error.png";
2017
import { Button } from "@/components/ui/button";
18+
import { Link } from "react-router-dom";
19+
import ErrorImage from "@/assets/error.png";
2120

2221
const Error = () => {
2322
return (

website/src/utils/Utils.tsx

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,6 @@ limitations under the License.
1717
import { CompareData, CompareResult, MacroBenchmarkTableData } from "@/types";
1818
import bytes from "bytes";
1919

20-
// BACKGROUND STATUS
21-
export const getStatusClass = (status) => {
22-
if (status != "finished" && status != "failed" && status != "started") {
23-
return "default";
24-
}
25-
return status;
26-
};
27-
28-
// FORMATDATE
29-
export const formatDate = (date) => {
30-
if (!date || date === 0) return null;
31-
32-
date = new Date(date);
33-
const year = date.getFullYear();
34-
const month = String(date.getMonth() + 1).padStart(2, "0");
35-
const day = String(date.getDate()).padStart(2, "0");
36-
const hours = String(date.getHours()).padStart(2, "0");
37-
const minutes = String(date.getMinutes()).padStart(2, "0");
38-
39-
return `${month}/${day}/${year} ${hours}:${minutes}`;
40-
};
41-
4220
//FORMATTING BYTES TO Bytes
4321
export const formatByte = (byte: number) => {
4422
const byteValue = bytes(byte);
@@ -73,40 +51,6 @@ export const errorApi: string =
7351
export const openDropDownValue = 1000;
7452
export const closeDropDownValue = 58;
7553

76-
// OPEN DROP DOWN
77-
78-
export const openDropDown = (currentValue, setOpenDropDown) => {
79-
if (currentValue === closeDropDownValue) {
80-
setOpenDropDown(openDropDownValue);
81-
} else {
82-
setOpenDropDown(closeDropDownValue);
83-
}
84-
};
85-
86-
// CHANGE VALUE DROPDOWN
87-
88-
export const valueDropDown = (
89-
ref,
90-
setDropDown,
91-
setCommitHash,
92-
setOpenDropDown,
93-
setChangeUrl,
94-
) => {
95-
setDropDown(ref.Name);
96-
setCommitHash(ref.CommitHash);
97-
setOpenDropDown(closeDropDownValue);
98-
};
99-
100-
// updateCommitHash: This function updates the value of CommitHash based on the provided Git reference and JSON data.
101-
export const updateCommitHash = (gitRef, setCommitHash, jsonDataRefs) => {
102-
const obj = jsonDataRefs.find((item) => item.Name === gitRef);
103-
setCommitHash(obj ? obj.CommitHash : null);
104-
};
105-
106-
////THE NUMBER OF PIXELS THAT ARE USED TO OPEN AND CLOSE THE PREVIOUS EXECUTIONS AND MICROBENCH TABLES
107-
export const openTables = 400;
108-
export const closeTables = 70;
109-
11054
export function formatGitRef(gitRef: string): string {
11155
return gitRef.slice(0, 8);
11256
}

0 commit comments

Comments
 (0)