From 536dc3fcb8a5b336d2823234e44e13e3bed2381f Mon Sep 17 00:00:00 2001 From: myrmidex Date: Tue, 12 Aug 2025 00:33:02 +0200 Subject: [PATCH] Fix modals --- frontend/src/pages/Channels.tsx | 146 ++++++++++++++++---------------- frontend/src/pages/Routes.tsx | 134 +++++++++++++++-------------- 2 files changed, 143 insertions(+), 137 deletions(-) diff --git a/frontend/src/pages/Channels.tsx b/frontend/src/pages/Channels.tsx index 310e2d6..bfc7947 100644 --- a/frontend/src/pages/Channels.tsx +++ b/frontend/src/pages/Channels.tsx @@ -129,7 +129,7 @@ const Channels: React.FC = () => {

- !{channel.name}@{channel.platform_instance?.url?.replace(/^https?:\/\//, '')} + {channel.display_name || channel.name}

{ )}
- {channel.display_name && ( -

{channel.display_name}

- )} +

+ !{channel.name}@{channel.platform_instance?.url?.replace(/^https?:\/\//, '')} +

@@ -229,79 +229,77 @@ const Channels: React.FC = () => { {/* Account Management Modal */} {showAccountModal && ( -
-
-
setShowAccountModal(null)}>
- - - -
-
-
-
- -
-
-

- Manage Accounts for {showAccountModal.channelName} -

-
-

- Select a platform account to link to this channel: -

- - {accounts && accounts.length > 0 ? ( -
- {accounts - .filter(account => !channels?.find(c => c.id === showAccountModal.channelId)?.platform_accounts?.some(pa => pa.id === account.id)) - .map((account) => ( - - ))} - - {accounts.filter(account => !channels?.find(c => c.id === showAccountModal.channelId)?.platform_accounts?.some(pa => pa.id === account.id)).length === 0 && ( -

- All available accounts are already linked to this channel. -

+
setShowAccountModal(null)}> +
e.stopPropagation()} + > +
+
+ +
+
+

+ Manage Accounts for {showAccountModal.channelName} +

+
+
+ +
+

+ Select a platform account to link to this channel: +

+ + {accounts && accounts.length > 0 ? ( +
+ {accounts + .filter(account => !channels?.find(c => c.id === showAccountModal.channelId)?.platform_accounts?.some(pa => pa.id === account.id)) + .map((account) => ( +
+ + {account.is_active ? 'Active' : 'Inactive'} + +
+ + ))} + + {accounts.filter(account => !channels?.find(c => c.id === showAccountModal.channelId)?.platform_accounts?.some(pa => pa.id === account.id)).length === 0 && ( +

+ All available accounts are already linked to this channel. +

+ )}
-
-
- -
+ ) : ( +

+ No platform accounts available. Create a platform account first. +

+ )} +
+ +
+
diff --git a/frontend/src/pages/Routes.tsx b/frontend/src/pages/Routes.tsx index cbbc86a..edecda9 100644 --- a/frontend/src/pages/Routes.tsx +++ b/frontend/src/pages/Routes.tsx @@ -280,11 +280,16 @@ const CreateRouteModal: React.FC = ({ feeds, channels, on }; return ( -
-
-
-

Create New Route

-
+
+
+
+ + + +
e.stopPropagation()}> +
+

Create New Route

+
- + +
@@ -379,66 +385,68 @@ const EditRouteModal: React.FC = ({ route, onClose, onSubmi }; return ( -
-
-
-

Edit Route

-
-

- Feed: {route.feed?.name} -

-

- Channel: {route.platform_channel?.display_name || route.platform_channel?.name} -

-
-
-
- - setPriority(parseInt(e.target.value))} - className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" - /> -

Higher priority routes are processed first

-
- -
- { - // Keywords will be refreshed via React Query invalidation - }} - /> -
- -
- - -
-
+
+
e.stopPropagation()} + > +

Edit Route

+
+

+ Feed: {route.feed?.name} +

+

+ Channel: {route.platform_channel?.display_name || route.platform_channel?.name} +

+
+
+ + setPriority(parseInt(e.target.value))} + className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" + /> +

Higher priority routes are processed first

+
+ +
+ { + // Keywords will be refreshed via React Query invalidation + }} + /> +
+ +
+ + +
+
); }; -export default Routes; \ No newline at end of file +export default Routes;