Skip to content

Commit de29337

Browse files
authored
[dashboard] minor fixes for pinning changes (#20001)
1 parent 823aae7 commit de29337

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

components/dashboard/src/workspaces/WorkspaceEntry.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const WorkspaceEntry: FunctionComponent<Props> = ({ info, shortVersion })
6161
<ItemFieldIcon>
6262
<WorkspaceStatusIndicator status={workspace?.status} />
6363
</ItemFieldIcon>
64-
<div className="flex-grow flex flex-col h-full py-auto">
64+
<div className="flex-grow flex flex-col h-full py-auto truncate">
6565
<a href={startUrl}>
6666
<div className="font-medium text-gray-800 dark:text-gray-200 truncate hover:text-blue-600 dark:hover:text-blue-400">
6767
{info.id}
@@ -77,40 +77,48 @@ export const WorkspaceEntry: FunctionComponent<Props> = ({ info, shortVersion })
7777
</div>
7878
{!shortVersion && (
7979
<>
80-
<div className="w-3/12 flex flex-col lg:flex-row lg:items-center lg:gap-6 justify-between px-3">
81-
<div className="text-gray-500 dark:text-gray-400 overflow-ellipsis truncate flex flex-row gap-1 items-center">
82-
<GitBranchIcon className="h-4 w-4" />
83-
<Tooltip content={currentBranch}>{currentBranch}</Tooltip>
80+
<div className="w-2/12 sm:w-3/12 xl:w-4/12 flex flex-col xl:flex-row xl:items-center xl:gap-6 justify-between px-1 md:px-3">
81+
<div className="text-gray-500 dark:text-gray-400 flex flex-row gap-1 items-center overflow-hidden">
82+
<div className="min-w-4">
83+
<GitBranchIcon className="h-4 w-4" />
84+
</div>
85+
<Tooltip content={currentBranch} className="truncate overflow-ellipsis">
86+
{currentBranch}
87+
</Tooltip>
8488
</div>
85-
<div className="mr-auto">
89+
<div className="mr-auto xl:hidden">
8690
<PendingChangesDropdown gitStatus={gitStatus} />
8791
</div>
8892
</div>
89-
<div className="w-2/12 px-3 flex items-center min-w">
93+
<div className="hidden xl:flex xl:items-center xl:min-w-46">
94+
<PendingChangesDropdown gitStatus={gitStatus} />
95+
</div>
96+
<div className="px-1 md:px-3 flex items-center min-w-96 w-28 lg:w-44 text-right">
9097
<Tooltip
9198
content={`Last Activate ${dayjs(
9299
info.status!.phase!.lastTransitionTime!.toDate(),
93100
).fromNow()}`}
101+
className="w-full"
94102
>
95103
<div className="text-sm w-full text-gray-400 overflow-ellipsis truncate">
96104
{dayjs(info.status?.phase?.lastTransitionTime?.toDate() ?? new Date()).fromNow()}
97105
</div>
98106
</Tooltip>
99107
</div>
100-
<div className="px-3 flex items-center">
108+
<div className="px-1 md:px-3 flex items-center">
101109
<div
110+
onClick={togglePinned}
102111
className={
103-
"px-2 flex items-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md cursor-pointer h-8 w-8"
112+
"group px-2 flex items-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md cursor-pointer h-8 w-8"
104113
}
105114
>
106115
<Tooltip content={workspace.metadata?.pinned ? "Unpin" : "Pin"}>
107116
<PinIcon
108-
onClick={togglePinned}
109117
className={
110118
"w-4 h-4 self-center " +
111119
(workspace.metadata?.pinned
112120
? "text-gray-600 dark:text-gray-300"
113-
: "text-gray-300 dark:text-500 hover:text-gray-600 dark:hover:text-gray-300")
121+
: "text-gray-300 dark:text-gray-600 group-hover:text-gray-600 dark:group-hover:text-gray-300")
114122
}
115123
/>
116124
</Tooltip>

components/dashboard/src/workspaces/WorkspaceOverflowMenu.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ export const WorkspaceEntryOverflowMenu: FunctionComponent<WorkspaceEntryOverflo
6666
workspaceId: workspace.id,
6767
spec: {
6868
admission: newLevel,
69-
}
69+
},
7070
});
7171
}, [updateWorkspace, workspace.id, workspace.spec?.admission]);
7272

7373
const togglePinned = useCallback(() => {
7474
updateWorkspace.mutate({
7575
workspaceId: workspace.id,
7676
metadata: {
77-
pinned: !workspace.metadata?.pinned
78-
}
77+
pinned: !workspace.metadata?.pinned,
78+
},
7979
});
8080
}, [updateWorkspace, workspace.id, workspace.metadata?.pinned]);
8181

@@ -105,11 +105,11 @@ export const WorkspaceEntryOverflowMenu: FunctionComponent<WorkspaceEntryOverflo
105105
title: "Open",
106106
href: startUrl.toString(),
107107
},
108-
{
109-
title: "Rename",
110-
href: "",
111-
onClick: () => setRenameModalVisible(true),
112-
},
108+
// {
109+
// title: "Rename",
110+
// href: "",
111+
// onClick: () => setRenameModalVisible(true),
112+
// },
113113
];
114114

115115
if (state === WorkspacePhase_Phase.RUNNING) {

0 commit comments

Comments
 (0)