mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 01:23:32 -06:00
Authentication UI: Remove auth settings (#67647)
This commit is contained in:
parent
f9fd15c01e
commit
93b461bd96
@ -11,7 +11,7 @@ import { StoreState } from 'app/types';
|
||||
import ConfigureAuthCTA from './components/ConfigureAuthCTA';
|
||||
import { ProviderCard } from './components/ProviderCard';
|
||||
import { loadSettings } from './state/actions';
|
||||
import { filterAuthSettings, getProviderUrl } from './utils';
|
||||
import { getProviderUrl } from './utils';
|
||||
|
||||
import { getRegisteredAuthProviders } from '.';
|
||||
|
||||
@ -20,9 +20,8 @@ interface OwnProps {}
|
||||
export type Props = OwnProps & ConnectedProps<typeof connector>;
|
||||
|
||||
function mapStateToProps(state: StoreState) {
|
||||
const { settings, isLoading, providerStatuses } = state.authConfig;
|
||||
const { isLoading, providerStatuses } = state.authConfig;
|
||||
return {
|
||||
settings,
|
||||
isLoading,
|
||||
providerStatuses,
|
||||
};
|
||||
@ -34,12 +33,7 @@ const mapDispatchToProps = {
|
||||
|
||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
export const AuthConfigPageUnconnected = ({
|
||||
settings,
|
||||
providerStatuses,
|
||||
isLoading,
|
||||
loadSettings,
|
||||
}: Props): JSX.Element => {
|
||||
export const AuthConfigPageUnconnected = ({ providerStatuses, isLoading, loadSettings }: Props): JSX.Element => {
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
useEffect(() => {
|
||||
@ -54,7 +48,6 @@ export const AuthConfigPageUnconnected = ({
|
||||
const availableProviders = authProviders.filter(
|
||||
(p) => !providerStatuses[p.id]?.enabled && !providerStatuses[p.id]?.configured
|
||||
);
|
||||
const authSettings = filterAuthSettings(settings);
|
||||
const firstAvailableProvider = availableProviders?.length ? availableProviders[0] : null;
|
||||
|
||||
return (
|
||||
@ -100,29 +93,6 @@ export const AuthConfigPageUnconnected = ({
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{!isEmpty(authSettings) && (
|
||||
<div className={styles.settingsSection}>
|
||||
<h3>Settings</h3>
|
||||
<table className="filter-table">
|
||||
<tbody>
|
||||
{Object.entries(authSettings).map(([sectionName, sectionSettings], i) => (
|
||||
<React.Fragment key={`section-${i}`}>
|
||||
<tr>
|
||||
<td className="admin-settings-section">{sectionName}</td>
|
||||
<td />
|
||||
</tr>
|
||||
{Object.entries(sectionSettings).map(([settingName, settingValue], j) => (
|
||||
<tr key={`property-${j}`}>
|
||||
<td className={styles.settingName}>{settingName}</td>
|
||||
<td className={styles.settingName}>{settingValue}</td>
|
||||
</tr>
|
||||
))}
|
||||
</React.Fragment>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)}
|
||||
</Page.Contents>
|
||||
</Page>
|
||||
);
|
||||
|
@ -1,15 +1,6 @@
|
||||
import { Settings } from 'app/types';
|
||||
|
||||
import { BASE_PATH } from './constants';
|
||||
import { AuthProviderInfo } from './types';
|
||||
|
||||
export function filterAuthSettings(settings: Settings) {
|
||||
const authSettings: Settings = Object.fromEntries(
|
||||
Object.entries(settings).filter(([sectionName]) => sectionName === 'auth')
|
||||
);
|
||||
return authSettings;
|
||||
}
|
||||
|
||||
export function getProviderUrl(provider: AuthProviderInfo) {
|
||||
return BASE_PATH + (provider.configPath || provider.id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user