Skip to content

Commit d248557

Browse files
authored
fix(settings): added isHosted gate to access homepage from settings, fixed context menu options (#2694)
* fix(settings): added isHosted gate to access homepage from settings, fixed context menu options * stronger typing
1 parent 8215a81 commit d248557

File tree

6 files changed

+30
-14
lines changed

6 files changed

+30
-14
lines changed

apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function POST(
2929

3030
const workflow = access.workflow
3131

32-
let payload: any = {}
32+
let payload: Record<string, unknown> = {}
3333
try {
3434
payload = await request.json()
3535
} catch {

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/components/chunk-context-menu/chunk-context-menu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ export function ChunkContextMenu({
158158
)}
159159

160160
{/* Destructive action */}
161-
{onToggleEnabled && onDelete && <PopoverDivider />}
161+
{onDelete &&
162+
((!isMultiSelect && onOpenInNewTab) ||
163+
(!isMultiSelect && onEdit) ||
164+
(!isMultiSelect && onCopyContent) ||
165+
onToggleEnabled) && <PopoverDivider />}
162166
{onDelete && (
163167
<PopoverItem
164168
disabled={disableDelete}

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/document-context-menu/document-context-menu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ export function DocumentContextMenu({
163163
)}
164164

165165
{/* Destructive action */}
166-
{onToggleEnabled && onDelete && <PopoverDivider />}
166+
{onDelete &&
167+
((!isMultiSelect && onOpenInNewTab) ||
168+
(!isMultiSelect && onRename) ||
169+
(!isMultiSelect && hasTags && onViewTags) ||
170+
onToggleEnabled) && <PopoverDivider />}
167171
{onDelete && (
168172
<PopoverItem
169173
disabled={disableDelete}

apps/sim/app/workspace/[workspaceId]/knowledge/components/knowledge-base-context-menu/knowledge-base-context-menu.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,12 @@ export function KnowledgeBaseContextMenu({
160160
)}
161161

162162
{/* Destructive action */}
163-
{showEdit && onEdit && showDelete && onDelete && <PopoverDivider />}
163+
{showDelete &&
164+
onDelete &&
165+
((showOpenInNewTab && onOpenInNewTab) ||
166+
(showViewTags && onViewTags) ||
167+
onCopyId ||
168+
(showEdit && onEdit)) && <PopoverDivider />}
164169
{showDelete && onDelete && (
165170
<PopoverItem
166171
disabled={disableDelete}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { signOut, useSession } from '@/lib/auth/auth-client'
2121
import { ANONYMOUS_USER_ID } from '@/lib/auth/constants'
2222
import { useBrandConfig } from '@/lib/branding/branding'
2323
import { getEnv, isTruthy } from '@/lib/core/config/env'
24+
import { isHosted } from '@/lib/core/config/feature-flags'
2425
import { getBaseUrl } from '@/lib/core/utils/urls'
2526
import { useProfilePictureUpload } from '@/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/hooks/use-profile-picture-upload'
2627
import { useGeneralSettings, useUpdateGeneralSetting } from '@/hooks/queries/general-settings'
@@ -565,13 +566,15 @@ export function General({ onOpenChange }: GeneralProps) {
565566
</Button>
566567
</>
567568
)}
568-
<Button
569-
onClick={() => window.open('/?from=settings', '_blank', 'noopener,noreferrer')}
570-
variant='active'
571-
className='ml-auto'
572-
>
573-
Home Page
574-
</Button>
569+
{isHosted && (
570+
<Button
571+
onClick={() => window.open('/?from=settings', '_blank', 'noopener,noreferrer')}
572+
variant='active'
573+
className='ml-auto'
574+
>
575+
Home Page
576+
</Button>
577+
)}
575578
</div>
576579

577580
{/* Password Reset Confirmation Modal */}

apps/sim/tools/http/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ export interface RequestParams {
44
url: string
55
method?: HttpMethod
66
headers?: TableRow[]
7-
body?: any
7+
body?: unknown
88
params?: TableRow[]
99
pathParams?: Record<string, string>
1010
formData?: Record<string, string | Blob>
1111
}
1212

1313
export interface RequestResponse extends ToolResponse {
1414
output: {
15-
data: any
15+
data: unknown
1616
status: number
1717
headers: Record<string, string>
1818
}
1919
}
2020

2121
export interface WebhookRequestParams {
2222
url: string
23-
body?: any
23+
body?: unknown
2424
secret?: string
2525
headers?: Record<string, string>
2626
}

0 commit comments

Comments
 (0)