zhangmo8 commented on code in PR #115: URL: https://github.com/apache/incubator-paimon-webui/pull/115#discussion_r1421419574
########## paimon-web-ui-new/src/layouts/content/components/sidebar/index.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 { defineComponent, ref, type PropType } from 'vue' +import { useRouter } from 'vue-router' +import type { Router } from 'vue-router' + +const Sidebar = defineComponent({ + name: 'Sidebar', + props: { + sideMenuOptions: { + type: Array as PropType<any>, Review Comment: ```suggestion type: Array as PropType<MenuOption>, ``` ########## paimon-web-ui-new/src/layouts/content/components/menubar/index.tsx: ########## @@ -20,40 +20,15 @@ import { RouterLink } from "vue-router" import type { NavBar } from "@/store/config/type" export default defineComponent({ + props:{ + menuOptions: { + type: Array as PropType<any>, Review Comment: please use the naive Menu component Type ```suggestion type: Array as PropType<MenuOption>, ``` ########## paimon-web-ui-new/src/layouts/content/components/topbar/index.tsx: ########## @@ -21,6 +21,12 @@ import MenuBar from '../menubar' import ToolBar from '../toolbar' export default defineComponent({ + props:{ + headerMenuOptions: { + type: Array as PropType<any>, Review Comment: ```suggestion type: Array as PropType<MenuOption>, ``` ########## paimon-web-ui-new/src/api/models/login/index.ts: ########## @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. */ import httpRequest from '../../request' -import type ResponseOptions from '@/api/types' +import type {ResponseOptions} from '@/api/types' Review Comment: code indentation ```suggestion import type { ResponseOptions } from '@/api/types' ``` ########## paimon-web-ui-new/src/layouts/content/index.tsx: ########## @@ -17,21 +17,47 @@ under the License. */ import NavBar from './components/topbar' import styles from './index.module.scss' +import SideBar from './components/sidebar' +import { useData } from './use-data' +import { useConfigStore } from '@/store/config' export default defineComponent({ name: 'ContentPage', setup() { + const configStore = useConfigStore() + const route = useRoute() + const { menuOptions, state } = useData() + const getSideOption = (state: any) => { + const activeNavKey = configStore.getCurrentNavActive + state.sideMenuOptions = menuOptions.value.filter((m: any) => m.key === activeNavKey)[0]?.sideMenuOptions || [] Review Comment: replace `filter` to `find` -- 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]
