When we create a Workflow and we save it, field Inventory can be edited. Once we configure a certain inventory and we click on save, this field becomes disabled and we can't edit anymore.
As far as we can see, ng-disabled is set to:
ng-disabled="!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) || !canEditInventory"
when WF template is created without configuring an inventory:
<input type="text" class="form-control Form-textInput input-medium lookup ng-pristine ng-untouched ng-valid ng-empty ng-valid-awlookup ng-valid-valid-resource" ng-model="inventory_name" name="inventory_name" ng-disabled="!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) || !canEditInventory" data-basepath="inventory" data-source="inventory" data-query="?name__iexact=:value" autopopulatelookup="false" ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 300, 'blur': 0 } }" awlookup="">
this works fine because we have permissions and we can edit. But when you configure an inventory and click save and you edit it again, then we have this code:
<input type="text" class="form-control Form-textInput input-medium lookup ng-pristine ng-untouched ng-valid ng-not-empty ng-valid-awlookup ng-valid-valid-resource" ng-model="inventory_name" name="inventory_name" ng-disabled="!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) || !canEditInventory" data-basepath="inventory" data-source="inventory" data-query="?name__iexact=:value" autopopulatelookup="false" ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 300, 'blur': 0 } }" awlookup="" disabled="disabled">
At this time, we're not able to modify inventory in a Workflow Job, So I think is something wrong when permissions are checked when inventory is not empty at Angular level but I can't find the reason.
Be able to modify inventory field in a Workflow Job when is configured.
Not able to modify inventory field in a Workflow Job when is configured
Same issue in my environment.
@mabashian you or somebody on UI have time to take a peek at this one?
devel PR: https://github.com/ansible/awx/pull/5411
Verified this as an admin and a regular user that has admin permissions over the related inventory. Both are able to edit the inventory now.
@dsesami @ryanpetrello @marshmalien thank you very much!