-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multi-tab endpoint credential validation by passing the right credential type when user hits "Enter" #4768
Fix multi-tab endpoint credential validation by passing the right credential type when user hits "Enter" #4768
Conversation
`$scope.currentTab` will always contain the correct tab value (prefix value for the endpoint validation) https://bugzilla.redhat.com/show_bug.cgi?id=1609735
f766bc1
to
8c7cd8f
Compare
8c7cd8f
to
f9109f7
Compare
Checked commits AparnaKarve/manageiq-ui-classic@6a332cf~...f9109f7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
verified fix in UI, good to go once green. |
…n_multitab_endpoint Fix multi-tab endpoint credential validation by passing the right credential type when user hits "Enter" (cherry picked from commit 0b54e1d) https://bugzilla.redhat.com/show_bug.cgi?id=1609735
Hammer backport details:
|
@@ -699,7 +698,7 @@ ManageIQ.angular.app.controller('emsCommonFormController', ['$http', '$scope', ' | |||
}; | |||
|
|||
$scope.updateAuthStatus = function(updatedValue) { | |||
$scope.angularForm[$scope.authType + '_auth_status'].$setViewValue(updatedValue); | |||
$scope.angularForm[$scope.currentTab + '_auth_status'].$setViewValue(updatedValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AparnaKarve that change causes the 'virtualization' tab of the Container provider to fail.
$scope.authType
returns kubevirt
, which $scope.currentTab
returns 'virtualization`.
There is kubevirt_auth_status
but there isn't virtualization_auth_status
, therefore attempt to validate the virtualization tab fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masayag Is this just a matter of renaming the virtualization
tab to kubevirt
?
Is it OK if we rename the tab to kubevirt
? Because $scope.currentTab
needs to match with the tab name that is specified in the haml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AparnaKarve ack from my side for renaming the tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR works fine for editing the Container Provider and for enabling the 'Virtualization' tab
However, we do allow user to view & change token for the Kubevirt provider under Infra --> Providers --> Edit
and that fails with the shown error in the screenshot:
the value of: ManageIQ.angular.scope.angularForm['default_auth_status'] is:
undefined
in this context, this one works: ManageIQ.angular.scope.angularForm['kubevirt_auth_status'].$setViewValue(true)
which isn't the conventional way it works for other providers - therefore we can just disable that option on this dialog and not allow changing the token(password) in this context, only under the virtualization tab.
So this PR fixes the blocked functionality of adding kubevirt provider and one gap to close.
I think this PR should be merged and the other issue should be addressed separately.
In a multi-tab form, when user hits the Enter key (and not the "Validate" button), the credential type passed down to the backend is always
default
, which leads to incorrect validation if the active tab is not "default", as described in the BZTo fix this, we need to always refer to the
currentTab
value that accurately gives us the actual credential type for the currently active tab.https://bugzilla.redhat.com/show_bug.cgi?id=1609735