exported and renamed also AuthProviders and FeatureFlags
Signed-off-by: Matteo Barone <matteo.barone@klarna.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
+3
-3
@@ -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('<AuthProviders />', () => {
|
||||
describe('<UserSettingsAuthProviders />', () => {
|
||||
it('displays a provider and calls its sign-in handler on click', async () => {
|
||||
const rendered = await renderWithEffects(
|
||||
wrapInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<AuthProviders />
|
||||
<UserSettingsAuthProviders />
|
||||
</ApiProvider>,
|
||||
),
|
||||
);
|
||||
+1
-1
@@ -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() || [];
|
||||
@@ -14,6 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { AuthProviders } from './AuthProviders';
|
||||
export { UserSettingsAuthProviders } from './UserSettingsAuthProviders';
|
||||
export { DefaultProviderSettings } from './DefaultProviderSettings';
|
||||
export { ProviderSettingsItem } from './ProviderSettingsItem';
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { FeatureFlags } from './FeatureFlags';
|
||||
export { UserSettingsFeatureFlags } from './UserSettingsFeatureFlags';
|
||||
|
||||
@@ -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"
|
||||
>
|
||||
<AuthProviders providerSettings={providerSettings} />
|
||||
<UserSettingsAuthProviders providerSettings={providerSettings} />
|
||||
</TabbedLayout.Route>
|
||||
<TabbedLayout.Route path="feature-flags" title="Feature Flags">
|
||||
<FeatureFlags />
|
||||
<UserSettingsFeatureFlags />
|
||||
</TabbedLayout.Route>
|
||||
</TabbedLayout>
|
||||
</Page>
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user