github-advanced-security[bot] commented on code in PR #31590:
URL: https://github.com/apache/superset/pull/31590#discussion_r2040732054


##########
superset-frontend/src/features/home/Menu.tsx:
##########
@@ -257,6 +255,43 @@
       </StyledSubMenu>
     );
   };
+  const renderBrand = () => {
+    let link;
+    if (theme.brandLogoUrl) {
+      let style = { padding: '0px', margin: '0px' } as React.CSSProperties;
+      if (theme.brandLogoHeight) {
+        style = { ...style, height: theme.brandLogoHeight, minHeight: '0px' };
+      }
+      if (theme.brandLogoMargin) {
+        style = { ...style, margin: theme.brandLogoMargin };
+      }
+      link = (
+        <a href={theme.brandLogoHref} className="navbar-brand" style={style}>
+          <img
+            src={theme.brandLogoUrl}
+            alt={theme.brandLogoAlt || 'Apache Superset'}
+          />
+        </a>
+      );
+    } else if (isFrontendRoute(window.location.pathname)) {
+      // 
---------------------------------------------------------------------------------
+      // TODO: deprecate this once Theme is fully rolled out
+      // Kept as is for backwards compatibility with the old theme system / 
superset_config.py
+      link = (
+        <GenericLink className="navbar-brand" to={brand.path}>
+          <img src={assetUrl(brand.icon)} alt={brand.alt} />
+        </GenericLink>
+      );
+    } else {
+      link = (
+        <a className="navbar-brand" href={brand.path} tabIndex={-1}>

Review Comment:
   ## DOM text reinterpreted as HTML
   
   [DOM text](1) is reinterpreted as HTML without escaping meta-characters.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2010)



##########
superset-frontend/src/features/home/Menu.tsx:
##########
@@ -257,6 +255,43 @@
       </StyledSubMenu>
     );
   };
+  const renderBrand = () => {
+    let link;
+    if (theme.brandLogoUrl) {
+      let style = { padding: '0px', margin: '0px' } as React.CSSProperties;
+      if (theme.brandLogoHeight) {
+        style = { ...style, height: theme.brandLogoHeight, minHeight: '0px' };
+      }
+      if (theme.brandLogoMargin) {
+        style = { ...style, margin: theme.brandLogoMargin };
+      }
+      link = (
+        <a href={theme.brandLogoHref} className="navbar-brand" style={style}>
+          <img
+            src={theme.brandLogoUrl}
+            alt={theme.brandLogoAlt || 'Apache Superset'}
+          />
+        </a>
+      );
+    } else if (isFrontendRoute(window.location.pathname)) {
+      // 
---------------------------------------------------------------------------------
+      // TODO: deprecate this once Theme is fully rolled out
+      // Kept as is for backwards compatibility with the old theme system / 
superset_config.py
+      link = (
+        <GenericLink className="navbar-brand" to={brand.path}>
+          <img src={assetUrl(brand.icon)} alt={brand.alt} />

Review Comment:
   ## DOM text reinterpreted as HTML
   
   [DOM text](1) is reinterpreted as HTML without escaping meta-characters.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2009)



##########
superset-frontend/src/features/home/Menu.tsx:
##########
@@ -257,6 +255,43 @@
       </StyledSubMenu>
     );
   };
+  const renderBrand = () => {
+    let link;
+    if (theme.brandLogoUrl) {
+      let style = { padding: '0px', margin: '0px' } as React.CSSProperties;
+      if (theme.brandLogoHeight) {
+        style = { ...style, height: theme.brandLogoHeight, minHeight: '0px' };
+      }
+      if (theme.brandLogoMargin) {
+        style = { ...style, margin: theme.brandLogoMargin };
+      }
+      link = (
+        <a href={theme.brandLogoHref} className="navbar-brand" style={style}>
+          <img
+            src={theme.brandLogoUrl}
+            alt={theme.brandLogoAlt || 'Apache Superset'}
+          />
+        </a>
+      );
+    } else if (isFrontendRoute(window.location.pathname)) {
+      // 
---------------------------------------------------------------------------------
+      // TODO: deprecate this once Theme is fully rolled out
+      // Kept as is for backwards compatibility with the old theme system / 
superset_config.py
+      link = (
+        <GenericLink className="navbar-brand" to={brand.path}>
+          <img src={assetUrl(brand.icon)} alt={brand.alt} />
+        </GenericLink>
+      );
+    } else {
+      link = (
+        <a className="navbar-brand" href={brand.path} tabIndex={-1}>
+          <img src={assetUrl(brand.icon)} alt={brand.alt} />

Review Comment:
   ## DOM text reinterpreted as HTML
   
   [DOM text](1) is reinterpreted as HTML without escaping meta-characters.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2011)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to