From 5916a76d0d8a542bc275090bf09ae3faae6f52e2 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Fri, 30 Jun 2023 20:24:19 -0300 Subject: [PATCH] formatting code --- src/backend/langflow/graph/edge/base.py | 6 +-- src/frontend/src/App.tsx | 4 +- .../components/parameterComponent/index.tsx | 10 ++--- .../src/CustomNodes/GenericNode/index.tsx | 20 +++++----- .../components/singleAlertComponent/index.tsx | 12 +++--- .../src/alerts/alertDropDown/index.tsx | 10 ++--- src/frontend/src/alerts/error/index.tsx | 2 +- src/frontend/src/alerts/notice/index.tsx | 4 +- src/frontend/src/alerts/success/index.tsx | 2 +- .../components/CrashErrorComponent/index.tsx | 12 +++--- .../EditFlowSettingsComponent/index.tsx | 4 +- .../ExtraSidebarComponent/index.tsx | 16 ++++---- .../ReactTooltipComponent/index.tsx | 2 +- .../src/components/cardComponent/index.tsx | 10 ++--- .../chatComponent/buildTrigger/index.tsx | 6 +-- .../chatComponent/chatMessage/index.tsx | 12 +++--- .../chatComponent/chatTrigger/index.tsx | 6 +-- .../components/codeAreaComponent/index.tsx | 20 +++++----- .../components/dropdownComponent/index.tsx | 12 +++--- .../src/components/floatComponent/index.tsx | 3 +- .../components/menuBar/index.tsx | 18 ++++----- .../src/components/headerComponent/index.tsx | 30 +++++++-------- .../src/components/inputComponent/index.tsx | 16 ++++---- .../components/inputFileComponent/index.tsx | 15 +++----- .../components/inputListComponent/index.tsx | 22 ++++++----- .../src/components/intComponent/index.tsx | 6 +-- .../src/components/loadingComponent/index.tsx | 6 +-- .../src/components/promptComponent/index.tsx | 16 +++++--- .../components/textAreaComponent/index.tsx | 16 +++++--- .../src/components/toggleComponent/index.tsx | 8 ++-- src/frontend/src/components/ui/card.tsx | 2 +- .../src/components/ui/dropdown-menu.tsx | 2 +- .../src/components/ui/rename-label.tsx | 4 +- src/frontend/src/components/ui/tabs.tsx | 2 +- src/frontend/src/constants.tsx | 2 +- src/frontend/src/modals/ApiModal/index.tsx | 10 ++--- .../src/modals/EditNodeModal/index.tsx | 18 ++++----- .../NodeModal/components/ModalField/index.tsx | 2 +- src/frontend/src/modals/NodeModal/index.tsx | 20 +++++----- .../src/modals/chatModal/chatInput/index.tsx | 4 +- .../chatModal/chatMessage/codeBlock/index.tsx | 4 +- .../modals/chatModal/chatMessage/index.tsx | 32 ++++++++-------- .../modals/chatModal/fileComponent/index.tsx | 20 +++++----- src/frontend/src/modals/chatModal/index.tsx | 26 ++++++------- .../src/modals/codeAreaModal/index.tsx | 8 ++-- src/frontend/src/modals/exportModal/index.tsx | 4 +- .../src/modals/flowSettingsModal/index.tsx | 4 +- .../src/modals/genericModal/index.tsx | 4 +- .../modals/importModal/buttonBox/index.tsx | 10 ++--- src/frontend/src/modals/importModal/index.tsx | 20 +++++----- src/frontend/src/modals/promptModal/index.tsx | 14 +++---- .../src/modals/textAreaModal/index.tsx | 14 +++---- .../src/pages/CommunityPage/index.tsx | 14 +++---- .../components/DisclosureComponent/index.tsx | 2 +- .../components/PageComponent/index.tsx | 12 +++--- .../extraSidebarComponent/index.tsx | 38 +++++++++---------- .../components/nodeToolbarComponent/index.tsx | 16 ++++---- src/frontend/src/pages/FlowPage/index.tsx | 2 +- src/frontend/src/pages/MainPage/index.tsx | 18 ++++----- 59 files changed, 325 insertions(+), 329 deletions(-) diff --git a/src/backend/langflow/graph/edge/base.py b/src/backend/langflow/graph/edge/base.py index b7a71ffa1..88a177e40 100644 --- a/src/backend/langflow/graph/edge/base.py +++ b/src/backend/langflow/graph/edge/base.py @@ -27,11 +27,7 @@ class Edge: # Get what type of input the target node is expecting self.matched_type = next( - ( - output - for output in self.source_types - if output in self.target_reqs - ), + (output for output in self.source_types if output in self.target_reqs), None, ) no_matched_type = self.matched_type is None diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 259c40fad..bf1fb7038 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -103,7 +103,7 @@ export default function App() { return ( //need parent component with width and height -
+
{ window.localStorage.removeItem("tabsData"); @@ -118,7 +118,7 @@ export default function App() {
{alertsList.map((alert) => ( diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 7e5b8e315..3dc17f3e2 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -86,7 +86,7 @@ export default function ParameterComponent({ 0 ? "items-center flex mt-3" : "items-center flex" + i > 0 ? "mt-3 flex items-center" : "flex items-center" )} >
<> -
+
{title} {required ? " *" : ""}
@@ -155,7 +155,7 @@ export default function ParameterComponent({ } className={classNames( left ? "-ml-0.5 " : "-mr-0.5 ", - "w-3 h-3 rounded-full border-2 bg-background" + "h-3 w-3 rounded-full border-2 bg-background" )} style={{ borderColor: color, @@ -220,7 +220,7 @@ export default function ParameterComponent({ ) : left === true && type === "str" && data.node.template[name].options ? ( -
+
-
+
diff --git a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx index 5827ccc2f..5a16390bb 100644 --- a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx @@ -25,14 +25,14 @@ export default function SingleAlert({ > {type === "error" ? (
-

+

{dropItem.title}

{dropItem.list ? ( @@ -72,17 +72,17 @@ export default function SingleAlert({
) : type === "notice" ? (
-

+

{dropItem.title}

-

+

{dropItem.link ? ( ) : (

diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx index fe6845ff9..ef703f624 100644 --- a/src/frontend/src/alerts/alertDropDown/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/index.tsx @@ -24,9 +24,9 @@ export default function AlertDropdown({}: AlertDropdownType) { return (
-
+
Notifications
-
+
{notificationList.length !== 0 ? ( notificationList.map((alertItem, index) => ( )) ) : ( -
+
No new notifications
)} diff --git a/src/frontend/src/alerts/error/index.tsx b/src/frontend/src/alerts/error/index.tsx index 872fa69bd..31980dc6b 100644 --- a/src/frontend/src/alerts/error/index.tsx +++ b/src/frontend/src/alerts/error/index.tsx @@ -39,7 +39,7 @@ export default function ErrorAlert({ removeAlert(id); }, 500); }} - className="rounded-md w-96 mt-6 shadow-xl bg-error-background p-4 cursor-pointer" + className="mt-6 w-96 cursor-pointer rounded-md bg-error-background p-4 shadow-xl" >
diff --git a/src/frontend/src/alerts/notice/index.tsx b/src/frontend/src/alerts/notice/index.tsx index 4d0747919..9af51a531 100644 --- a/src/frontend/src/alerts/notice/index.tsx +++ b/src/frontend/src/alerts/notice/index.tsx @@ -36,7 +36,7 @@ export default function NoticeAlert({ setShow(false); removeAlert(id); }} - className="rounded-md w-96 mt-6 shadow-xl bg-info-background p-4" + className="mt-6 w-96 rounded-md bg-info-background p-4 shadow-xl" >
@@ -44,7 +44,7 @@ export default function NoticeAlert({

{title}

-

+

{link !== "" ? (

diff --git a/src/frontend/src/components/CrashErrorComponent/index.tsx b/src/frontend/src/components/CrashErrorComponent/index.tsx index 8bd32af92..fd7d22c36 100644 --- a/src/frontend/src/components/CrashErrorComponent/index.tsx +++ b/src/frontend/src/components/CrashErrorComponent/index.tsx @@ -1,11 +1,11 @@ export default function CrashErrorComponent({ error, resetErrorBoundary }) { return ( -
-
-

+
+
+

Oops! An unknown error has occurred.

-

+

Please click the 'Reset Application' button to restore the application's state. If the error persists, please create an issue on our GitHub page. We apologize for any inconvenience this may have @@ -14,7 +14,7 @@ export default function CrashErrorComponent({ error, resetErrorBoundary }) {

@@ -22,7 +22,7 @@ export default function CrashErrorComponent({ error, resetErrorBoundary }) { href="https://github.com/logspace-ai/langflow/issues/new" target="_blank" rel="noopener noreferrer" - className="bg-status-red hover:bg-error-foreground text-background font-bold py-2 px-4 rounded" + className="rounded bg-status-red px-4 py-2 font-bold text-background hover:bg-error-foreground" > Create Issue diff --git a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx index 7aa225056..7ce5f4f26 100644 --- a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx +++ b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx @@ -47,7 +47,7 @@ export const EditFlowSettings: React.FC = ({
Name{" "} {isMaxLength && ( - + Character limit reached )} @@ -71,7 +71,7 @@ export const EditFlowSettings: React.FC = ({ onChange={handleDescriptionChange} value={description ?? ""} placeholder="Flow description" - className="max-h-[100px] mt-2 font-normal" + className="mt-2 max-h-[100px] font-normal" rows={3} /> diff --git a/src/frontend/src/components/ExtraSidebarComponent/index.tsx b/src/frontend/src/components/ExtraSidebarComponent/index.tsx index 913b6b8eb..6bc95cde7 100644 --- a/src/frontend/src/components/ExtraSidebarComponent/index.tsx +++ b/src/frontend/src/components/ExtraSidebarComponent/index.tsx @@ -18,10 +18,10 @@ export default function ExtraSidebar() {