Merge pull request #12251 from nixocio/ui_issue_11196

Add controller_node to job details page
This commit is contained in:
Jessica Steurer
2022-06-03 08:57:29 -03:00
committed by GitHub
3 changed files with 8 additions and 5 deletions

View File

@@ -2236,7 +2236,6 @@ class InventoryUpdateSerializer(UnifiedJobSerializer, InventorySourceOptionsSeri
'source_project_update',
'custom_virtualenv',
'instance_group',
'-controller_node',
)
def get_related(self, obj):
@@ -2311,7 +2310,6 @@ class InventoryUpdateDetailSerializer(InventoryUpdateSerializer):
class InventoryUpdateListSerializer(InventoryUpdateSerializer, UnifiedJobListSerializer):
class Meta:
model = InventoryUpdate
fields = ('*', '-controller_node') # field removal undone by UJ serializer
class InventoryUpdateCancelSerializer(InventoryUpdateSerializer):

View File

@@ -220,7 +220,7 @@ class TestControllerNode:
assert 'controller_node' not in r.data
r = get(reverse('api:inventory_update_detail', kwargs={'pk': inventory_update.pk}), admin_user, expect=200)
assert 'controller_node' not in r.data
assert 'controller_node' in r.data
r = get(reverse('api:system_job_detail', kwargs={'pk': system_job.pk}), admin_user, expect=200)
assert 'controller_node' not in r.data

View File

@@ -186,7 +186,6 @@ function JobDetail({ job, inventorySourceLabels }) {
}
return null;
};
return (
<CardBody>
<DetailList>
@@ -349,6 +348,13 @@ function JobDetail({ job, inventorySourceLabels }) {
label={t`Execution Node`}
value={job.execution_node}
/>
{job?.controller_node ? (
<Detail
dataCy="job-controller-node"
label={t`Controller Node`}
value={job.controller_node}
/>
) : null}
{instanceGroup && !instanceGroup?.is_container_group && (
<Detail
dataCy="job-instance-group"
@@ -388,7 +394,6 @@ function JobDetail({ job, inventorySourceLabels }) {
helpText={jobHelpText.forks}
/>
)}
{credential && (
<Detail
dataCy="job-machine-credential"