Skip to content
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

Bugfix/CS-40883 - Added condition to handle if and entry is referenced inside a span tag in JSONRTE #1039

Merged
merged 4 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.4.15",
"version": "1.4.16",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -17,7 +17,7 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.4.15",
"@contentstack/cli-cm-seed": "~1.4.16",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"inquirer": "8.2.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.4.16",
"version": "1.4.17",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@contentstack/cli-cm-export": "~1.8.1",
"@contentstack/cli-cm-import": "~1.8.3",
"@contentstack/cli-cm-import": "~1.8.4",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"@colors/colors": "^1.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.8.3",
"version": "1.8.4",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ module.exports = class ImportEntries {

if (element.length) {
for (const item of element) {
if ((item.type === 'p' || item.type === 'a') && item.children && item.children.length > 0) {
if ((item.type === 'p' || item.type === 'a' || item.type === 'span') && item.children && item.children.length > 0) {
return this.doEntryReferencesExist(item.children);
} else if (this.isEntryRef(item)) {
return true;
Expand All @@ -1269,7 +1269,7 @@ module.exports = class ImportEntries {
return true;
}

if ((element.type === 'p' || element.type === 'a') && element.children && element.children.length > 0) {
if ((element.type === 'p' || element.type === 'a' || element.type ==='span') && element.children && element.children.length > 0) {
return this.doEntryReferencesExist(element.children);
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/contentstack-import/src/utils/entries-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const lookupEntries = function (data: any, mappedUids: Record<string, any
if (element.type) {
switch (element.type) {
case 'a':
case 'span':
case 'p': {
if (element.children && element.children.length > 0) {
gatherJsonRteEntryIds(element);
Expand Down Expand Up @@ -412,7 +413,7 @@ function doEntryReferencesExist(element: Record<string, any>[] | any): boolean {

if (element.length) {
for (const item of element) {
if ((item.type === 'p' || item.type === 'a') && item.children && item.children.length > 0) {
if ((item.type === 'p' || item.type === 'a' || item.type === 'span') && item.children && item.children.length > 0) {
return doEntryReferencesExist(item.children);
} else if (isEntryRef(item)) {
return true;
Expand All @@ -423,7 +424,7 @@ function doEntryReferencesExist(element: Record<string, any>[] | any): boolean {
return true;
}

if ((element.type === 'p' || element.type === 'a') && element.children && element.children.length > 0) {
if ((element.type === 'p' || element.type === 'a' || element.type === 'span') && element.children && element.children.length > 0) {
return doEntryReferencesExist(element.children);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-launch/oclif.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.10",
"version": "1.0.11",
"commands": {
"launch:base-command": {
"id": "launch:base-command",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.4.15",
"version": "1.4.16",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "~1.8.3",
"@contentstack/cli-cm-import": "~1.8.4",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"axios": "1.3.4",
Expand Down
8 changes: 4 additions & 4 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
},
"dependencies": {
"@contentstack/cli-auth": "~1.3.13",
"@contentstack/cli-cm-bootstrap": "~1.4.15",
"@contentstack/cli-cm-bootstrap": "~1.4.16",
"@contentstack/cli-cm-bulk-publish": "~1.3.11",
"@contentstack/cli-cm-clone": "~1.4.16",
"@contentstack/cli-cm-clone": "~1.4.17",
"@contentstack/cli-cm-export": "~1.8.1",
"@contentstack/cli-cm-export-to-csv": "~1.4.2",
"@contentstack/cli-cm-import": "~1.8.3",
"@contentstack/cli-cm-import": "~1.8.4",
"@contentstack/cli-cm-migrate-rte": "~1.4.11",
"@contentstack/cli-cm-seed": "~1.4.15",
"@contentstack/cli-cm-seed": "~1.4.16",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-config": "~1.4.11",
"@contentstack/cli-launch": "~1.0.11",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading