From 652afaf8638886b5d7fc51d312bd9bda4180eb5d Mon Sep 17 00:00:00 2001 From: aliang Date: Mon, 30 Dec 2024 15:04:45 +0800 Subject: [PATCH] fix(ui): align job info view in context providers (#3629) * fix(ui): align job info view in context providers * update: table layout * [autofix.ci] apply automated fixes * update --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../(dashboard)/components/dashboard-main.tsx | 2 +- .../profile/components/change-name.tsx | 2 +- .../profile/components/change-password.tsx | 6 +- .../(dashboard)/profile/components/email.tsx | 2 +- .../detail/components/provider-detail.tsx | 209 +++++++------- .../providers/components/job-trigger.tsx | 2 +- .../providers/doc/components/custom-doc.tsx | 258 +++++++++--------- .../git/components/repository-table.tsx | 142 +++++----- 8 files changed, 317 insertions(+), 306 deletions(-) diff --git a/ee/tabby-ui/app/(dashboard)/components/dashboard-main.tsx b/ee/tabby-ui/app/(dashboard)/components/dashboard-main.tsx index a2b652cfe434..22a3a3942089 100644 --- a/ee/tabby-ui/app/(dashboard)/components/dashboard-main.tsx +++ b/ee/tabby-ui/app/(dashboard)/components/dashboard-main.tsx @@ -34,7 +34,7 @@ export default function MainContent({ }, [pathname]) return ( - + {/* Wraps right hand side into ScrollArea, making scroll bar consistent across all browsers */}
diff --git a/ee/tabby-ui/app/(dashboard)/profile/components/change-name.tsx b/ee/tabby-ui/app/(dashboard)/profile/components/change-name.tsx index 34af29f5aa3f..454f4d24b4aa 100644 --- a/ee/tabby-ui/app/(dashboard)/profile/components/change-name.tsx +++ b/ee/tabby-ui/app/(dashboard)/profile/components/change-name.tsx @@ -81,7 +81,7 @@ const ChangeNameForm: React.FC = ({ Name - + diff --git a/ee/tabby-ui/app/(dashboard)/profile/components/change-password.tsx b/ee/tabby-ui/app/(dashboard)/profile/components/change-password.tsx index 5f62ca74d442..f39070aadfa7 100644 --- a/ee/tabby-ui/app/(dashboard)/profile/components/change-password.tsx +++ b/ee/tabby-ui/app/(dashboard)/profile/components/change-password.tsx @@ -95,7 +95,7 @@ const ChangePasswordForm: React.FC = ({ Old password = ({ New password = ({ Confirm new password {
diff --git a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/[kind]/detail/components/provider-detail.tsx b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/[kind]/detail/components/provider-detail.tsx index 9e0b6eb249ed..f4f4d0b464d9 100644 --- a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/[kind]/detail/components/provider-detail.tsx +++ b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/[kind]/detail/components/provider-detail.tsx @@ -284,111 +284,114 @@ const ActiveRepoTable: React.FC<{ return ( <> - - - - Name - URL - Access - Job - - - - - - - {activeRepos?.length || recentlyActivatedRepositories?.length ? ( - <> - {recentlyActivatedRepositories?.map(x => { - return ( - - - {x.node.displayName} - - - {x.node.gitUrl} - - - - -
- -
-
-
- ) - })} - {activeRepos?.map(x => { - return ( - - - {x.node.displayName} - - - {x.node.gitUrl} - - - - - - - handleTriggerJobRun(x.node.jobInfo.command) - } - /> - - - - - - ) - })} - - ) : ( + +
+ - -
- No repositories - -
-
+ Name + URL + Access + Job + + +
- )} - -
+ + + {activeRepos?.length || recentlyActivatedRepositories?.length ? ( + <> + {recentlyActivatedRepositories?.map(x => { + return ( + + + {x.node.displayName} + + + {x.node.gitUrl} + + + + +
+ +
+
+
+ ) + })} + {activeRepos?.map(x => { + return ( + + + {x.node.displayName} + + + {x.node.gitUrl} + + + + + + + handleTriggerJobRun(x.node.jobInfo.command) + } + /> + + + + + + ) + })} + + ) : ( + + +
+ No repositories + +
+
+
+ )} +
+ + + {(page > 1 || pageInfo?.hasNextPage) && (
diff --git a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/components/job-trigger.tsx b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/components/job-trigger.tsx index 9c7c6ad37738..ad1656273ec0 100644 --- a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/components/job-trigger.tsx +++ b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/providers/components/job-trigger.tsx @@ -110,7 +110,7 @@ export function JobInfoView(props: JobInfoProps) { return (
- + - - - - - Name - - - - - -
- inputRef.current?.focus()} - /> - setFilterPattern(e.target.value)} - ref={inputRef} - placeholder="Search..." - onKeyDown={onInputKeyDown} - /> - {filterPattern ? ( - - ) : null} -
-
-
-
- - - -
-
- Access - Job - -
-
- - {!currentList?.length && !fetching ? ( - - - {!list?.length ? ( -
- No data - - - Add - -
- ) : ( - 'No matches data' - )} -
-
- ) : ( - <> - {currentList?.map(x => { - return ( - - -

{x.node.name}

-

- {x.node.url} -

-
- - +
+ + + + Name + + + + + +
+ inputRef.current?.focus()} /> - - - { - if (x.node?.jobInfo?.command) { - handleTriggerJobRun( - x.node.id, - x.node?.jobInfo.command - ) - } - }} + setFilterPattern(e.target.value)} + ref={inputRef} + placeholder="Search..." + onKeyDown={onInputKeyDown} /> - - - - - - ) - })} - - )} - -
+ {filterPattern ? ( + + ) : null} +
+ + +
+ + + +
+ + Access + Job + + + + + {!currentList?.length && !fetching ? ( + + + {!list?.length ? ( +
+ No data + + + Add + +
+ ) : ( + 'No matches data' + )} +
+
+ ) : ( + <> + {currentList?.map(x => { + return ( + + +

{x.node.name}

+

+ {x.node.url} +

+
+ + + + + { + if (x.node?.jobInfo?.command) { + handleTriggerJobRun( + x.node.id, + x.node?.jobInfo.command + ) + } + }} + /> + + + + +
+ ) + })} + + )} +
+ + + - - - - Name - Git URL - Access - Job - - - - - {!currentPageRepos?.length && currentPage === 1 ? ( + +
+ - - No Data - + Name + Git URL + Access + Job + - ) : ( - <> - {currentPageRepos?.map(x => { - return ( - - - {x.node.name} - - - {x.node.gitUrl} - - - - - - - handleTriggerJobRun(x.node.jobInfo.command) - } - /> - - - - - - ) - })} - - )} - -
+ {x.node.name} + + + {x.node.gitUrl} + + + + + + + handleTriggerJobRun(x.node.jobInfo.command) + } + /> + + + + + + ) + })} + + )} + + + + {showPagination && (