Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit696d264

Browse files
refactor: remove app column from tasks table (#18135)
Remove the "app" column from the tasks table since the user can click on the task and use apps there.
1 parentd44d8ab commit696d264

File tree

1 file changed

+2
-90
lines changed

1 file changed

+2
-90
lines changed

‎site/src/pages/TasksPage/TasksPage.tsx

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import{API}from"api/api";
22
import{getErrorDetail,getErrorMessage}from"api/errors";
33
import{disabledRefetchOptions}from"api/queries/util";
4-
importtype{
5-
Template,
6-
Workspace,
7-
WorkspaceAgent,
8-
WorkspaceApp,
9-
}from"api/typesGenerated";
4+
importtype{Template}from"api/typesGenerated";
105
import{Avatar}from"components/Avatar/Avatar";
116
import{AvatarData}from"components/Avatar/AvatarData";
127
import{Button}from"components/Button/Button";
13-
import{ExternalImage}from"components/ExternalImage/ExternalImage";
148
import{displayError}from"components/GlobalSnackbar/utils";
159
import{Margins}from"components/Margins/Margins";
1610
import{
@@ -34,23 +28,15 @@ import {
3428
TableHeader,
3529
TableRow,
3630
}from"components/Table/Table";
37-
import{
38-
Tooltip,
39-
TooltipContent,
40-
TooltipProvider,
41-
TooltipTrigger,
42-
}from"components/Tooltip/Tooltip";
4331
import{useAuthenticated}from"hooks";
4432
import{ExternalLinkIcon,RotateCcwIcon,SendIcon}from"lucide-react";
45-
import{useAppLink}from"modules/apps/useAppLink";
4633
import{AI_PROMPT_PARAMETER_NAME,typeTask}from"modules/tasks/tasks";
4734
import{WorkspaceAppStatus}from"modules/workspaces/WorkspaceAppStatus/WorkspaceAppStatus";
48-
importtype{FC,PropsWithChildren,ReactNode}from"react";
35+
importtype{FC,ReactNode}from"react";
4936
import{Helmet}from"react-helmet-async";
5037
import{useMutation,useQuery,useQueryClient}from"react-query";
5138
import{LinkasRouterLink}from"react-router-dom";
5239
importTextareaAutosizefrom"react-textarea-autosize";
53-
import{cn}from"utils/cn";
5440
import{pageTitle}from"utils/page";
5541
import{relativeTime}from"utils/time";
5642

@@ -351,11 +337,6 @@ const TasksTable: FC<TasksTableProps> = ({ templates }) => {
351337
src={workspace.owner_avatar_url}
352338
/>
353339
</TableCell>
354-
<TableCellclassName="pl-10">
355-
{agent&&app&&(
356-
<IconAppLinkapp={app}workspace={workspace}agent={agent}/>
357-
)}
358-
</TableCell>
359340
</TableRow>
360341
);
361342
})
@@ -387,82 +368,13 @@ const TasksTable: FC<TasksTableProps> = ({ templates }) => {
387368
<TableHead>Task</TableHead>
388369
<TableHead>Status</TableHead>
389370
<TableHead>Created by</TableHead>
390-
<TableHeadclassName="w-0"/>
391371
</TableRow>
392372
</TableHeader>
393373
<TableBody>{body}</TableBody>
394374
</Table>
395375
);
396376
};
397377

398-
typeIconAppLinkProps={
399-
app:WorkspaceApp;
400-
workspace:Workspace;
401-
agent:WorkspaceAgent;
402-
};
403-
404-
constIconAppLink:FC<IconAppLinkProps>=({ app, workspace, agent})=>{
405-
constlink=useAppLink(app,{
406-
workspace,
407-
agent,
408-
});
409-
410-
return(
411-
<BaseIconLink
412-
key={app.id}
413-
label={`Open${link.label}`}
414-
href={link.href}
415-
onClick={(e)=>{
416-
link.onClick?.(e);
417-
e.stopPropagation();
418-
}}
419-
>
420-
<ExternalImagesrc={app.icon??"/icon/widgets.svg"}/>
421-
</BaseIconLink>
422-
);
423-
};
424-
425-
typeBaseIconLinkProps=PropsWithChildren<{
426-
label:string;
427-
href:string;
428-
isLoading?:boolean;
429-
target?:string;
430-
onClick?:(e:React.MouseEvent<HTMLAnchorElement>)=>void;
431-
}>;
432-
433-
constBaseIconLink:FC<BaseIconLinkProps>=({
434-
href,
435-
isLoading,
436-
label,
437-
children,
438-
target,
439-
onClick,
440-
})=>{
441-
return(
442-
<TooltipProvider>
443-
<Tooltip>
444-
<TooltipTriggerasChild>
445-
<Buttonvariant="outline"size="icon-lg"asChild>
446-
<a
447-
target={target}
448-
className={cn(["z-10 relative",{"animate-pulse":isLoading}])}
449-
href={href}
450-
onClick={(e)=>{
451-
e.stopPropagation();
452-
onClick?.(e);
453-
}}
454-
>
455-
{children}
456-
<spanclassName="sr-only">{label}</span>
457-
</a>
458-
</Button>
459-
</TooltipTrigger>
460-
<TooltipContent>{label}</TooltipContent>
461-
</Tooltip>
462-
</TooltipProvider>
463-
);
464-
};
465-
466378
exportconstdata={
467379
// TODO: This function is currently inefficient because it fetches all templates
468380
// and their parameters individually, resulting in many API calls and slow

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp