File tree 1 file changed +13
-1
lines changed
client/src/components/Form/Elements/FormData
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ const keepOptionsUpdate = ref(0);
123
123
*/
124
124
const canBrowse = computed (() => variant .value && !! variant .value .find ((v ) => v .src === SOURCE .DATASET ));
125
125
126
+ /**
127
+ * A list of valid `src`s for the variant
128
+ */
129
+ const validSrcs = computed (() => {
130
+ return variant .value ? variant .value .map ((v ) => v .src ) : [];
131
+ });
132
+
126
133
/**
127
134
* Provides the currently shown source type
128
135
*/
@@ -562,7 +569,12 @@ function canAcceptSrc(element: HistoryOrCollectionItem) {
562
569
}
563
570
} else if (historyContentType === " dataset_collection" ) {
564
571
if (props .type === " data" ) {
565
- // collection can always be mapped over a data input ... in theory.
572
+ // if this input doesn't accept collections at all, return false
573
+ if (! validSrcs .value .includes (SOURCE .COLLECTION )) {
574
+ $emit (" alert" , " dataset collection is not a valid input for this dataset parameter." );
575
+ return false ;
576
+ }
577
+ // otherwise, collection can always be mapped over a data input ... in theory.
566
578
// One day we should also validate the map over model
567
579
return true ;
568
580
}
You can’t perform that action at this time.
0 commit comments