File tree 3 files changed +24
-0
lines changed
public/locales/translation
src/components/useCaseBuilder
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -843,6 +843,10 @@ useCaseBuilder:
843
843
rag_knowledge_base_not_enabled : >-
844
844
{{retrieveKnowledgeBase}} is specified in the prompt template, but RAG
845
845
Chat (Knowledge Base) is not enabled in GenU.
846
+ spaces_in_label : >-
847
+ Remove any white spaces before and after {{label}}.
848
+ spaces_in_value : >-
849
+ Remove any white spaces before and after options of {{label}}.
846
850
favorites : Favorites
847
851
fileUploadDescription : Users can upload files for the LLM to reference the content.
848
852
fileUploadDisabled : Disable file upload
Original file line number Diff line number Diff line change @@ -720,6 +720,8 @@ useCaseBuilder:
720
720
rag_knowledge_base_not_enabled : >-
721
721
プロンプトテンプレート内で {{retrieveKnowledgeBase}} が指定されていますが GenU で RAG チャット
722
722
(Knowledge Base) が有効になっていません。
723
+ spaces_in_label : ' {{label}}の前後にある空白を削除してください。'
724
+ spaces_in_value : ' {{label}}の値は、前後に空白を含まないよう設定してください。'
723
725
favorites : お気に入り
724
726
fileUploadDescription : 添付可能なファイルはモデルによって異なります
725
727
fileUploadDisabled : ファイルは添付できません
Original file line number Diff line number Diff line change @@ -280,6 +280,14 @@ const UseCaseBuilderView: React.FC<Props> = (props) => {
280
280
}
281
281
}
282
282
283
+ for ( const item of items ) {
284
+ if ( item . label != item . label . trim ( ) ) {
285
+ tmpErrorMessages . push (
286
+ t ( 'useCaseBuilder.error.spaces_in_label' , { label : item . label } )
287
+ ) ;
288
+ }
289
+ }
290
+
283
291
for ( const item of selectItems ) {
284
292
if ( ! item . options || item . options . length === 0 ) {
285
293
tmpErrorMessages . push ( t ( 'useCaseBuilder.error.missing_select_options' ) ) ;
@@ -295,6 +303,16 @@ const UseCaseBuilderView: React.FC<Props> = (props) => {
295
303
) ;
296
304
}
297
305
306
+ // Check for options with leading/trailing spaces
307
+ const spacedOptions = options . filter ( ( o ) => o !== o . trim ( ) ) ;
308
+ if ( spacedOptions . length > 0 ) {
309
+ tmpErrorMessages . push (
310
+ t ( 'useCaseBuilder.error.spaces_in_value' , {
311
+ label : item . label
312
+ } )
313
+ ) ;
314
+ }
315
+
298
316
const uniqueOptions = options . filter (
299
317
( elem , idx , self ) => self . findIndex ( ( e ) => e === elem ) === idx
300
318
) ;
You can’t perform that action at this time.
0 commit comments