File tree 3 files changed +19
-7
lines changed
apps/content-editor/src/app/views
3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,13 @@ export const ItemCreate = () => {
164
164
setSaving ( true ) ;
165
165
166
166
try {
167
- const res : any = await dispatch ( createItem ( modelZUID , itemZUID ) ) ;
167
+ const res : any = await dispatch (
168
+ createItem ( {
169
+ modelZUID,
170
+ itemZUID,
171
+ skipPathPartValidation : model ?. type === "dataset" ,
172
+ } )
173
+ ) ;
168
174
if ( res . err || res . error ) {
169
175
if ( res . missingRequired || res . lackingCharLength ) {
170
176
const missingRequiredFieldNames : string [ ] =
Original file line number Diff line number Diff line change @@ -138,13 +138,18 @@ export const Meta = forwardRef(
138
138
} ;
139
139
} ) ;
140
140
141
+ // No need to validate pathPart for datasets
142
+ if ( model ?. type === "dataset" ) {
143
+ delete currentErrors . pathPart ;
144
+ }
145
+
141
146
setTimeout ( ( ) => {
142
147
setErrors ( currentErrors ) ;
143
148
} ) ;
144
149
} ,
145
150
} ;
146
151
} ,
147
- [ errors , web ]
152
+ [ errors , web , model ]
148
153
) ;
149
154
150
155
useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -514,7 +514,7 @@ export function saveItem({
514
514
} ;
515
515
}
516
516
517
- export function createItem ( modelZUID , itemZUID ) {
517
+ export function createItem ( { modelZUID, itemZUID, skipPathPartValidation } ) {
518
518
return ( dispatch , getState ) => {
519
519
const state = getState ( ) ;
520
520
@@ -553,10 +553,11 @@ export function createItem(modelZUID, itemZUID) {
553
553
return false ;
554
554
} ) ;
555
555
556
- const hasMissingRequiredSEOFields =
557
- ! item ?. web ?. metaTitle ||
558
- ! item ?. web ?. metaDescription ||
559
- ! item ?. web ?. pathPart ;
556
+ const hasMissingRequiredSEOFields = skipPathPartValidation
557
+ ? ! item ?. web ?. metaTitle || ! item ?. web ?. metaDescription
558
+ : ! item ?. web ?. metaTitle ||
559
+ ! item ?. web ?. metaDescription ||
560
+ ! item ?. web ?. pathPart ;
560
561
561
562
// Check minlength is satisfied
562
563
const lackingCharLength = fields ?. filter (
You can’t perform that action at this time.
0 commit comments