Add execution environment detail to template expanded row

This commit is contained in:
Marliana Lara
2021-04-09 14:40:59 -04:00
parent aa69a493b6
commit 0bc4702a26
3 changed files with 15 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ import { ActionsTd, ActionItem } from '../PaginatedTable';
import { DetailList, Detail, DeletedDetail } from '../DetailList';
import ChipGroup from '../ChipGroup';
import CredentialChip from '../CredentialChip';
import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail';
import { timeOfDay, formatDateString } from '../../util/dates';
import { JobTemplatesAPI, WorkflowJobTemplatesAPI } from '../../api';
@@ -258,7 +259,8 @@ function TemplateListItem({
dataCy={`template-${template.id}-inventory`}
/>
) : (
!askInventoryOnLaunch && (
!askInventoryOnLaunch &&
template.type === 'job_template' && (
<DeletedDetail label={i18n._(t`Inventory`)} />
)
)}
@@ -273,6 +275,10 @@ function TemplateListItem({
dataCy={`template-${template.id}-project`}
/>
)}
<ExecutionEnvironmentDetail
virtualEnvironment={template.custom_virtualenv}
executionEnvironment={summaryFields?.execution_environment}
/>
<Detail
label={i18n._(t`Last Modified`)}
value={formatDateString(template.modified)}

View File

@@ -419,6 +419,7 @@ describe('<TemplateListItem />', () => {
assertDetail('Organization', "Mike's Org");
assertDetail('Inventory', "Mike's Inventory");
assertDetail('Project', "Mike's Project");
assertDetail('Execution Environment', 'Mock EE 1.2.3');
expect(
wrapper.find('Detail[label="Credentials"]').containsAllMatchingElements([
<span>

View File

@@ -138,6 +138,12 @@
"id": "1",
"name": "Webhook Credential"
},
"execution_environment": {
"description": "",
"id": 1,
"image": "foo.io/mock/test-ee:1.2.3",
"name": "Mock EE 1.2.3"
}
},
"created": "2019-09-30T16:18:34.564820Z",
@@ -179,6 +185,7 @@
"diff_mode": false,
"allow_simultaneous": false,
"custom_virtualenv": null,
"execution_environment": 1,
"job_slice_count": 1,
"webhook_credential": 1,
"webhook_key": "asertdyuhjkhgfd234567kjgfds",