mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 07:45:25 +00:00
fix: dont show master sandbox base in list
This commit is contained in:
@@ -474,6 +474,7 @@ watch(
|
|||||||
<NcFormBuilderInputSelectBase
|
<NcFormBuilderInputSelectBase
|
||||||
:value="deepReference(field.model)"
|
:value="deepReference(field.model)"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
:filter-option="field.filterOption"
|
||||||
@update:value="setFormStateWithEmit(field.model, $event)"
|
@update:value="setFormStateWithEmit(field.model, $event)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const props = withDefaults(
|
|||||||
value: string
|
value: string
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
dropdownMatchSelectWidth?: boolean
|
dropdownMatchSelectWidth?: boolean
|
||||||
|
filterOption?: (base: NcProject) => boolean
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
dropdownMatchSelectWidth: true,
|
dropdownMatchSelectWidth: true,
|
||||||
@@ -17,11 +18,13 @@ const vModel = useVModel(props, 'value', emits)
|
|||||||
const basesStore = useBases()
|
const basesStore = useBases()
|
||||||
|
|
||||||
const baseOptions = computed(() => {
|
const baseOptions = computed(() => {
|
||||||
return basesStore.basesList.map((base) => ({
|
return basesStore.basesList
|
||||||
label: base.title,
|
.filter((base) => !props.filterOption || props.filterOption(base))
|
||||||
value: base.id,
|
.map((base) => ({
|
||||||
meta: base.meta,
|
label: base.title,
|
||||||
}))
|
value: base.id,
|
||||||
|
meta: base.meta,
|
||||||
|
}))
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -31,10 +34,11 @@ const baseOptions = computed(() => {
|
|||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:show-search="baseOptions.length > 4"
|
:show-search="baseOptions.length > 4"
|
||||||
allow-clear
|
allow-clear
|
||||||
|
:filter-option="(input, option) => antSelectFilterOption(input, option, ['data-label'])"
|
||||||
placeholder="- Select base -"
|
placeholder="- Select base -"
|
||||||
:dropdown-match-select-width="dropdownMatchSelectWidth"
|
:dropdown-match-select-width="dropdownMatchSelectWidth"
|
||||||
>
|
>
|
||||||
<a-select-option v-for="option of baseOptions" :key="option.value" :value="option.value">
|
<a-select-option v-for="option of baseOptions" :key="option.value" :value="option.value" :data-label="option.label">
|
||||||
<div class="w-full flex gap-2 items-center" :data-testid="option.value">
|
<div class="w-full flex gap-2 items-center" :data-testid="option.value">
|
||||||
<div class="min-w-5 flex items-center justify-center">
|
<div class="min-w-5 flex items-center justify-center">
|
||||||
<GeneralProjectIcon :color="parseProp(option.meta).iconColor" size="small" />
|
<GeneralProjectIcon :color="parseProp(option.meta).iconColor" size="small" />
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ const { formState, isLoading, submit } = useProvideFormBuilderHelper({
|
|||||||
equal: 'existing',
|
equal: 'existing',
|
||||||
},
|
},
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
|
filterOption: (base) => base && !base?.sandbox_master,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: FormBuilderInputType.Input,
|
type: FormBuilderInputType.Input,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { BaseType } from "../Api";
|
||||||
|
|
||||||
export enum FormBuilderInputType {
|
export enum FormBuilderInputType {
|
||||||
Input = 'input',
|
Input = 'input',
|
||||||
Textarea = 'textarea',
|
Textarea = 'textarea',
|
||||||
@@ -266,6 +268,7 @@ export interface FormBuilderSelectIntegrationElement
|
|||||||
export interface FormBuilderSelectBaseElement extends FormBuilderElementBase {
|
export interface FormBuilderSelectBaseElement extends FormBuilderElementBase {
|
||||||
type: FormBuilderInputType.SelectBase;
|
type: FormBuilderInputType.SelectBase;
|
||||||
defaultValue?: string | null;
|
defaultValue?: string | null;
|
||||||
|
filterOption?: (base: BaseType) => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user