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

kishor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit f5c081035d52dcc2c13f4d68459446032f743c91
Author: Brijesh Bhalala <brijeshbhalala2...@gmail.com>
AuthorDate: Tue Jun 20 17:00:45 2023 +0530

    RANGER-4292: Long zone names are not showing perfectly in the zone search 
dropdown of service manager
    
    Signed-off-by: Kishor Gollapalliwar <kishor.gollapalli...@gmail.com>
---
 .../react-webapp/src/views/ServiceManager/ServiceDefinitions.jsx  | 8 +++++++-
 .../src/main/webapp/react-webapp/src/views/SideBar/TopNavBar.jsx  | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinitions.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinitions.jsx
index 05934e447..db2710bb9 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinitions.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinitions.jsx
@@ -297,7 +297,11 @@ class ServiceDefinitions extends Component {
       }
     };
   };
-
+  formatOptionLabel = ({ label }) => (
+    <div title={label} className="text-truncate">
+      {label}
+    </div>
+  );
   render() {
     const {
       filterServiceDefs,
@@ -326,6 +330,7 @@ class ServiceDefinitions extends Component {
         paddingTop: "0px"
       })
     };
+
     return (
       <React.Fragment>
         <div>
@@ -366,6 +371,7 @@ class ServiceDefinitions extends Component {
                         }
                   }
                   //isDisabled={true}
+                  formatOptionLabel={this.formatOptionLabel}
                   isDisabled={isEmpty(zones) ? true : false}
                   onChange={this.getSelectedZone}
                   isClearable
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/SideBar/TopNavBar.jsx 
b/security-admin/src/main/webapp/react-webapp/src/views/SideBar/TopNavBar.jsx
index 29b7c1ce9..1833d219b 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/SideBar/TopNavBar.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/SideBar/TopNavBar.jsx
@@ -199,7 +199,11 @@ export const TopNavBar = (props) => {
       );
     }
   };
-
+  const formatOptionLabel = ({ label }) => (
+    <div title={label} className="text-truncate">
+      {label}
+    </div>
+  );
   return (
     <nav className="navbar navbar-expand-lg navbar-light bg-light 
content-top-nav">
       <div className="top-nav-title-wrapper">
@@ -216,6 +220,7 @@ export const TopNavBar = (props) => {
             localStorageZoneDetails != null ? zoneServicesData : 
allServicesData
           )} */
           options={getServices(allServicesData)}
+          formatOptionLabel={formatOptionLabel}
           onChange={(e) => handleServiceChange(e)}
           value={!policyLoader ? getCurrentService(serviceData) : ""}
           menuPlacement="auto"
@@ -232,6 +237,7 @@ export const TopNavBar = (props) => {
               options={getZones(allZonesData)}
               onChange={(e) => handleZoneChange(e)}
               value={!policyLoader ? getCurrentZone(currentServiceZone) : ""}
+              formatOptionLabel={formatOptionLabel}
               menuPlacement="auto"
               placeholder="Select Zone Name"
               isClearable

Reply via email to