Skip to content

Commit

Permalink
fix: check strategy matches selected value in form (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidma415 authored Feb 20, 2024
1 parent 76f9a02 commit 0bc3fd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/ViewSpecRegistrationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
class="alert-message"
/>
<KTable
class="applications-list"
:is-loading="currentState.matches('pending')"
data-testid="applications-list"
:fetcher-cache-key="fetcherCacheKey"
Expand Down Expand Up @@ -369,7 +370,7 @@ export default defineComponent({
watch(() => selectedApplication.value, (newSelectedApplication, oldSelectedApplication) => {
// We reset selectedScopes if we change applications
if (newSelectedApplication !== oldSelectedApplication && selectedScopes.value.length) {
if (newSelectedApplication !== oldSelectedApplication && selectedScopes.value?.length) {
selectedScopes.value = []
}
})
Expand All @@ -395,7 +396,9 @@ export default defineComponent({
})
}
if (selectedApplication.value) {
// don't fetch the applications granted scopes if there are no available
// scopes.
if (selectedApplication.value && availableScopes.value?.length) {
fetchingScopes.value = true
await portalApiV2.value.service.applicationsApi.getApplicationProductVersionGrantedScopes({
Expand Down Expand Up @@ -455,12 +458,11 @@ export default defineComponent({
.table-text {
text-align: left;
font-weight: 600;
}
.application-registration-modal {
:deep(.selected) {
.k-input-label {
td {
font-weight: 600;
width: 100%;
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/Applications/ApplicationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export default defineComponent({
value: strat.id,
isDcr: strat.credential_type === 'client_credentials',
isSelfManaged: strat.credential_type === 'self_managed_client_credentials',
selected: formData.value.auth_strategy_id ? strat.id === formData.value.auth_strategy_id : ($route.query.auth_strategy_id || false)
selected: formData.value.auth_strategy_id ? strat.id === formData.value.auth_strategy_id : (strat.id === $route.query.auth_strategy_id || false)
}))
}
Expand Down

0 comments on commit 0bc3fd9

Please sign in to comment.