Skip to content

Commit 7b1c0ba

Browse files
authored
Merge pull request #6 from aspiers/fix-sds-demo
2 parents 60c84c9 + 406b7cd commit 7b1c0ba

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

packages/sds-demo/rollup.config.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ module.exports = defineConfig((commandLineArguments) => {
137137
if (devMode) return // Skip in development (uses loopback client)
138138

139139
// Detect deployment URL from environment
140-
// VERCEL_URL is available during Vercel builds
141-
// Fallback to VERCEL_PROJECT_PRODUCTION_URL or CLIENT_URL for custom config
140+
// VERCEL_URL contains the current deployment URL (preview or production)
141+
// VERCEL_PROJECT_PRODUCTION_URL contains the production URL (fallback)
142+
// CLIENT_URL can be used for custom configurations
142143
const deploymentUrl =
143-
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
144144
process.env.VERCEL_URL ||
145+
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
145146
process.env.CLIENT_URL
146147

147148
if (!deploymentUrl) {
@@ -176,9 +177,7 @@ module.exports = defineConfig((commandLineArguments) => {
176177
source: JSON.stringify(metadata, null, 2),
177178
})
178179

179-
console.log(
180-
`Generated client-metadata.json for ${clientUrl}`,
181-
)
180+
console.log(`Generated client-metadata.json for ${clientUrl}`)
182181
},
183182
},
184183

packages/sds-demo/src/components/collaboration-modal.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
useRevokeAccessMutation,
88
} from '../queries/use-collaboration-queries.ts'
99
import {
10-
type RepositoryPermissions,
1110
formatCollaboratorName,
1211
getPermissionLevel,
1312
validateDid,
@@ -32,10 +31,6 @@ export function CollaborationModal({
3231
'collaborators',
3332
)
3433
const [userDid, setUserDid] = useState('')
35-
const [permissions, setPermissions] = useState<RepositoryPermissions>({
36-
read: true,
37-
write: false,
38-
})
3934
const [selectedRole, setSelectedRole] = useState<
4035
'viewer' | 'contributor' | 'admin'
4136
>('viewer')
@@ -45,17 +40,35 @@ export function CollaborationModal({
4540
viewer: {
4641
name: 'Viewer',
4742
description: 'Can view repository content',
48-
permissions: { read: true, write: false, admin: false },
43+
permissions: {
44+
read: true,
45+
create: false,
46+
update: false,
47+
delete: false,
48+
admin: false,
49+
},
4950
},
5051
contributor: {
5152
name: 'Contributor',
5253
description: 'Can view and modify repository content',
53-
permissions: { read: true, write: true, admin: false },
54+
permissions: {
55+
read: true,
56+
create: true,
57+
update: true,
58+
delete: true,
59+
admin: false,
60+
},
5461
},
5562
admin: {
5663
name: 'Admin',
5764
description: 'Full access including user management',
58-
permissions: { read: true, write: true, admin: true },
65+
permissions: {
66+
read: true,
67+
create: true,
68+
update: true,
69+
delete: true,
70+
admin: true,
71+
},
5972
},
6073
}
6174

@@ -90,7 +103,6 @@ export function CollaborationModal({
90103
// Reset form
91104
setUserDid('')
92105
setSelectedRole('viewer')
93-
setPermissions({ read: true, write: false })
94106
setActiveTab('collaborators') // Switch back to collaborators tab
95107
} catch (error) {
96108
console.error('Failed to grant access:', error)

0 commit comments

Comments
 (0)