Skip to content

Commit

Permalink
allow custom attributes in LDAP Explorer, fixes #8367
Browse files Browse the repository at this point in the history
  • Loading branch information
satkunas committed Nov 6, 2024
1 parent 2b27dbe commit e6435e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div class="base-flex-wrap" align-v="center">
<ldap-attribute-selector ref="attributeComponentRef"
:namespace="`${namespace}.attribute`"
taggable
/>

<base-input-chosen-one ref="operatorComponentRef" v-if="attributeValue"
Expand All @@ -11,6 +12,7 @@

<component :is="valueComponent" ref="valueComponentRef" v-if="operatorValue"
:namespace="`${namespace}.value`"
taggable
v-bind="valueBind"
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
:value="inputValue"
:label="text"
:isLoading="isLoading"
:taggable="taggable"
:track-by="text"
:single-label="singleLabel"
:on-select="onSelect"
:on-tag="onTag"
:on-remove="onRemove"
:on-open="onOpen"
:on-close="onClose"
Expand Down Expand Up @@ -54,10 +56,7 @@ function setup(props, _) { // eslint-disable-line
const isFocused = ref(false)
const isLoading = computed(() => inject(ProvidedKeys.LdapAttributesLoading).value)
const isConnected = computed(() => inject(ProvidedKeys.connectedToLdap).value)
const allOptions = computed(() => {
if (!isConnected.value) {
return []
}
const inputOptions = computed(() => {
return moveSelectionToTop(inject(ProvidedKeys.LdapAttributes).value.map(valueToSelectValue))
})
const isDisabled = inject('isLoading')
Expand Down Expand Up @@ -109,6 +108,10 @@ function setup(props, _) { // eslint-disable-line
validateChoice()
}
function onTag(value) {
onSelect(valueToSelectValue(value))
}
function onOpen() {
isFocused.value = true
}
Expand All @@ -124,12 +127,13 @@ function setup(props, _) { // eslint-disable-line
validateChoice()
return {
inputOptions: allOptions,
inputOptions,
isDisabled,
isFocused,
isLoading,
isConnected,
onSelect,
onTag,
onOpen,
onClose,
onRemove,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
:selected-label="selectedLabel"
:show-labels="showLabels"
:show-pointer="showPointer"
:taggable="taggable"
:track-by="trackBy"
:value="value"
@search-change="onSearch"
@select="onSelect"
@tag="onTag"
@open="onOpen"
@remove="onRemove"
@close="onClose"
Expand Down Expand Up @@ -105,7 +107,6 @@ export const props = {
validator: value => ['sm', 'md', 'lg'].includes(value)
},
onSearch: {
type: Function,
default: () => {}
Expand All @@ -116,6 +117,11 @@ export const props = {
default: () => {}
},
onTag: {
type: Function,
default: () => {}
},
onOpen: {
type: Function,
default: () => {}
Expand Down

0 comments on commit e6435e8

Please sign in to comment.