diff --git "a/migration-planner-ui_and_autotests.json" "b/migration-planner-ui_and_autotests.json" new file mode 100644--- /dev/null +++ "b/migration-planner-ui_and_autotests.json" @@ -0,0 +1,2760 @@ +[ + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "1f694b03-64c5-4c8e-977f-007ce0f155bf", + "name": "eslint.config.js", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/eslint.config.js", + "code": "import globals from \"globals\";\nimport eslintJs from \"@eslint/js\";\nimport tsEslint from \"typescript-eslint\";\nimport pluginReact from \"eslint-plugin-react\";\nimport pluginReactHooks from 'eslint-plugin-react-hooks';\nimport pluginReactRefresh from 'eslint-plugin-react-refresh';\n\nconst config = tsEslint.config(\n eslintJs.configs.recommended,\n ...tsEslint.configs.recommended,\n {\n name: \"General\",\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: import.meta.dirname,\n },\n globals:\n {\n ...globals.node,\n },\n },\n rules: {\n \"@typescript-eslint/no-unused-vars\": [\n \"warn\",\n {\n args: \"all\",\n argsIgnorePattern: \"^_\",\n destructuredArrayIgnorePattern: \"^_\",\n varsIgnorePattern: \"^_\",\n ignoreRestSiblings: true,\n },\n ],\n \"@typescript-eslint/explicit-function-return-type\": \"warn\",\n }\n },\n {\n name: \"React (Web)\",\n files: [\"**/*.{tsx,jsx}\"],\n languageOptions: {\n globals: {\n ...globals.browser,\n }\n },\n settings: {\n react: {\n version: \"detect\"\n }\n },\n plugins: {\n 'react': pluginReact,\n 'react-hooks': pluginReactHooks,\n 'react-refresh': pluginReactRefresh,\n },\n rules: {\n ...pluginReact.configs.flat['jsx-runtime'].rules,\n ...pluginReactHooks.configs.recommended.rules,\n \"react-refresh/only-export-components\": \"warn\",\n },\n },\n {\n name: \"Ignored\",\n ignores: [\"**/dist\", \"**/node_modules\", \"eslint.config.js\"],\n }\n);\n\nexport default config;\n" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "9ce256e2-0915-42fa-a4c3-9b241172cea8", + "name": "vite.config.ts", + "imports": "[{'import_name': ['defineConfig'], 'import_path': 'vite'}]", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/vite.config.ts", + "code": "import { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react-swc\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\n\n// https://vitejs.dev/config/\nexport default defineConfig((_env) => {\n return {\n plugins: [tsconfigPaths(), react()],\n server: {\n proxy: {\n \"/agent/api/v1\": {\n target: \"http://172.17.0.3:3333\",\n changeOrigin: true,\n rewrite: (path): string => path.replace(/^\\/agent/, \"\"),\n },\n },\n },\n };\n});\n" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "1c3486d9-9ac2-4ac2-a01d-0a450589b04f", + "name": "vite-env.d.ts", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/@types/vite-env.d.ts", + "code": "/// \n\ninterface ImportMetaEnv {\n readonly VITE_AGENT_BASEPATH: string;\n // Add other env variables here\n}\n\ninterface ImportMeta {\n readonly env: ImportMetaEnv;\n}\n" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "de5ff8fd-3ee7-4f4b-bb62-bb1e7d50500f", + "name": "AbortSignal.ts", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/common/AbortSignal.ts", + "code": "export function newAbortSignal(\n delay?: number,\n abortMessage?: string\n): AbortSignal {\n const abortController = new AbortController();\n const signal = abortController.signal;\n\n if (delay) {\n window.setTimeout(() => {\n abortController.abort(abortMessage);\n }, delay);\n }\n\n return signal;\n}\n" + }, + { + "element_type": "function", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "ddadabf7-a5da-4e71-86ec-d0e2fd583da8", + "name": "newAbortSignal", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/common/AbortSignal.ts", + "code": "function newAbortSignal(\n delay?: number,\n abortMessage?: string\n): AbortSignal {\n const abortController = new AbortController();\n const signal = abortController.signal;\n\n if (delay) {\n window.setTimeout(() => {\n abortController.abort(abortMessage);\n }, delay);\n }\n\n return signal;\n}", + "parent": "{}" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "5729a4f7-c329-472f-b34f-8762ec20d1cd", + "name": "AgentUIVersion.tsx", + "imports": "[{'import_name': ['useState', 'useEffect'], 'import_path': 'react'}, {'import_name': ['AgentApiInterface'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['useInjection'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['Symbols'], 'import_path': '#/main/Symbols'}]", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/common/AgentUIVersion.tsx", + "code": "import React, { useState, useEffect } from 'react';\nimport type { AgentApiInterface } from \"@migration-planner-ui/agent-client/apis\";\nimport { useInjection } from '@migration-planner-ui/ioc';\nimport { Symbols } from '#/main/Symbols';\n\nexport const AgentUIVersion: React.FC = () => {\n const agentApi = useInjection(Symbols.AgentApi);\n const [versionInfo, setVersionInfo] = useState(null);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n const fetchVersion = async ():Promise => {\n try {\n const statusReply = await agentApi.getAgentVersion();\n setVersionInfo(statusReply);\n } catch (err) {\n console.error('Error fetching agent version:', err);\n setError('Error fetching version');\n }\n };\n\n fetchVersion();\n }, [agentApi]);\n\n if (error) {\n return ;\n }\n\n if (!versionInfo) {\n return ;\n }\n\n return (\n \n );\n};" + }, + { + "element_type": "function", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "eb5b8299-b6a6-4ae3-9b56-5310a7d24a00", + "name": "AgentUIVersion", + "imports": "[{'import_name': ['useState', 'useEffect'], 'import_path': 'react'}, {'import_name': ['AgentApiInterface'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['useInjection'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['Symbols'], 'import_path': '#/main/Symbols'}]", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/common/AgentUIVersion.tsx", + "code": "() => {\n const agentApi = useInjection(Symbols.AgentApi);\n const [versionInfo, setVersionInfo] = useState(null);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n const fetchVersion = async ():Promise => {\n try {\n const statusReply = await agentApi.getAgentVersion();\n setVersionInfo(statusReply);\n } catch (err) {\n console.error('Error fetching agent version:', err);\n setError('Error fetching version');\n }\n };\n\n fetchVersion();\n }, [agentApi]);\n\n if (error) {\n return ;\n }\n\n if (!versionInfo) {\n return ;\n }\n\n return (\n \n );\n}", + "parent": "{}" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "42822398-bc0c-451e-bd7c-ba1eb2371e82", + "name": "Time.ts", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/common/Time.ts", + "code": "export type Duration = number;\n\nexport const enum Time {\n Millisecond = 1,\n Second = 1000 * Millisecond,\n Minute = 60 * Second,\n Hour = 60 * Minute,\n Day = 24 * Hour,\n Week = 7 * Day,\n}\n\nexport const sleep = (delayMs: Duration): Promise =>\n new Promise((resolve) => {\n setTimeout(resolve, delayMs);\n });\n" + }, + { + "element_type": "function", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "c5f63536-e0da-41a5-be62-26366848c777", + "name": "sleep", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/common/Time.ts", + "code": "(delayMs: Duration): Promise =>\n new Promise((resolve) => {\n setTimeout(resolve, delayMs);\n })", + "parent": "{}" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "81986736-4902-48a7-9c3e-afa4455ff13c", + "name": "Aliases.ts", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/login-form/Aliases.ts", + "code": "export type FormControlValidatedStateVariant =\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"default\";\n" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "863a9fdb-0187-4368-8743-860b501d951b", + "name": "Constants.ts", + "imports": "[{'import_name': ['Time'], 'import_path': '#/common/Time'}]", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/login-form/Constants.ts", + "code": "import { Time } from \"#/common/Time\";\n\nexport const DATA_SHARING_ALLOWED_DEFAULT_STATE = true;\nexport const REQUEST_TIMEOUT_SECONDS = 30 * Time.Second;\n" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "06837832-eba4-435b-b9f8-770ed39b7d5a", + "name": "FormStates.ts", + "imports": "", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/login-form/FormStates.ts", + "code": "export const enum FormStates {\n CheckingStatus = \"checkingStatus\",\n WaitingForCredentials = \"waitingForCredentials\",\n Submitting = \"submitting\",\n CredentialsAccepted = \"credentialsAccepted\",\n CredentialsRejected = \"credentialsRejected\",\n InvalidCredentials = \"invalidCredentials\",\n GatheringInventory = \"gatheringInventory\"\n}\n" + }, + { + "element_type": "file", + "project_name": "kubev2v/migration-planner-ui", + "uuid": "dfc3e195-5b0a-43c0-b0ae-0a90dd979add", + "name": "LoginForm.tsx", + "imports": "[{'import_name': ['Alert', 'AlertActionLink', 'Button', 'Card', 'CardBody', 'CardFooter', 'CardHeader', 'Checkbox', 'Form', 'FormGroup', 'FormHelperText', 'HelperText', 'HelperTextItem', 'List', 'ListItem', 'Text', 'TextContent', 'TextInput', 'Spinner', 'SplitItem', 'Split', 'Icon', 'Divider'], 'import_path': '@patternfly/react-core'}, {'import_name': ['LoginFormViewModelInterface'], 'import_path': './hooks/UseViewModel'}, {'import_name': ['FormStates'], 'import_path': './FormStates'}, {'import_name': ['CheckCircleIcon', 'InfoCircleIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['getConfigurationBasePath'], 'import_path': '#/main/Root'}]", + "file_location": "https://github.com/kubev2v/migration-planner-ui/apps/agent/src/login-form/LoginForm.tsx", + "code": "import React from \"react\";\nimport {\n Alert,\n AlertActionLink,\n Button,\n Card,\n CardBody,\n CardFooter,\n CardHeader,\n Checkbox,\n Form,\n FormGroup,\n FormHelperText,\n HelperText,\n HelperTextItem,\n List,\n ListItem,\n Text,\n TextContent,\n TextInput,\n Spinner,\n SplitItem,\n Split,\n Icon,\n Divider,\n} from \"@patternfly/react-core\";\nimport { LoginFormViewModelInterface } from \"./hooks/UseViewModel\";\nimport { FormStates } from \"./FormStates\";\nimport {\n CheckCircleIcon,\n InfoCircleIcon\n} from \"@patternfly/react-icons\";\nimport { getConfigurationBasePath } from \"#/main/Root\";\nimport globalSuccessColor100 from \"@patternfly/react-tokens/dist/esm/global_success_color_100\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LoginForm {\n export type Props = {\n vm: LoginFormViewModelInterface;\n };\n}\n\nexport const LoginForm: React.FC = (props) => {\n const { vm } = props;\n console.log(vm.formState);\n return (\n \n \n \n Migration Discovery VM\n \n The migration discovery VM requires access to your VMware\n environment to execute a discovery process that gathers essential\n data, including network topology, storage configuration, and VM\n inventory. The process leverages this information to provide\n recommendations for a seamless migration to OpenShift\n Virtualization.\n \n \n \n\n \n\n \n \n \n \n Access control\n \n \n \n To ensure secure access during the discovery process, we recommend creating a dedicated VMware user account with read-only permissions.\n \n \n\n \n\n \n
\n