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

jbonofre pushed a commit to branch ui
in repository https://gitbox.apache.org/repos/asf/polaris-tools.git


The following commit(s) were added to refs/heads/ui by this push:
     new a58aed1  Update catalog routing
a58aed1 is described below

commit a58aed1b25f05dc95cb2145188fc004634173c11
Author: JB Onofré <[email protected]>
AuthorDate: Mon Oct 27 19:05:51 2025 +0100

    Update catalog routing
---
 ui/src/catalog.tsx   | 9 +++++++--
 ui/src/workspace.tsx | 6 +++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/ui/src/catalog.tsx b/ui/src/catalog.tsx
index 9ec4866..0b394ae 100644
--- a/ui/src/catalog.tsx
+++ b/ui/src/catalog.tsx
@@ -17,6 +17,7 @@
  * under the License.
 */
 import { useState, useEffect } from 'react';
+import { useParams } from 'react-router';
 import { Link } from 'react-router-dom';
 import { Breadcrumb, Card, Form, Input, Select, Tabs, Collapse, Divider, 
Button, Space, message } from 'antd';
 import { HomeOutlined, ApartmentOutlined, AmazonOutlined, GoogleOutlined, 
CloudOutlined, FileSyncOutlined, SaveOutlined, PauseCircleOutlined } from 
'@ant-design/icons';
@@ -145,13 +146,14 @@ function StorageConfig() {
 
 export default function Catalog(props) {
 
-    const [ catalogName, setCatalogName ] = useState();
     const [ catalogDetail, setCatalogDetail ] = useState();
 
     const bearer = 'Bearer ' + props.token;
 
     const [ catalogForm ] = Form.useForm();
 
+    let { catalogName } = useParams();
+
     const onFinish = (values) => {
         const request = {
           'catalog': {
@@ -209,7 +211,10 @@ export default function Catalog(props) {
                 }
                 return response.json();
             })
-            .then((data) => setCatalogDetail(data))
+            .then((data) => {
+                console.log(data);
+                setCatalogDetail(data);
+            })
             .catch((error) => {
                 message.error('An error occurred: ' + error.message);
                 console.error(error);
diff --git a/ui/src/workspace.tsx b/ui/src/workspace.tsx
index 911f7c3..e23ac64 100644
--- a/ui/src/workspace.tsx
+++ b/ui/src/workspace.tsx
@@ -32,9 +32,10 @@ function SideMenu(props) {
     const[ collapsed, setCollapsed ] = useState(false);
 
     const catalogElementsMenu = props.catalogs.map((element) => {
+        const link = "/catalog/" + element.name;
         return({
            key: element.name,
-           label: element.name,
+           label: <Link to={link}>{element.name}</Link>,
            icon: <ApartmentOutlined/>
         });
     });
@@ -142,6 +143,9 @@ export default function Workspace(props) {
                         <Route path="/catalog/create" key="catalog-create" 
exact={true}>
                             <Catalog token={props.token} 
fetchCatalogs={fetchCatalogs} />
                         </Route>
+                        <Route path="/catalog/:catalogName" key="catalog">
+                            <Catalog token={props.token} 
fetchCataalogs={fetchCatalogs} />
+                        </Route>
                         <Route path="/settings" key="settings" exect={true}>
                             <Settings realm={realm} realmHeader={realmHeader} 
setRealm={setRealm} setRealmHeader={setRealmHeader} />
                         </Route>

Reply via email to