feat: add force flag to import omitted fields [#62]#919
feat: add force flag to import omitted fields [#62]#919Marco Link (marcolink) wants to merge 1 commit intomainfrom
Conversation
Janko Marklein (ruderngespra)
left a comment
There was a problem hiding this comment.
Very cool stuff, love all the additional types as well. Maybe we can add an additional entry to the readme list here.
Also, what do you think about "delete-omitted-fields" instead of "force", just because force could be needed for other things in the future and sounds quite generic.
| ctx.sourceData = transformedSourceData | ||
| const customTransformers: Partial<typeof transformers> = {} | ||
| if (options.force) { | ||
| customTransformers.contentTypes = (contentType: ContentTypeProps) => pipe(transformers.contentTypes, forceDeleteOmittedFieldTransform)(contentType) |
There was a problem hiding this comment.
Personally not the biggest fan of adding the pipe dependency "just" for this, not sure about the benefit, we also just can pass the params through all all transformers instead, no?
|
|
||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore | ||
| return transformedLocale |
There was a problem hiding this comment.
why do we need this ignore here, what's the issue?
There was a problem hiding this comment.
The retuned shape only has a subset of data in the sys field (only the id field)
test/unit/transform/force-delete-omitted-field-transform.test.ts
Outdated
Show resolved
Hide resolved
64a4b71 to
d8c310a
Compare
d8c310a to
4dcf628
Compare
4dcf628 to
eb98727
Compare
Introduce a new flag
forceto enforce content type imports with omitted fields. If the flag is present, we delete omitted fields before importing the content type.Addresses the feature request formulated in several issues: