-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solving errors in merge to main (#59)
* Disable login button if user don't want to share data (#49) Signed-off-by: Montse Ortega <[email protected]> * Add agent version to agent UI (#50) Signed-off-by: Montse Ortega <[email protected]> * Add agent version to Agent UI (#52) Signed-off-by: Montse Ortega <[email protected]> * ECOPROJECT-2357: Adjusting UI to last changes of API (#51) * ECOPROJECT-2357: Adjusting UI to last changes of API Signed-off-by: Montse Ortega <[email protected]> * Use /url endpoint to get proper URL to UI (#53) Signed-off-by: Ondra Machacek <[email protected]> * Add .ova suffix to image (#54) Signed-off-by: Ondra Machacek <[email protected]> * Wait to load the sources table until agents and sources are loaded (#55) Signed-off-by: Montse Ortega <[email protected]> * Defining custom fotter for the wizard (#56) Signed-off-by: Montse Ortega <[email protected]> * Add example report PDF to be downloaded (#57) Signed-off-by: Montse Ortega <[email protected]> * Change Openshift text to OpenShift (#58) Signed-off-by: Montse Ortega <[email protected]> --------- Signed-off-by: Montse Ortega <[email protected]> Signed-off-by: Ondra Machacek <[email protected]> Co-authored-by: Ondra Machacek <[email protected]>
- Loading branch information
1 parent
20b797d
commit 24847c0
Showing
33 changed files
with
907 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import type { AgentApiInterface } from "@migration-planner-ui/agent-client/apis"; | ||
import { useInjection } from '@migration-planner-ui/ioc'; | ||
import { Symbols } from '#/main/Symbols'; | ||
|
||
export const AgentUIVersion: React.FC = () => { | ||
const agentApi = useInjection<AgentApiInterface>(Symbols.AgentApi); | ||
const [versionInfo, setVersionInfo] = useState<string | null>(null); | ||
const [error, setError] = useState<string | null>(null); | ||
|
||
useEffect(() => { | ||
const fetchVersion = async ():Promise<void> => { | ||
try { | ||
const statusReply = await agentApi.getAgentVersion(); | ||
setVersionInfo(statusReply); | ||
} catch (err) { | ||
console.error('Error fetching agent version:', err); | ||
setError('Error fetching version'); | ||
} | ||
}; | ||
|
||
fetchVersion(); | ||
}, [agentApi]); | ||
|
||
if (error) { | ||
return <div data-testid="agent-api-lib-version" hidden>Error: {error}</div>; | ||
} | ||
|
||
if (!versionInfo) { | ||
return <div data-testid="agent-api-lib-version" hidden>Loading...</div>; | ||
} | ||
|
||
return ( | ||
<div data-testid="agent-api-lib-version" hidden> | ||
{versionInfo} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { AgentApiInterface, DeleteAgentRequest } from "@migration-planner-ui/api-client/apis"; | ||
import { Agent } from "@migration-planner-ui/api-client/models"; | ||
import { InitOverrideFunction, ApiResponse, ConfigurationParameters } from "@migration-planner-ui/api-client/runtime"; | ||
|
||
export class MockAgentApi implements AgentApiInterface { | ||
constructor(_configuration: ConfigurationParameters) { | ||
console.warn("#### CAUTION: Using MockAgentApi ####"); | ||
} | ||
|
||
deleteAgentRaw(_requestParameters: DeleteAgentRequest, _initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<Agent>> { | ||
throw new Error("Method not implemented."); | ||
} | ||
deleteAgent(_requestParameters: DeleteAgentRequest, _initOverrides?: RequestInit | InitOverrideFunction): Promise<Agent> { | ||
throw new Error("Method not implemented."); | ||
} | ||
listAgentsRaw(_initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<Array<Agent>>> { | ||
throw new Error("Method not implemented."); | ||
} | ||
async listAgents(_initOverrides?: RequestInit | InitOverrideFunction): Promise<Array<Agent>> { | ||
const { default: json } = await import("./responses/agents.json"); | ||
return json as unknown as Array<Agent>; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"associated": true, | ||
"createdAt": "2024-12-11T07:22:40.264166+01:00", | ||
"credentialUrl": "http://127.0.0.1:3333", | ||
"sourceId": "29031FCA-3274-4067-A655-8BC4C322EA3F", | ||
"id": "f8d28f7d-d862-47c5-b823-9763b319ff91", | ||
"status": "up-to-date", | ||
"statusInfo": "Inventory successfully collected", | ||
"updatedAt": "2024-12-11T07:23:25.261977+01:00", | ||
"version": "b1dc3f5" | ||
}, | ||
{ | ||
"associated": true, | ||
"createdAt": "2024-12-11T07:22:40.264166+01:00", | ||
"credentialUrl": "http://127.0.0.1:3333", | ||
"sourceId": "29031FCA-3274-4067-A655-8BC4C322EA3C", | ||
"id": "f8d28f7d-d862-47c5-b823-9763b319ff92", | ||
"status": "gathering-initial-inventory", | ||
"statusInfo": "Gathering inventory", | ||
"updatedAt": "2024-12-11T07:23:25.261977+01:00", | ||
"version": "b1dc3f5" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.