Skip to content

Commit 3f77afb

Browse files
committed
feat: Explain why imported applications are locked
https://harperdb.atlassian.net/browse/STUDIO-492
1 parent d0d25c1 commit 3f77afb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/features/instance/applications/components/ContentActions.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { RestartButton } from '@/components/RestartButton';
22
import { Button } from '@/components/ui/button';
3+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
34
import { useInstanceClientIdParams } from '@/config/useInstanceClient';
45
import { newApplication } from '@/features/instance/applications/components/ApplicationsSidebar/specialItems';
56
import { useEditorFileContent } from '@/features/instance/applications/context/editorFileContent';
@@ -12,6 +13,7 @@ import {
1213
DownloadIcon,
1314
FileIcon,
1415
FolderIcon,
16+
LockIcon,
1517
PackageIcon,
1618
PanelRightCloseIcon,
1719
PanelRightOpenIcon,
@@ -62,6 +64,28 @@ export function ContentActions({ toggledSidebar, toggleSidebar }: {
6264

6365
{openedEntry && openedEntry?.path !== newApplication && (<>
6466

67+
{openedEntry.package && <Tooltip>
68+
<TooltipTrigger asChild>
69+
<Button variant="ghost" type="button" className="cursor-help">
70+
<LockIcon width={16} height={16} />
71+
<span className="hidden md:inline-block">
72+
Imported applications are read-only
73+
</span>
74+
</Button>
75+
</TooltipTrigger>
76+
<TooltipContent>
77+
{restrictPackageModification
78+
? <>
79+
This application is read-only, and cannot be modified.<br />
80+
It helps govern clustering amongst your instances.
81+
</>
82+
: <>
83+
This application is read-only, and cannot be directly modified. But you can re-deploy or remove it.
84+
</>
85+
}
86+
</TooltipContent>
87+
</Tooltip>}
88+
6589
{!isDirectory(openedEntry) && !openedEntry.package && canManageBrowseInstance && <Button
6690
variant="default"
6791
className="rounded-none"

0 commit comments

Comments
 (0)