Skip to content
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

Issue 95: username/password for GitHub should be removed - no longer available #73

Merged
merged 2 commits into from Sep 14, 2020

Conversation

kaladay
Copy link
Contributor

@kaladay kaladay commented Sep 3, 2020

To actually achieve this, much of the directive is rewritten.

The management type string needs to be passed to the directive so that it can be determined whether or not the type has changed.
With the previous design, one could not reliably determine if/when the username/password fields should disappear or not.
The original management type is saved and then the auth information is updated if the management type changes.

It also turns out that if a watch is not used, then there is no reliable way to determine if the management type is the correct value.
Closing the modal and opening up a new model is a way to potentially get the wrong information as the data from the previous open model may be preserved.
I would argue that this is a pre-existing bug that needed to be fixed to ensure that the changes here work as expected.

The isAuthRequired() function is rewritten to better handle when the 'auth' checkbox should be presented or not.
This function then should only run when needed to avoid resetting auth data when the auth data should not be reset.

The originalType should be uninitialized so that the very first run can handle setting the auth.required.
In all other cases the auth.required should never be set when the management type changes.
This is, in part, because the auth data gets cleared and it could incorrectly set the auth.useToken value.

The hasToken() function has been replaced with refreshAuth() to achieve all of this.
The name is changed to better clarify the purpose and intent of the function.

This commit requires changes in the service.

resolves TAMULib/ProjectManagementService#95
relates TAMULib/ProjectManagementService#97

…available

To actually achieve this, much of the directive is rewritten.

The management type string needs to be passed to the directive so that it can be determined whether or not the type has changed.
With the previous design, one could not reliably determine if/when the username/password fields should disappear or not.
The original management type is saved and then the auth information is updated if the management type changes.

It also turns out that if a watch is not used, then there is no reliable way to determine if the management type is the correct value.
Closing the modal and opening up a new model is a way to potentially get the wrong information as the data from the previous open model may be preserved.
I would argue that this is a pre-existing bug that needed to be fixed to ensure that the changes here work as expected.

The isAuthRequired() function is rewritten to better handle when the 'auth' checkbox should be presented or not.
This function then should only run when needed to avoid resetting auth data when the auth data should not be reset.

The originalType should be uninitialized so that the very first run can handle setting the auth.required.
In all other cases the auth.required should never be set when the management type changes.
This is, in part, because the auth data gets cleared and it could incorrectly set the auth.useToken value.

The hasToken() function has been replaced with refreshAuth() to achieve all of this.
The name is changed to better clarify the purpose and intent of the function.

This commit requires changes in the service.
@coveralls
Copy link

coveralls commented Sep 3, 2020

Coverage Status

Coverage increased (+1.7%) to 81.608% when pulling a258c7e on product-sprint6-95 into b5d514f on product-sprint6-staging.

kaladay added a commit that referenced this pull request Sep 10, 2020
This expands upon PR #73 further removing the basic authentication for VersionOne as well.

With these changes, it makes sense to remove the settings and simplify the model design.
This better allows for validation using the existing weaver validation functionality.
The most notable downside of this particular implementation is the database changes.

The URL is now a validated and required part of the ManagementService.

The token is now a validated part of the ManagementService, but is not explicitly required via the DB.
Both Github and VersionOne require token, so the default behavior is to require the token.

see: #70
see: #73
@kaladay kaladay merged commit 2674e50 into product-sprint6-staging Sep 14, 2020
@kaladay kaladay deleted the product-sprint6-95 branch September 17, 2020 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants