11import { DialogField } from "../Dialog/Dialog" ;
22
33
4- const PatternRegex = "^[A-Za-z][A-Za-z0-9_./-]*$ " ;
5- const PatternErrStr = " must start with a letter and contain only letters, numbers, underscores, periods, hyphens, and forward slashes ." ;
4+ const PatternDenyRegex = "[ ,:~] " ;
5+ const PatternDenyErr = " cannot contain spaces, commas, colons, or tildes ." ;
66const capitalize = ( s : string ) : string => { return s ?. length ? s . charAt ( 0 ) . toUpperCase ( ) + s . slice ( 1 ) : "" ; }
77
88/** Dev Note: Once we get actual user data we should use that for Contributor and ContributorOrganization */
@@ -21,16 +21,16 @@ export const entityCreateFields = (model: any): DialogField[] => {
2121 type : "text" as const ,
2222 label : "Name" ,
2323 required : true ,
24- pattern : PatternRegex ,
25- patternErr : "Name" + PatternErrStr ,
24+ patternDeny : PatternDenyRegex ,
25+ patternErr : "Name" + PatternDenyErr ,
2626 } ,
2727 {
2828 name : "UniqueName" ,
2929 type : "text" as const ,
3030 label : "Unique Name" ,
3131 required : true ,
32- pattern : PatternRegex ,
33- patternErr : "Unique Name" + PatternErrStr ,
32+ patternDeny : PatternDenyRegex ,
33+ patternErr : "Unique Name" + PatternDenyErr ,
3434 } ,
3535 { name : "Description" , type : "text" as const , label : "Description" } ,
3636 {
@@ -107,16 +107,16 @@ export const attributeCreateFields = (model: any, valueSetId: string | number |
107107 type : "text" as const ,
108108 label : "Name" ,
109109 required : true ,
110- pattern : PatternRegex ,
111- patternErr : "Name" + PatternErrStr ,
110+ patternDeny : PatternDenyRegex ,
111+ patternErr : "Name" + PatternDenyErr ,
112112 } ,
113113 {
114114 name : "UniqueName" ,
115115 type : "text" as const ,
116116 label : "Unique Name" ,
117117 required : true ,
118- pattern : PatternRegex ,
119- patternErr : "Unique Name" + PatternErrStr ,
118+ patternDeny : PatternDenyRegex ,
119+ patternErr : "Unique Name" + PatternDenyErr ,
120120 } ,
121121 {
122122 name : "DataType" ,
@@ -199,8 +199,8 @@ export const valueSetCreateFields = (model: any): DialogField[] => {
199199 type : "text" as const ,
200200 label : "Name" ,
201201 required : true ,
202- pattern : PatternRegex ,
203- patternErr : "Name" + PatternErrStr ,
202+ patternDeny : PatternDenyRegex ,
203+ patternErr : "Name" + PatternDenyErr ,
204204 } ,
205205 { name : "Description" , type : "text" as const , label : "Description" } ,
206206 {
@@ -251,8 +251,8 @@ export const valueCreateFields = (model: any): DialogField[] => {
251251 type : "text" as const ,
252252 label : "Value Name" ,
253253 required : true ,
254- pattern : PatternRegex ,
255- patternErr : "Value Name" + PatternErrStr ,
254+ patternDeny : PatternDenyRegex ,
255+ patternErr : "Value Name" + PatternDenyErr ,
256256 } ,
257257 { name : "Description" , type : "text" as const , label : "Description" } ,
258258 {
0 commit comments