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

Added MySquads #10026

Merged
merged 9 commits into from Mar 31, 2022
Merged

Conversation

awanlin
Copy link
Collaborator

@awanlin awanlin commented Mar 6, 2022

Signed-off-by: Andre Wanlin awanlin@rapidrtc.com

Hey, I just made a Pull Request!

Introduced a new MySquads SidebarItem that links to one or more groups based on the logged in user's membership.

To use MySquads you'll need to add it to your Root.tsx like this:

// app/src/components/Root/Root.tsx
+ import { MySquads } from '@backstage/plugin-org';
+ import GroupIcon from '@material-ui/icons/People';

<SidebarPage>
    <Sidebar>
      //...
      <SidebarGroup label="Menu" icon={<MenuIcon />}>
        {/* Global nav, not org-specific */}
        //...
        <SidebarItem icon={HomeIcon} to="catalog" text="Home" />
+        <MySquads
+          singularTitle="My Squad"
+          pluralTitle="My Squads"
+          icon={GroupIcon}
+        />
       //...
      </SidebarGroup>
    </ Sidebar>
</SidebarPage>

Single Squad:

mysquads-logged-in-single

Multiple Squads:

mysquads-logged-in-multiple

(MySquads uses the metadata.title and if that is not present then uses the metadata.name this is why Team D is shown as "team-d")

Closes #8678

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@awanlin awanlin requested a review from a team as a code owner March 6, 2022 16:03
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2022

🦋 Changeset detected

Latest commit: c9d59ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@backstage/plugin-org Patch
example-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@awanlin
Copy link
Collaborator Author

awanlin commented Mar 6, 2022

@freben, I put this in the Org plugin as that seemed to make the most logic sense to me. I'm open to moving it though, would be pretty easy.

Also, for the test of a user with multiple groups I could not find a way to get at the SidebarSubmenuItem to do some validation on them. If someone could help me with that I'd be happy to improve this.

@awanlin awanlin mentioned this pull request Mar 6, 2022
@awanlin awanlin force-pushed the topic/add-mysquads-sidebar-item branch from ce5dea0 to 1a35824 Compare March 7, 2022 14:46
Copy link
Member

@benjdlambert benjdlambert left a comment

Choose a reason for hiding this comment

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

This looks good! Just a nit about the naming? 🙏

plugins/org/src/components/MySquads/MySquads.tsx Outdated Show resolved Hide resolved
@awanlin
Copy link
Collaborator Author

awanlin commented Mar 18, 2022

Ready for another review, please :)

Copy link
Member

@freben freben left a comment

Choose a reason for hiding this comment

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

Good stuff! Just small nits

plugins/org/src/components/MyGroups/MyGroups.tsx Outdated Show resolved Hide resolved
plugins/org/src/components/MyGroups/MyGroups.tsx Outdated Show resolved Hide resolved
plugins/org/src/components/MyGroups/MyGroups.tsx Outdated Show resolved Hide resolved
plugins/org/src/components/MyGroups/MyGroups.test.tsx Outdated Show resolved Hide resolved
Andre Wanlin added 3 commits March 26, 2022 09:42
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2022

Changed Packages

Package Name Package Path Changeset Bump Current Version
example-app packages/app none v0.2.70-next.1
@backstage/plugin-org plugins/org patch v0.5.4-next.1

Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
@awanlin
Copy link
Collaborator Author

awanlin commented Mar 26, 2022

I could swear it said I should have a changeset for the example-app, I'll take that out then

Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
@awanlin
Copy link
Collaborator Author

awanlin commented Mar 30, 2022

@freben thanks for your patience with me on this one, have some things to take away and learn better. I think I have this PR in a state where it's ready to merge now though

Signed-off-by: Johan Haals <johan.haals@gmail.com>
Copy link
Member

@jhaals jhaals left a comment

Choose a reason for hiding this comment

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

Thanks for the patience with this one @awanlin

I took the liberty to fix commit a small fix for a mismatch in single/double quotes.
Going to ship this once it goes green

@jhaals jhaals merged commit 25be8b7 into backstage:master Mar 31, 2022
@awanlin
Copy link
Collaborator Author

awanlin commented Mar 31, 2022

Thanks @benjdlambert @freben and @jhaals for your reviews and helping me through with this. 🚀

@awanlin awanlin deleted the topic/add-mysquads-sidebar-item branch March 31, 2022 11:30
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.

[Plugin] My Squad
4 participants