mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Merge pull request #9755 from nixocio/ui_issue_9752
Remove isolated and controller from the UI Remove isolated and controller from the UI. See: #9752 Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
This commit is contained in:
commit
cb32f5b096
@ -30,8 +30,6 @@ const instanceGroup = {
|
|||||||
jobs_total: 0,
|
jobs_total: 0,
|
||||||
instances: 0,
|
instances: 0,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
is_container_group: true,
|
is_container_group: true,
|
||||||
credential: 71,
|
credential: 71,
|
||||||
policy_instance_percentage: 0,
|
policy_instance_percentage: 0,
|
||||||
|
|||||||
@ -29,8 +29,6 @@ const instanceGroup = {
|
|||||||
jobs_total: 0,
|
jobs_total: 0,
|
||||||
instances: 0,
|
instances: 0,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
is_container_group: true,
|
is_container_group: true,
|
||||||
credential: 71,
|
credential: 71,
|
||||||
policy_instance_percentage: 0,
|
policy_instance_percentage: 0,
|
||||||
|
|||||||
@ -27,8 +27,6 @@ const instanceGroupData = {
|
|||||||
jobs_total: 0,
|
jobs_total: 0,
|
||||||
instances: 1,
|
instances: 1,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
is_container_group: false,
|
is_container_group: false,
|
||||||
credential: null,
|
credential: null,
|
||||||
policy_instance_percentage: 46,
|
policy_instance_percentage: 46,
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { withI18n } from '@lingui/react';
|
|||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
import { Link, useHistory } from 'react-router-dom';
|
import { Link, useHistory } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Button, Label, Split, SplitItem } from '@patternfly/react-core';
|
import { Button } from '@patternfly/react-core';
|
||||||
|
|
||||||
import AlertModal from '../../../components/AlertModal';
|
import AlertModal from '../../../components/AlertModal';
|
||||||
import { CardBody, CardActionsRow } from '../../../components/Card';
|
import { CardBody, CardActionsRow } from '../../../components/Card';
|
||||||
@ -43,40 +43,13 @@ function InstanceGroupDetails({ instanceGroup, i18n }) {
|
|||||||
instanceGroup,
|
instanceGroup,
|
||||||
i18n
|
i18n
|
||||||
);
|
);
|
||||||
const verifyInstanceGroup = item => {
|
|
||||||
if (item.is_isolated) {
|
|
||||||
return (
|
|
||||||
<Split hasGutter>
|
|
||||||
<SplitItem>{item.name}</SplitItem>
|
|
||||||
<SplitItem>
|
|
||||||
<Label aria-label={i18n._(t`isolated instance`)}>
|
|
||||||
{i18n._(t`Isolated`)}
|
|
||||||
</Label>
|
|
||||||
</SplitItem>
|
|
||||||
</Split>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (item.is_controller) {
|
|
||||||
return (
|
|
||||||
<Split hasGutter>
|
|
||||||
<SplitItem>{item.name}</SplitItem>
|
|
||||||
<SplitItem>
|
|
||||||
<Label aria-label={i18n._(t`controller instance`)}>
|
|
||||||
{i18n._(t`Controller`)}
|
|
||||||
</Label>
|
|
||||||
</SplitItem>
|
|
||||||
</Split>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return <>{item.name}</>;
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<DetailList>
|
<DetailList>
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`Name`)}
|
label={i18n._(t`Name`)}
|
||||||
value={verifyInstanceGroup(instanceGroup)}
|
value={instanceGroup.name}
|
||||||
dataCy="instance-group-detail-name"
|
dataCy="instance-group-detail-name"
|
||||||
/>
|
/>
|
||||||
<Detail
|
<Detail
|
||||||
|
|||||||
@ -21,7 +21,6 @@ const instanceGroups = [
|
|||||||
policy_instance_percentage: 50,
|
policy_instance_percentage: 50,
|
||||||
percent_capacity_remaining: 60,
|
percent_capacity_remaining: 60,
|
||||||
is_container_group: false,
|
is_container_group: false,
|
||||||
is_isolated: false,
|
|
||||||
created: '2020-07-21T18:41:02.818081Z',
|
created: '2020-07-21T18:41:02.818081Z',
|
||||||
modified: '2020-07-24T20:32:03.121079Z',
|
modified: '2020-07-24T20:32:03.121079Z',
|
||||||
summary_fields: {
|
summary_fields: {
|
||||||
@ -41,7 +40,6 @@ const instanceGroups = [
|
|||||||
policy_instance_percentage: 0,
|
policy_instance_percentage: 0,
|
||||||
percent_capacity_remaining: 0,
|
percent_capacity_remaining: 0,
|
||||||
is_container_group: true,
|
is_container_group: true,
|
||||||
is_isolated: false,
|
|
||||||
created: '2020-07-21T18:41:02.818081Z',
|
created: '2020-07-21T18:41:02.818081Z',
|
||||||
modified: '2020-07-24T20:32:03.121079Z',
|
modified: '2020-07-24T20:32:03.121079Z',
|
||||||
summary_fields: {
|
summary_fields: {
|
||||||
@ -150,18 +148,4 @@ describe('<InstanceGroupDetails/>', () => {
|
|||||||
|
|
||||||
expect(wrapper.find('Button[aria-label="Edit"]').length).toBe(0);
|
expect(wrapper.find('Button[aria-label="Edit"]').length).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should display isolated label', async () => {
|
|
||||||
await act(async () => {
|
|
||||||
wrapper = mountWithContexts(
|
|
||||||
<InstanceGroupDetails
|
|
||||||
instanceGroup={{ ...instanceGroups[0], is_isolated: true }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
wrapper.update();
|
|
||||||
expect(
|
|
||||||
wrapper.find('Label[aria-label="isolated instance"]').prop('children')
|
|
||||||
).toEqual('Isolated');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -28,8 +28,6 @@ const instanceGroupData = {
|
|||||||
jobs_total: 0,
|
jobs_total: 0,
|
||||||
instances: 1,
|
instances: 1,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
is_container_group: false,
|
is_container_group: false,
|
||||||
credential: null,
|
credential: null,
|
||||||
policy_instance_percentage: 46,
|
policy_instance_percentage: 46,
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import { Link } from 'react-router-dom';
|
|||||||
import 'styled-components/macro';
|
import 'styled-components/macro';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Label,
|
|
||||||
Progress,
|
Progress,
|
||||||
ProgressMeasureLocation,
|
ProgressMeasureLocation,
|
||||||
ProgressSize,
|
ProgressSize,
|
||||||
@ -52,28 +51,6 @@ function InstanceGroupListItem({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const verifyInstanceGroup = item => {
|
|
||||||
if (item.is_isolated) {
|
|
||||||
return (
|
|
||||||
<span css="margin-left: 12px">
|
|
||||||
<Label aria-label={i18n._(t`isolated instance`)}>
|
|
||||||
{i18n._(t`Isolated`)}
|
|
||||||
</Label>
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (item.is_controller) {
|
|
||||||
return (
|
|
||||||
<span css="margin-left: 12px">
|
|
||||||
<Label aria-label={i18n._(t`controller instance`)}>
|
|
||||||
{i18n._(t`Controller`)}
|
|
||||||
</Label>
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tr id={`ig-row-${instanceGroup.id}`}>
|
<Tr id={`ig-row-${instanceGroup.id}`}>
|
||||||
<Td
|
<Td
|
||||||
@ -87,7 +64,6 @@ function InstanceGroupListItem({
|
|||||||
<Td id={labelId} dataLabel={i18n._(t`Name`)}>
|
<Td id={labelId} dataLabel={i18n._(t`Name`)}>
|
||||||
<Link to={`${detailUrl}`}>
|
<Link to={`${detailUrl}`}>
|
||||||
<b>{instanceGroup.name}</b>
|
<b>{instanceGroup.name}</b>
|
||||||
{verifyInstanceGroup(instanceGroup)}
|
|
||||||
</Link>
|
</Link>
|
||||||
</Td>
|
</Td>
|
||||||
<Td dataLabel={i18n._(t`Type`)}>
|
<Td dataLabel={i18n._(t`Type`)}>
|
||||||
|
|||||||
@ -25,8 +25,6 @@ const instanceGroup = {
|
|||||||
jobs_total: 0,
|
jobs_total: 0,
|
||||||
instances: 1,
|
instances: 1,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
is_container_group: false,
|
is_container_group: false,
|
||||||
credential: 3,
|
credential: 3,
|
||||||
policy_instance_percentage: 46,
|
policy_instance_percentage: 46,
|
||||||
|
|||||||
@ -25,8 +25,6 @@ const instanceGroup = {
|
|||||||
jobs_total: 0,
|
jobs_total: 0,
|
||||||
instances: 1,
|
instances: 1,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
is_container_group: false,
|
is_container_group: false,
|
||||||
credential: null,
|
credential: null,
|
||||||
policy_instance_percentage: 46,
|
policy_instance_percentage: 46,
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import React, { useCallback, useState } from 'react';
|
|||||||
import { Link, useHistory } from 'react-router-dom';
|
import { Link, useHistory } from 'react-router-dom';
|
||||||
import { withI18n } from '@lingui/react';
|
import { withI18n } from '@lingui/react';
|
||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
import { Button, Chip, Label } from '@patternfly/react-core';
|
import { Button, Chip } from '@patternfly/react-core';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import AlertModal from '../../../components/AlertModal';
|
import AlertModal from '../../../components/AlertModal';
|
||||||
@ -111,18 +111,6 @@ function JobDetail({ job, i18n }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const buildInstanceGroupLink = item => {
|
const buildInstanceGroupLink = item => {
|
||||||
if (item.is_isolated) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Link to={`/instance_groups/${item.id}`}>{item.name}</Link>
|
|
||||||
<span css="margin-left: 12px">
|
|
||||||
<Label aria-label={i18n._(t`isolated instance`)}>
|
|
||||||
{i18n._(t`Isolated`)}
|
|
||||||
</Label>
|
|
||||||
</span>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return <Link to={`/instance_groups/${item.id}`}>{item.name}</Link>;
|
return <Link to={`/instance_groups/${item.id}`}>{item.name}</Link>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -176,8 +176,6 @@ const mockInstanceGroups = [
|
|||||||
jobs_total: 3,
|
jobs_total: 3,
|
||||||
instances: 1,
|
instances: 1,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
policy_instance_percentage: 100,
|
policy_instance_percentage: 100,
|
||||||
policy_instance_minimum: 0,
|
policy_instance_minimum: 0,
|
||||||
policy_instance_list: [],
|
policy_instance_list: [],
|
||||||
|
|||||||
@ -76,8 +76,6 @@ describe('<JobTemplateForm />', () => {
|
|||||||
jobs_total: 3,
|
jobs_total: 3,
|
||||||
instances: 1,
|
instances: 1,
|
||||||
controller: null,
|
controller: null,
|
||||||
is_controller: false,
|
|
||||||
is_isolated: false,
|
|
||||||
policy_instance_percentage: 100,
|
policy_instance_percentage: 100,
|
||||||
policy_instance_minimum: 0,
|
policy_instance_minimum: 0,
|
||||||
policy_instance_list: [],
|
policy_instance_list: [],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user