Merge pull request #6625 from marshmalien/jt-form-bugs

Fix JT form playbook select error message and more 

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-04-07 22:55:30 +00:00 committed by GitHub
commit 7ddd4d74c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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({