From 08ac01fa5b62342d68ca6ef334f8c89a8464b464 Mon Sep 17 00:00:00 2001 From: Matteo Barone Date: Tue, 29 Jun 2021 15:32:32 +0200 Subject: [PATCH] exported and renamed also AuthProviders and FeatureFlags Signed-off-by: Matteo Barone --- plugins/user-settings/api-report.md | 9 ++++++--- ...iders.test.tsx => UserSettingsAuthProviders.test.tsx} | 6 +++--- .../{AuthProviders.tsx => UserSettingsAuthProviders.tsx} | 2 +- .../user-settings/src/components/AuthProviders/index.ts | 2 +- .../{FeatureFlags.tsx => UserSettingsFeatureFlags.tsx} | 2 +- .../user-settings/src/components/FeatureFlags/index.ts | 2 +- plugins/user-settings/src/components/SettingsPage.tsx | 8 ++++---- plugins/user-settings/src/components/index.ts | 1 + 8 files changed, 18 insertions(+), 14 deletions(-) rename plugins/user-settings/src/components/AuthProviders/{AuthProviders.test.tsx => UserSettingsAuthProviders.test.tsx} (92%) rename plugins/user-settings/src/components/AuthProviders/{AuthProviders.tsx => UserSettingsAuthProviders.tsx} (95%) rename plugins/user-settings/src/components/FeatureFlags/{FeatureFlags.tsx => UserSettingsFeatureFlags.tsx} (97%) diff --git a/plugins/user-settings/api-report.md b/plugins/user-settings/api-report.md index 9eec78b6a3..dc85df0d3d 100644 --- a/plugins/user-settings/api-report.md +++ b/plugins/user-settings/api-report.md @@ -11,9 +11,6 @@ import { ProfileInfo } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; import { SessionApi } from '@backstage/core-plugin-api'; -// @public (undocumented) -export const AuthProviders: ({ providerSettings }: Props_2) => JSX.Element; - // @public (undocumented) export const DefaultProviderSettings: ({ configuredProviders }: Props_3) => JSX.Element; @@ -29,6 +26,12 @@ export const Settings: () => JSX.Element; // @public (undocumented) export const UserSettingsAppearanceCard: () => JSX.Element; +// @public (undocumented) +export const UserSettingsAuthProviders: ({ providerSettings }: Props_2) => JSX.Element; + +// @public (undocumented) +export const UserSettingsFeatureFlags: () => JSX.Element; + // @public (undocumented) export const UserSettingsGeneral: () => JSX.Element; diff --git a/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx b/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.test.tsx similarity index 92% rename from plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx rename to plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.test.tsx index abb2f2f42c..085a884f2e 100644 --- a/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx +++ b/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.test.tsx @@ -17,7 +17,7 @@ import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils'; import { fireEvent } from '@testing-library/react'; import React from 'react'; -import { AuthProviders } from './AuthProviders'; +import { UserSettingsAuthProviders } from './UserSettingsAuthProviders'; import { ApiProvider, @@ -52,12 +52,12 @@ const apiRegistry = ApiRegistry.from([ [googleAuthApiRef, mockGoogleAuth], ]); -describe('', () => { +describe('', () => { it('displays a provider and calls its sign-in handler on click', async () => { const rendered = await renderWithEffects( wrapInTestApp( - + , ), ); diff --git a/plugins/user-settings/src/components/AuthProviders/AuthProviders.tsx b/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.tsx similarity index 95% rename from plugins/user-settings/src/components/AuthProviders/AuthProviders.tsx rename to plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.tsx index 1456380d55..8107944781 100644 --- a/plugins/user-settings/src/components/AuthProviders/AuthProviders.tsx +++ b/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.tsx @@ -26,7 +26,7 @@ type Props = { providerSettings?: JSX.Element; }; -export const AuthProviders = ({ providerSettings }: Props) => { +export const UserSettingsAuthProviders = ({ providerSettings }: Props) => { const configApi = useApi(configApiRef); const providersConfig = configApi.getOptionalConfig('auth.providers'); const configuredProviders = providersConfig?.keys() || []; diff --git a/plugins/user-settings/src/components/AuthProviders/index.ts b/plugins/user-settings/src/components/AuthProviders/index.ts index 5221656caf..036467eb37 100644 --- a/plugins/user-settings/src/components/AuthProviders/index.ts +++ b/plugins/user-settings/src/components/AuthProviders/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export { AuthProviders } from './AuthProviders'; +export { UserSettingsAuthProviders } from './UserSettingsAuthProviders'; export { DefaultProviderSettings } from './DefaultProviderSettings'; export { ProviderSettingsItem } from './ProviderSettingsItem'; diff --git a/plugins/user-settings/src/components/FeatureFlags/FeatureFlags.tsx b/plugins/user-settings/src/components/FeatureFlags/UserSettingsFeatureFlags.tsx similarity index 97% rename from plugins/user-settings/src/components/FeatureFlags/FeatureFlags.tsx rename to plugins/user-settings/src/components/FeatureFlags/UserSettingsFeatureFlags.tsx index 2fee2157e2..5a3f077920 100644 --- a/plugins/user-settings/src/components/FeatureFlags/FeatureFlags.tsx +++ b/plugins/user-settings/src/components/FeatureFlags/UserSettingsFeatureFlags.tsx @@ -26,7 +26,7 @@ import { } from '@backstage/core-plugin-api'; import { InfoCard } from '@backstage/core-components'; -export const FeatureFlags = () => { +export const UserSettingsFeatureFlags = () => { const featureFlagsApi = useApi(featureFlagsApiRef); const featureFlags = featureFlagsApi.getRegisteredFlags(); diff --git a/plugins/user-settings/src/components/FeatureFlags/index.ts b/plugins/user-settings/src/components/FeatureFlags/index.ts index d23fc77066..fe1c091abf 100644 --- a/plugins/user-settings/src/components/FeatureFlags/index.ts +++ b/plugins/user-settings/src/components/FeatureFlags/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { FeatureFlags } from './FeatureFlags'; +export { UserSettingsFeatureFlags } from './UserSettingsFeatureFlags'; diff --git a/plugins/user-settings/src/components/SettingsPage.tsx b/plugins/user-settings/src/components/SettingsPage.tsx index eb74a380f8..eebf6ff865 100644 --- a/plugins/user-settings/src/components/SettingsPage.tsx +++ b/plugins/user-settings/src/components/SettingsPage.tsx @@ -15,8 +15,8 @@ */ import React from 'react'; -import { AuthProviders } from './AuthProviders'; -import { FeatureFlags } from './FeatureFlags'; +import { UserSettingsAuthProviders } from './AuthProviders'; +import { UserSettingsFeatureFlags } from './FeatureFlags'; import { UserSettingsGeneral } from './General'; import { Header, Page, TabbedLayout } from '@backstage/core-components'; @@ -37,10 +37,10 @@ export const SettingsPage = ({ providerSettings }: Props) => { path="auth-providers" title="Authentication Providers" > - + - + diff --git a/plugins/user-settings/src/components/index.ts b/plugins/user-settings/src/components/index.ts index e2dc4218e2..cb058f9c5e 100644 --- a/plugins/user-settings/src/components/index.ts +++ b/plugins/user-settings/src/components/index.ts @@ -17,4 +17,5 @@ export { Settings } from './Settings'; export { SettingsPage as Router } from './SettingsPage'; export * from './AuthProviders'; export * from './General'; +export * from './FeatureFlags'; export { useUserProfile } from './useUserProfileInfo';