Comments (3)
I looked into the issue, and have found a possible cause.
Why are field
and sys
deleted from the object before diff is created?
const fromTypeDef = Object.assign({}, to)
delete(fromTypeDef.fields)
delete(fromTypeDef.sys)
const toTypeDef = Object.assign({}, to)
delete(toTypeDef.fields)
delete(toTypeDef.sys)
const typeDefDiff: DiffArray<IField> = diff(fromTypeDef, toTypeDef)
const fieldsDiff: DiffArray<IField> = diff(from.fields, to.fields)
@gburgett and @bsgreenb what's your thought on this?
from contentful-schema-diff.
Hi @Jgfrausing,
The answer is directly below that line, where we check to see if typeDefDiff has any changes. If it does, we pass the new values to the second parameter of editContentType
. That parameter takes the following fields:
export interface IContentTypeOptions {
/** Name of the content type. */
name: string,
/** Description of the content type. */
description?: string,
/** ID of the field to use as the display field for the content type. */
displayField?: string
}
Note that "sys" and "fields" are not in that definition, so we ignore them for the purposes of that diff.
Now to your original issue, if you select that button, it should update the "displayField" property of the content type and therefore it ought to show up in the diff. Would you please provide two Contentful export JSON files of a content type that reproduces this issue? You can do this by exporting your space before checking the box, and then again after checking the box and hitting save on the content type.
Thank you,
Gordon
from contentful-schema-diff.
Hi @gburgett ,
Sorry for the delay. I've created a small sandbox env and changed the entry title field.
(Something went wrong in the process, so the field controls got changed as well)
The zipfile contains the states title.json and name.json and the diff output.
20210518080717_modify_person.zip
from contentful-schema-diff.
Related Issues (15)
- 🐛 When a content type is removed no migration file created HOT 1
- Bug: Content type argument doesn't work HOT 9
- Can't find module HOT 2
- Vulnerability of contentful-management dependency HOT 1
- Changes to content type name and/or description are not picked up
- Doesn't handle default value
- Migration of ID change is incorrect - `id()` is not a function HOT 1
- field add / remove improperly generate update sometimes HOT 7
- Test fails: modify › writes created fields HOT 2
- script could not be parsed HOT 4
- Syntax error HOT 3
- Default value for widgetNameSpace for changeFieldControl HOT 2
- CI-friendly migration HOT 4
- Package causes ts linter to go crazy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contentful-schema-diff.