From 4e31bdd2d26e3762c4e76b2e6130098c4779de53 Mon Sep 17 00:00:00 2001 From: mabashian Date: Mon, 4 Nov 2019 16:38:49 -0500 Subject: [PATCH] Removes changes to serializer that added type to host recent jobs. Addresses Switch styling issues on host list items. --- awx/api/serializers.py | 1 - .../src/screens/Host/HostList/HostListItem.jsx | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 15e5a808cb..a3d8d43306 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -1701,7 +1701,6 @@ class HostSerializer(BaseSerializerWithVariables): 'name': j.job.job_template.name if j.job.job_template is not None else "", 'status': j.job.status, 'finished': j.job.finished, - 'type': j.job.get_real_instance_class()._meta.verbose_name.replace(' ', '_') } for j in obj.job_host_summaries.select_related('job__job_template').order_by('-created')[:5]]) return d diff --git a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx index a316926045..4cd624da01 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx @@ -6,7 +6,7 @@ import { DataListItem, DataListItemRow, DataListItemCells, - Switch, + Switch as PFSwitch, Tooltip, } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; @@ -20,6 +20,15 @@ import { Sparkline } from '@components/Sparkline'; import VerticalSeparator from '@components/VerticalSeparator'; import { Host } from '@types'; +import styled from 'styled-components'; + +const Switch = styled(PFSwitch)` + display: flex; + flex-wrap: no-wrap; + /* workaround PF bug; used in calculating switch width: */ + --pf-c-switch__toggle-icon--Offset: 0.125rem; +`; + class HostListItem extends React.Component { static propTypes = { host: Host.isRequired,