Преглед изворни кода

fix(dashboard): Fix empty state of list type config args

Fixes #3969
Michael Bromley пре 2 месеци
родитељ
комит
c95a00b0f8

+ 14 - 16
packages/dashboard/src/lib/components/shared/configurable-operation-multi-selector.tsx

@@ -94,17 +94,17 @@ type QueryData = {
  * ```
  * ```
  */
  */
 export function ConfigurableOperationMultiSelector({
 export function ConfigurableOperationMultiSelector({
-                                                       value,
-                                                       onChange,
-                                                       queryDocument,
-                                                       queryOptions,
-                                                       queryKey,
-                                                       dataPath,
-                                                       buttonText,
-                                                       dropdownTitle,
-                                                       emptyText = 'No options found',
-                                                       showEnhancedDropdown = true,
-                                                   }: Readonly<ConfigurableOperationMultiSelectorProps>) {
+    value,
+    onChange,
+    queryDocument,
+    queryOptions,
+    queryKey,
+    dataPath,
+    buttonText,
+    dropdownTitle,
+    emptyText = 'No options found',
+    showEnhancedDropdown = true,
+}: Readonly<ConfigurableOperationMultiSelectorProps>) {
     const { data } = useQuery<QueryData>(
     const { data } = useQuery<QueryData>(
         queryOptions || {
         queryOptions || {
             queryKey: [queryKey],
             queryKey: [queryKey],
@@ -134,7 +134,7 @@ export function ConfigurableOperationMultiSelector({
                 code: operation.code,
                 code: operation.code,
                 arguments: operationDef.args.map(arg => ({
                 arguments: operationDef.args.map(arg => ({
                     name: arg.name,
                     name: arg.name,
-                    value: arg.defaultValue != null ? arg.defaultValue.toString() : '',
+                    value: arg.defaultValue != null ? arg.defaultValue.toString() : arg.list ? '[]' : '',
                 })),
                 })),
             },
             },
         ]);
         ]);
@@ -195,10 +195,8 @@ export function ConfigurableOperationMultiSelector({
                                                 onCombinationModeChange(index, newValue)
                                                 onCombinationModeChange(index, newValue)
                                             }
                                             }
                                             name={''}
                                             name={''}
-                                            ref={() => {
-                                            }}
-                                            onBlur={() => {
-                                            }}
+                                            ref={() => {}}
+                                            onBlur={() => {}}
                                             position={index}
                                             position={index}
                                         />
                                         />
                                     </div>
                                     </div>