Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lovincyrus
Copy link
Contributor

@lovincyrus lovincyrus commented Oct 31, 2025

This PR implements the feature to invite guest users with project access selection from org users. Closes https://linear.app/rilldata/issue/APP-229/force-project-access-selection-when-creating-guest-users-at-org-user

CleanShot.2025-10-31.at.17.59.46.mp4

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@lovincyrus lovincyrus self-assigned this Oct 31, 2025
@lovincyrus lovincyrus marked this pull request as ready for review October 31, 2025 10:25
Copy link
Contributor

Thanks Cyrus! Some feedback:

Proposed Changes:

  1. Remove “Guest” as a role option
    Remove the Guest role from the Member Creation page.
  2. Add “Create Guest” functionality
    Introduce a “Create Guest” button on the Guests page.
    • When clicked, users can enter one or more email addresses (comma-separated).
    • Users can then multi-select which projects to grant access to (users must select at least 1 project in order to create guest users)
    • Users must select at least 1 access level for the projects selected. Dropdown selector for access level with options:
      • Admin
      • Editor
      • Viewer (default)

@lovincyrus
Copy link
Contributor Author

Thanks Cyrus! Some feedback:

Proposed Changes:

  1. Remove “Guest” as a role option Remove the Guest role from the Member Creation page.

  2. Add “Create Guest” functionalityIntroduce a “Create Guest” button on the Guests page.

    • When clicked, users can enter one or more email addresses (comma-separated).

    • Users can then multi-select which projects to grant access to (users must select at least 1 project in order to create guest users)

    • Users must select at least 1 access level for the projects selected. Dropdown selector for access level with options:

      • Admin
      • Editor
      • Viewer (default)

Addressed the proposed changes. @ericokuma

@lovincyrus lovincyrus requested a review from ericokuma November 4, 2025 09:39
@ericokuma
Copy link
Contributor

@ericokuma
Copy link
Contributor

<div class="mt-3">
<div class="text-xs font-medium mb-1">Project access</div>
{#if $projectsQuery?.isLoading}
<div class="text-xs text-slate-500">Loading projects…</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use a spinner everywhere in the app. Is there a design to use text instead? If not we should stick to using spinners.

{#if $projectsQuery?.isLoading}
<div class="text-xs text-slate-500">Loading projects…</div>
{:else if $projectsQuery?.error}
<div class="text-xs text-red-500">Failed to load projects</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should display the error as well. Perhaps the full page error triggers? Please test it once, you can manually throw error in the tanstack query methods.

class="font-normal flex items-center overflow-hidden"
checked={selectedProjects.includes(p.name)}
on:click={() => {
const idx = selectedProjects.indexOf(p.name);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this somewhat complex handler out of markup.


{#if failedInvites.length > 0}
<div class="text-sm text-red-500 py-2">
{failedInvites.length === 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this supposed to say? xyz already failed to invite doesnt make sense to me.

@@ -0,0 +1,297 @@
<script lang="ts">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets call this AddGuestsDialog to match the verb of the backend API

? 'bg-slate-200'
: 'hover:bg-slate-100'} px-2 py-1"
>
<span>{roleLabel(selectedRole)}</span>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use ORG_ROLES_OPTIONS ? No need for roleLabel either.

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.

4 participants