feat(workspace): allow sharing notes and shared folders as editor
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m13s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m13s
The share dialog for notes and shared folders now offers "Bearbeiten" and "Nur Lesen" and stores write/read accordingly. Editors already edit through the sync engine since phase 2. Adds e2e/share.e2e.mjs: shares a note as editor through the dialog and checks that the recipient can edit it; e2e/run.sh runs both browser tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
51f90eb7e4
commit
08d9b2dc77
7 files changed
+122
-13
No files matched your search
@@ -2268,15 +2268,12 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
||||
shares={unifiedShares}
|
||||
teams={teams}
|
||||
collaborators={collaborators}
|
||||
allowRoleSelection={false}
|
||||
fixedPermission="viewer"
|
||||
onAddShare={async (targetType, targetId) => {
|
||||
onAddShare={async (targetType, targetId, role) => {
|
||||
const permission = role === 'editor' ? 'write' : 'read';
|
||||
if (shareModalDoc) {
|
||||
await api.createDocShare(
|
||||
shareModalDoc.id,
|
||||
targetType === 'team'
|
||||
? { teamId: targetId, permission: 'read' }
|
||||
: { userId: targetId, permission: 'read' }
|
||||
targetType === 'team' ? { teamId: targetId, permission } : { userId: targetId, permission }
|
||||
);
|
||||
const updatedShares = await api.getDocShares(shareModalDoc.id);
|
||||
setActiveDocShares(updatedShares);
|
||||
@@ -2284,7 +2281,7 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
||||
await api.createFolderShare(shareModalFolder.id, {
|
||||
targetType,
|
||||
targetId,
|
||||
permission: 'read',
|
||||
permission,
|
||||
});
|
||||
const updatedFolder = await api.getSharedFolder(shareModalFolder.id);
|
||||
setShareModalFolder(updatedFolder);
|
||||
|
||||
Reference in new issue
Block a user