Skip to content

Commit 15c3d45

Browse files
committed
fix(frontend): add boolean select dropdown to configuration edit modals
Configuration edit modals were using text input for boolean fields, allowing invalid values. Added Select dropdown that restricts input to "true" or "false" only, matching the installation wizard behavior. Modified ConfigurationEnv, ConfigurationArgs, ConfigurationHeaders, and ConfigurationQueryParams components to render Select for boolean types instead of text input.
1 parent 4fe6ad3 commit 15c3d45

File tree

4 files changed

+112
-4
lines changed

4 files changed

+112
-4
lines changed

services/frontend/src/components/mcp-server/installation/config/ConfigurationArgs.vue

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import { Badge } from '@/components/ui/badge'
1212
import { Input } from '@/components/ui/input'
1313
import { Label } from '@/components/ui/label'
1414
import { Textarea } from '@/components/ui/textarea'
15+
import {
16+
Select,
17+
SelectContent,
18+
SelectItem,
19+
SelectTrigger,
20+
SelectValue,
21+
} from '@/components/ui/select'
1522
import {
1623
AlertDialog,
1724
AlertDialogContent,
@@ -154,6 +161,10 @@ const isTextarea = (item: any) => {
154161
(item.placeholder && item.placeholder.length > 100)
155162
}
156163
164+
const isBoolean = (item: any) => {
165+
return item?.type === 'boolean'
166+
}
167+
157168
const validateForm = () => {
158169
const errors: Record<string, string> = {}
159170
@@ -447,7 +458,22 @@ const modalTitle = computed(() => {
447458
<div class="space-y-2">
448459
<Label for="config-value">{{ editingScope === 'team' ? 'Team Value' : 'User Value' }}</Label>
449460

450-
<div v-if="editingItem && isTextarea(editingItem)" class="relative">
461+
<!-- Boolean select -->
462+
<Select
463+
v-if="editingItem && isBoolean(editingItem)"
464+
v-model="editingValue"
465+
>
466+
<SelectTrigger>
467+
<SelectValue placeholder="Select value" />
468+
</SelectTrigger>
469+
<SelectContent>
470+
<SelectItem value="false">false</SelectItem>
471+
<SelectItem value="true">true</SelectItem>
472+
</SelectContent>
473+
</Select>
474+
475+
<!-- Textarea for long values -->
476+
<div v-else-if="editingItem && isTextarea(editingItem)" class="relative">
451477
<Textarea
452478
id="config-value"
453479
v-model="editingValue"
@@ -458,6 +484,7 @@ const modalTitle = computed(() => {
458484
/>
459485
</div>
460486

487+
<!-- Regular input -->
461488
<div v-else class="relative">
462489
<Input
463490
id="config-value"

services/frontend/src/components/mcp-server/installation/config/ConfigurationEnv.vue

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import { Badge } from '@/components/ui/badge'
1212
import { Input } from '@/components/ui/input'
1313
import { Label } from '@/components/ui/label'
1414
import { Textarea } from '@/components/ui/textarea'
15+
import {
16+
Select,
17+
SelectContent,
18+
SelectItem,
19+
SelectTrigger,
20+
SelectValue,
21+
} from '@/components/ui/select'
1522
import {
1623
AlertDialog,
1724
AlertDialogContent,
@@ -151,6 +158,10 @@ const isTextarea = (item: any) => {
151158
(item.placeholder && item.placeholder.length > 100)
152159
}
153160
161+
const isBoolean = (item: any) => {
162+
return item?.type === 'boolean'
163+
}
164+
154165
const validateForm = () => {
155166
const errors: Record<string, string> = {}
156167
@@ -440,7 +451,22 @@ const modalTitle = computed(() => {
440451
<div class="space-y-2">
441452
<Label for="config-value">{{ editingScope === 'team' ? 'Team Value' : 'User Value' }}</Label>
442453

443-
<div v-if="editingItem && isTextarea(editingItem)" class="relative">
454+
<!-- Boolean select -->
455+
<Select
456+
v-if="editingItem && isBoolean(editingItem)"
457+
v-model="editingValue"
458+
>
459+
<SelectTrigger>
460+
<SelectValue placeholder="Select value" />
461+
</SelectTrigger>
462+
<SelectContent>
463+
<SelectItem value="false">false</SelectItem>
464+
<SelectItem value="true">true</SelectItem>
465+
</SelectContent>
466+
</Select>
467+
468+
<!-- Textarea for long values -->
469+
<div v-else-if="editingItem && isTextarea(editingItem)" class="relative">
444470
<Textarea
445471
id="config-value"
446472
v-model="editingValue"
@@ -451,6 +477,7 @@ const modalTitle = computed(() => {
451477
/>
452478
</div>
453479

480+
<!-- Regular input -->
454481
<div v-else class="relative">
455482
<Input
456483
id="config-value"

services/frontend/src/components/mcp-server/installation/config/ConfigurationHeaders.vue

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import { Badge } from '@/components/ui/badge'
1212
import { Input } from '@/components/ui/input'
1313
import { Label } from '@/components/ui/label'
1414
import { Textarea } from '@/components/ui/textarea'
15+
import {
16+
Select,
17+
SelectContent,
18+
SelectItem,
19+
SelectTrigger,
20+
SelectValue,
21+
} from '@/components/ui/select'
1522
import {
1623
AlertDialog,
1724
AlertDialogContent,
@@ -151,6 +158,10 @@ const isTextarea = (item: any) => {
151158
(item.placeholder && item.placeholder.length > 100)
152159
}
153160
161+
const isBoolean = (item: any) => {
162+
return item?.type === 'boolean'
163+
}
164+
154165
const validateForm = () => {
155166
const errors: Record<string, string> = {}
156167
@@ -440,7 +451,22 @@ const modalTitle = computed(() => {
440451
<div class="space-y-2">
441452
<Label for="config-value">{{ editingScope === 'team' ? 'Team Value' : 'User Value' }}</Label>
442453

443-
<div v-if="editingItem && isTextarea(editingItem)" class="relative">
454+
<!-- Boolean select -->
455+
<Select
456+
v-if="editingItem && isBoolean(editingItem)"
457+
v-model="editingValue"
458+
>
459+
<SelectTrigger>
460+
<SelectValue placeholder="Select value" />
461+
</SelectTrigger>
462+
<SelectContent>
463+
<SelectItem value="false">false</SelectItem>
464+
<SelectItem value="true">true</SelectItem>
465+
</SelectContent>
466+
</Select>
467+
468+
<!-- Textarea for long values -->
469+
<div v-else-if="editingItem && isTextarea(editingItem)" class="relative">
444470
<Textarea
445471
id="config-value"
446472
v-model="editingValue"
@@ -451,6 +477,7 @@ const modalTitle = computed(() => {
451477
/>
452478
</div>
453479

480+
<!-- Regular input -->
454481
<div v-else class="relative">
455482
<Input
456483
id="config-value"

services/frontend/src/components/mcp-server/installation/config/ConfigurationQueryParams.vue

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import { Badge } from '@/components/ui/badge'
1212
import { Input } from '@/components/ui/input'
1313
import { Label } from '@/components/ui/label'
1414
import { Textarea } from '@/components/ui/textarea'
15+
import {
16+
Select,
17+
SelectContent,
18+
SelectItem,
19+
SelectTrigger,
20+
SelectValue,
21+
} from '@/components/ui/select'
1522
import {
1623
AlertDialog,
1724
AlertDialogContent,
@@ -151,6 +158,10 @@ const isTextarea = (item: any) => {
151158
(item.placeholder && item.placeholder.length > 100)
152159
}
153160
161+
const isBoolean = (item: any) => {
162+
return item?.type === 'boolean'
163+
}
164+
154165
const validateForm = () => {
155166
const errors: Record<string, string> = {}
156167
@@ -440,7 +451,22 @@ const modalTitle = computed(() => {
440451
<div class="space-y-2">
441452
<Label for="config-value">{{ editingScope === 'team' ? 'Team Value' : 'User Value' }}</Label>
442453

443-
<div v-if="editingItem && isTextarea(editingItem)" class="relative">
454+
<!-- Boolean select -->
455+
<Select
456+
v-if="editingItem && isBoolean(editingItem)"
457+
v-model="editingValue"
458+
>
459+
<SelectTrigger>
460+
<SelectValue placeholder="Select value" />
461+
</SelectTrigger>
462+
<SelectContent>
463+
<SelectItem value="false">false</SelectItem>
464+
<SelectItem value="true">true</SelectItem>
465+
</SelectContent>
466+
</Select>
467+
468+
<!-- Textarea for long values -->
469+
<div v-else-if="editingItem && isTextarea(editingItem)" class="relative">
444470
<Textarea
445471
id="config-value"
446472
v-model="editingValue"
@@ -451,6 +477,7 @@ const modalTitle = computed(() => {
451477
/>
452478
</div>
453479

480+
<!-- Regular input -->
454481
<div v-else class="relative">
455482
<Input
456483
id="config-value"

0 commit comments

Comments
 (0)