Skip to content

Commit

Permalink
Added vue unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar <sagargurung1001@gmail.com>
  • Loading branch information
SagarGi committed Dec 24, 2024
1 parent 39c9ef4 commit 6a1a046
Show file tree
Hide file tree
Showing 2 changed files with 277 additions and 22 deletions.
27 changes: 14 additions & 13 deletions src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,19 @@ export default {
this.isFormCompleted.authorizationMethod = true
this.authorizationMethod.authorizationMethodSet = this.authorizationMethod.currentAuthorizationMethodSelected = this.state.authorization_method
}
if (this.state.authorization_method === AUTH_METHOD.OIDC && this.state.authorization_settings.oidc_provider !== '' && this.state.authorization_settings.targeted_audience_client_id !== '') {
if (this.state.openproject_instance_url && this.state.authorization_method) {
if (this.state.authorization_method === AUTH_METHOD.OAUTH2) {
if (!this.state.openproject_client_id || !this.state.openproject_client_secret) {
this.formMode.authorizationSetting = F_MODES.EDIT
}
}
if (this.state.authorization_method === AUTH_METHOD.OIDC) {
if (!this.state.authorization_settings.oidc_provider || !this.state.authorization_settings.targeted_audience_client_id) {
this.formMode.authorizationSetting = F_MODES.EDIT
}
}
}
if (this.state.authorization_method === AUTH_METHOD.OIDC && this.state.authorization_settings.oidc_provider && this.state.authorization_settings.targeted_audience_client_id) {
this.formMode.authorizationSetting = F_MODES.VIEW
this.isFormCompleted.authorizationSetting = true
this.authorizationSetting.oidcProviderSet = this.authorizationSetting.currentOIDCProviderSelected = this.state.authorization_settings.oidc_provider
Expand All @@ -893,18 +905,7 @@ export default {
this.formMode.opOauth = F_MODES.EDIT
}
}
if (this.state.openproject_instance_url && this.state.authorization_method) {
if (this.state.authorization_method === AUTH_METHOD.OAUTH2) {
if (!this.state.openproject_client_id || !this.state.openproject_client_secret) {
this.formMode.authorizationSetting = F_MODES.EDIT
}
}
if (this.state.authorization_method === AUTH_METHOD.OIDC) {
if (!this.state.authorization_settings.oidc_provider || !this.state.authorization_settings.targeted_audience_client_id) {
this.formMode.authorizationSetting = F_MODES.EDIT
}
}
}
if (this.state.nc_oauth_client) {
this.formMode.ncOauth = F_MODES.VIEW
this.isFormCompleted.ncOauth = true
Expand Down
Loading

0 comments on commit 6a1a046

Please sign in to comment.