@@ -83,16 +83,15 @@ export default function AccessScopeCriteriaForm({
83
83
className = "rounded border border-gray-300 bg-gray-50 p-3"
84
84
>
85
85
< div className = "mb-2 flex items-center justify-end gap-2" >
86
- { /* Display per-scope validation error (except wildcard errors, which are shown inline) */ }
86
+ { /* Display per-scope validation error */ }
87
87
{ ( ( ) => {
88
88
const error =
89
89
showError &&
90
90
Array . isArray ( scopesError ) &&
91
91
scopesError [ index ] ;
92
92
return (
93
93
error &&
94
- typeof error === "string" &&
95
- ! error . includes ( "Wildcard" ) && (
94
+ typeof error === "string" && (
96
95
< p className = "text-sm text-red-500" > { error } </ p >
97
96
)
98
97
) ;
@@ -130,47 +129,36 @@ export default function AccessScopeCriteriaForm({
130
129
< div
131
130
className = { disabled ? "pointer-events-none opacity-60" : "" }
132
131
>
133
- < FormikTextArea
134
- name = { `scopes.${ index } .names` }
135
- label = "Names"
136
- placeholder = "Enter resource names, one per line, or * for all"
137
- hint = "Enter one resource name per line for exact matches. Use * alone to match all resources."
138
- rows = { 6 }
139
- />
132
+ < label className = "form-label" > Names</ label >
140
133
{ scope . names &&
141
134
scope . names . trim ( ) . length > 0 &&
142
135
( ( ) => {
143
136
const names = scope . names
144
137
. split ( "\n" )
145
138
. map ( ( n : string ) => n . trim ( ) )
146
139
. filter ( Boolean ) ;
147
- const hasWildcard = names . includes ( "*" ) ;
148
- const hasWildcardError = hasWildcard && names . length > 1 ;
149
140
150
141
return (
151
- < >
152
- < div
153
- className = { `mt-2 rounded border p-2 ${ hasWildcardError ? "border-red-300 bg-red-50" : "border-gray-200 bg-gray-50" } ` }
154
- >
155
- < div className = "flex flex-wrap gap-1" >
156
- { names . map ( ( name : string , nameIndex : number ) => (
157
- < Badge
158
- key = { nameIndex }
159
- text = { name }
160
- color = "gray"
161
- size = "sm"
162
- />
163
- ) ) }
164
- </ div >
142
+ < div className = "mb-2 rounded border border-gray-200 bg-gray-50 p-2" >
143
+ < div className = "flex flex-wrap gap-1" >
144
+ { names . map ( ( name : string , nameIndex : number ) => (
145
+ < Badge
146
+ key = { nameIndex }
147
+ text = { name }
148
+ color = "blue"
149
+ size = "sm"
150
+ />
151
+ ) ) }
165
152
</ div >
166
- { hasWildcardError && (
167
- < p className = "mt-1 text-sm text-red-600" >
168
- Wildcard '*' must be the only name when used
169
- </ p >
170
- ) }
171
- </ >
153
+ </ div >
172
154
) ;
173
155
} ) ( ) }
156
+ < FormikTextArea
157
+ name = { `scopes.${ index } .names` }
158
+ placeholder = "Enter resource names, one per line, or * for all"
159
+ hint = "Enter one resource name per line for exact matches. Use * alone to match all resources."
160
+ rows = { 4 }
161
+ />
174
162
</ div >
175
163
</ div >
176
164
</ div >
0 commit comments