Fix playbook error message and JT save bug

This commit is contained in:
Marliana Lara 2020-04-06 17:53:54 -04:00
parent 285e9c2f62
commit 189a10e35a
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
3 changed files with 4 additions and 6 deletions

View File

@ -108,10 +108,7 @@ class JobTemplateEdit extends Component {
try {
await JobTemplatesAPI.update(template.id, remainingValues);
await Promise.all([
this.submitLabels(
labels,
values.project.summary_fields.organization.id
),
this.submitLabels(labels, template?.organization),
this.submitInstanceGroups(instanceGroups, initialInstanceGroups),
this.submitCredentials(credentials),
]);

View File

@ -52,7 +52,7 @@ function JobTemplateForm({
i18n,
}) {
const [contentError, setContentError] = useState(false);
const [project, setProject] = useState(null);
const [project, setProject] = useState(template?.summary_fields?.project);
const [inventory, setInventory] = useState(
template?.summary_fields?.inventory
);
@ -282,6 +282,7 @@ function JobTemplateForm({
<FormGroup
fieldId="template-playbook"
helperTextInvalid={playbookMeta.error}
isValid={!playbookMeta.touched || !playbookMeta.error}
isRequired
label={i18n._(t`Playbook`)}
>

View File

@ -70,7 +70,7 @@ export const JobTemplate = shape({
inventory: number,
job_type: oneOf(['run', 'check']),
playbook: string,
project: shape({}),
project: number,
});
export const Inventory = shape({