@@ -157,26 +157,27 @@ const ValidationSchemaForTemplateVariables = (
157
157
. of (
158
158
Yup . object ( ) . shape ( {
159
159
name : Yup . string ( ) . required ( ) ,
160
- value : Yup . string ( ) . test ( "verify with template" , ( val , ctx ) => {
161
- const name = ctx . parent . name ;
162
- const templateVariable = templateVariables . find (
163
- ( variable ) => variable . name === name ,
164
- ) ;
165
- if ( templateVariable ?. sensitive ) {
166
- // It's possible that the secret is already stored in database,
167
- // so we can't properly verify the "required" condition.
168
- return true ;
169
- }
170
- if ( templateVariable ?. required ) {
171
- if ( ! val || val . length === 0 ) {
172
- return ctx . createError ( {
173
- path : ctx . path ,
174
- message : "Variable is required." ,
175
- } ) ;
160
+ value : Yup . string ( )
161
+ . test ( "verify with template" , ( val , ctx ) => {
162
+ const name = ctx . parent . name ;
163
+ const templateVariable = templateVariables . find (
164
+ ( variable ) => variable . name === name ,
165
+ ) ;
166
+ if ( templateVariable ?. sensitive ) {
167
+ // It's possible that the secret is already stored in database,
168
+ // so we can't properly verify the "required" condition.
169
+ return true ;
176
170
}
177
- }
178
- return true ;
179
- } ) ,
171
+ if ( templateVariable ?. required ) {
172
+ if ( ! val || val . length === 0 ) {
173
+ return ctx . createError ( {
174
+ path : ctx . path ,
175
+ message : "Variable is required." ,
176
+ } ) ;
177
+ }
178
+ }
179
+ return true ;
180
+ } ) ,
180
181
} ) ,
181
182
)
182
183
. required ( ) ;
0 commit comments