File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,15 @@ export default {
275
275
if (configrecord .type === ' WhitespaceSeparatedListWithOptions' ) {
276
276
newValue = newValue .join (' ' )
277
277
}
278
+
279
+ // The updateConfiguration API expects a blank string to clean up the configuration value
280
+ if (
281
+ ([' CSV' , ' Order' , ' WhitespaceSeparatedListWithOptions' ].includes (configrecord .type ) && Object .keys (newValue).length === 0 ) ||
282
+ (configrecord .type === ' String' && newValue .length === 0 )
283
+ ) {
284
+ newValue = ' '
285
+ }
286
+
278
287
const params = {
279
288
[this .scopeKey ]: this .$route .params ? .id ,
280
289
name: configrecord .name ,
@@ -362,6 +371,17 @@ export default {
362
371
}
363
372
return 0
364
373
}
374
+
375
+ if (configrecord .value ? .trim ().length === 0 ) {
376
+ if ([' CSV' , ' Order' , ' WhitespaceSeparatedListWithOptions' ].includes (configrecord .type )) {
377
+ return []
378
+ }
379
+
380
+ if (configrecord .type === ' String' ) {
381
+ return ' '
382
+ }
383
+ }
384
+
365
385
if ([' Order' , ' CSV' ].includes (configrecord .type )) {
366
386
if (configrecord .value && configrecord .value .length > 0 ) {
367
387
return String (configrecord .value ).split (' ,' )
You can’t perform that action at this time.
0 commit comments