OpnForm icon indicating copy to clipboard operation
OpnForm copied to clipboard

Team Functionality

Open JhumanJ opened this issue 1 year ago • 3 comments

Enable Multi-User Collaboration in Workspaces on OpnForm

Background

OpnForm is already is built around workspaces - with collaboration in mind. However, it currently only supports a single-user per workspace. This issue aims to extend the current functionality to allow multiple users to collaborate within a single workspace.

Features to Implement

User Listing in Workspace Settings

Invite User Functionality

  • Visibility: Only available to admins.
  • Features:
    • Directly add registered users to the workspace.
    • Send an invitation email to unregistered users to join OpnForm. A draft email will should included in the pull request for further refinement by ourselves.

Promote User to Workspace Owner

  • Functionality: Add a button to promote a user to the role of workspace owner.
  • Confirmation: Require confirmation via a dialog box.

Remove User from Workspace

  • Constraints: Users cannot remove a workspace owner.
  • Confirmation: Require confirmation via a dialog box.

Adjust Workspace Leaving Mechanics

  • Condition: Change functionality if the workspace has more than one user.
    • Replace the “Remove workspace” button with “Leave the workspace”.
    • Adjust the backend to support this new action.

Technical Considerations

  • Authorization: Use Laravel policies for authorization/permissions checks.
  • Controller: Implement a WorkspaceUserController for managing workspace-related user actions (invite user, remove, promote etc).
  • Routing: API routes should be prefixed with workspaces/{id}/users.
  • We currently have only 2 roles: user and admin, but we will soon add more ('reader' who won't be able to create/edit forms for instance). So as part of this PR, let's change the boolean is_owner on the user_workspace table and replace it with a role string. In the migration doing this, make sure to assign the role admin to existing users. You should also create a UserWorkspace model and relationships (at least with the User model) to simplify access to roles

Expected Benefits

This enhancement will support collaborative efforts among users in a single workspace, improving productivity and user satisfaction on our platform.

JhumanJ avatar May 09 '24 09:05 JhumanJ

/bounty $200

JhumanJ avatar May 13 '24 11:05 JhumanJ

I would like to give a try on this 🙋 /attempt #406

Algora profile Completed bounties Tech Active attempts Options
@ezhil56x 25 bounties from 10 projects
JavaScript, TypeScript,
Rust & more
Cancel attempt

ezhil56x avatar May 13 '24 11:05 ezhil56x

I managed to setup OpnForm in my local dev environment

Started api server with php artisan serve and client with npm run dev I tried adding the following in .env of client

NUXT_PUBLIC_APP_URL=http://localhost:3000
NUXT_PUBLIC_API_BASE=http://127.0.0.1:8000

I am getting the following error, when I try to signup. I think still the client is not using the api. How can I fix this?

 WARN  [Vue Router warn]: No match found for location with path "/user"

ezhil56x avatar May 17 '24 11:05 ezhil56x

@ezhil56x are you still working on the issue

LL-Etiane avatar May 20 '24 01:05 LL-Etiane

/attempt #406

Options

LL-Etiane avatar May 20 '24 02:05 LL-Etiane

[!NOTE] The user @ezhil56x is already attempting to complete issue #406 and claim the bounty. We recommend checking in on @ezhil56x's progress, and potentially collaborating, before starting a new solution.

algora-pbc[bot] avatar May 20 '24 02:05 algora-pbc[bot]

@LL-Etiane Waiting for a reply from maintainer

ezhil56x avatar May 20 '24 06:05 ezhil56x

Hi @ezhil56x can you inspect the page and check the network tab to see where the request is being sent? Can you try pinging the back-end with a tool like postman? Any logs in storage/laravel.log?

JhumanJ avatar May 20 '24 07:05 JhumanJ

@ezhil56x I had similar error, Went ahead and manually set the env variable from terminal but if you run with docker it will work well

Using windows

LL-Etiane avatar May 20 '24 07:05 LL-Etiane

Will try troubleshooting in both ways, thanks!

ezhil56x avatar May 20 '24 07:05 ezhil56x

@ezhil56x: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar May 20 '24 11:05 algora-pbc[bot]

@JhumanJ @LL-Etiane Doesn't seem to work. The request is being sent to http://localhost:3000/user instead of http://127.0.0.1:8000/user. Is there any other way I can fix this issue

ezhil56x avatar May 20 '24 13:05 ezhil56x

Hi...I am interested in this. Has it been resolved yet?

jovialcore avatar Jun 17 '24 07:06 jovialcore

Working on it Have done the tasks. One bug is holding from completing. When a full page reload is done, the workspaces users are not loaded well

LL-Etiane avatar Jun 17 '24 07:06 LL-Etiane

Working on it Have done the tasks. One bug is holding from completing. When a full page reload is done, the workspaces users are not loaded well

Alright. Kudos

jovialcore avatar Jun 17 '24 08:06 jovialcore

Bounty paid to @LL-Etiane outside of Algora since he is in a location not supported by Stripe :( Thanks for the great work! PR: https://github.com/JhumanJ/OpnForm/pull/416

JhumanJ avatar Jun 17 '24 17:06 JhumanJ