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 787711a  Update settings view
787711a is described below

commit 787711a34a23d3cab333f74533a23de6f0a39e56
Author: JB Onofré <[email protected]>
AuthorDate: Mon Oct 27 18:04:38 2025 +0100

    Update settings view
---
 ui/src/settings.tsx  | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 ui/src/workspace.tsx |  2 +-
 2 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/ui/src/settings.tsx b/ui/src/settings.tsx
new file mode 100644
index 0000000..0796f7f
--- /dev/null
+++ b/ui/src/settings.tsx
@@ -0,0 +1,63 @@
+/**
+ * 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 { Link } from 'react-router-dom';
+import { Breadcrumb, Card, Form, Input, Space, Button, message } from 'antd';
+import { HomeOutlined, SettingOutlined, SaveOutlined, PauseCircleOutlined } 
from '@ant-design/icons';
+
+export default function Settings(props) {
+
+    const initialValues = {
+        realmHeader: props.realmHeader,
+        realm: props.realm
+    };
+
+    const [ settingsForm ] = Form.useForm();
+
+    const onFinish = (values) => {
+        props.setRealmHeader(values.realmHeader);
+        props.setRealm(values.realm);
+        message.info('Settings updated');
+    };
+
+    return(
+        <>
+        <Breadcrumb items={[ { title: <Link to="/"><HomeOutlined/></Link> }, { 
title: <SettingOutlined/> } ]} />
+        <Card title="Settings" style={{ width: '100%' }}>
+            <Form name="settings" form={settingsForm} labelCol={{ span: 8 }}
+                wrapperCol={{ span: 16 }}
+                style={{ style: '100%' }}
+                initialValues={initialValues} onFinish={onFinish}>
+                <Form.Item name="realmHeader" label="Realm Header" rules={[{ 
required: true, message: 'The Realm Header is required' }]}>
+                    <Input allowClear={true} />
+                </Form.Item>
+                <Form.Item name="realm" label="Realm" rules={[{ required: 
true, message: 'The Realm is required' }]}>
+                    <Input allowClear={true} />
+                </Form.Item>
+                <Form.Item label={null}>
+                    <Space>
+                        <Button type="primary" icon={<SaveOutlined/>} 
onClick={() => settingsForm.submit()}>Save</Button>
+                        <Button icon={<PauseCircleOutlined/>} onClick={() => 
settingsForm.resetFields()}>Cancel</Button>
+                    </Space>
+                </Form.Item>
+            </Form>
+        </Card>
+        </>
+    );
+
+}
\ No newline at end of file
diff --git a/ui/src/workspace.tsx b/ui/src/workspace.tsx
index 69a3e60..911f7c3 100644
--- a/ui/src/workspace.tsx
+++ b/ui/src/workspace.tsx
@@ -143,7 +143,7 @@ export default function Workspace(props) {
                             <Catalog token={props.token} 
fetchCatalogs={fetchCatalogs} />
                         </Route>
                         <Route path="/settings" key="settings" exect={true}>
-                            <Settings realm={realm} realmHeader={realmHeader} 
/>
+                            <Settings realm={realm} realmHeader={realmHeader} 
setRealm={setRealm} setRealmHeader={setRealmHeader} />
                         </Route>
                     </Switch>
                 </Layout.Content>

Reply via email to