liuxiran commented on a change in pull request #1813: URL: https://github.com/apache/apisix-dashboard/pull/1813#discussion_r627812863
########## File path: web/src/components/PluginFlow/PluginFlow.tsx ########## @@ -0,0 +1,203 @@ +/* + * 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 React, { useEffect, useState } from 'react' +import { Modal, Form, Input, Alert } from 'antd' +import { Cell } from '@antv/x6' +import { useIntl } from 'umi' + +import FlowGraph from './components/FlowGraph' +import Toolbar from './components/Toolbar' +import { DEFAULT_CONDITION_PROPS, DEFAULT_PLUGIN_PROPS, DEFAULT_STENCIL_WIDTH, DEFAULT_TOOLBAR_HEIGHT, FlowGraphEvent } from './constants' +import styles from './style.less' +import ConfigPanel from './components/ConfigPanel' +import PluginDetail from '../Plugin/PluginDetail' +import { fetchList } from '../Plugin/service' + +type Props = { + chart: { + cells: Cell.Properties[]; + }; + readonly?: boolean; +} + +type PluginProps = { + id: string; + name: string; + visible: boolean; + data: any; +} + +type ConditionProps = { + id: string; + visible: boolean; + data: string; +} + +const PluginFlow: React.FC<Props> = ({ chart, readonly = false }) => { + const { formatMessage } = useIntl() + + // NOTE: To prevent from graph is not initialized + const [isReady, setIsReady] = useState(false) + const [plugins, setPlugins] = useState<PluginComponent.Meta[]>([]) + + const [pluginProps, setPluginProps] = useState<PluginProps>(DEFAULT_PLUGIN_PROPS) + const [conditionProps, setConditionProps] = useState<ConditionProps>(DEFAULT_CONDITION_PROPS) + + const getContainerSize = () => { Review comment: > 1. When I try to collapse it and reopen it, I cannot reproduce that the card gets smaller 🤔 my browser is chrome, and version is `90.0.4430.93(正式版本) (x86_64)` and the the appearance of bug just like this: https://user-images.githubusercontent.com/2561857/117374665-22954200-af00-11eb-99cd-17a195e1ac68.mp4 -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org