Skip to content

Commit d2b2ea5

Browse files
committed
feat(ee): add enterprise modules
1 parent a9b7d75 commit d2b2ea5

File tree

39 files changed

+140
-103
lines changed

39 files changed

+140
-103
lines changed

apps/sim/app/(auth)/sso/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { redirect } from 'next/navigation'
22
import { getEnv, isTruthy } from '@/lib/core/config/env'
3-
import SSOForm from '@/app/(auth)/sso/sso-form'
3+
import SSOForm from '@/ee/sso/components/sso-form'
44

55
export const dynamic = 'force-dynamic'
66

apps/sim/app/api/organizations/[id]/invitations/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { hasWorkspaceAdminAccess } from '@/lib/workspaces/permissions/utils'
2929
import {
3030
InvitationsNotAllowedError,
3131
validateInvitationsAllowed,
32-
} from '@/executor/utils/permission-check'
32+
} from '@/ee/access-control/utils/permission-check'
3333

3434
const logger = createLogger('OrganizationInvitations')
3535

apps/sim/app/api/workspaces/invitations/route.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('Workspace Invitations API Route', () => {
102102
inArray: vi.fn().mockImplementation((field, values) => ({ type: 'inArray', field, values })),
103103
}))
104104

105-
vi.doMock('@/executor/utils/permission-check', () => ({
105+
vi.doMock('@/ee/access-control/utils/permission-check', () => ({
106106
validateInvitationsAllowed: vi.fn().mockResolvedValue(undefined),
107107
InvitationsNotAllowedError: class InvitationsNotAllowedError extends Error {
108108
constructor() {

apps/sim/app/api/workspaces/invitations/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { getFromEmailAddress } from '@/lib/messaging/email/utils'
2121
import {
2222
InvitationsNotAllowedError,
2323
validateInvitationsAllowed,
24-
} from '@/executor/utils/permission-check'
24+
} from '@/ee/access-control/utils/permission-check'
2525

2626
export const dynamic = 'force-dynamic'
2727

@@ -38,7 +38,6 @@ export async function GET(req: NextRequest) {
3838
}
3939

4040
try {
41-
// Get all workspaces where the user has permissions
4241
const userWorkspaces = await db
4342
.select({ id: workspace.id })
4443
.from(workspace)
@@ -55,10 +54,8 @@ export async function GET(req: NextRequest) {
5554
return NextResponse.json({ invitations: [] })
5655
}
5756

58-
// Get all workspaceIds where the user is a member
5957
const workspaceIds = userWorkspaces.map((w) => w.id)
6058

61-
// Find all invitations for those workspaces
6259
const invitations = await db
6360
.select()
6461
.from(workspaceInvitation)

apps/sim/app/chat/[identifier]/chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import {
1414
ChatMessageContainer,
1515
EmailAuth,
1616
PasswordAuth,
17-
SSOAuth,
1817
VoiceInterface,
1918
} from '@/app/chat/components'
2019
import { CHAT_ERROR_MESSAGES, CHAT_REQUEST_TIMEOUT_MS } from '@/app/chat/constants'
2120
import { useAudioStreaming, useChatStreaming } from '@/app/chat/hooks'
21+
import SSOAuth from '@/ee/sso/components/sso-auth'
2222

2323
const logger = createLogger('ChatClient')
2424

apps/sim/app/chat/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export { default as EmailAuth } from './auth/email/email-auth'
22
export { default as PasswordAuth } from './auth/password/password-auth'
3-
export { default as SSOAuth } from './auth/sso/sso-auth'
43
export { ChatErrorState } from './error-state/error-state'
54
export { ChatHeader } from './header/header'
65
export { ChatInput } from './input/input'

apps/sim/app/workspace/[workspaceId]/knowledge/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { redirect } from 'next/navigation'
22
import { getSession } from '@/lib/auth'
33
import { verifyWorkspaceMembership } from '@/app/api/workflows/utils'
4-
import { getUserPermissionConfig } from '@/executor/utils/permission-check'
4+
import { getUserPermissionConfig } from '@/ee/access-control/utils/permission-check'
55
import { Knowledge } from './knowledge'
66

77
interface KnowledgePageProps {
@@ -23,7 +23,6 @@ export default async function KnowledgePage({ params }: KnowledgePageProps) {
2323
redirect('/')
2424
}
2525

26-
// Check permission group restrictions
2726
const permissionConfig = await getUserPermissionConfig(session.user.id)
2827
if (permissionConfig?.hideKnowledgeBaseTab) {
2928
redirect(`/workspace/${workspaceId}`)

apps/sim/app/workspace/[workspaceId]/templates/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getSession } from '@/lib/auth'
66
import { verifyWorkspaceMembership } from '@/app/api/workflows/utils'
77
import type { Template as WorkspaceTemplate } from '@/app/workspace/[workspaceId]/templates/templates'
88
import Templates from '@/app/workspace/[workspaceId]/templates/templates'
9-
import { getUserPermissionConfig } from '@/executor/utils/permission-check'
9+
import { getUserPermissionConfig } from '@/ee/access-control/utils/permission-check'
1010

1111
interface TemplatesPageProps {
1212
params: Promise<{

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ export function CredentialSets() {
246246
setNewSetDescription('')
247247
setNewSetProvider('google-email')
248248

249-
// Open detail view for the newly created group
250249
if (result?.credentialSet) {
251250
setViewingSet(result.credentialSet)
252251
}
@@ -336,7 +335,6 @@ export function CredentialSets() {
336335
email,
337336
})
338337

339-
// Start 60s cooldown
340338
setResendCooldowns((prev) => ({ ...prev, [invitationId]: 60 }))
341339
const interval = setInterval(() => {
342340
setResendCooldowns((prev) => {
@@ -393,7 +391,6 @@ export function CredentialSets() {
393391
return <GmailIcon className='h-4 w-4' />
394392
}
395393

396-
// All hooks must be called before any early returns
397394
const activeMemberships = useMemo(
398395
() => memberships.filter((m) => m.status === 'active'),
399396
[memberships]
@@ -447,7 +444,6 @@ export function CredentialSets() {
447444
<div className='flex h-full flex-col gap-[16px]'>
448445
<div className='min-h-0 flex-1 overflow-y-auto'>
449446
<div className='flex flex-col gap-[16px]'>
450-
{/* Group Info */}
451447
<div className='flex items-center gap-[16px]'>
452448
<div className='flex items-center gap-[8px]'>
453449
<span className='font-medium text-[13px] text-[var(--text-primary)]'>
@@ -471,7 +467,6 @@ export function CredentialSets() {
471467
</div>
472468
</div>
473469

474-
{/* Invite Section - Email Tags Input */}
475470
<div className='flex flex-col gap-[4px]'>
476471
<div className='flex items-center gap-[8px]'>
477472
<TagInput
@@ -495,7 +490,6 @@ export function CredentialSets() {
495490
{emailError && <p className='text-[12px] text-[var(--text-error)]'>{emailError}</p>}
496491
</div>
497492

498-
{/* Members List - styled like team members */}
499493
<div className='flex flex-col gap-[16px]'>
500494
<h4 className='font-medium text-[14px] text-[var(--text-primary)]'>Members</h4>
501495

@@ -519,7 +513,6 @@ export function CredentialSets() {
519513
</p>
520514
) : (
521515
<div className='flex flex-col gap-[16px]'>
522-
{/* Active Members */}
523516
{activeMembers.map((member) => {
524517
const name = member.userName || 'Unknown'
525518
const avatarInitial = name.charAt(0).toUpperCase()
@@ -572,7 +565,6 @@ export function CredentialSets() {
572565
)
573566
})}
574567

575-
{/* Pending Invitations */}
576568
{pendingInvitations.map((invitation) => {
577569
const email = invitation.email || 'Unknown'
578570
const emailPrefix = email.split('@')[0]
@@ -641,7 +633,6 @@ export function CredentialSets() {
641633
</div>
642634
</div>
643635

644-
{/* Footer Actions */}
645636
<div className='mt-auto flex items-center justify-end'>
646637
<Button onClick={handleBackToList} variant='tertiary'>
647638
Back
@@ -822,7 +813,6 @@ export function CredentialSets() {
822813
</div>
823814
</div>
824815

825-
{/* Create Polling Group Modal */}
826816
<Modal open={showCreateModal} onOpenChange={handleCloseCreateModal}>
827817
<ModalContent size='sm'>
828818
<ModalHeader>Create Polling Group</ModalHeader>
@@ -895,7 +885,6 @@ export function CredentialSets() {
895885
</ModalContent>
896886
</Modal>
897887

898-
{/* Leave Confirmation Modal */}
899888
<Modal open={!!leavingMembership} onOpenChange={() => setLeavingMembership(null)}>
900889
<ModalContent size='sm'>
901890
<ModalHeader>Leave Polling Group</ModalHeader>
@@ -923,7 +912,6 @@ export function CredentialSets() {
923912
</ModalContent>
924913
</Modal>
925914

926-
{/* Delete Confirmation Modal */}
927915
<Modal open={!!deletingSet} onOpenChange={() => setDeletingSet(null)}>
928916
<ModalContent size='sm'>
929917
<ModalHeader>Delete Polling Group</ModalHeader>

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export { AccessControl } from './access-control/access-control'
21
export { ApiKeys } from './api-keys/api-keys'
32
export { BYOK } from './byok/byok'
43
export { Copilot } from './copilot/copilot'
@@ -10,7 +9,6 @@ export { Files as FileUploads } from './files/files'
109
export { General } from './general/general'
1110
export { Integrations } from './integrations/integrations'
1211
export { MCP } from './mcp/mcp'
13-
export { SSO } from './sso/sso'
1412
export { Subscription } from './subscription/subscription'
1513
export { TeamManagement } from './team-management/team-management'
1614
export { WorkflowMcpServers } from './workflow-mcp-servers/workflow-mcp-servers'

0 commit comments

Comments
 (0)