import { Box, Button, Flashbar, Header, NonCancelableCustomEvent, ProgressBar,SpaceBetween, Tabs, TabsProps } from "@awsui/components-react"; import React, { useCallback, useEffect, useMemo, useState } from "react"; import { useDispatch, useSelector} from "react-redux"; import { Redirect, useHistory, useLocation } from "react-router"; import { v4 as uuid } from "uuid"; import { data } from "vis-network"; import { paths } from "../../constants/paths"; import { usePortingAssistantSelector } from "../../createReduxStore"; import { HistoryState } from "../../models/locationState"; import { PreTriggerData,Project } from "../../models/project"; import { MetricSource, MetricType, ReactMetric } from "../../models/reactmetric"; import { SolutionDetails } from "../../models/solution"; import { analyzeSolution, exportSolution, openSolutionInIDE } from "../../store/actions/backend"; import { selectPortingLocation } from "../../store/selectors/portingSelectors"; import { selectCurrentSolutionPath } from "../../store/selectors/solutionSelectors"; import { selectProjectTableData } from "../../store/selectors/tableSelectors"; import { checkInternetAccess } from "../../utils/checkInternetAccess"; import { createPreTriggerDataFromProjectsTable } from "../../utils/createPreTriggerDataFromProjectTable"; import { getErrorMetric } from "../../utils/getErrorMetric"; import { getTargetFramework } from "../../utils/getTargetFramework"; import { getTotalProjects } from "../../utils/getTotalProjects"; import { hasNewData, isLoaded, isLoading, isLoadingWithData, Loadable } from "../../utils/Loadable"; import { ApiTable } from "../AssessShared/ApiTable"; import { FileTable } from "../AssessShared/FileTable"; import { NugetPackageTable } from "../AssessShared/NugetPackageTable"; import { ProjectReferences } from "../AssessShared/ProjectReferences"; import { useApiAnalysisFlashbarMessage } from "../AssessShared/useApiAnalysisFlashbarMessage"; import { useNugetFlashbarMessages } from "../AssessShared/useNugetFlashbarMessages"; import { CustomerFeedbackModal } from "../CustomerContribution/CustomerFeedbackModal"; import { InfoLink } from "../InfoLink"; import { PortConfigurationModal } from "../PortConfigurationModal/PortConfigurationModal"; import { getPercent } from "./../../utils/getPercent" import { ProjectsTable, TableData } from "./ProjectsTable"; import { SolutionSummary } from "./SolutionSummary"; interface Props { solution: Loadable; projects: Loadable; } const AssessSolutionDashboardInternal: React.FC = ({ solution, projects }) => { const dispatch = useDispatch(); const history = useHistory(); const location = useLocation(); const portingLocation = usePortingAssistantSelector(state => selectPortingLocation(state, location.pathname)); const [showPortingModal, setShowPortingModal] = useState(false); const targetFramework = getTargetFramework(); const [feedbackModal, setFeedbackModalVisible] = React.useState(false); const [emailModal, setEmailModalVisible] = React.useState(false); const solutionPath = usePortingAssistantSelector(state => selectCurrentSolutionPath(state, location.pathname)); const [totalProjects, setTotalProjects] = useState(0); useNugetFlashbarMessages(projects); useApiAnalysisFlashbarMessage(solution); useEffect(()=> { (async () => { setTotalProjects(await getTotalProjects(solutionPath)); })(); }, [solutionPath]); const projectsTable = usePortingAssistantSelector(state => selectProjectTableData(state, location.pathname)); var preTriggerDataDictionary: { [projectName: string]: PreTriggerData} = createPreTriggerDataFromProjectsTable(projectsTable); const tabs = useMemo( () => [ { label: "Projects", id: "projects", content: }, { label: "Project references", id: "project-references", content: }, { label: "NuGet packages", id: "nuget-packages", content: }, { label: "APIs", id: "apis", content: }, { label: "Source files", id: "source-files", content: } ], [solution, projects] ); const onChangeTab = useCallback( (event: NonCancelableCustomEvent) => { history.push(location.pathname, { activeTabId: event.detail.activeTabId, activePageId: 1 }); }, [history, location.pathname] ); if (solution == null) { return ; } return (

Once you select an application for porting, Porting Assistant for .NET can speed up the process by setting up the project file with updated NuGet/Microsoft packages and formatted package references in a format that is compatible with .NET Core. You can use the updated project file to start refactoring your application. When you select an application for porting, Porting Assistant for .NET copies the .NET Framework source code and the associated project files to a .NET Core compatible format. If there are any known replacements, Porting Assistant for .NET applies them. When a project is ported, it may not be entirely .NET Core compatible because there may be other APIs, packages, and code blocks that must be substituted and refactored for compatibility.

} learnMoreLinks={[]} /> } description={ Improve the compatibility of your solution by refactoring the source code for each project and reassessing it. } actions={ setShowPortingModal(false)} onSubmit={() => { try { if (isLoaded(solution)) { let clickMetric: ReactMetric = { SolutionPath: solution.data.solutionFilePath, MetricSource: MetricSource.PortSolutionSelect, MetricType: MetricType.UIClickEvent } window.electron.writeReactLog(clickMetric); history.push({ pathname: `/port-solution/${encodeURIComponent(solution.data.solutionFilePath)}`, state: { projects: hasNewData(projects) ? projects.data : [] } }); } } catch (err) { const errorMetric = getErrorMetric(err, MetricSource.PortSolutionSelect); window.electron.writeReactLog(errorMetric); throw err; } }} /> } > {hasNewData(solution)? solution.data.solutionName : ""}
) } ]} />
); }; export const AssessSolutionDashboard = React.memo(AssessSolutionDashboardInternal);