This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 763dee5ac22 Fix version check for RC versions (#61318)
763dee5ac22 is described below

commit 763dee5ac2203e5e0ca8ec8c44eb3166c011085e
Author: Ajay9704 <[email protected]>
AuthorDate: Thu Feb 12 02:30:48 2026 +0530

    Fix version check for RC versions (#61318)
    
    * fix version check
    
    * chnaged typescript
    
    * Update NavTabs.tsx
    
    * generated
    
    * suggestions followed
    
    * fix static
    
    * fix static
    
    * fix static
    
    * Update NavTabs.tsx
    
    * addressed suggestions
    
    * assets restored
    
    * correctly handled tests
    
    * fix: rebuild assets and update www-hash.txt
---
 .../providers/edge3/plugins/www/dist/main.umd.cjs  | 14 ++++----
 .../edge3/plugins/www/src/layouts/NavTabs.tsx      | 10 ++----
 .../providers/edge3/plugins/www/src/utils/index.ts |  1 +
 .../plugins/www/src/utils/versionUtils.test.ts     | 42 ++++++++++++++++++++++
 .../www/src/utils/{index.ts => versionUtils.ts}    | 14 ++++++--
 providers/edge3/www-hash.txt                       |  2 +-
 6 files changed, 65 insertions(+), 18 deletions(-)

diff --git 
a/providers/edge3/src/airflow/providers/edge3/plugins/www/dist/main.umd.cjs 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/dist/main.umd.cjs
index 6686460995e..95e24421378 100644
--- a/providers/edge3/src/airflow/providers/edge3/plugins/www/dist/main.umd.cjs
+++ b/providers/edge3/src/airflow/providers/edge3/plugins/www/dist/main.umd.cjs
@@ -1,14 +1,14 @@
-(function(f,w){typeof exports=="object"&&typeof 
module<"u"?module.exports=w(require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("react-dom")):typeof
 
define=="function"&&define.amd?define(["react/jsx-runtime","react","react-router-dom","react-dom"],w):(f=typeof
 
globalThis<"u"?globalThis:f||self,f.AirflowPlugin=w(f.ReactJSXRuntime,f.React,f.ReactRouterDOM,f.ReactDOM))})(this,(function(f,w,ut,Co){"use
 strict";function x0(e){const t=Object.create(null,{[Symbol.t [...]
+(function(f,w){typeof exports=="object"&&typeof 
module<"u"?module.exports=w(require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("react-dom")):typeof
 
define=="function"&&define.amd?define(["react/jsx-runtime","react","react-router-dom","react-dom"],w):(f=typeof
 
globalThis<"u"?globalThis:f||self,f.AirflowPlugin=w(f.ReactJSXRuntime,f.React,f.ReactRouterDOM,f.ReactDOM))})(this,(function(f,w,ut,Co){"use
 strict";function E0(e){const t=Object.create(null,{[Symbol.t [...]
       <svg width="46" height="15" style="left: -15.5px; position: absolute; 
top: 0; filter: drop-shadow(rgba(0, 0, 0, 0.4) 0px 1px 1.1px);">
         <g transform="translate(2 3)">
           <path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 
31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z" style="stroke-width: 2px; stroke: 
white;"></path>
           <path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 
31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z"></path>
         </g>
-      </svg>`,r.body.appendChild(n)},$w=(e,t={})=>new 
Intl.NumberFormat(e,t),Mw=(e,t={})=>new 
ff(e,t),Wa=(e,t)=>{const{prop:r,computed:n}=t;return 
r("formatOptions")?e===""?Number.NaN:n("parser").parse(e):parseFloat(e)},wr=(e,t)=>{const{prop:r,computed:n}=t;return
 
Number.isNaN(e)?"":r("formatOptions")?n("formatter").format(e):e.toString()},Ww=(e,t)=>{let
 r=e!==void 0&&!Number.isNaN(e)?e:1;return t?.style==="percent"&&(e===void 
0||Number.isNaN(e))&&(r=.01),r},{choose:Bw,guards:Hw,createMa [...]
+      </svg>`,r.body.appendChild(n)},Mw=(e,t={})=>new 
Intl.NumberFormat(e,t),Ww=(e,t={})=>new 
ff(e,t),Wa=(e,t)=>{const{prop:r,computed:n}=t;return 
r("formatOptions")?e===""?Number.NaN:n("parser").parse(e):parseFloat(e)},wr=(e,t)=>{const{prop:r,computed:n}=t;return
 
Number.isNaN(e)?"":r("formatOptions")?n("formatter").format(e):e.toString()},Bw=(e,t)=>{let
 r=e!==void 0&&!Number.isNaN(e)?e:1;return t?.style==="percent"&&(e===void 
0||Number.isNaN(e))&&(r=.01),r},{choose:Hw,guards:jw,createMa [...]
 )+\\(\\s*max(-device)?-${e}`,"i"),min:new 
RegExp(`\\(\\s*min(-device)?-${e}`,"i"),maxMin:new 
RegExp(`(!?\\(\\s*max(-device)?-${e})(.|
-)+\\(\\s*min(-device)?-${e}`,"i"),max:new 
RegExp(`\\(\\s*max(-device)?-${e}`,"i")}),mI=Eg("width"),vI=Eg("height"),Sg=e=>({isMin:Tg(e.minMax,e.maxMin,e.min),isMax:Tg(e.maxMin,e.minMax,e.max)}),{isMin:ol,isMax:Cg}=Sg(mI),{isMin:il,isMax:wg}=Sg(vI),kg=/print/i,Ig=/^print$/i,bI=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/,yI=/(\d)/,io=Number.MAX_VALUE,xI={ch:8.8984375,em:16,rem:16,ex:8.296875,px:1};function
 Og(e){const t=bI.exec(e)||(ol(e)||il(e)?yI.exec(e):null);if(!t)return 
io;if(t[0]==="0")return 0; [...]
-`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&pR[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+",
 "+n:n)}),t},Em=Symbol("internals");function mo(e){return 
e&&String(e).trim().toLowerCase()}function Yi(e){return 
e===!1||e==null?e:R.isArray(e)?e.map(Yi):String(e)}function vR(e){const 
t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let 
n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const bR=e=>/ [...]
-`)}getSetCookie(){return 
this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static
 from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const 
n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const 
n=(this[Em]=this[Em]={accessors:{}}).accessors,o=this.prototype;function 
i(s){const a=mo(s);n[a]||(xR(o,s),n[a]=!0)}return 
R.isArray(t)?t.forEach(i):i(t),this}};Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-A
 [...]
+)+\\(\\s*min(-device)?-${e}`,"i"),max:new 
RegExp(`\\(\\s*max(-device)?-${e}`,"i")}),vI=Eg("width"),bI=Eg("height"),Sg=e=>({isMin:Tg(e.minMax,e.maxMin,e.min),isMax:Tg(e.maxMin,e.minMax,e.max)}),{isMin:ol,isMax:Cg}=Sg(vI),{isMin:il,isMax:wg}=Sg(bI),kg=/print/i,Ig=/^print$/i,yI=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/,xI=/(\d)/,io=Number.MAX_VALUE,EI={ch:8.8984375,em:16,rem:16,ex:8.296875,px:1};function
 Og(e){const t=yI.exec(e)||(ol(e)||il(e)?xI.exec(e):null);if(!t)return 
io;if(t[0]==="0")return 0; [...]
+`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&mR[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+",
 "+n:n)}),t},Em=Symbol("internals");function mo(e){return 
e&&String(e).trim().toLowerCase()}function Yi(e){return 
e===!1||e==null?e:R.isArray(e)?e.map(Yi):String(e)}function bR(e){const 
t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let 
n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const yR=e=>/ [...]
+`)}getSetCookie(){return 
this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static
 from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const 
n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const 
n=(this[Em]=this[Em]={accessors:{}}).accessors,o=this.prototype;function 
i(s){const a=mo(s);n[a]||(ER(o,s),n[a]=!0)}return 
R.isArray(t)?t.forEach(i):i(t),this}};Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-A
 [...]
 `+s.map(Lm).join(`
-`):" "+Lm(s[0]):"as no adapter specified";throw new Y("There is no suitable 
adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const 
Fm={getAdapter:DR,adapters:Fl};function 
Dl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw
 new vo(null,e)}function Dm(e){return 
Dl(e),e.headers=Ze.from(e.headers),e.data=Ll.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded"
 [...]
-`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof 
t=="string"?(r=r||{},r.url=t):r=t||{},r=Ur(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void
 
0&&es.assertOptions(n,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean),legacyInterceptorReqResOrdering:ct.transitional(ct.boolean)},!1),o!=null&&(R.isFunction(o)?r.paramsSerializer={serialize:o}:es.assertOptions(o,{encode:ct.
 [...]
+`):" "+Lm(s[0]):"as no adapter specified";throw new Y("There is no suitable 
adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const 
Fm={getAdapter:zR,adapters:Fl};function 
Dl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw
 new vo(null,e)}function Dm(e){return 
Dl(e),e.headers=Ze.from(e.headers),e.data=Ll.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded"
 [...]
+`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof 
t=="string"?(r=r||{},r.url=t):r=t||{},r=Ur(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void
 
0&&es.assertOptions(n,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean),legacyInterceptorReqResOrdering:ct.transitional(ct.boolean)},!1),o!=null&&(R.isFunction(o)?r.paramsSerializer={serialize:o}:es.assertOptions(o,{encode:ct.
 [...]
diff --git 
a/providers/edge3/src/airflow/providers/edge3/plugins/www/src/layouts/NavTabs.tsx
 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/layouts/NavTabs.tsx
index 0d8e4efe010..070ad2a2643 100644
--- 
a/providers/edge3/src/airflow/providers/edge3/plugins/www/src/layouts/NavTabs.tsx
+++ 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/layouts/NavTabs.tsx
@@ -22,8 +22,7 @@ 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";
+import { getLegacyRouterNavigation, useContainerWidth } from "src/utils";
 
 type Props = {
   readonly tabs: Array<{ icon?: ReactNode; label: string; value: string }>;
@@ -44,12 +43,7 @@ export const NavTabs = ({ tabs }: Props) => {
   let legacyRouterNavigation: boolean | undefined = undefined;
 
   if (data) {
-    const airflowCoreVersion = data.version;
-    if (lte(airflowCoreVersion, "3.1.6")) {
-      legacyRouterNavigation = true;
-    } else {
-     legacyRouterNavigation = false;
-    }
+    legacyRouterNavigation = getLegacyRouterNavigation(data.version);
   }
 
   return (
diff --git 
a/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/index.ts 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/index.ts
index 05f62c605e6..bb2a9d1d7b1 100644
--- a/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/index.ts
+++ b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/index.ts
@@ -19,3 +19,4 @@
 
 export { autoRefreshInterval } from "./config";
 export { useContainerWidth } from "./useContainerWidth";
+export { getLegacyRouterNavigation } from "./versionUtils";
diff --git 
a/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/versionUtils.test.ts
 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/versionUtils.test.ts
new file mode 100644
index 00000000000..356817e961e
--- /dev/null
+++ 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/versionUtils.test.ts
@@ -0,0 +1,42 @@
+
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { getLegacyRouterNavigation } from "src/utils/versionUtils";
+import { describe, expect, it } from "vitest";
+
+describe("getLegacyRouterNavigation", () => {
+  it("returns true for versions <= 3.1.6", () => {
+    expect(getLegacyRouterNavigation("3.1.6")).toBe(true);
+    expect(getLegacyRouterNavigation("3.1.5")).toBe(true);
+    expect(getLegacyRouterNavigation("3.0.0")).toBe(true);
+  });
+
+  it("returns false for versions > 3.1.6", () => {
+    expect(getLegacyRouterNavigation("3.1.7")).toBe(false);
+    expect(getLegacyRouterNavigation("3.1.7rc1")).toBe(false);
+    expect(getLegacyRouterNavigation("3.2.0")).toBe(false);
+    expect(getLegacyRouterNavigation("4.0.0")).toBe(false);
+  });
+
+  it("returns undefined for invalid versions", () => {
+    expect(getLegacyRouterNavigation("invalid")).toBe(undefined);
+    expect(getLegacyRouterNavigation("")).toBe(undefined);
+  });
+});
diff --git 
a/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/index.ts 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/versionUtils.ts
similarity index 71%
copy from 
providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/index.ts
copy to 
providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/versionUtils.ts
index 05f62c605e6..56ee74f865a 100644
--- a/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/index.ts
+++ 
b/providers/edge3/src/airflow/providers/edge3/plugins/www/src/utils/versionUtils.ts
@@ -1,3 +1,4 @@
+
 /*!
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,5 +18,14 @@
  * under the License.
  */
 
-export { autoRefreshInterval } from "./config";
-export { useContainerWidth } from "./useContainerWidth";
+import { coerce, lte } from "semver";
+
+export const getLegacyRouterNavigation = (version: string): boolean | 
undefined => {
+  const coercedVersion = coerce(version);
+  const airflowCoreVersion = coercedVersion?.version ?? null;
+
+  if (airflowCoreVersion) {
+    return lte(airflowCoreVersion, "3.1.6");
+  }
+  return undefined;
+};
diff --git a/providers/edge3/www-hash.txt b/providers/edge3/www-hash.txt
index d43695179c3..cca1060a92e 100644
--- a/providers/edge3/www-hash.txt
+++ b/providers/edge3/www-hash.txt
@@ -1 +1 @@
-94785f1784e07613622a92efb89c8462c814f73c1c8add12af2404ecd88e4820
+19f521c1d0e6f65e70c05c45650ec710e5301922f9e18079529284c007cda3b9

Reply via email to