Re-fixed looping issues in #1012 and bugs from the issue that the initial fix caused

This commit is contained in:
frikky
2023-02-06 22:53:04 +01:00
parent 449db7f9de
commit fe6be71076
8 changed files with 810 additions and 667 deletions
+10 -2
View File
@@ -564,6 +564,7 @@ const AppFramework = (props) => {
const alert = useAlert()
const handleLoadNextSuggestion = (frameworkData) => {
console.log("Should check for next apps to load from App suggestion model")
//fetch(globalUrl + "/api/v1/workflows/usecases", {
@@ -623,7 +624,6 @@ const AppFramework = (props) => {
suggestions.push(value.slice(0,1))
}
console.log("SUGG: ", suggestions)
setInjectedApps(suggestions)
})
.catch((error) => {
@@ -909,6 +909,10 @@ const AppFramework = (props) => {
})
}
useEffect(() => {
handleLoadNextSuggestion(frameworkData)
}, [])
useEffect(() => {
console.log("New selected app: ", newSelectedApp, discoveryData)
if (newSelectedApp.objectID === undefined || newSelectedApp.objectID === undefined || newSelectedApp.objectID.length === 0) {
@@ -1931,10 +1935,11 @@ const AppFramework = (props) => {
return (
<div style={{display: "flex", position: "absolute", top: categoryTop, left: categoryLeft, zIndex: 10010, }}>
{apps.map((app) => {
{apps.map((app, appIndex) => {
return (
<Chip
avatar={<Avatar alt={app.name} src={app.image_url} style={{backgroundColor: "white", }} />}
key={app.id}
label={""}
variant="contained"
style={{}}
@@ -2089,6 +2094,9 @@ const AppFramework = (props) => {
setSelectionOpen(true)
setDefaultSearch("")
//handleLoadNextSuggestion(frameworkData)
setInjectedApps([])
const foundelement = cy.getElementById(discoveryData.id)
if (foundelement !== undefined && foundelement !== null) {