Skip to content

Commit

Permalink
user-settings: avoid depending on descriptions from ApiRefs
Browse files Browse the repository at this point in the history
Co-authored-by: Juan Lulkin <[email protected]>
Signed-off-by: Patrik Oldsberg <[email protected]>
  • Loading branch information
Rugvip and Juan Lulkin committed Mar 11, 2021
1 parent 9804a52 commit 147b4c5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-students-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-user-settings': patch
---

Avoid using `ApiRef` descriptions in the UI.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ describe('<AuthProviders />', () => {

expect(rendered.getByText('Google')).toBeInTheDocument();
expect(
rendered.getByText(googleAuthApiRef.description),
rendered.getByText(
'Provides authentication towards Google APIs and identities',
),
).toBeInTheDocument();

const button = rendered.getByTitle('Sign in to Google');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,47 +34,47 @@ export const DefaultProviderSettings = ({ configuredProviders }: Props) => (
{configuredProviders.includes('google') && (
<ProviderSettingsItem
title="Google"
description={googleAuthApiRef.description}
description="Provides authentication towards Google APIs and identities"
apiRef={googleAuthApiRef}
icon={Star}
/>
)}
{configuredProviders.includes('microsoft') && (
<ProviderSettingsItem
title="Microsoft"
description={microsoftAuthApiRef.description}
description="Provides authentication towards Microsoft APIs and identities"
apiRef={microsoftAuthApiRef}
icon={Star}
/>
)}
{configuredProviders.includes('github') && (
<ProviderSettingsItem
title="GitHub"
description={githubAuthApiRef.description}
description="Provides authentication towards GitHub APIs"
apiRef={githubAuthApiRef}
icon={Star}
/>
)}
{configuredProviders.includes('gitlab') && (
<ProviderSettingsItem
title="GitLab"
description={gitlabAuthApiRef.description}
description="Provides authentication towards GitLab APIs"
apiRef={gitlabAuthApiRef}
icon={Star}
/>
)}
{configuredProviders.includes('okta') && (
<ProviderSettingsItem
title="Okta"
description={oktaAuthApiRef.description}
description="Provides authentication towards Okta APIs"
apiRef={oktaAuthApiRef}
icon={Star}
/>
)}
{configuredProviders.includes('oauth2') && (
<ProviderSettingsItem
title="YourOrg"
description={oauth2ApiRef.description}
description="Example of how to use oauth2 custom provider"
apiRef={oauth2ApiRef}
icon={Star}
/>
Expand Down

0 comments on commit 147b4c5

Please sign in to comment.