fix WorkflowJobTemplate export where WorkflowApprovalTemplate is not properly exported

fixes https://github.com/ansible/awx/issues/7946
- added WorkflowApprovalTemplate page type to allow URL registration
- added resources regex that’s associated resource URL with WorkflowApprovalTemplate
- registered the new resource regex with WorkflowApprovalTemplate page type
- modified `DEPENDENT_EXPORT` handling (insisted by @jbradberry)
- added special case handling for WorkflowApprovalTemplate due to its unique nature

unique nature of WorkflowApprovalTemplate
- when exporting WorkflowJobTemplate with approval node the WorkflowJobTemplateNode need to contain a related "create_approval_template" the POST data for "create_approval_template" need to come from the "workflow_approval_template"
- during the export of a WorkflowJobTemplateNode that is an approval node we need to get the data from "workflow_approval_template" and use that to populate the "create_approval_template"

Co-Authored-By: Jeff Bradberry <685957+jbradberry@users.noreply.github.com>
Signed-off-by: Hao Liu <haoli@redhat.com>
This commit is contained in:
Hao Liu
2022-07-12 19:02:23 -04:00
parent 8031b3d402
commit 769c253ac2
4 changed files with 80 additions and 19 deletions

View File

@@ -40,3 +40,4 @@ from .instance_groups import * # NOQA
from .credential_input_sources import * # NOQA
from .metrics import * # NOQA
from .subscriptions import * # NOQA
from .workflow_approval_templates import * # NOQA