()
| 23 | import { useTranslation } from "react-i18next"; |
| 24 | |
| 25 | function Plugins() { |
| 26 | const { t } = useTranslation(); |
| 27 | const createPluginRef = useRef<any>() |
| 28 | const dispatch = useDispatch() |
| 29 | const { pluginLists } = useSelector((state: any) => state.plugin); |
| 30 | const { bundleTableColumn } = CommonComponents() |
| 31 | const { tooltipEditTitle, tooltipDeleteTitle,tooltipPluginTitle } = tooltipTitle(); |
| 32 | const [loading, setLoading] = useState(false); |
| 33 | const [form] = Form.useForm() |
| 34 | const [pluginFunList, setPluginFunList] = useState([]) |
| 35 | const [deleteValue, setDeleteValue] = useState('') |
| 36 | const [updatePrevButton, setUpdatePrevButton] = useState(false) |
| 37 | const [OpenDeleteModal, setOpenDeleteModal] = useState(false) |
| 38 | const [limit, setLimit] = useState(20) |
| 39 | const [hasMore, setHasMore] = useState(false) |
| 40 | const [formDisabled, setFormDisabled] = useState(false) |
| 41 | const [openCreateModal1, setOpenDrawer] = useState(false) |
| 42 | const [bundleId, setBundleId] = useState('') |
| 43 | const [bundleName, setBundleName] = useState('') |
| 44 | const [bundilesList, setBundlesList] = useState([]) |
| 45 | const [credentialsSchema, setCredentialsSchema] = useState({}) |
| 46 | const [inputSchema, setInputSchema] = useState({}) |
| 47 | const [resetButtonShow, setResetButtonShow] = useState(true) |
| 48 | const [pluginListData, setPluginListData] = useState([]) |
| 49 | const [pluginId, setPluginId] = useState('') |
| 50 | const [pluginName, setPluginName] = useState('') |
| 51 | const [pluginDesc, setPluginDesc] = useState('') |
| 52 | const [bundleDesc, setBundleDesc] = useState('') |
| 53 | const [confirmLoading, setConfirmLoading] = useState(false) |
| 54 | const [openEditDrawer, setOpenEditDrawer] = useState(false) |
| 55 | const [openEditFormDrawer, setOpenEditFormDrawer] = useState(false) |
| 56 | const [isShowBundle, setIsShowBundle] = useState(true) |
| 57 | const [cachedImages, setCachedImages] = useState({}); |
| 58 | useEffect(() => { |
| 59 | const params1 = { |
| 60 | limit: 100, |
| 61 | offset: 0, |
| 62 | lang: 'en' |
| 63 | } |
| 64 | getBundleList(params1) |
| 65 | }, []) |
| 66 | useEffect(() => { |
| 67 | if (pluginLists.data.length > 0) { |
| 68 | const data = pluginLists.data.map((item: any) => { |
| 69 | return { |
| 70 | ...item, |
| 71 | } |
| 72 | }) |
| 73 | setPluginFunList(data) |
| 74 | setHasMore(pluginLists.has_more) |
| 75 | } else { |
| 76 | setPluginFunList([]) |
| 77 | } |
| 78 | }, [pluginLists]) |
| 79 | const fetchData = async (params: any) => { |
| 80 | setLoading(true); |
| 81 | try { |
| 82 | const res: any = await getPluginList(params) |
nothing calls this directly
no test coverage detected