More minor fixes for cloud/onprem to be in line

This commit is contained in:
Frikky
2025-02-28 01:17:46 +01:00
parent 1d9f5aa8be
commit 24ee675304
13 changed files with 133 additions and 56 deletions
+3 -8
View File
@@ -2715,10 +2715,12 @@ const AngularWorkflow = (defaultprops) => {
return newExample
}
/*
for (var i = 0; i < found.length; i++) {
//newExample = newExample.replace(found[i], "REQUIRED")
newExample = newExample.replace(found[i], "REPLACE_ME")
}
*/
return newExample
}
@@ -7116,7 +7118,6 @@ const AngularWorkflow = (defaultprops) => {
data: newcybranch,
};
console.log("SHOULD STITCH WITH STARTNODE");
cy.add(edgeToBeAdded);
}
@@ -12416,13 +12417,7 @@ const AngularWorkflow = (defaultprops) => {
// Get parent nodes and their data
if (selectedEdge) {
let nodeId;
if (type === "source") {
nodeId = selectedEdge.source;
} else if (type === "destination") {
nodeId = selectedEdge.target;
}
const nodeId = selectedEdge.target;
const node = cy.getElementById(nodeId);
if (node?.length > 0) {
+15 -19
View File
@@ -52,12 +52,11 @@ const searchClient = algoliasearch(
const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl, deactivatedIndexes, currTab, handleAppClick, leftSideBarOpenByClick, userdata, fetchApps, appsToShow, setAppsToShow, setUserApps, }) => {
const navigate = useNavigate();
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io" || window.location.host === "localhost:3000";
const appUrl = isCloud ? `/apps/${data.id}` : `https://shuffler.io/apps/${data.id}`;
//const appUrl = isCloud ? `/apps/${data.id}` : `https://shuffler.io/apps/${data.id}`;
const appUrl = `/apps/${data.id}`
var canEditApp = userdata?.support ||
userdata?.id === data?.owner ||
(userdata?.admin === "true" && userdata?.active_org?.id === data?.reference_org) ||
data?.contributors?.includes(userdata?.id)
var canEditApp = userdata?.support || userdata?.id === data?.owner ||
(userdata?.admin === "true" && userdata?.active_org?.id === data?.reference_org) || data?.contributors?.includes(userdata?.id)
const paperStyle = {
backgroundColor: mouseHoverIndex === index ? "rgba(26, 26, 26, 1)" : "#212121",
@@ -71,7 +70,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.1)",
marginBottom: 20,
transition: "width 0.3s ease",
};
}
return (
<Grid item xs={12} key={index}>
@@ -133,6 +132,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
margin: "12px 0",
fontFamily: theme?.typography?.fontFamily,
}}>
<div style={{
display: 'flex',
flexDirection: 'row',
@@ -144,6 +144,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
maxWidth: "90%",
gap: 8
}}>
<div style={{
overflow: "hidden",
textOverflow: "ellipsis",
@@ -152,6 +153,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
}}>
{data.name.replace(/_/g, ' ').replace(/\b\w/g, char => char.toUpperCase())}
</div>
</div>
<div style={{
overflow: "hidden",
@@ -162,6 +164,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
}}>
{data.categories ? data.categories.join(", ") : "NA"}
</div>
<div style={{
overflow: "hidden",
textOverflow: "ellipsis",
@@ -187,6 +190,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
</span>
))}
</div>
{/* Deactivate button */}
{(currTab === 0 || currTab === 1) && !deactivatedIndexes.includes(index) && mouseHoverIndex === index && data.generated === true && (
<div style={{
@@ -222,6 +226,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
</button>
)
}
<Button
disabled={data?.reference_org === userdata?.active_org?.id}
className="deactivate-button"
@@ -264,18 +269,6 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
}
} else {
toast.success("App deactivated successfully. Will take effect on refresh..")
/*
// This somehow didn't work
if (appsToShow !== undefined && appsToShow !== null && appsToShow.length > 0) {
const newApps = appsToShow?.filter((app) => app.id !== data.id)
if (newApps !== undefined && newApps !== null && newApps.length > 0) {
setAppsToShow(newApps)
setUserApps(newApps)
}
}
}
*/
}
})
.catch(error => {
@@ -645,6 +638,7 @@ const Hits = ({
</div>
)}
</div>
<div style={{
display: 'flex',
justifyContent: 'flex-end',
@@ -654,7 +648,7 @@ const Hits = ({
}}>
{hoverEffect === index && (
<div>
{allActivatedAppIds && allActivatedAppIds.includes(data.objectID) ? (
{allActivatedAppIds && allActivatedAppIds?.includes(data.objectID) ? (
<Button
style={{
width: 110,
@@ -673,7 +667,9 @@ const Hits = ({
}}>
Deactivate
</Button>
) : (
<Button
style={{
backgroundColor: "#FF8544",
+1 -1
View File
@@ -397,7 +397,7 @@ const Dashboard = (props) => {
if (foundQuery !== null && foundQuery !== undefined) {
setSelectedUsecaseCategory(foundQuery)
const newitem = removeParam("selected", cursearch);
const newitem = removeParam("selected", cursearch);
navigate(curpath + newitem)
}
+3 -3
View File
@@ -186,9 +186,9 @@ const LoginDialog = (props) => {
if (responseJson.tutorials === undefined || responseJson.tutorials === null || !responseJson.tutorials.includes("welcome")) {
console.log("RUN Welcome!!")
setTimeout(() => {
navigate("/welcome?tab=2")
},200)
setTimeout(() => {
navigate("/welcome?tab=2")
},200)
// window.location.pathname = ""
return
}