-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature/identity providers #3865
Conversation
<template v-slot:default> | ||
<span | ||
class="text-secondary" | ||
v-html="$t('identity_provider.use_nonce', { url: useNonceDefinition })" |
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.
fixed
v-model="groupsMapping" | ||
:options="groupsMappingOptions" | ||
dense | ||
:label="$t('laguages')" |
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.
Wrong label, "Groups Mapping" expected
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.
👍
groupsClaim: 0, | ||
groupsScript: 1, | ||
}; | ||
const groupsMappingOptions = ref([ |
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.
Don't need to be a ref, it will not change
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.
👍
{ label: t('identity_provider.groups_claim'), value: 'groupsClaim' }, | ||
{ label: t('identity_provider.groups_javascript'), value: 'groupsScript' }, | ||
]); | ||
const groupsMapping = ref(groupsMappingOptions.value[groupsMappingOptionsIndices.groupsClaim]); |
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.
Hum better to not set this incorrect value at this point
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.
Just put 'groupsClaim'
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.
👍
if (value) { | ||
if (props.provider) { | ||
newProvider.value = { ...props.provider }; | ||
groupsMapping.value = newProvider.value.groupsClaim |
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.
When groupsClaim is "", the wrong groups mapping strategy is selected, you must check for undefined value instead
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.
👍
lazy-rules | ||
> | ||
</q-input> | ||
<q-select |
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.
use emit-value and map-options attributes of q-select
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.
👍
newProvider.value = { ...props.provider }; | ||
groupsMapping.value = newProvider.value.groupsClaim | ||
? groupsMappingOptions.value[groupsMappingOptionsIndices.groupsClaim] | ||
: groupsMappingOptions.value[groupsMappingOptionsIndices.groupsScript]; |
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.
Not correct, groupsMappingOptions is not an object
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.
Just use 'groupsClaim' or 'groupsScript' (keep it simple and readable)
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.
👍
const editMode = computed(() => !!props.provider && !!props.provider.name); | ||
const submitCaption = computed(() => (editMode.value ? t('update') : t('add'))); | ||
const dialogTitle = computed(() => (editMode.value ? t('identity_provider_edit') : t('identity_provider_add'))); | ||
const isGroupsMappingByClaim = computed(() => groupsMapping.value.value === 'groupsClaim'); |
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.
If you use emit-value and map-options on q-select, it will simplify to groupsMapping.value === 'groupsClaim'
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.
Fixed
readTimeout: 0, | ||
} as IDProviderDto; | ||
|
||
const groupsMappingOptionsIndices = { |
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.
You do not need this since this info is already in the options.
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.
👍
Closes: #3832