KEYCLOAK-11839: Fix linting errors in DeviceActivityPage
This commit is contained in:
parent
68fa37b4cd
commit
401c02cc19
1 changed files with 7 additions and 24 deletions
|
@ -29,8 +29,6 @@ import {
|
||||||
DataListItemCells,
|
DataListItemCells,
|
||||||
Grid,
|
Grid,
|
||||||
GridItem,
|
GridItem,
|
||||||
Level,
|
|
||||||
LevelItem,
|
|
||||||
Stack,
|
Stack,
|
||||||
StackItem
|
StackItem
|
||||||
} from '@patternfly/react-core';
|
} from '@patternfly/react-core';
|
||||||
|
@ -107,7 +105,7 @@ export class DeviceActivityPage extends React.Component<DeviceActivityPageProps,
|
||||||
|
|
||||||
private signOutAll = () => {
|
private signOutAll = () => {
|
||||||
AccountServiceClient.Instance.doDelete("/sessions")
|
AccountServiceClient.Instance.doDelete("/sessions")
|
||||||
.then( (response: AxiosResponse<Object>) => {
|
.then( () => {
|
||||||
KeycloakService.Instance.logout(baseUrl);
|
KeycloakService.Instance.logout(baseUrl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -122,11 +120,10 @@ export class DeviceActivityPage extends React.Component<DeviceActivityPageProps,
|
||||||
|
|
||||||
private fetchDevices(): void {
|
private fetchDevices(): void {
|
||||||
AccountServiceClient.Instance.doGet("/sessions/devices")
|
AccountServiceClient.Instance.doGet("/sessions/devices")
|
||||||
.then((response: AxiosResponse<Object>) => {
|
.then((response: AxiosResponse<Device[]>) => {
|
||||||
console.log({response});
|
console.log({response});
|
||||||
|
|
||||||
let devices = response.data as Device[];
|
let devices: Device[] = this.moveCurrentToTop(response.data);
|
||||||
devices = this.moveCurrentToTop(devices);
|
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
devices: devices
|
devices: devices
|
||||||
|
@ -188,10 +185,10 @@ export class DeviceActivityPage extends React.Component<DeviceActivityPageProps,
|
||||||
}
|
}
|
||||||
|
|
||||||
private makeClientsString(clients: Client[]): string {
|
private makeClientsString(clients: Client[]): string {
|
||||||
let clientsString: string = "";
|
let clientsString = "";
|
||||||
clients.map( (client: Client, index: number) => {
|
clients.forEach( (client: Client, index: number) => {
|
||||||
let clientName: string;
|
let clientName: string;
|
||||||
if (client.hasOwnProperty('clientName') && (client.clientName != undefined) && (client.clientName != '')) {
|
if (client.hasOwnProperty('clientName') && (client.clientName !== undefined) && (client.clientName !== '')) {
|
||||||
clientName = Msg.localize(client.clientName);
|
clientName = Msg.localize(client.clientName);
|
||||||
} else {
|
} else {
|
||||||
clientName = client.clientId;
|
clientName = client.clientId;
|
||||||
|
@ -312,17 +309,3 @@ export class DeviceActivityPage extends React.Component<DeviceActivityPageProps,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class IconGridItem extends React.Component {
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<GridItem span={1}>
|
|
||||||
<Level gutter='lg'>
|
|
||||||
<LevelItem/>
|
|
||||||
<LevelItem>{this.props.children}</LevelItem>
|
|
||||||
<LevelItem/>
|
|
||||||
</Level>
|
|
||||||
</GridItem>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue