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

Feature/identity providers #3865

Merged
merged 7 commits into from
Jul 9, 2024
Merged

Feature/identity providers #3865

merged 7 commits into from
Jul 9, 2024

Conversation

kazoompa
Copy link
Member

@kazoompa kazoompa commented Jul 5, 2024

Closes: #3832

<template v-slot:default>
<span
class="text-secondary"
v-html="$t('identity_provider.use_nonce', { url: useNonceDefinition })"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Url link does not work, check box captures the event. You do not need this fancy link (or put it in a <div class="text-hint"> below the q-checkbox

image

Copy link
Member Author

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')"
Copy link
Member

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

Copy link
Member Author

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([
Copy link
Member

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

Copy link
Member Author

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]);
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just put 'groupsClaim'

Copy link
Member Author

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
Copy link
Member

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

Copy link
Member Author

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
Copy link
Member

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

Copy link
Member Author

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];
Copy link
Member

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

Copy link
Member

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)

Copy link
Member Author

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');
Copy link
Member

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'

Copy link
Member Author

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 = {
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ymarcon ymarcon merged commit 9f32d84 into master Jul 9, 2024
2 checks passed
@ymarcon ymarcon deleted the feature/identity-providers branch July 9, 2024 20:15
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.

feat(ui): data access admin
2 participants