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