Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(slice-machine): add OwnerSelect in FieldSet's stories #1276

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

bapmrl
Copy link
Collaborator

@bapmrl bapmrl commented Jan 26, 2024

No description provided.

@bapmrl bapmrl requested a review from angeloashmore January 26, 2024 15:40
@bapmrl bapmrl self-assigned this Jan 26, 2024
Copy link

vercel bot commented Jan 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
slice-machine ✅ Ready (Inspect) Visit Preview Jan 29, 2024 8:39am

Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

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

Looks great! I really like how composable the FIeldSet components are. 🙂

I left few comments/suggestions.


type OrganizationSelectProps = { disabled?: boolean };

function OrganizationSelect(props: OrganizationSelectProps): ReactNode {
Copy link
Member

Choose a reason for hiding this comment

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

"Organization" is a GitHub-specific term and is only one kind of owner type (the other is "User"). The API uses the term "Owner" to represent an organization or user. Thus, we could replace references to "Organization" with "Owner". What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree! I'll make the change.

constrainContentWidth
flexContent
placeholder="Organization"
renderStartIcon={() => <GitHubIcon color={tokens.color.greyLight11} />}
Copy link
Member

Choose a reason for hiding this comment

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

The icon appears further away from the text than it should. I saw you opened a thread here: Open Slack

Will we eventually change <Select> to use a smaller gap?

Copy link
Collaborator Author

@bapmrl bapmrl Jan 29, 2024

Choose a reason for hiding this comment

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

I hope soon, but the conversation involves several team members with different priorities 😄

sx={{ width: "calc(50% - 8px)" }}
>
<SelectItem size="large" value="organization-1">
Organization
Copy link
Member

Choose a reason for hiding this comment

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

We may want to add icons to the select items to represent the Git provider. In this case, we would probably want a GitHub logo to appear next to each item. In the future, we would show different provider icons, like the GitLab and Bitbucket logos.

Copy link
Collaborator Author

@bapmrl bapmrl Jan 29, 2024

Choose a reason for hiding this comment

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

Shouldn't we display a "user" or "organization" icon instead? ^^ For instance, if the user just selected GitHub in the previous step, I would expect the Select to only contain items that are either GitHub users or GitHub organizations, no?

Copy link
Member

Choose a reason for hiding this comment

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

We should probably support multiple connected accounts at once, like the Vercel "New Project" screen works:

image

They force switching Git providers, but I think we can support multiple providers at once. Thus, we would need to a way to differentiate providers.

I don't think owner type is as important as provider type since a user may add two accounts with the same name from different providers. The different between a user and team owner has less of an impact, but we could still display a "team" label next to team accounts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've updated the code to display the provider's icon in each item ^^

@bapmrl bapmrl force-pushed the bmo/add-organization-select-story branch from 2dc81a1 to 4f1298b Compare January 29, 2024 08:33
@bapmrl bapmrl changed the title feat(slice-machine): add OrganizationSelect in FieldSet's stories feat(slice-machine): add OwnerSelect in FieldSet's stories Jan 29, 2024
@bapmrl
Copy link
Collaborator Author

bapmrl commented Jan 29, 2024

I'm merging @angeloashmore, but we can continue the conversation about the icons to display next to each SelectItem 🙂

@bapmrl bapmrl merged commit 430e13f into main Jan 29, 2024
12 of 24 checks passed
@bapmrl bapmrl deleted the bmo/add-organization-select-story branch January 29, 2024 08:35
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.

2 participants