Added integration framework properly
This commit is contained in:
@@ -187,7 +187,7 @@ const ConfigureWorkflow = (props) => {
|
||||
console.log("No apps loaded: ", apps);
|
||||
|
||||
if (setConfigureWorkflowModalOpen !== undefined) {
|
||||
setConfigureWorkflowModalOpen(false);
|
||||
setConfigureWorkflowModalOpen(false)
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -198,7 +198,7 @@ const ConfigureWorkflow = (props) => {
|
||||
const newactions = [];
|
||||
for (let [key, keyval] in Object.entries(workflow.actions)) {
|
||||
|
||||
const action = workflow.actions[key];
|
||||
var action = JSON.parse(JSON.stringify(workflow.actions[key]))
|
||||
var newaction = {
|
||||
large_image: action.large_image,
|
||||
app_name: action.app_name,
|
||||
@@ -220,17 +220,67 @@ const ConfigureWorkflow = (props) => {
|
||||
}
|
||||
|
||||
if (action.app_name === "Integration Framework") {
|
||||
console.log("Skipping integration framework: ", action)
|
||||
continue
|
||||
var selected_app = ""
|
||||
for (var paramkey in action.parameters) {
|
||||
const param = action.parameters[paramkey]
|
||||
|
||||
if (param.name === "app_name") {
|
||||
selected_app = param.value
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for (var appauth in appAuthentication) {
|
||||
if (appAuthentication[appauth].app.name.toLowerCase() === selected_app.toLowerCase()) {
|
||||
newaction.auth_done = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (newaction.auth_done) {
|
||||
continue
|
||||
}
|
||||
|
||||
for (var appkey in apps) {
|
||||
if (apps[appkey].name.toLowerCase() === selected_app.toLowerCase()) {
|
||||
newaction.app_name = apps[appkey].name
|
||||
newaction.app_version = apps[appkey].app_version
|
||||
newaction.app = apps[appkey]
|
||||
newaction.app_id = apps[appkey].id
|
||||
|
||||
newaction.must_activate = false
|
||||
newaction.must_authenticate = true
|
||||
|
||||
newaction.steps.push({
|
||||
"title": "Authenticate app",
|
||||
"type": "authenticate",
|
||||
"required": true,
|
||||
})
|
||||
|
||||
action.app_id = apps[appkey].id
|
||||
action.authentication_id = ""
|
||||
action.authentication = {
|
||||
"required": true,
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (newaction.app.id === undefined) {
|
||||
console.log("Failed to find app: ", selected_app)
|
||||
continue
|
||||
}
|
||||
|
||||
newaction.update_version = "1.1.0"
|
||||
}
|
||||
|
||||
// ID match OR name match + version match
|
||||
//const app = apps.find((app) => app.id === action.app_id || (app.name === action.app_name && (app.app_version === action.app_version || (app.loop_versions !== null && app.loop_versions.includes(action.app_version)))))
|
||||
//
|
||||
|
||||
// without version match
|
||||
const newappname = action.app_name.toLowerCase().replaceAll(" ", "_")
|
||||
const app = apps.find((app) => app.id === action.app_id || app.name.toLowerCase().replaceAll(" ", "_") === newappname)
|
||||
var app = apps.find((app) => app.id === action.app_id || app.name.toLowerCase().replaceAll(" ", "_") === newappname)
|
||||
|
||||
if (app === undefined || app === null) {
|
||||
|
||||
@@ -246,6 +296,19 @@ const ConfigureWorkflow = (props) => {
|
||||
"required": true,
|
||||
})
|
||||
} else {
|
||||
if (action.authentication_id !== "" && app.authentication.required === true) {
|
||||
var authFound = false
|
||||
for (var authkey in appAuthentication) {
|
||||
if (appAuthentication[authkey].id === action.authentication_id) {
|
||||
authFound = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (!authFound) {
|
||||
action.authentication_id = ""
|
||||
}
|
||||
}
|
||||
|
||||
if (action.authentication_id === "" && app.authentication.required === true && action.parameters !== undefined && action.parameters !== null) {
|
||||
// Check if configuration is filled or not
|
||||
@@ -292,9 +355,11 @@ const ConfigureWorkflow = (props) => {
|
||||
//console.log(newaction.app_name,"AUTH: ", newaction.must_authenticate, " ACTIVATE: ", newaction.must_activate)
|
||||
|
||||
if (newaction.must_authenticate) {
|
||||
var authenticationOptions = [];
|
||||
|
||||
var authenticationOptions = []
|
||||
for (let [key,keyval] in Object.entries(appAuthentication)) {
|
||||
const auth = appAuthentication[key];
|
||||
const auth = appAuthentication[key]
|
||||
|
||||
if (auth.app.name === app.name && auth.active) {
|
||||
//console.log("Found auth: ", auth)
|
||||
authenticationOptions.push(auth);
|
||||
@@ -403,17 +468,18 @@ const ConfigureWorkflow = (props) => {
|
||||
continue;
|
||||
}
|
||||
|
||||
requiredTriggers.push(trigger);
|
||||
requiredTriggers.push(trigger)
|
||||
}
|
||||
}
|
||||
|
||||
if (requiredTriggers.length === 0 && requiredVariables.length === 0 && newactions.length === 0 && setConfigureWorkflowModalOpen !== undefined) {
|
||||
setConfigureWorkflowModalOpen(false);
|
||||
if (setConfigureWorkflowModalOpen !== undefined && requiredTriggers.length === 0 && requiredVariables.length === 0 && newactions.length === 0 ) {
|
||||
console.log("No required triggers, variables or actions. Closing modal.")
|
||||
setConfigureWorkflowModalOpen(false)
|
||||
}
|
||||
|
||||
setRequiredTriggers(requiredTriggers);
|
||||
setRequiredVariables(requiredVariables);
|
||||
setRequiredActions(newactions);
|
||||
setRequiredTriggers(requiredTriggers)
|
||||
setRequiredVariables(requiredVariables)
|
||||
setRequiredActions(newactions)
|
||||
}
|
||||
|
||||
if (appAuthentication !== undefined && previousAuth !== undefined && appAuthentication.length !== previousAuth.length) {
|
||||
|
||||
@@ -202,12 +202,12 @@ const Header = (props) => {
|
||||
removeCookie("__session", { path: "/" });
|
||||
window.location.pathname = "/";
|
||||
|
||||
localStorage.setItem("globalUrl", "")
|
||||
localStorage.setItem("globalUrl", "")
|
||||
|
||||
// Delete userinfo from localstorage
|
||||
localStorage.removeItem("apps")
|
||||
localStorage.removeItem("workflows")
|
||||
localStorage.removeItem("userinfo")
|
||||
// Delete userinfo from localstorage
|
||||
localStorage.removeItem("apps")
|
||||
localStorage.removeItem("workflows")
|
||||
localStorage.removeItem("userinfo")
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
@@ -374,13 +374,13 @@ const Header = (props) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
}}
|
||||
>
|
||||
{/*<Badge badgeContent={notifications.filter((n) => n.read === false).length} color="primary">*/}
|
||||
<NotificationsIcon
|
||||
color="secondary"
|
||||
style={{ height: 30, width: 30 }}
|
||||
alt="Your username here"
|
||||
src=""
|
||||
/>
|
||||
{/*<Badge badgeContent={notifications.filter((n) => n.read === false).length} color="primary">*/}
|
||||
<NotificationsIcon
|
||||
color="secondary"
|
||||
style={{ height: 30, width: 30 }}
|
||||
alt="Your username here"
|
||||
src=""
|
||||
/>
|
||||
</IconButton>
|
||||
<Menu
|
||||
id="simple-menu"
|
||||
@@ -411,32 +411,32 @@ const Header = (props) => {
|
||||
}}
|
||||
>
|
||||
<div style={{ display: "flex", marginBottom: 5 }}>
|
||||
<Typography variant="body1" style={{flex: 1, }}>
|
||||
<Typography variant="body1" style={{ flex: 1, }}>
|
||||
Notifications ({notifications.filter((data) => !data.read).length})
|
||||
</Typography>
|
||||
<ButtonGroup style={{height: 40, flex: 1, }}>
|
||||
{notifications.length > 1 ? (
|
||||
<Button
|
||||
color="primary"
|
||||
variant="outlined"
|
||||
disabled={notifications.filter((data) => !data.read).length === 0}
|
||||
onClick={() => {
|
||||
clearNotifications();
|
||||
}}
|
||||
>
|
||||
Flush
|
||||
</Button>
|
||||
) : null}
|
||||
<Button
|
||||
color="primary"
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
navigate("/admin?tab=organization&admin_tab=priorities")
|
||||
}}
|
||||
>
|
||||
Explore
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
<ButtonGroup style={{ height: 40, flex: 1, }}>
|
||||
{notifications.length > 1 ? (
|
||||
<Button
|
||||
color="primary"
|
||||
variant="outlined"
|
||||
disabled={notifications.filter((data) => !data.read).length === 0}
|
||||
onClick={() => {
|
||||
clearNotifications();
|
||||
}}
|
||||
>
|
||||
Flush
|
||||
</Button>
|
||||
) : null}
|
||||
<Button
|
||||
color="primary"
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
navigate("/admin?tab=organization&admin_tab=priorities")
|
||||
}}
|
||||
>
|
||||
Explore
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
<Typography variant="body2" color="textSecondary" style={{ marginTop: 5, }}>
|
||||
Notifications generated made by Shuffle to help you discover issues or
|
||||
@@ -481,10 +481,10 @@ const Header = (props) => {
|
||||
if (response.status !== 200) {
|
||||
console.log("Error in response");
|
||||
} else {
|
||||
localStorage.removeItem("apps")
|
||||
localStorage.removeItem("workflows")
|
||||
localStorage.removeItem("userinfo")
|
||||
}
|
||||
localStorage.removeItem("apps")
|
||||
localStorage.removeItem("workflows")
|
||||
localStorage.removeItem("userinfo")
|
||||
}
|
||||
|
||||
return response.json();
|
||||
})
|
||||
@@ -496,6 +496,10 @@ const Header = (props) => {
|
||||
localStorage.setItem("globalUrl", responseJson.region_url);
|
||||
//globalUrl = responseJson.region_url
|
||||
}
|
||||
if (responseJson["reason"] === "SSO_REDIRECT") {
|
||||
window.location.href = responseJson["url"]
|
||||
return
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
@@ -567,7 +571,7 @@ const Header = (props) => {
|
||||
alt="Your username here"
|
||||
src={parsedAvatar}
|
||||
/>
|
||||
<ExpandMoreIcon style={{color: "rgba(255,255,255,0.4)", }}/>
|
||||
<ExpandMoreIcon style={{ color: "rgba(255,255,255,0.4)", }} />
|
||||
</IconButton>
|
||||
<Menu
|
||||
id="simple-menu"
|
||||
@@ -604,11 +608,11 @@ const Header = (props) => {
|
||||
handleClose();
|
||||
}}
|
||||
>
|
||||
<NotificationsIcon style={{ marginRight: 5 }} /> Notifications
|
||||
<NotificationsIcon style={{ marginRight: 5 }} /> Notifications
|
||||
</MenuItem>
|
||||
</Link>
|
||||
|
||||
{/*notificationMenu*/}
|
||||
{/*notificationMenu*/}
|
||||
<Divider style={{ marginTop: 10, marginBottom: 10, }} />
|
||||
<Link to="/docs" style={hrefStyle}>
|
||||
<MenuItem
|
||||
@@ -985,9 +989,9 @@ const Header = (props) => {
|
||||
</span>
|
||||
|
||||
{userdata === undefined ||
|
||||
userdata.orgs === undefined ||
|
||||
userdata.orgs === null ||
|
||||
userdata.orgs.length <= 0 ? null : (
|
||||
userdata.orgs === undefined ||
|
||||
userdata.orgs === null ||
|
||||
userdata.orgs.length <= 0 ? null : (
|
||||
<span style={{ paddingTop: 5 }}>
|
||||
<Select
|
||||
disableUnderline
|
||||
@@ -1014,9 +1018,9 @@ const Header = (props) => {
|
||||
value={userdata.active_org.id}
|
||||
fullWidth
|
||||
onChange={(e) => {
|
||||
if (e.target.value === undefined || e.target.value === "create_new_suborgs") {
|
||||
return
|
||||
}
|
||||
if (e.target.value === undefined || e.target.value === "create_new_suborgs") {
|
||||
return
|
||||
}
|
||||
|
||||
handleClickChangeOrg(e.target.value);
|
||||
}}
|
||||
@@ -1148,32 +1152,32 @@ const Header = (props) => {
|
||||
</MenuItem>
|
||||
);
|
||||
})}
|
||||
<Divider />
|
||||
<Link to="/admin?tab=suborgs" style={hrefStyle}>
|
||||
<MenuItem
|
||||
key={"add suborgs"}
|
||||
style={{
|
||||
backgroundColor: theme.palette.inputColor,
|
||||
color: "white",
|
||||
height: 40,
|
||||
zIndex: 10003,
|
||||
}}
|
||||
value={"create_new_suborgs"}
|
||||
>
|
||||
<Tooltip
|
||||
color="primary"
|
||||
title={""}
|
||||
placement="left"
|
||||
>
|
||||
<div style={{ display: "flex", marginLeft: 85, }}>
|
||||
<AddIcon />
|
||||
<span style={{ marginLeft: 8 }}>
|
||||
Add suborgs
|
||||
</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</MenuItem>
|
||||
</Link>
|
||||
<Divider />
|
||||
<Link to="/admin?tab=suborgs" style={hrefStyle}>
|
||||
<MenuItem
|
||||
key={"add suborgs"}
|
||||
style={{
|
||||
backgroundColor: theme.palette.inputColor,
|
||||
color: "white",
|
||||
height: 40,
|
||||
zIndex: 10003,
|
||||
}}
|
||||
value={"create_new_suborgs"}
|
||||
>
|
||||
<Tooltip
|
||||
color="primary"
|
||||
title={""}
|
||||
placement="left"
|
||||
>
|
||||
<div style={{ display: "flex", marginLeft: 85, }}>
|
||||
<AddIcon />
|
||||
<span style={{ marginLeft: 8 }}>
|
||||
Add suborgs
|
||||
</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</MenuItem>
|
||||
</Link>
|
||||
</Select>
|
||||
</span>
|
||||
)}
|
||||
@@ -1444,100 +1448,100 @@ const Header = (props) => {
|
||||
:
|
||||
*/
|
||||
|
||||
const topbarHeight = showTopbar ? 40 : 0
|
||||
const topbar = !showTopbar ? null :
|
||||
curpath === "/" || curpath.includes("/docs/") || curpath === "/pricing" || curpath === "/contact" || curpath === "/search" ?
|
||||
<span style={{ zIndex: 50001, }}>
|
||||
<div style={{ position: "relative", height: topbarHeight, backgroundImage: "linear-gradient(to right, #f86a3e, #f34079)", overflow: "hidden", }}>
|
||||
<Typography variant="body1" style={{ paddingTop: 7, margin: "auto", textAlign: "center", color: "white", }}>
|
||||
Shuffle 1.4 is out! Read more about
|
||||
<u>
|
||||
<a href="https://github.com/Shuffle/Shuffle" style={{ color: "inherit", }} onClick={() => {
|
||||
ReactGA.event({
|
||||
category: "landingpage",
|
||||
action: "click_header_features",
|
||||
label: "",
|
||||
})
|
||||
const topbarHeight = showTopbar ? 40 : 0
|
||||
const topbar = !showTopbar ? null :
|
||||
curpath === "/" || curpath.includes("/docs/") || curpath === "/pricing" || curpath === "/contact" || curpath === "/search" ?
|
||||
<span style={{ zIndex: 50001, }}>
|
||||
<div style={{ position: "relative", height: topbarHeight, backgroundImage: "linear-gradient(to right, #f86a3e, #f34079)", overflow: "hidden", }}>
|
||||
<Typography variant="body1" style={{ paddingTop: 7, margin: "auto", textAlign: "center", color: "white", }}>
|
||||
Shuffle 1.4 is out! Read more about
|
||||
<u>
|
||||
<a href="https://github.com/Shuffle/Shuffle" style={{ color: "inherit", }} onClick={() => {
|
||||
ReactGA.event({
|
||||
category: "landingpage",
|
||||
action: "click_header_features",
|
||||
label: "",
|
||||
})
|
||||
|
||||
//if (window.drift !== undefined) {
|
||||
// window.drift.api.startInteraction({ interactionId: 341911 })
|
||||
//} else {
|
||||
// console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
|
||||
//}
|
||||
}} style={{ cursor: "pointer", textDecoration: "none", color: "rgba(255,255,255,0.8)" }}>
|
||||
Features
|
||||
</a>
|
||||
</u>
|
||||
,
|
||||
<u>
|
||||
<span onClick={() => {
|
||||
ReactGA.event({
|
||||
category: "landingpage",
|
||||
action: "click_header_pricing",
|
||||
label: "",
|
||||
})
|
||||
//if (window.drift !== undefined) {
|
||||
// window.drift.api.startInteraction({ interactionId: 341911 })
|
||||
//} else {
|
||||
// console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
|
||||
//}
|
||||
}} style={{ cursor: "pointer", textDecoration: "none", color: "rgba(255,255,255,0.8)" }}>
|
||||
Features
|
||||
</a>
|
||||
</u>
|
||||
,
|
||||
<u>
|
||||
<span onClick={() => {
|
||||
ReactGA.event({
|
||||
category: "landingpage",
|
||||
action: "click_header_pricing",
|
||||
label: "",
|
||||
})
|
||||
|
||||
navigate("/pricing")
|
||||
navigate("/pricing")
|
||||
|
||||
//if (window.drift !== undefined) {
|
||||
// window.drift.api.startInteraction({ interactionId: 341911 })
|
||||
//} else {
|
||||
// console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
|
||||
//}
|
||||
}} style={{ cursor: "pointer", textDecoration: "none", color: "rgba(255,255,255,0.8)" }}>
|
||||
Pricing
|
||||
</span>
|
||||
</u>
|
||||
and
|
||||
<u>
|
||||
<span onClick={() => {
|
||||
ReactGA.event({
|
||||
category: "landingpage",
|
||||
action: "click_header_creators",
|
||||
label: "",
|
||||
})
|
||||
//if (window.drift !== undefined) {
|
||||
// window.drift.api.startInteraction({ interactionId: 341911 })
|
||||
//} else {
|
||||
// console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
|
||||
//}
|
||||
}} style={{ cursor: "pointer", textDecoration: "none", color: "rgba(255,255,255,0.8)" }}>
|
||||
Pricing
|
||||
</span>
|
||||
</u>
|
||||
and
|
||||
<u>
|
||||
<span onClick={() => {
|
||||
ReactGA.event({
|
||||
category: "landingpage",
|
||||
action: "click_header_creators",
|
||||
label: "",
|
||||
})
|
||||
|
||||
navigate("/creators")
|
||||
navigate("/creators")
|
||||
|
||||
//if (window.drift !== undefined) {
|
||||
// window.drift.api.startInteraction({ interactionId: 341911 })
|
||||
//} else {
|
||||
// console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
|
||||
//}
|
||||
}} style={{ cursor: "pointer", textDecoration: "none", color: "rgba(255,255,255,0.8)" }}>
|
||||
Earning as a Creator
|
||||
</span>
|
||||
</u>
|
||||
</Typography>
|
||||
<IconButton color="secondary" style={{ position: "absolute", top: -3, right: 20, }} onClick={(event) => { setShowTopbar(false) }}>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</div>
|
||||
</span>
|
||||
:
|
||||
null
|
||||
|
||||
//if (window.drift !== undefined) {
|
||||
// window.drift.api.startInteraction({ interactionId: 341911 })
|
||||
//} else {
|
||||
// console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
|
||||
//}
|
||||
}} style={{ cursor: "pointer", textDecoration: "none", color: "rgba(255,255,255,0.8)" }}>
|
||||
Earning as a Creator
|
||||
</span>
|
||||
</u>
|
||||
</Typography>
|
||||
<IconButton color="secondary" style={{ position: "absolute", top: -3, right: 20, }} onClick={(event) => { setShowTopbar(false) }}>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</div>
|
||||
</span>
|
||||
:
|
||||
null
|
||||
|
||||
return !isMobile ?
|
||||
<div style={{marginTop: 0, }}>
|
||||
<AppBar
|
||||
color="transparent"
|
||||
elevation={0}
|
||||
style={{
|
||||
backgroundColor: "transparent",
|
||||
boxShadow: "none",
|
||||
minHeight: 68,
|
||||
maxHeight: 68,
|
||||
backgroundColor: theme.palette.backgroundColor,
|
||||
}}
|
||||
>
|
||||
<div style={{ marginTop: 0, }}>
|
||||
<AppBar
|
||||
color="transparent"
|
||||
elevation={0}
|
||||
style={{
|
||||
backgroundColor: "transparent",
|
||||
boxShadow: "none",
|
||||
minHeight: 68,
|
||||
maxHeight: 68,
|
||||
backgroundColor: theme.palette.backgroundColor,
|
||||
}}
|
||||
>
|
||||
|
||||
{topbar}
|
||||
{topbar}
|
||||
|
||||
<div style={{position: "sticky", top: 0, }}>
|
||||
{loginTextBrowser}
|
||||
</div>
|
||||
</AppBar>
|
||||
</div>
|
||||
<div style={{ position: "sticky", top: 0, }}>
|
||||
{loginTextBrowser}
|
||||
</div>
|
||||
</AppBar>
|
||||
</div>
|
||||
:
|
||||
<MobileView>{loginTextMobile}</MobileView>
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1485,15 +1485,15 @@ const ParsedAction = (props) => {
|
||||
);
|
||||
}
|
||||
|
||||
// Added autofill to make this ALOT simpler
|
||||
if (isCloud && (selectedAction.app_name === "Shuffle Tools" || selectedAction.app_name === "email") && (selectedAction.name === "send_email_shuffle" || selectedAction.name === "send_sms_shuffle") && data.name === "apikey") {
|
||||
if (selectedActionParameters[count].length === 0) {
|
||||
selectedAction.parameters[count].value = "TMP: Will be replaced during execution if cloud"
|
||||
setSelectedAction(selectedAction)
|
||||
}
|
||||
// Added autofill to make this ALOT simpler
|
||||
if (isCloud && (selectedAction.app_name === "Shuffle Tools" || selectedAction.app_name === "email") && (selectedAction.name === "send_email_shuffle" || selectedAction.name === "send_sms_shuffle") && data.name === "apikey") {
|
||||
if (selectedActionParameters[count].length === 0) {
|
||||
selectedAction.parameters[count].value = "TMP: Will be replaced during execution if cloud"
|
||||
setSelectedAction(selectedAction)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
var staticcolor = "inherit";
|
||||
var actioncolor = "inherit";
|
||||
@@ -1558,6 +1558,17 @@ const ParsedAction = (props) => {
|
||||
*/
|
||||
}
|
||||
|
||||
if (selectedAction.name === "custom_action" && data.name === "body") {
|
||||
for (var key in selectedActionParameters) {
|
||||
const param = selectedActionParameters[key]
|
||||
if (param.name === "method") {
|
||||
if (param.value === "GET") {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.name.startsWith("${") && data.name.endsWith("}")) {
|
||||
const paramcheck = selectedAction.parameters.find((param) => param.name === "body");
|
||||
|
||||
@@ -2678,8 +2689,6 @@ const ParsedAction = (props) => {
|
||||
/*<div style={{width: 17, height: 17, borderRadius: 17 / 2, backgroundColor: itemColor, marginRight: 10, marginTop: 2, marginTop: "auto", marginBottom: "auto",}}/>*/
|
||||
}
|
||||
|
||||
//console.log(data.configuration)
|
||||
|
||||
const buttonTitle = `Authenticate ${selectedApp.name.replaceAll("_", " ")}`
|
||||
const hasAutocomplete = data.autocompleted === true
|
||||
return (
|
||||
@@ -2840,8 +2849,8 @@ const ParsedAction = (props) => {
|
||||
setUpdate(Math.random());
|
||||
}}
|
||||
onClick={() => {
|
||||
setShowAutocomplete(true)
|
||||
}}
|
||||
setShowAutocomplete(true)
|
||||
}}
|
||||
fullWidth
|
||||
open={showAutocomplete}
|
||||
style={{
|
||||
@@ -3007,7 +3016,9 @@ const ParsedAction = (props) => {
|
||||
a.category_label !== undefined && a.category_label !== null && a.category_label.length > 0).concat(sortByKey(selectedApp.actions, "label"))
|
||||
).sort(sortByCategoryLabel))
|
||||
|
||||
var baselabel = selectedAction.label;
|
||||
|
||||
const selectedAppIcon = selectedAction.large_image
|
||||
var baselabel = selectedAction.label
|
||||
return (
|
||||
<div style={appApiViewStyle} id="parsed_action_view">
|
||||
|
||||
@@ -3015,13 +3026,29 @@ const ParsedAction = (props) => {
|
||||
<span>
|
||||
<div style={{ display: "flex", minHeight: 40, marginBottom: 30 }}>
|
||||
<div style={{ flex: 1 }}>
|
||||
<h3 style={{ marginBottom: 5 }}>
|
||||
{(
|
||||
selectedAction.app_name.charAt(0).toUpperCase() +
|
||||
selectedAction.app_name.substring(1)
|
||||
).replaceAll("_", " ")}
|
||||
</h3>
|
||||
<div style={{display: "flex", marginTop: 10, }}>
|
||||
<div style={{ display: "flex", }}
|
||||
onClick={() => {
|
||||
//window.open("/apps/${selectedAction.app_id}", "_blank")
|
||||
}}
|
||||
>
|
||||
<Tooltip title={"App: "+selectedAction.app_name} placement="top">
|
||||
<img src={selectedAppIcon} style={{
|
||||
width: 30,
|
||||
height: 30,
|
||||
marginRight: 10,
|
||||
borderRadius: 5,
|
||||
marginTop: 13,
|
||||
border: "2px solid rgba(255,255,255,0.3)",
|
||||
}} />
|
||||
</Tooltip>
|
||||
<h3 style={{ }}>
|
||||
{(
|
||||
selectedAction.app_name.charAt(0).toUpperCase() +
|
||||
selectedAction.app_name.substring(1)
|
||||
).replaceAll("_", " ")}
|
||||
</h3>
|
||||
</div>
|
||||
<div style={{display: "flex", marginTop: 0, }}>
|
||||
<IconButton
|
||||
style={{
|
||||
marginTop: "auto",
|
||||
|
||||
@@ -24,8 +24,9 @@ const Priorities = (props) => {
|
||||
const [showDismissed, setShowDismissed] = React.useState(false);
|
||||
const [showRead, setShowRead] = React.useState(false);
|
||||
const [appFramework, setAppFramework] = React.useState({});
|
||||
const [selectedWorkflow, setSelectedWorkflow] = React.useState("");
|
||||
const [selectedExecutionId, setSelectedExecutionId] = React.useState("");
|
||||
|
||||
const [selectedWorkflow, setSelectedWorkflow] = React.useState("NO HIGHLIGHT");
|
||||
const [selectedExecutionId, setSelectedExecutionId] = React.useState("NO HIGHLIGHT");
|
||||
let navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
@@ -86,6 +87,44 @@ const Priorities = (props) => {
|
||||
})
|
||||
}
|
||||
|
||||
const clearNotifications = () => {
|
||||
// Don't really care about the logout
|
||||
|
||||
toast("Clearing notifications")
|
||||
fetch(`${globalUrl}/api/v1/notifications/clear`, {
|
||||
credentials: "include",
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(function (response) {
|
||||
if (response.status !== 200) {
|
||||
console.log("Error in response");
|
||||
}
|
||||
|
||||
return response.json();
|
||||
})
|
||||
.then(function (responseJson) {
|
||||
if (responseJson.success === true) {
|
||||
// Reload the UI
|
||||
const newNotifications = notifications.map((notification) => {
|
||||
notification.read = true
|
||||
return notification
|
||||
})
|
||||
|
||||
setNotifications(newNotifications)
|
||||
setShowRead(true)
|
||||
} else {
|
||||
toast("Failed dismissing notifications. Please try again later.");
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("error in notification dismissal: ", error);
|
||||
//removeCookie("session_token", {path: "/"})
|
||||
});
|
||||
};
|
||||
|
||||
const dismissNotification = (alert_id, disabled) => {
|
||||
var notificationurl = `${globalUrl}/api/v1/notifications/${alert_id}/markasread`
|
||||
if (disabled === true) {
|
||||
@@ -178,7 +217,7 @@ const Priorities = (props) => {
|
||||
var orgId = "";
|
||||
|
||||
|
||||
const highlighted = data.reference_url === undefined || data.reference_url === null || data.reference_url.length === 0 ? false : data.reference_url.includes(selectedExecutionId) || data.reference_url.includes(selectedWorkflow)
|
||||
const highlighted = selectedExecutionId === "" && selectedWorkflow === "" ? false : data.reference_url === undefined || data.reference_url === null || data.reference_url.length === 0 ? false : data.reference_url.includes(selectedExecutionId) || data.reference_url.includes(selectedWorkflow)
|
||||
|
||||
if (userdata.orgs !== undefined) {
|
||||
const foundOrg = userdata.orgs.find((org) => org.id === data["org_id"]);
|
||||
@@ -351,12 +390,27 @@ const Priorities = (props) => {
|
||||
</a>
|
||||
</span>
|
||||
<div/>
|
||||
<Switch
|
||||
checked={showRead}
|
||||
onChange={() => {
|
||||
setShowRead(!showRead);
|
||||
}}
|
||||
/> Show read
|
||||
<div style={{display: "flex", marginTop: 10, marginBottom: 10, }}>
|
||||
<Switch
|
||||
checked={showRead}
|
||||
onChange={() => {
|
||||
setShowRead(!showRead);
|
||||
}}
|
||||
/><span style={{marginTop: 5, }}> Show read </span>
|
||||
{notifications !== undefined && notifications !== null && notifications.length > 1 ? (
|
||||
<Button
|
||||
color="primary"
|
||||
variant="outlined"
|
||||
disabled={notifications.filter((data) => !data.read).length === 0}
|
||||
onClick={() => {
|
||||
clearNotifications()
|
||||
}}
|
||||
style={{marginLeft: 50, }}
|
||||
>
|
||||
Mark all as read
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
{notifications === null || notifications === undefined || notifications.length === 0 ? null :
|
||||
<div>
|
||||
{notifications.map((notification, index) => {
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
DialogTitle,
|
||||
DialogContent,
|
||||
} from '@mui/material';
|
||||
|
||||
import Mousetrap from 'mousetrap';
|
||||
|
||||
import {
|
||||
@@ -31,7 +32,6 @@ import {
|
||||
|
||||
import { Search as SearchIcon, Close as CloseIcon, Folder as FolderIcon, Code as CodeIcon, LibraryBooks as LibraryBooksIcon } from '@mui/icons-material'
|
||||
import KeyboardCommandKeyIcon from '@mui/icons-material/KeyboardCommandKey';
|
||||
import algoliasearch from 'algoliasearch/lite';
|
||||
import aa from 'search-insights'
|
||||
import { InstantSearch, Configure, connectSearchBox, connectHits, Index } from 'react-instantsearch-dom';
|
||||
//import { InstantSearch, SearchBox, Hits, connectSearchBox, connectHits, Index } from 'react-instantsearch-dom';
|
||||
@@ -42,7 +42,6 @@ const chipStyle = {
|
||||
backgroundColor: "#3d3f43", height: 30, marginRight: 5, paddingLeft: 5, paddingRight: 5, height: 28, cursor: "pointer", borderColor: "#3d3f43", color: "white",
|
||||
}
|
||||
|
||||
const searchClient = algoliasearch("JNSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240")
|
||||
const SearchField = props => {
|
||||
const { serverside, userdata, isMobile, isLoaded, globalUrl, isHeader, isLoggedIn, small, rounded } = props
|
||||
|
||||
|
||||
Reference in New Issue
Block a user