File tree 2 files changed +10
-4
lines changed
data-plugins/lib/collections
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ export class PluginRender extends Plugin {
70
70
label : 'Colormap' ,
71
71
type : 'string' ,
72
72
'ui:widget' : 'tagger' ,
73
+ allowOther : {
74
+ type : 'string'
75
+ } ,
73
76
enum : colorMaps
74
77
} ,
75
78
colormap : {
@@ -89,6 +92,9 @@ export class PluginRender extends Plugin {
89
92
label : 'Resampling' ,
90
93
type : 'string' ,
91
94
'ui:widget' : 'tagger' ,
95
+ allowOther : {
96
+ type : 'string'
97
+ } ,
92
98
enum : [
93
99
[ 'near' , 'Nearest neighbour' ] ,
94
100
[ 'bilinear' , 'Bilinear' ] ,
Original file line number Diff line number Diff line change @@ -53,12 +53,12 @@ export function WidgetTagger(props: WidgetProps) {
53
53
54
54
if ( field . type === 'string' ) {
55
55
if ( ! field . enum ) {
56
- throw new Error ( "WidgetTagger: 'enum' is required for string fields " ) ;
56
+ throw new Error ( "WidgetTagger: 'enum' is required when type is 'string' " ) ;
57
57
}
58
58
59
59
if ( field . allowOther ?. type !== 'string' ) {
60
60
throw new Error (
61
- "WidgetTagger: 'allowOther.type' is required for the 'tagger' widget. Use the 'select' widget instead."
61
+ "WidgetTagger: 'allowOther.type' is required for the 'tagger' widget with 'enum' options . Use the 'select' widget instead."
62
62
) ;
63
63
}
64
64
@@ -68,14 +68,14 @@ export function WidgetTagger(props: WidgetProps) {
68
68
if ( field . type === 'array' ) {
69
69
if ( field . items . type !== 'string' ) {
70
70
throw new Error (
71
- "WidgetTagger: 'items.type' must be 'string' for array fields "
71
+ "WidgetTagger: 'items.type' must be 'string' when type is 'array' "
72
72
) ;
73
73
}
74
74
75
75
if ( field . items . enum ) {
76
76
if ( field . items . allowOther ?. type !== 'string' ) {
77
77
throw new Error (
78
- "WidgetTagger: 'items.allowOther.type' is required for the 'tagger' widget with 'enum'. Use the 'select' widget instead."
78
+ "WidgetTagger: 'items.allowOther.type' is required for the 'tagger' widget with 'enum' options . Use the 'select' widget instead."
79
79
) ;
80
80
}
81
81
You can’t perform that action at this time.
0 commit comments