Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/sim/app/(auth)/components/oauth-provider-checker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
isGithubAuthDisabled,
isGoogleAuthDisabled,
isMicrosoftAuthDisabled,
isProd,
} from '@/lib/core/config/env-flags'

export async function getOAuthProviderStatus() {
Expand All @@ -16,5 +15,5 @@ export async function getOAuthProviderStatus() {
const microsoftAvailable =
!!(env.MICROSOFT_CLIENT_ID && env.MICROSOFT_CLIENT_SECRET) && !isMicrosoftAuthDisabled

return { githubAvailable, googleAvailable, microsoftAvailable, isProduction: isProd }
return { githubAvailable, googleAvailable, microsoftAvailable }
}
2 changes: 0 additions & 2 deletions apps/sim/app/(auth)/components/social-login-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ interface SocialLoginButtonsProps {
googleAvailable: boolean
microsoftAvailable: boolean
callbackURL?: string
isProduction: boolean
children?: ReactNode
}

Expand All @@ -24,7 +23,6 @@ export function SocialLoginButtons({
googleAvailable,
microsoftAvailable,
callbackURL = '/workspace',
isProduction,
children,
}: SocialLoginButtonsProps) {
const [isGithubLoading, setIsGithubLoading] = useState(false)
Expand Down
3 changes: 0 additions & 3 deletions apps/sim/app/(auth)/login/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,11 @@ export default function LoginPage({
githubAvailable,
googleAvailable,
microsoftAvailable,
isProduction,
registrationDisabled,
}: {
githubAvailable: boolean
googleAvailable: boolean
microsoftAvailable: boolean
isProduction: boolean
/** DISABLE_REGISTRATION. Hides the signup cross-link, which `/signup` blocks. */
registrationDisabled: boolean
}) {
Expand Down Expand Up @@ -430,7 +428,6 @@ export default function LoginPage({
googleAvailable={googleAvailable}
githubAvailable={githubAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
callbackURL={callbackUrl}
>
{ssoEnabled && !hasOnlySSO && (
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ export const metadata: Metadata = {
export const dynamic = 'force-dynamic'

export default async function LoginPage() {
const { githubAvailable, googleAvailable, microsoftAvailable, isProduction } =
await getOAuthProviderStatus()
const { githubAvailable, googleAvailable, microsoftAvailable } = await getOAuthProviderStatus()

return (
<Suspense fallback={<LoginLoading />}>
<LoginForm
githubAvailable={githubAvailable}
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
registrationDisabled={isRegistrationDisabled}
/>
</Suspense>
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ export default async function SignupPage({
)
}

const { githubAvailable, googleAvailable, microsoftAvailable, isProduction } =
await getOAuthProviderStatus()
const { githubAvailable, googleAvailable, microsoftAvailable } = await getOAuthProviderStatus()

return (
<SignupForm
githubAvailable={githubAvailable}
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
emailSignupEnabled={!isEmailSignupDisabled}
emailVerificationEnabled={isEmailVerificationEffectivelyEnabled()}
/>
Expand Down
5 changes: 0 additions & 5 deletions apps/sim/app/(auth)/signup/signup-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ interface SignupFormProps {
githubAvailable: boolean
googleAvailable: boolean
microsoftAvailable: boolean
isProduction: boolean
emailSignupEnabled: boolean
/** Server-derived: verification is enabled AND a mail provider is configured. */
emailVerificationEnabled: boolean
Expand All @@ -101,7 +100,6 @@ function SignupFormContent({
githubAvailable,
googleAvailable,
microsoftAvailable,
isProduction,
emailSignupEnabled,
emailVerificationEnabled,
}: SignupFormProps) {
Expand Down Expand Up @@ -484,7 +482,6 @@ function SignupFormContent({
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
callbackURL={redirectUrl || '/workspace'}
isProduction={isProduction}
>
{ssoEnabled && !hasOnlySSO && (
<SSOLoginButton callbackURL={redirectUrl || '/workspace'} variant='outline' />
Expand All @@ -507,7 +504,6 @@ export default function SignupPage({
githubAvailable,
googleAvailable,
microsoftAvailable,
isProduction,
emailSignupEnabled,
emailVerificationEnabled,
}: SignupFormProps) {
Expand All @@ -519,7 +515,6 @@ export default function SignupPage({
githubAvailable={githubAvailable}
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
emailSignupEnabled={emailSignupEnabled}
emailVerificationEnabled={emailVerificationEnabled}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ export function usePromptEditor({
const mentionMenu = useMentionMenu({
message: value,
selectedContexts: contextManagement.selectedContexts,
onContextSelect: addContextNotified,
onMessageChange: commitValue,
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ interface UseMentionMenuProps {
message: string
/** Currently selected contexts */
selectedContexts: ChatContext[]
/** Callback when a context is selected */
onContextSelect: (context: ChatContext) => void
/** Callback when message changes */
onMessageChange: (message: string) => void
}
Expand All @@ -23,7 +21,6 @@ interface UseMentionMenuProps {
export function useMentionMenu({
message,
selectedContexts,
onContextSelect,
onMessageChange,
}: UseMentionMenuProps) {
// Refs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ interface FieldItemProps {
connection: ConnectedBlock
field: SchemaField
path: string
level: number
hasChildren?: boolean
isExpanded?: boolean
onToggleExpand?: (path: string) => void
Expand All @@ -37,7 +36,6 @@ export function FieldItem({
connection,
field,
path,
level,
hasChildren,
isExpanded,
onToggleExpand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ interface ConnectionBlocksProps {
interface FieldTreeNodesProps {
fields: SchemaField[]
parentPath: string
level: number
connection: ConnectedBlock
isFieldExpanded: (connectionId: string, fieldPath: string) => boolean
onToggleFieldExpansion: (connectionId: string, fieldPath: string) => void
Expand All @@ -36,7 +35,6 @@ interface FieldTreeNodesProps {
function FieldTreeNodes({
fields,
parentPath,
level,
connection,
isFieldExpanded,
onToggleFieldExpansion,
Expand All @@ -52,7 +50,6 @@ function FieldTreeNodes({
connection={connection}
field={field}
path={fieldPath}
level={level}
hasChildren={hasChildren}
isExpanded={expanded}
onToggleExpand={(p) => onToggleFieldExpansion(connection.id, p)}
Expand All @@ -63,7 +60,6 @@ function FieldTreeNodes({
<FieldTreeNodes
fields={field.children!}
parentPath={fieldPath}
level={level + 1}
connection={connection}
isFieldExpanded={isFieldExpanded}
onToggleFieldExpansion={onToggleFieldExpansion}
Expand Down Expand Up @@ -152,7 +148,6 @@ function ConnectionItem({
<FieldTreeNodes
fields={fields}
parentPath=''
level={0}
connection={connection}
isFieldExpanded={isFieldExpanded}
onToggleFieldExpansion={onToggleFieldExpansion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,19 @@ function SelectedCountDisplay({ noneSelected, allSelected, count }: SelectedCoun
interface GroupedCheckboxListProps {
blockId: string
subBlockId: string
title: string
options: { label: string; id: string; group?: string }[]
isPreview?: boolean
subBlockValues: Record<string, any>
disabled?: boolean
maxHeight?: number
}

export function GroupedCheckboxList({
blockId,
subBlockId,
title,
options,
isPreview = false,
subBlockValues,
disabled = false,
maxHeight = 400,
}: GroupedCheckboxListProps) {
const activeSearchTarget = useActiveSearchTarget()
const [open, setOpen] = useState(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ const buildNestedTagTree = (tags: string[], blockName: string): NestedTag[] => {
interface NestedTagRendererProps {
nestedTag: NestedTag
group: NestedBlockTagGroup
flatTagList: Array<{ tag: string; group?: BlockTagGroup }>
/** Map from tag string to index for O(1) lookups */
flatTagIndexMap: Map<string, number>
selectedIndex: number
Expand All @@ -403,7 +402,6 @@ interface FolderContentsProps extends NestedTagRendererProps {
*/
const FolderContentsInner: React.FC<FolderContentsProps> = ({
group,
flatTagList,
flatTagIndexMap,
selectedIndex,
setSelectedIndex,
Expand Down Expand Up @@ -565,7 +563,6 @@ const FolderContents: React.FC<Omit<NestedTagRendererProps, never>> = (props) =>
const NestedTagRenderer: React.FC<NestedTagRendererProps> = ({
nestedTag,
group,
flatTagList,
flatTagIndexMap,
selectedIndex,
setSelectedIndex,
Expand Down Expand Up @@ -612,7 +609,6 @@ const NestedTagRenderer: React.FC<NestedTagRendererProps> = ({
<FolderContents
nestedTag={nestedTag}
group={group}
flatTagList={flatTagList}
flatTagIndexMap={flatTagIndexMap}
selectedIndex={selectedIndex}
setSelectedIndex={setSelectedIndex}
Expand Down Expand Up @@ -1633,9 +1629,9 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
</PopoverAnchor>
<KeyboardNavigationHandler
visible={visible}
flatTagList={flatTagList}
selectedIndex={selectedIndex}
setSelectedIndex={setSelectedIndex}
flatTagList={flatTagList}
nestedBlockTagGroups={nestedBlockTagGroups}
handleTagSelect={handleTagSelect}
onFolderEnter={() => {
Expand Down Expand Up @@ -1720,7 +1716,6 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
key={`${group.blockId}-${nestedTag.key}`}
nestedTag={nestedTag}
group={group}
flatTagList={flatTagList}
flatTagIndexMap={flatTagIndexMap}
selectedIndex={selectedIndex}
setSelectedIndex={setSelectedIndex}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,12 +844,10 @@ function SubBlockComponent({
<GroupedCheckboxList
blockId={blockId}
subBlockId={config.id}
title={config.title ?? ''}
options={config.options as { label: string; id: string; group?: string }[]}
isPreview={isPreview}
subBlockValues={subBlockValues ?? {}}
disabled={isDisabled}
maxHeight={config.maxHeight}
/>
)

Expand Down
6 changes: 3 additions & 3 deletions apps/sim/ee/custom-blocks/components/custom-block-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ export function CustomBlockDetail({ blockId, workspaceId, onBack }: CustomBlockD
[blocks, blockId]
)

const publish = usePublishCustomBlock(workspaceId)
const update = useUpdateCustomBlock(workspaceId)
const remove = useDeleteCustomBlock(workspaceId)
const publish = usePublishCustomBlock()
const update = useUpdateCustomBlock()
const remove = useDeleteCustomBlock()

// Needed in both modes: the source picker (create) and the manage gate (edit).
const { data: workspaces = [] } = useWorkspacesQuery()
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/hooks/queries/custom-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function useCustomBlockUsageCounts(blockId?: string, options?: { enabled?
})
}

export function usePublishCustomBlock(workspaceId?: string) {
export function usePublishCustomBlock() {
const queryClient = useQueryClient()
return useMutation({
mutationFn: (body: PublishCustomBlockBody) => requestJson(publishCustomBlockContract, { body }),
Expand All @@ -85,7 +85,7 @@ export function usePublishCustomBlock(workspaceId?: string) {
})
}

export function useUpdateCustomBlock(workspaceId?: string) {
export function useUpdateCustomBlock() {
const queryClient = useQueryClient()
return useMutation({
mutationFn: ({ id, ...body }: UpdateCustomBlockBody & { id: string }) =>
Expand All @@ -96,7 +96,7 @@ export function useUpdateCustomBlock(workspaceId?: string) {
})
}

export function useDeleteCustomBlock(workspaceId?: string) {
export function useDeleteCustomBlock() {
const queryClient = useQueryClient()
return useMutation({
mutationFn: (id: string) => requestJson(deleteCustomBlockContract, { params: { id } }),
Expand Down
Loading