mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-07 22:24:06 -05:00
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
This commit is contained in:
@@ -29,7 +29,7 @@ export async function POST(
|
||||
|
||||
const workflow = access.workflow
|
||||
|
||||
let payload: any = {}
|
||||
let payload: Record<string, unknown> = {}
|
||||
try {
|
||||
payload = await request.json()
|
||||
} catch {
|
||||
|
||||
@@ -158,7 +158,11 @@ export function ChunkContextMenu({
|
||||
)}
|
||||
|
||||
{/* Destructive action */}
|
||||
{onToggleEnabled && onDelete && <PopoverDivider />}
|
||||
{onDelete &&
|
||||
((!isMultiSelect && onOpenInNewTab) ||
|
||||
(!isMultiSelect && onEdit) ||
|
||||
(!isMultiSelect && onCopyContent) ||
|
||||
onToggleEnabled) && <PopoverDivider />}
|
||||
{onDelete && (
|
||||
<PopoverItem
|
||||
disabled={disableDelete}
|
||||
|
||||
@@ -163,7 +163,11 @@ export function DocumentContextMenu({
|
||||
)}
|
||||
|
||||
{/* Destructive action */}
|
||||
{onToggleEnabled && onDelete && <PopoverDivider />}
|
||||
{onDelete &&
|
||||
((!isMultiSelect && onOpenInNewTab) ||
|
||||
(!isMultiSelect && onRename) ||
|
||||
(!isMultiSelect && hasTags && onViewTags) ||
|
||||
onToggleEnabled) && <PopoverDivider />}
|
||||
{onDelete && (
|
||||
<PopoverItem
|
||||
disabled={disableDelete}
|
||||
|
||||
@@ -160,7 +160,12 @@ export function KnowledgeBaseContextMenu({
|
||||
)}
|
||||
|
||||
{/* Destructive action */}
|
||||
{showEdit && onEdit && showDelete && onDelete && <PopoverDivider />}
|
||||
{showDelete &&
|
||||
onDelete &&
|
||||
((showOpenInNewTab && onOpenInNewTab) ||
|
||||
(showViewTags && onViewTags) ||
|
||||
onCopyId ||
|
||||
(showEdit && onEdit)) && <PopoverDivider />}
|
||||
{showDelete && onDelete && (
|
||||
<PopoverItem
|
||||
disabled={disableDelete}
|
||||
|
||||
@@ -21,6 +21,7 @@ import { signOut, useSession } from '@/lib/auth/auth-client'
|
||||
import { ANONYMOUS_USER_ID } from '@/lib/auth/constants'
|
||||
import { useBrandConfig } from '@/lib/branding/branding'
|
||||
import { getEnv, isTruthy } from '@/lib/core/config/env'
|
||||
import { isHosted } from '@/lib/core/config/feature-flags'
|
||||
import { getBaseUrl } from '@/lib/core/utils/urls'
|
||||
import { useProfilePictureUpload } from '@/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/hooks/use-profile-picture-upload'
|
||||
import { useGeneralSettings, useUpdateGeneralSetting } from '@/hooks/queries/general-settings'
|
||||
@@ -565,13 +566,15 @@ export function General({ onOpenChange }: GeneralProps) {
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
<Button
|
||||
onClick={() => window.open('/?from=settings', '_blank', 'noopener,noreferrer')}
|
||||
variant='active'
|
||||
className='ml-auto'
|
||||
>
|
||||
Home Page
|
||||
</Button>
|
||||
{isHosted && (
|
||||
<Button
|
||||
onClick={() => window.open('/?from=settings', '_blank', 'noopener,noreferrer')}
|
||||
variant='active'
|
||||
className='ml-auto'
|
||||
>
|
||||
Home Page
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Password Reset Confirmation Modal */}
|
||||
|
||||
@@ -4,7 +4,7 @@ export interface RequestParams {
|
||||
url: string
|
||||
method?: HttpMethod
|
||||
headers?: TableRow[]
|
||||
body?: any
|
||||
body?: unknown
|
||||
params?: TableRow[]
|
||||
pathParams?: Record<string, string>
|
||||
formData?: Record<string, string | Blob>
|
||||
@@ -12,7 +12,7 @@ export interface RequestParams {
|
||||
|
||||
export interface RequestResponse extends ToolResponse {
|
||||
output: {
|
||||
data: any
|
||||
data: unknown
|
||||
status: number
|
||||
headers: Record<string, string>
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export interface RequestResponse extends ToolResponse {
|
||||
|
||||
export interface WebhookRequestParams {
|
||||
url: string
|
||||
body?: any
|
||||
body?: unknown
|
||||
secret?: string
|
||||
headers?: Record<string, string>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user