This commit is contained in:
Frikky
2024-05-31 09:38:29 +02:00
parent e6ddb24875
commit 7a58953cc5
3 changed files with 87 additions and 34 deletions
+2
View File
@@ -514,6 +514,8 @@ const AuthenticationOauth2 = (props) => {
getAppAuthentication(true, true, true); getAppAuthentication(true, true, true);
} }
toast("Authentication successful!")
// This is more a guess than anything // This is more a guess than anything
// Should be handled in getAppAuthentication() // Should be handled in getAppAuthentication()
// in the parent component to make it accurate, // in the parent component to make it accurate,
+1 -5
View File
@@ -8182,7 +8182,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
width: imagesize, width: imagesize,
height: imagesize, height: imagesize,
pointerEvents: "none",
// Stretch if necessary // Stretch if necessary
objectFit: "cover", objectFit: "cover",
// Center the object // Center the object
@@ -14938,9 +14937,6 @@ const AngularWorkflow = (defaultprops) => {
top: isMobile ? 30 : appBarSize + 20, top: isMobile ? 30 : appBarSize + 20,
} }
const TopCytoscapeBar = (props) => { const TopCytoscapeBar = (props) => {
if (workflow.public === true) { if (workflow.public === true) {
return null return null
@@ -14956,6 +14952,7 @@ const AngularWorkflow = (defaultprops) => {
<div style={topBarStyle}> <div style={topBarStyle}>
<div style={{ <div style={{
margin: "0px 10px 0px 10px", margin: "0px 10px 0px 10px",
pointerevents: "none",
}}> }}>
<Breadcrumbs <Breadcrumbs
aria-label="breadcrumb" aria-label="breadcrumb"
@@ -14980,7 +14977,6 @@ const AngularWorkflow = (defaultprops) => {
</Link> </Link>
<h2 style={{ <h2 style={{
margin: 0, margin: 0,
pointerEvents: "none",
}}>{workflow.name}</h2> }}>{workflow.name}</h2>
</Breadcrumbs> </Breadcrumbs>
+63 -8
View File
@@ -10,6 +10,8 @@ import theme from '../theme.jsx';
//import { useAlert //import { useAlert
import { ToastContainer, toast } from "react-toastify" import { ToastContainer, toast } from "react-toastify"
//import "./CollapsibleList.css"
import AuthenticationOauth2 from "../components/Oauth2Auth.jsx"; import AuthenticationOauth2 from "../components/Oauth2Auth.jsx";
import AuthenticationWindow from "../components/AuthenticationWindow.jsx"; import AuthenticationWindow from "../components/AuthenticationWindow.jsx";
import { base64_decode, appCategories } from "../views/AppCreator.jsx"; import { base64_decode, appCategories } from "../views/AppCreator.jsx";
@@ -128,6 +130,12 @@ const SetAuthentication = (props) => {
} }
}, []); }, []);
const [expandedIndex, setExpandedIndex] = useState(null);
const handleToggle = (index) => {
setExpandedIndex(expandedIndex === index ? null : index);
};
// Handle: // Handle:
// 1. Check for org_id, authentication, and app keys in queries // 1. Check for org_id, authentication, and app keys in queries
// 2. Load the app auth info from the orgs' apps // 2. Load the app auth info from the orgs' apps
@@ -135,16 +143,33 @@ const SetAuthentication = (props) => {
// Make sure to test both private and public apps // Make sure to test both private and public apps
const appname = app.name !== undefined ? app.name : ""; const appname = app.name !== undefined ? app.name : "";
const appLink = "/apps/" + app.id || "";
console.log("App: ", app)
return ( return (
<div style={{width: 1000, margin: "auto", marginTop: 50, }}> <div style={{width: 1000, margin: "auto", marginTop: 50, }}>
{loadFail !== "" ? {loadFail !== "" ?
loadFail loadFail
: :
<div> <><div>
<Typography variant="h4" style={{marginBottom: 20,}}> <Typography variant="h4" style={{ marginBottom: 20, }}>
Configure {appname} Authentication A Shuffle Organization has invited you to: Configure <a href={appLink} target="_blank" style={{ color: '#FF8444', textDecoration: 'none' }}>{appname}</a> Authentication
</Typography> </Typography>
{/* What does this mean box */}
<Typography variant="h6" style={{ marginBottom: 20, }}>
What does this mean?
</Typography>
<Typography variant="body1" style={{ marginBottom: 20, }}>
A Shuffle Organization has invited you to configure authentication for this app so that they can use this authentication in one of their workflows.
</Typography>
<Typography variant="h6">
Authenticate Here:
</Typography>
<Typography variant="body1" style={{ marginBottom: 20, }}>
{app.authentication === undefined || app.authentication === null || app.authentication.length === 0 ? {app.authentication === undefined || app.authentication === null || app.authentication.length === 0 ?
null null
: :
@@ -160,18 +185,48 @@ const SetAuthentication = (props) => {
authenticationType={app.authentication} authenticationType={app.authentication}
isCloud={true} isCloud={true}
authButtonOnly={true} authButtonOnly={true}
getAppAuthentication={undefined} getAppAuthentication={undefined} />
/>
: :
<AuthenticationWindow <AuthenticationWindow
globalUrl={globalUrl} globalUrl={globalUrl}
selectedApp={app} selectedApp={app}
authFieldsOnly={true} authFieldsOnly={true}
getAppAuthentication={undefined} getAppAuthentication={undefined}
appAuthentication={appAuthentication} appAuthentication={appAuthentication} />}
/> </Typography>
}
<Typography variant="h6" style={{ marginBottom: 20, }}>
What can they do with this?
</Typography>
<Typography variant="body1" style={{ marginBottom: 20, }}>
You can check the actions they want to use <a href={appLink} target="_blank" style={{ color: '#FF8444', textDecoration: 'none' }}>here</a>.
</Typography>
<Typography variant="body1" style={{ marginBottom: 20, }}>
{/* Add a box below */}
<div className="collapsible-container">
<div className="collapsible-list">
{app.actions?.map((item, index) => (
<div key={index} className="collapsible-item">
<div className="collapsible-label" onClick={() => handleToggle(index)}>
{item.label}
</div> </div>
{expandedIndex === index && (
<div className="collapsible-description">
{item.description}
</div>
)}
</div>
))}
</div>
</div>
</Typography>
</div>
<>
<div style={{ height: 100, }}></div>
</>
</>
} }
</div> </div>
) )