From 080f30aecd92c61b4b8c7480c82467d3d9b2d7be Mon Sep 17 00:00:00 2001 From: Hari Krishna Date: Mon, 29 Apr 2024 05:08:06 +0000 Subject: [PATCH] reverting changes that are not done by me --- backend/go-app/main.go | 2 +- frontend/src/views/Admin.jsx | 462 ++++++++++++++--------------------- 2 files changed, 184 insertions(+), 280 deletions(-) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 45bd1b83..eb73f9b9 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -4907,7 +4907,7 @@ func initHandlers() { r.HandleFunc("/api/v1/triggers/outlook/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/register", shuffle.HandleNewGmailRegister).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/getFolders", shuffle.HandleGetGmailFolders).Methods("GET", "OPTIONS") - //r.HandleFunc("/api/v1/triggers/all", shuffle.HandleGetTriggers).Methods("GET", "OPTIONS") + r.HandleFunc("/api/v1/triggers", shuffle.HandleGetTriggers).Methods("GET", "OPTIONS") //r.HandleFunc("/api/v1/triggers/gmail/routing", handleGmailRouting).Methods("POST", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index d0de71c6..eb4173ef 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -242,13 +242,13 @@ const Admin = (props) => { }, [isDropzone]); useEffect(() => { - if (userdata.orgs !== undefined && + if ( + userdata.orgs !== undefined && userdata.orgs !== null && - userdata.orgs.length > 0) { - handleGetSubOrgs(userdata.active_org.id); - } else { - console.log("Bad Userdata with orgs not existing") - } + userdata.orgs.length > 0 + ) { + handleGetSubOrgs(userdata.active_org.id); + } else console.log("error in user data"); }, [userdata]); useEffect(() => { @@ -738,7 +738,7 @@ If you're interested, please let me know a time that works for you, or set up a }; const handleGetAllTriggers = () => { - fetch(globalUrl + "/api/v1/triggers/all", { + fetch(globalUrl + "/api/v1/triggers", { method: "GET", headers: { "Content-Type": "application/json", @@ -933,13 +933,6 @@ If you're interested, please let me know a time that works for you, or set up a }); }; - - if (userdata.support === true && selectedOrganization.id !== "" && selectedOrganization.id !== undefined && selectedOrganization.id !== null && selectedOrganization.id !== userdata.active_org.id) { - toast("Refreshing window to fix org support access") - window.location.reload() - return null - } - if ( userdata.support === true && selectedOrganization.id !== "" && @@ -4556,107 +4549,7 @@ If you're interested, please let me know a time that works for you, or set up a /> ); - const schedulesView = - curTab === 5 ? ( -
-
-

Schedules

- - Schedules used in Workflows. Makes locating and control easier.{" "} - - Learn more - - -
- - - - - - - - - - - {allSchedules === undefined || allSchedules === null - ? null - : allSchedules.map((schedule, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } - - return ( - - 0 ? ( - schedule.frequency - ) : ( - {schedule.seconds} seconds - ) - } - /> - - - {schedule.workflow_id} - - } - /> - - - - - - ); - })} - - -
-

WebHooks

-
- - - - - - - - - - - - {webHooks === undefined || webHooks === null - ? null - : webHooks.map((webhook, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } - - return ( - - - - + + - - - ); - })} - - - {/*
-

Tenzir Pipelines

- - Controls a pipeline to run things.{" "} - - Learn more - - + { + const elementName = "copy_element_shuffle"; + var copyText = document.getElementById(elementName); + if (copyText !== null && copyText !== undefined) { + const clipboard = navigator.clipboard; + if (clipboard === undefined) { + toast("Can only copy over HTTPS (port 3443)"); + return; + } + + navigator.clipboard.writeText(webhook.info.url); + copyText.select(); + copyText.setSelectionRange( + 0, + 99999, + ); /* For mobile devices */ + + /* Copy the text inside the text field */ + document.execCommand("copy"); + + toast("URL copied to clipboard"); + } + }} + > + + + + ) + } + /> + + + + + + ); + })} + + + {/*
+

Tenzir Pipelines

+ + Controls a pipeline to run things.{" "} + + Learn more + + +
+ + */}
- - */} -
-) : null; + ) : null; const appCategoryView = curTab === 8 ? (