spine-framework-cortex 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CortexSidebar.tsx +23 -0
- package/index.tsx +6 -0
- package/package.json +1 -1
- package/pages/team/TeamPage.tsx +12 -4
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
BarChart3,
|
|
25
25
|
Search,
|
|
26
26
|
Download,
|
|
27
|
+
UserPlus,
|
|
27
28
|
} from "lucide-react"
|
|
28
29
|
import {
|
|
29
30
|
Sidebar,
|
|
@@ -45,6 +46,10 @@ export function CortexSidebar({ ...props }: React.ComponentProps<typeof Sidebar>
|
|
|
45
46
|
const { user } = useAuth()
|
|
46
47
|
const appPath = useAppPath()
|
|
47
48
|
|
|
49
|
+
const isTeamAdmin =
|
|
50
|
+
user?.is_system_admin ||
|
|
51
|
+
user?.roles?.some((r: string) => r === 'support_admin' || r === 'system_admin')
|
|
52
|
+
|
|
48
53
|
const crmItems = [
|
|
49
54
|
{ title: "Dashboard", url: appPath('/dashboard'), icon: LayoutDashboard },
|
|
50
55
|
{ title: "Accounts", url: appPath('/crm/accounts'), icon: Building2 },
|
|
@@ -128,6 +133,24 @@ export function CortexSidebar({ ...props }: React.ComponentProps<typeof Sidebar>
|
|
|
128
133
|
</SidebarGroup>
|
|
129
134
|
</SidebarContent>
|
|
130
135
|
|
|
136
|
+
{isTeamAdmin && (
|
|
137
|
+
<SidebarGroup>
|
|
138
|
+
<SidebarGroupLabel>Admin</SidebarGroupLabel>
|
|
139
|
+
<SidebarGroupContent>
|
|
140
|
+
<SidebarMenu>
|
|
141
|
+
<SidebarMenuItem>
|
|
142
|
+
<SidebarMenuButton asChild isActive={isActive(appPath('/team'))}>
|
|
143
|
+
<a href={appPath('/team')}>
|
|
144
|
+
<UserPlus className="h-4 w-4" />
|
|
145
|
+
<span>Team</span>
|
|
146
|
+
</a>
|
|
147
|
+
</SidebarMenuButton>
|
|
148
|
+
</SidebarMenuItem>
|
|
149
|
+
</SidebarMenu>
|
|
150
|
+
</SidebarGroupContent>
|
|
151
|
+
</SidebarGroup>
|
|
152
|
+
)}
|
|
153
|
+
|
|
131
154
|
<SidebarFooter className="p-4">
|
|
132
155
|
<div className="text-xs text-muted-foreground truncate">{user?.email || ''}</div>
|
|
133
156
|
</SidebarFooter>
|
package/index.tsx
CHANGED
|
@@ -33,6 +33,9 @@ const KBIngestionPage = lazy(() => import('./pages/kb/KBIngestionPage'))
|
|
|
33
33
|
// Courses
|
|
34
34
|
const CoursesPage = lazy(() => import('./pages/courses/CoursesPage'))
|
|
35
35
|
|
|
36
|
+
// Team
|
|
37
|
+
const TeamPage = lazy(() => import('./pages/team/TeamPage').then(m => ({ default: m.TeamPage })))
|
|
38
|
+
|
|
36
39
|
// Intelligence
|
|
37
40
|
const IntelligencePage = lazy(() => import('./pages/intelligence/IntelligencePage'))
|
|
38
41
|
|
|
@@ -89,6 +92,9 @@ function CortexLayout() {
|
|
|
89
92
|
{/* Courses */}
|
|
90
93
|
<Route path="courses/*" element={<CoursesPage />} />
|
|
91
94
|
|
|
95
|
+
{/* Team */}
|
|
96
|
+
<Route path="team" element={<TeamPage />} />
|
|
97
|
+
|
|
92
98
|
{/* Intelligence */}
|
|
93
99
|
<Route path="intelligence" element={<IntelligencePage />} />
|
|
94
100
|
|
package/package.json
CHANGED
package/pages/team/TeamPage.tsx
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @stability stable
|
|
6
6
|
*
|
|
7
7
|
* Cortex team management page. Visible to support_admin and system_admin.
|
|
8
|
-
* Invites are
|
|
9
|
-
*
|
|
8
|
+
* Invites are scoped to the spine-system account with selectable cortex roles.
|
|
9
|
+
* List is filtered to cortex roles only (support, support_admin).
|
|
10
10
|
*
|
|
11
11
|
* Route: /cortex/team
|
|
12
12
|
*
|
|
@@ -17,6 +17,13 @@ import React from 'react'
|
|
|
17
17
|
import { InviteManager } from '../../../../.framework/src/components/shared/InviteManager'
|
|
18
18
|
import { useAuth } from '../../../../.framework/src/contexts/AuthContext'
|
|
19
19
|
|
|
20
|
+
const CORTEX_ROLES = [
|
|
21
|
+
{ slug: 'support', name: 'Support' },
|
|
22
|
+
{ slug: 'support_admin', name: 'Support Admin' },
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
const CORTEX_ROLE_SLUGS = CORTEX_ROLES.map(r => r.slug).join(',')
|
|
26
|
+
|
|
20
27
|
export function TeamPage() {
|
|
21
28
|
const { user } = useAuth()
|
|
22
29
|
|
|
@@ -37,14 +44,15 @@ export function TeamPage() {
|
|
|
37
44
|
<div>
|
|
38
45
|
<h1 className="text-2xl font-semibold text-slate-900">Team</h1>
|
|
39
46
|
<p className="mt-1 text-sm text-slate-500">
|
|
40
|
-
Invite support staff and manage access
|
|
47
|
+
Invite support staff and manage access to Cortex.
|
|
41
48
|
</p>
|
|
42
49
|
</div>
|
|
43
50
|
|
|
44
51
|
<InviteManager
|
|
45
52
|
scope="account"
|
|
46
53
|
accountId={user?.account_id}
|
|
47
|
-
|
|
54
|
+
allowedRoles={CORTEX_ROLES}
|
|
55
|
+
roleSlugsFilter={CORTEX_ROLE_SLUGS}
|
|
48
56
|
/>
|
|
49
57
|
</div>
|
|
50
58
|
)
|