Skip to content

Commit a79aeba

Browse files
committed
Complete role system unification across entire project
- Fix Signup.tsx: Change Node Watcher to Viewer in onboarding text - Fix GraphContext.tsx: Update role mapping from old system to ADMIN/USER/VIEW - Fix UserManagement.tsx: Update promotion buttons to use correct roles - Fix UpdateGraphModal.tsx: Replace all old role names with GUEST/VIEWER/USER/ADMIN - Fix CreateGraphModal.tsx: Replace all old role names with GUEST/VIEWER/USER/ADMIN All role references now use consistent GUEST, VIEWER, USER, ADMIN system.
1 parent 77412a6 commit a79aeba

5 files changed

Lines changed: 21 additions & 23 deletions

File tree

packages/web/src/components/CreateGraphModal.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function CreateGraphModal({ isOpen, onClose, parentGraphId }: CreateGraph
2020
parentGraphId,
2121
teamId: currentTeam?.id || 'default-team',
2222
tags: [],
23-
defaultRole: 'NodeWatcher',
23+
defaultRole: 'VIEWER',
2424
isShared: false,
2525
status: 'DRAFT'
2626
});
@@ -141,7 +141,7 @@ export function CreateGraphModal({ isOpen, onClose, parentGraphId }: CreateGraph
141141
parentGraphId,
142142
teamId: currentTeam?.id || 'default-team',
143143
tags: [],
144-
defaultRole: 'NodeWatcher',
144+
defaultRole: 'VIEWER',
145145
isShared: false,
146146
status: 'DRAFT'
147147
});
@@ -569,15 +569,14 @@ export function CreateGraphModal({ isOpen, onClose, parentGraphId }: CreateGraph
569569
Default Role for Team Members
570570
</label>
571571
<select
572-
value={formData.defaultRole || 'NodeWatcher'}
572+
value={formData.defaultRole || 'VIEWER'}
573573
onChange={(e) => setFormData(prev => ({ ...prev, defaultRole: e.target.value }))}
574574
className="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-gray-200 focus:ring-2 focus:ring-green-500 focus:border-green-500 transition-colors"
575575
>
576-
<option value="NodeWatcher">NodeWatcher - View only access</option>
577-
<option value="Connector">Connector - Can create connections between nodes</option>
578-
<option value="OriginNode">OriginNode - Can create and edit nodes</option>
579-
<option value="PathKeeper">PathKeeper - Can manage workflows and paths</option>
580-
<option value="GraphMaster">GraphMaster - Full administrative access</option>
576+
<option value="GUEST">Guest - Anonymous demo access (read-only)</option>
577+
<option value="VIEWER">Viewer - Can view graphs and nodes (read-only)</option>
578+
<option value="USER">User - Can create and work on tasks</option>
579+
<option value="ADMIN">Admin - Full system administration access</option>
581580
</select>
582581
<p className="text-xs text-gray-500 mt-1">Default permission level for new team members joining this graph</p>
583582
</div>
@@ -649,7 +648,7 @@ export function CreateGraphModal({ isOpen, onClose, parentGraphId }: CreateGraph
649648
)}
650649
<div className="flex justify-between">
651650
<span className="text-gray-400">Default Role:</span>
652-
<span className="font-medium text-purple-300">{formData.defaultRole || 'NodeWatcher'}</span>
651+
<span className="font-medium text-purple-300">{formData.defaultRole || 'VIEWER'}</span>
653652
</div>
654653
</div>
655654
<div className="space-y-3">

packages/web/src/components/UpdateGraphModal.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function UpdateGraphModal({ isOpen, onClose }: UpdateGraphModalProps) {
1818
description: '',
1919
type: 'PROJECT' as 'PROJECT' | 'WORKSPACE' | 'SUBGRAPH' | 'TEMPLATE',
2020
tags: [] as string[],
21-
defaultRole: 'NodeWatcher',
21+
defaultRole: 'VIEWER',
2222
status: 'ACTIVE' as 'ACTIVE' | 'ARCHIVED' | 'DRAFT',
2323
isShared: false
2424
});
@@ -33,7 +33,7 @@ export function UpdateGraphModal({ isOpen, onClose }: UpdateGraphModalProps) {
3333
description: currentGraph.description || '',
3434
type: (currentGraph.type as 'PROJECT' | 'WORKSPACE' | 'SUBGRAPH' | 'TEMPLATE') || 'PROJECT',
3535
tags: currentGraph.tags || [],
36-
defaultRole: currentGraph.defaultRole || 'NodeWatcher',
36+
defaultRole: currentGraph.defaultRole || 'VIEWER',
3737
status: (currentGraph.status as 'ACTIVE' | 'ARCHIVED' | 'DRAFT') || 'ACTIVE',
3838
isShared: currentGraph.isShared || false
3939
});
@@ -291,11 +291,10 @@ export function UpdateGraphModal({ isOpen, onClose }: UpdateGraphModalProps) {
291291
onChange={(e) => setFormData(prev => ({ ...prev, defaultRole: e.target.value }))}
292292
className="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-gray-200 focus:ring-2 focus:ring-green-500 focus:border-green-500 transition-colors"
293293
>
294-
<option value="NodeWatcher">NodeWatcher - View only access</option>
295-
<option value="Connector">Connector - Can create connections between nodes</option>
296-
<option value="OriginNode">OriginNode - Can create and edit nodes</option>
297-
<option value="PathKeeper">PathKeeper - Can manage workflows and paths</option>
298-
<option value="GraphMaster">GraphMaster - Full administrative access</option>
294+
<option value="GUEST">Guest - Anonymous demo access (read-only)</option>
295+
<option value="VIEWER">Viewer - Can view graphs and nodes (read-only)</option>
296+
<option value="USER">User - Can create and work on tasks</option>
297+
<option value="ADMIN">Admin - Full system administration access</option>
299298
</select>
300299
<p className="text-xs text-gray-500 mt-1">Default permission level for new team members joining this graph</p>
301300
</div>

packages/web/src/components/UserManagement.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ export function UserManagement() {
212212
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
213213
<button className="btn btn-secondary">
214214
<Users className="h-4 w-4 mr-2" />
215-
Promote to Connector
215+
Promote to User
216216
</button>
217217
<button className="btn btn-secondary">
218218
<UserCheck className="h-4 w-4 mr-2" />
219-
Grant Origin Node
219+
Grant Viewer Access
220220
</button>
221221
<button className="btn btn-secondary">
222222
<Settings className="h-4 w-4 mr-2" />
223-
Make Path Keeper
223+
Make Admin
224224
</button>
225225
</div>
226226
</div>

packages/web/src/contexts/GraphContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ export function GraphProvider({ children }: GraphProviderProps) {
156156
admins: [input.createdBy || currentUser?.id || ''].filter(Boolean),
157157
editors: [],
158158
viewers: [],
159-
teamPermission: input.defaultRole === 'GraphMaster' ? 'ADMIN' :
160-
input.defaultRole === 'OriginNode' || input.defaultRole === 'PathKeeper' ? 'EDIT' :
159+
teamPermission: input.defaultRole === 'ADMIN' ? 'ADMIN' :
160+
input.defaultRole === 'USER' ? 'EDIT' :
161161
'VIEW'
162162
}),
163163
shareSettings: JSON.stringify({

packages/web/src/pages/Signup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,10 @@ export function Signup() {
408408

409409
{/* Role Information */}
410410
<div className="mt-8 p-4 bg-gray-800 border border-gray-700 rounded-lg">
411-
<h3 className="text-sm font-semibold text-gray-300 mb-2">Your Journey Begins as a Node Watcher</h3>
411+
<h3 className="text-sm font-semibold text-gray-300 mb-2">Your Journey Begins as a Viewer</h3>
412412
<p className="text-xs text-gray-400">
413413
All new members start with read-only access. As you contribute and demonstrate value,
414-
the community may elevate your role to Connector, Origin Node, or even Path Keeper.
414+
the community may elevate your role to User or even Admin.
415415
</p>
416416
</div>
417417
</div>

0 commit comments

Comments
 (0)