From d3e5bf48f022ba74c31e7e0e9c54a1451b619c18 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 20 Jan 2020 16:15:46 +0100 Subject: [PATCH] KEYCLOAK-12431 don't use user agent but patternfly --- .../resources/app/content/ContentPage.tsx | 10 +-- .../DeviceActivityPage.tsx | 86 +++++++++---------- 2 files changed, 46 insertions(+), 50 deletions(-) diff --git a/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/ContentPage.tsx b/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/ContentPage.tsx index c855cea220..a829218f0a 100644 --- a/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/ContentPage.tsx +++ b/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/ContentPage.tsx @@ -1,4 +1,4 @@ -/* +/* * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ interface ContentPageProps { * @author Stan Silvert ssilvert@redhat.com (C) 2019 Red Hat Inc. */ export class ContentPage extends React.Component { - + public constructor(props: ContentPageProps) { super(props); } @@ -44,7 +44,7 @@ export class ContentPage extends React.Component {
<strong><Msg msgKey={this.props.title}/></strong> - {this.props.onRefresh && + {this.props.onRefresh && }> @@ -52,8 +52,8 @@ export class ContentPage extends React.Component { {this.props.introMessage && }
- -
+ +
{this.props.children}
diff --git a/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/device-activity-page/DeviceActivityPage.tsx b/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/device-activity-page/DeviceActivityPage.tsx index 6b813837ca..9087cedf76 100644 --- a/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/device-activity-page/DeviceActivityPage.tsx +++ b/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/device-activity-page/DeviceActivityPage.tsx @@ -1,4 +1,4 @@ -/* +/* * Copyright 2018 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,15 +34,15 @@ import { } from '@patternfly/react-core'; import { - AmazonIcon, - ChromeIcon, - EdgeIcon, - FirefoxIcon, + AmazonIcon, + ChromeIcon, + EdgeIcon, + FirefoxIcon, GlobeIcon, - InternetExplorerIcon, + InternetExplorerIcon, OperaIcon, SafariIcon, - YandexInternationalIcon, + YandexInternationalIcon, } from '@patternfly/react-icons'; import {Msg} from '../../widgets/Msg'; @@ -50,7 +50,7 @@ import {ContinueCancelModal} from '../../widgets/ContinueCancelModal'; import {KeycloakService} from '../../keycloak-service/keycloak.service'; import {ContentPage} from '../ContentPage'; import { ContentAlert } from '../ContentAlert'; - + declare const baseUrl: string; export interface DeviceActivityPageProps { @@ -87,12 +87,12 @@ interface Client { clientId: string; clientName: string; } - + /** * @author Stan Silvert ssilvert@redhat.com (C) 2019 Red Hat Inc. */ export class DeviceActivityPage extends React.Component { - + public constructor(props: DeviceActivityPageProps) { super(props); @@ -124,11 +124,11 @@ export class DeviceActivityPage extends React.Component @@ -234,7 +234,7 @@ export class DeviceActivityPage extends React.Component , - {this.isShowSignOutAll(this.state.devices) && + {this.isShowSignOutAll(this.state.devices) && - + + - {/* <-- top spacing */} + {/* <-- top spacing */} {this.state.devices.map((device: Device, deviceIndex: number) => { return ( {device.sessions.map((session: Session, sessionIndex: number) => { return ( - - - + + + {this.findBrowserIcon(session)} - {!this.state.devices[0].mobile && + + {session.ipAddress} + + {session.current && - {session.ipAddress} - - } - {session.current && - - + } - - {!session.browser.toLowerCase().includes('unknown') && -

{session.browser} / {this.findOS(device)} {this.findOSVersion(device)}

- } - {this.state.devices[0].mobile && -

{Msg.localize('ipAddress')} {session.ipAddress}

- } + + {!session.browser.toLowerCase().includes('unknown') && +

{session.browser} / {this.findOS(device)} {this.findOSVersion(device)}

}

{Msg.localize('lastAccessedOn')} {this.time(session.lastAccess)}

{Msg.localize('clients')} {this.makeClientsString(session.clients)}

{Msg.localize('startedAt')} {this.time(session.started)}

{Msg.localize('expiresAt')} {this.time(session.expires)}

- {!session.current && + {!session.current && this.signOutSession(device, session)} + buttonId={this.elementId('sign-out', session)} + modalTitle='doSignOut' + buttonVariant='secondary' + modalMessage='signOutWarning' + onContinue={() => this.signOutSession(device, session)} /> - } - + } +
); - + })}
) })} - {/* <-- bottom spacing */} + {/* <-- bottom spacing */}
-
+ + - +
);