-
Notifications
You must be signed in to change notification settings - Fork 8
Dev #967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #967
Changes from all commits
1ad1de6
e9539ec
0e05dd1
4f32ebc
55b67ac
39698f5
ff7494e
051ecd8
285943c
fc391f1
78d3875
12e234a
7488b13
c687f32
99372cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,29 +160,24 @@ function buildFieldSchema(item: any, marketPlacePath: string, parentUid = ''): a | |
| } | ||
| } | ||
|
|
||
| if (blockSchema.length > 0) { | ||
| blocks.push({ | ||
| title: blockRawUid, // Keep original for title | ||
| uid: blockUid, // Snake case for uid | ||
| schema: removeDuplicateFields(blockSchema) | ||
| }); | ||
| } | ||
| blocks.push({ | ||
| title: blockRawUid, // Keep original for title | ||
| uid: blockUid, // Snake case for uid | ||
| schema: removeDuplicateFields(blockSchema) | ||
| }); | ||
| } | ||
|
|
||
| if (blocks.length > 0) { | ||
| return { | ||
| data_type: "blocks", | ||
| display_name: item?.display_name || rawUid, // Keep original for display | ||
| field_metadata: {}, | ||
| uid: itemUid, // Snake case uid | ||
| multiple: true, | ||
| mandatory: false, | ||
| unique: false, | ||
| non_localizable: false, | ||
| blocks: removeDuplicateFields(blocks) | ||
| }; | ||
| } | ||
| return null; | ||
| return { | ||
| data_type: "blocks", | ||
| display_name: item?.display_name || rawUid, // Keep original for display | ||
| field_metadata: {}, | ||
| uid: itemUid, // Snake case uid | ||
| multiple: true, | ||
| mandatory: false, | ||
| unique: false, | ||
| non_localizable: false, | ||
| blocks: removeDuplicateFields(blocks) | ||
| }; | ||
|
Comment on lines
+170
to
+180
|
||
| } | ||
|
|
||
| if (fieldType === 'group') { | ||
|
|
@@ -316,14 +311,25 @@ export function buildSchemaTree(fields: any[], parentUid = '', parentType = '', | |
|
|
||
| if (hasChildren) { | ||
| if (fieldType === 'modular_blocks') { | ||
| // Get modular block children | ||
| // Get modular block children (check both current and backup UIDs) | ||
| const mbChildren = fields.filter(f => { | ||
| if (!f) return false; | ||
| const fUid = f?.contentstackFieldUid || ''; | ||
| if (!fUid || !fieldUid) return false; | ||
| return f?.contentstackFieldType === 'modular_blocks_child' && | ||
| fUid.startsWith(fieldUid + '.') && | ||
| !fUid.substring(fieldUid.length + 1).includes('.'); | ||
| if (f?.contentstackFieldType !== 'modular_blocks_child') return false; | ||
|
|
||
| if (fUid.startsWith(fieldUid + '.') && | ||
| !fUid.substring(fieldUid.length + 1).includes('.')) { | ||
| return true; | ||
| } | ||
|
|
||
| if (oldFieldUid && oldFieldUid !== fieldUid && | ||
| fUid.startsWith(oldFieldUid + '.') && | ||
| !fUid.substring(oldFieldUid.length + 1).includes('.')) { | ||
| return true; | ||
| } | ||
|
|
||
| return false; | ||
| }); | ||
|
|
||
| result.schema = mbChildren.map(child => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| REACT_APP_WEBSITE_BASE_URL="http://localhost:3000/" | ||
| REACT_APP_BASE_API_URL="http://localhost:5001/" | ||
| REACT_APP_API_VERSION=v2 | ||
| REACT_APP_HOST="http://localhost:3000" | ||
| REACT_APP_UPLOAD_SERVER="http://localhost:4002/" | ||
| REACT_APP_OFFLINE_CMS=true | ||
| VITE_WEBSITE_BASE_URL="http://localhost:3000/" | ||
| VITE_BASE_API_URL="http://localhost:5001/" | ||
| VITE_API_VERSION=v2 | ||
| VITE_HOST="http://localhost:3000" | ||
| VITE_UPLOAD_SERVER="http://localhost:4002/" | ||
| VITE_OFFLINE_CMS=true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,4 @@ yarn-error.log* | |
|
|
||
|
|
||
| # .npmrc | ||
| .npmrc | ||
|
|
||
| !.env.local | ||
| .npmrc | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,4 +20,5 @@ USER nodeapp | |
|
|
||
| EXPOSE 3000 | ||
|
|
||
| CMD [ "npm", "run", "start" ] | ||
| # Build at container startup so VITE_* env vars from docker-compose | ||
| CMD [ "sh", "-c", "npm run build && npx vite preview --port 3000 --host" ] | ||
|
Comment on lines
+23
to
+24
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty blocks are now always pushed to the blocks array, even when blockSchema is empty. This could result in modular blocks with empty schemas being created. The previous logic filtered out blocks with no fields. Consider whether empty blocks should be allowed or if the length check should be restored.