Skip to content
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@chakra-ui/react": "^3.31.0",
"@emotion/react": "^11.14.0",
"@tanstack/react-query": "^5.90.19",
"@types/semver": "^7.7.1",
"axios": "^1.13.2",
"next-themes": "^0.4.6",
"react": "^19.2.3",
Expand All @@ -43,6 +44,7 @@
"react-icons": "^5.5.0",
"react-router-dom": "^7.12.0",
"react-timeago": "^8.3.0",
"semver": "^7.7.3",
"use-debounce": "^10.1.0"
},
"devDependencies": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
* under the License.
*/
import { Center, Flex } from "@chakra-ui/react";
import axios from "axios";
import { useQuery } from "@tanstack/react-query";
import { useRef, type ReactNode } from "react";
import { NavLink } from "react-router-dom";

import { useContainerWidth } from "src/utils";
import { lte } from "semver";

type Props = {
readonly tabs: Array<{ icon?: ReactNode; label: string; value: string }>;
Expand All @@ -30,10 +33,29 @@ export const NavTabs = ({ tabs }: Props) => {
const containerRef = useRef<HTMLDivElement>(null);
const containerWidth = useContainerWidth(containerRef);

const { data } = useQuery<{version: string, git_version: string | null}>({
queryFn: async () => {
const res = await axios.get("/api/v2/version");
return res.data;
},
queryKey: ["appVersion"],
});

let legacyRouterNavigation: boolean | undefined = undefined;

if (data) {
const airflowCoreVersion = data.version;
if (lte(airflowCoreVersion, "3.1.6")) {
legacyRouterNavigation = true;
} else {
legacyRouterNavigation = false;
}
}

return (
<Flex alignItems="center" borderBottomWidth={1} mb={2} ref={containerRef}>
{tabs.map(({ icon, label, value }) => (
<NavLink end key={value} title={label} to={value}>
{legacyRouterNavigation !== undefined ? tabs.map(({ icon, label, value }) => (
<NavLink end key={value} title={label} to={legacyRouterNavigation ? value : `../${value}`} relative={legacyRouterNavigation ? "route" : "path"}>
{({ isActive }) => (
<Center
borderBottomColor="border.info"
Expand All @@ -50,7 +72,7 @@ export const NavTabs = ({ tabs }: Props) => {
</Center>
)}
</NavLink>
))}
)): undefined}
</Flex>
);
};
2 changes: 1 addition & 1 deletion providers/edge3/www-hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4368fe2c5258f6cf92c4b9e3df47e23e9b6db199d2b3b1643d6f679708d51302
10cb23ea3b5d740866aa436e75bb44e68501ef5aebb30836d924282414777792