Skip to content

feat(backend): add share-file action node#26

Open
LukasHirt wants to merge 2 commits into
mainfrom
feat/action-share-file
Open

feat(backend): add share-file action node#26
LukasHirt wants to merge 2 commits into
mainfrom
feat/action-share-file

Conversation

@LukasHirt

@LukasHirt LukasHirt commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements the "Share File" action node end to end: actionType: 'share' grants viewer/editor access on the workflow's current file to a specified user or group via oCIS's Graph API, the same pattern tag/comment already established for Graph-only (non-WebDAV) actions.

  • Backend: GraphClient.Share(ctx, authHeader, itemID, recipient, role) in backend/pkg/ocisclient/share.go, plus a small recipient-resolution helper that looks up a user, then a group, by search term. Wired into runAction's new case "share": in backend/pkg/executor/executor.go, which renders the recipient template against vars (like every other action param), resolves the item id via the existing ResolveItemID, defaults role to "viewer", and sets result.Output = recipient.
  • Frontend: new action-share entry in NODE_TYPES (frontend/src/nodeTypes.ts) under the Actions category, with recipient (text input) and role (viewer/editor select) fields added to NodeDetailsPanel.vue, mirroring the tag/comment field-rendering pattern and the existing select-field convention used for trigger/event type.

Test plan

  • cd backend && go build ./... && go vet ./... && go test ./...
  • cd frontend && npm run test:unit && npm run check:types && npm run lint && npm run build
  • reuse lint
  • Manual verification against a live oCIS instance

🤖 Generated with Claude Code

@LukasHirt
LukasHirt requested a review from a team as a code owner July 24, 2026 16:20
@LukasHirt LukasHirt self-assigned this Jul 24, 2026
Grants viewer/editor access on a workflow's current file to a user or group
via oCIS's Graph API, following the same GraphClient.ResolveItemID pattern
tag/comment already use. Adds GraphClient.Share plus a recipient-resolution
helper (email/group name -> Graph user/group id) and a "share" runAction case.

The invite endpoint shape (POST /graph/v1.0/drives/{driveID}/items/{itemID}/
invite) and its request body are inferred from this codebase's existing Graph
client conventions and general oCIS/libre-graph API knowledge, not verified
against a live oCIS instance -- see the doc comment on Share for specifics.
Tests cover the runAction wiring (template rendering, ResolveItemID -> Share
call, default role, missing-recipient failure) via the existing fakeGraph
mock; no new HTTP-level test harness was added since ocisclient has none yet.

Signed-off-by: Lukas Hirt <info@hirt.cz>
Adds a "Share File" entry to the Actions palette (action-share, actionType
"share") mirroring the existing tag/comment action pattern: a recipient text
input (rendered against workflow vars server-side, like every other action
param) and a viewer/editor role select in NodeDetailsPanel.vue, matching the
select-field convention already used for trigger/event type.

Covered by new Vitest specs: nodeTypes.spec.ts asserts the node type is
registered under the Actions category and discoverable like other actions;
NodeDetailsPanel.spec.ts mounts the panel (stubbing oc-icon/oc-button/
oc-text-input, the first component-mount test in this suite) to assert the
recipient input and role select are wired to actionParams and emit updates.

Signed-off-by: Lukas Hirt <info@hirt.cz>
@LukasHirt
LukasHirt force-pushed the feat/action-share-file branch from 32ba662 to 88e5155 Compare July 24, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant