contentstack_utils 1.1.1 → 1.1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/codeql-analysis.yml +68 -0
- data/.github/workflows/jira.yml +28 -0
- data/.github/workflows/release-gem.yml +31 -0
- data/.github/workflows/sast-scan.yml +11 -0
- data/.github/workflows/sca-scan.yml +15 -0
- data/.github/workflows/secrets-scan.yml +11 -0
- data/.gitignore +10 -10
- data/.yardopts +3 -3
- data/CHANGELOG.md +21 -12
- data/CODEOWNERS +1 -1
- data/Gemfile +4 -4
- data/Gemfile.lock +29 -24
- data/LICENSE +20 -20
- data/README.md +96 -96
- data/Rakefile +32 -32
- data/SECURITY.md +27 -27
- data/contentstack_utils.gemspec +31 -31
- data/lib/contentstack_utils/interface/renderable.rb +8 -8
- data/lib/contentstack_utils/model/metadata.rb +68 -68
- data/lib/contentstack_utils/model/options.rb +115 -113
- data/lib/contentstack_utils/support/helper.rb +2 -2
- data/lib/contentstack_utils/utils.rb +163 -163
- data/lib/contentstack_utils/version.rb +2 -2
- data/lib/contentstack_utils.rb +3 -3
- data/spec/lib/model/metadata_spec.rb +94 -94
- data/spec/lib/model/option_spec.rb +316 -309
- data/spec/lib/utils_spec.rb +642 -642
- data/spec/mock/constant_render_options.rb +15 -15
- data/spec/mock/custom_render_option.rb +23 -23
- data/spec/mock/json_to_html_mock.rb +146 -146
- data/spec/spec_helper.rb +9 -8
- data/spec/support/constant.rb +616 -616
- data/spec/support/xml_parse.rb +30 -30
- metadata +11 -17
@@ -1,16 +1,16 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
EMBEDDED_ASSET_WITH_DEFAULT_RENDER_OPTION = ContentstackUtils::Model::Options.new(ENTRY_EMBEDDED_ASSET)
|
4
|
-
|
5
|
-
EMBEDDED_ASSET_WITH_NO_ASSET_OBJECT = ContentstackUtils::Model::Options.new(ENTRY_ASSET_EMBED_BLANK)
|
6
|
-
|
7
|
-
EMBEDDED_ENTRY_WITH_DEFAULT_RENDER_OPTION = ContentstackUtils::Model::Options.new(ENTRY_EMBEDDED_ENTRIES)
|
8
|
-
|
9
|
-
EMBEDDED_OBJECT_WITH_DEFAULT_RENDER_OPTION = ContentstackUtils::Model::Options.new(ENTRY_EMBEDDED_OBJECTS)
|
10
|
-
|
11
|
-
|
12
|
-
EMBEDDED_ASSET_WITH_CUSTOM_RENDER_OPTION = ContentstackUtilsTest::CustomLOption.new(ENTRY_EMBEDDED_ASSET)
|
13
|
-
|
14
|
-
EMBEDDED_ENTRY_WITH_CUSTOM_RENDER_OPTION = ContentstackUtilsTest::CustomLOption.new(ENTRY_EMBEDDED_ENTRIES)
|
15
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
EMBEDDED_ASSET_WITH_DEFAULT_RENDER_OPTION = ContentstackUtils::Model::Options.new(ENTRY_EMBEDDED_ASSET)
|
4
|
+
|
5
|
+
EMBEDDED_ASSET_WITH_NO_ASSET_OBJECT = ContentstackUtils::Model::Options.new(ENTRY_ASSET_EMBED_BLANK)
|
6
|
+
|
7
|
+
EMBEDDED_ENTRY_WITH_DEFAULT_RENDER_OPTION = ContentstackUtils::Model::Options.new(ENTRY_EMBEDDED_ENTRIES)
|
8
|
+
|
9
|
+
EMBEDDED_OBJECT_WITH_DEFAULT_RENDER_OPTION = ContentstackUtils::Model::Options.new(ENTRY_EMBEDDED_OBJECTS)
|
10
|
+
|
11
|
+
|
12
|
+
EMBEDDED_ASSET_WITH_CUSTOM_RENDER_OPTION = ContentstackUtilsTest::CustomLOption.new(ENTRY_EMBEDDED_ASSET)
|
13
|
+
|
14
|
+
EMBEDDED_ENTRY_WITH_CUSTOM_RENDER_OPTION = ContentstackUtilsTest::CustomLOption.new(ENTRY_EMBEDDED_ENTRIES)
|
15
|
+
|
16
16
|
EMBEDDED_OBJECT_WITH_CUSTOM_RENDER_OPTION = ContentstackUtilsTest::CustomLOption.new(ENTRY_EMBEDDED_OBJECTS)
|
@@ -1,24 +1,24 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
module ContentstackUtilsTest
|
3
|
-
class CustomLOption < ContentstackUtils::Model::Options
|
4
|
-
def render_option(embeddedObject, metadata)
|
5
|
-
case metadata.style_type
|
6
|
-
when 'block'
|
7
|
-
if metadataArray.content_type_uid === 'content_block'
|
8
|
-
return "<div><div>#{embeddedObject.title}</div></div>"
|
9
|
-
end
|
10
|
-
when 'inline'
|
11
|
-
if metadataArray.content_type_uid === 'embeddedrte'
|
12
|
-
return "<div><div>#{embeddedObject.uid}</div></div>"
|
13
|
-
end
|
14
|
-
when 'display'
|
15
|
-
return "<img src=\"#{embeddedObject["url"]}\" alt=\"Alternet Text\" />"
|
16
|
-
end
|
17
|
-
super(embeddedObject, metadata)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
class CustomRaiseOption< ContentstackUtils::Interface::Rendarable
|
22
|
-
|
23
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
module ContentstackUtilsTest
|
3
|
+
class CustomLOption < ContentstackUtils::Model::Options
|
4
|
+
def render_option(embeddedObject, metadata)
|
5
|
+
case metadata.style_type
|
6
|
+
when 'block'
|
7
|
+
if metadataArray.content_type_uid === 'content_block'
|
8
|
+
return "<div><div>#{embeddedObject.title}</div></div>"
|
9
|
+
end
|
10
|
+
when 'inline'
|
11
|
+
if metadataArray.content_type_uid === 'embeddedrte'
|
12
|
+
return "<div><div>#{embeddedObject.uid}</div></div>"
|
13
|
+
end
|
14
|
+
when 'display'
|
15
|
+
return "<img src=\"#{embeddedObject["url"]}\" alt=\"Alternet Text\" />"
|
16
|
+
end
|
17
|
+
super(embeddedObject, metadata)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class CustomRaiseOption< ContentstackUtils::Interface::Rendarable
|
22
|
+
|
23
|
+
end
|
24
24
|
end
|
@@ -1,147 +1,147 @@
|
|
1
|
-
|
2
|
-
PlainTextHtml = "<strong>Aliquam sit amet libero dapibus, eleifend ligula at, varius justo</strong><strong><em>Lorem ipsum</em></strong><strong><em><u>dolor sit amet</u></em></strong><strong><em><u><strike>consectetur adipiscing elit.</strike></u></em></strong><strong><em><u><span>Sed condimentum iaculis magna in vehicula. </span></u></em></strong><strong><em><u><sup>Vestibulum vitae convallis </sup></u></em></strong><strong><em><u><sub> lacus. </sub></u></em></strong>"
|
3
|
-
ParagraphHtml = "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum iaculis magna in vehicula. Vestibulum vitae convallis lacus. Praesent a diam iaculis turpis rhoncus faucibus. Aliquam sed pulvinar sem.</p>"
|
4
|
-
H1Html = "<h1><strong><em><u><sub>Lorem ipsum dolor sit amet.</sub></u></em></strong></h1>"
|
5
|
-
H2Html = "<h2><strong><em><u><sub>Vestibulum a ligula eget massa sagittis aliquam sit amet quis tortor. </sub></u></em></strong></h2>"
|
6
|
-
H3Html = "<h3><strong><em><u><sub>Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.</sub></u></em></strong></h3>"
|
7
|
-
H4Html = "<h4><strong><em><u><sub>MaNullam feugiat turpis quis elit interdum, vitae laoreet quam viverra</sub></u></em></strong></h4>"
|
8
|
-
H5Html = "<h5>Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.</h5>"
|
9
|
-
H6Html = "<h6>Nunc porta diam vitae purus semper, ut consequat lorem vehicula.</h6>"
|
10
|
-
OrderListHtml = "<ol><li>Morbi in quam molestie, fermentum diam vitae, bibendum ipsum.</li><li>Pellentesque mattis lacus in quam aliquam congue</li><li>Integer feugiat leo dignissim, lobortis enim vitae, mollis lectus.</li><li>Sed in ante lacinia, molestie metus eu, fringilla sapien.</li></ol>"
|
11
|
-
UnorderListHtml = "<ul><li>Sed quis metus sed mi hendrerit mollis vel et odio.</li><li>Integer vitae sem dignissim, elementum libero vel, fringilla massa.</li><li>Integer imperdiet arcu sit amet tortor faucibus aliquet.</li><li>Aenean scelerisque velit vitae dui vehicula, at congue massa sagittis.</li></ul>"
|
12
|
-
ImgHtml = "<img src='https://images.contentstack.com/v3/Donald.jog.png' />"
|
13
|
-
TableHtml = "<table><thead><tr><th><p>Header 1</p></th><th><p>Header 2</p></th></tr></thead><tbody><tr><td><p>Body row 1 data 1</p></td><td><p>Body row 1 data 2</p></td></tr><tr><td><p>Body row 2 data 1</p></td><td><p>Body row 2 data 2</p></td></tr></tbody></table>"
|
14
|
-
BlockquoteHtml = "<blockquote>Praesent eu ex sed nibh venenatis pretium.</blockquote>"
|
15
|
-
CodeHtml = "<code>Code template.</code>"
|
16
|
-
LinkInPHtml = "<p><strong><em><u><sub></sub></u></em></strong><a href='LINK.com'>LINK</a></p>"
|
17
|
-
EmbedHtml = "<iframe src='https://www.youtube.com/watch?v=AOP0yARiW8U'></iframe>"
|
18
|
-
AssetReferenceHtml = "<img src='/v3/dummy.pdf' alt='dummy.pdf' />"
|
19
|
-
EntryReferenceBlockHtml = "<div><p>Update this title</p><p>Content type: <span>content_block</span></p></div>"
|
20
|
-
EntryReferenceLinkHtml = "<a href='/copy-of-entry-final-02'>/copy-of-entry-final-02</a>"
|
21
|
-
EntryReferenceInlineHtml = "<span>updated title</span>"
|
22
|
-
|
23
|
-
BlankDocument = '{ "uid":"06e34a7a4e5d7fc2acd", "_version":13, "attrs":{ }, "children":[],"type":"doc"}'
|
24
|
-
PlainTextJson = '{ "uid":"06e34a7a4e5d7fc2acd", "_version":13, "attrs":{ }, "children":[{"text":"Aliquam sit amet libero dapibus, eleifend ligula at, varius justo","bold":true},{ "text":"Lorem ipsum","bold":true,"italic":true},{ "text":"dolor sit amet","bold":true,"italic":true,"underline":true},{ "text":"consectetur adipiscing elit.","bold":true,"italic":true,"underline":true,"strikethrough":true},{ "text":"Sed condimentum iaculis magna in vehicula. ","bold":true,"italic":true,"underline":true,"inlineCode":true},{ "text":"Vestibulum vitae convallis ","bold":true,"italic":true,"underline":true,"superscript":true},{ "text":" lacus. ","bold":true,"italic":true,"underline":true,"subscript":true}],"type":"doc"}'
|
25
|
-
H1Json = '{ "uid":"06e34a7a449d7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h1","attrs":{ },"uid":"c2dfed70 4d7030c65e2e1","children":[{ "text":"Lorem ipsum dolor sit amet.","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
26
|
-
H2Json = '{ "uid":"06e34a7a4e2acd","_version":13,"attrs":{ },"children":[{ "type":"h2","attrs":{ },"uid":"c2dfed9a7030c65e2e1","children":[{ "text":"Vestibulum a ligula eget massa sagittis aliquam sit amet quis tortor. ","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
27
|
-
H3Json = '{ "uid":"06e34ad7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h3","attrs":{ },"uid":"c2df42cfb70 4d7030c65e2e1","children":[{ "text":"Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
28
|
-
H4Json = '{ "uid":"06e34a7a4e54cd", "_version":13, "attrs":{ "style":{ "text-align":"center" }, "redactor-attributes":{ } }, "children":[{"type":"h4","attrs":{},"uid":"c2dfed4d7030c65e2e1","children":[{"text":"MaNullam feugiat turpis quis elit interdum, vitae laoreet quam viverra","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
29
|
-
H5Json = '{ "uid": "06e381190849dacd", "_version": 13, "attrs": { }, "children": [ { "type": "h5", "attrs": {}, "uid": "c2d672242cfb7045e2e1", "children": [ { "text": "Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum." } ] } ], "type": "doc" }'
|
30
|
-
H6Json = '{ "uid": "06e34a71190849d7fcd", "_version": 13, "attrs": { }, "children": [ { "type": "h6", "attrs": {}, "uid": "c2dfa672242cfb7e2e1", "children": [ { "text": "Nunc porta diam vitae purus semper, ut consequat lorem vehicula." } ] } ], "type": "doc" }'
|
31
|
-
OrderListJson = '{ "uid":"06e35 48119084 9d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"2b5b4acbb3cfce02d3e","type":"ol","children":[{"type":"li","attrs":{"style":{"text-align":"justify"},"redactor-attributes":{ }},"uid":"160bbd7430b98bd3d996","children":[{"text":"Morbi in quam molestie, fermentum diam vitae, bibendum ipsum."}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"a15f4d749bc2903d","children":[{ "text":"Pellentesque mattis lacus in quam aliquam congue"}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"e54224bbcb6f9e8f1e43","children":[{ "text":"Integer feugiat leo dignissim, lobortis enim vitae, mollis lectus."}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"c0148bab9af758784","children":[{ "text":"Sed in ante lacinia, molestie metus eu, fringilla sapien."}]}],"id":"7f413d448a","attrs":{ }}],"type":"doc"}'
|
32
|
-
UnorderListJson = '{ "uid":"0e5481190849a", "_version":13, "attrs":{ }, "children":[{"uid":"a3a2b443ebffc867b","type":"ul","children":[{"uid":"f67354d4eed64451922","type":"li","children":[{"text":"Sed quis metus sed mi hendrerit mollis vel et odio."}],"attrs":{ }},{ "uid":"5 50cba5 bea92f23e36fd1","type":"li","children":[{ "text":"Integer vitae sem dignissim, elementum libero vel, fringilla massa."}],"attrs":{ } },{ "uid":"0e5c9b4cd983e8fd543","type":"li","children":[{ "text":"Integer imperdiet arcu sit amet tortor faucibus aliquet."}],"attrs":{ } },{ "uid":"6d9a43a3816bd83a9a","type":"li","children":[{ "text":"Aenean scelerisque velit vitae dui vehicula, at congue massa sagittis."}],"attrs":{ } }],"id":"b083fa46ef899420ab19","attrs":{ }}],"type":"doc"}'
|
33
|
-
ImgJson = '{ "uid":"06e34a7a4849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"f3be74be3b64646e626","type":"img","attrs":{"src":"https://images.contentstack.com/v3/Donald.jog.png","width":33.69418132611637,"height":"auto","redactor-attributes":{"asset_uid":"47f1aa5ae422cd1"}},"children":[{"text":""}]}],"type":"doc"}'
|
34
|
-
ImgJsonURL = '{ "uid":"06e34a7a4849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"f3be74be3b64646e626","type":"img","attrs":{"url":"https://images.contentstack.com/v3/Donald.jog.png","width":33.69418132611637,"height":"auto","redactor-attributes":{"asset_uid":"47f1aa5ae422cd1"}},"children":[{"text":""}]}],"type":"doc"}'
|
35
|
-
ParagraphJson = '{ "uid":"0d7fd", "_version":13, "attrs":{ }, "children":[{"type":"p","attrs":{},"uid":"0a1b5676aa510e5a","children":[{"text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum iaculis magna in vehicula. Vestibulum vitae convallis lacus. Praesent a diam iaculis turpis rhoncus faucibus. Aliquam sed pulvinar sem."}]}],"type":"doc"}'
|
36
|
-
BlockquoteJson = '{ "uid":"06084d7fd", "_version":13, "attrs":{ }, "children":[{"uid":"503f9cc97534db55","type":"blockquote","id":"431f78e567161460","children":[{"text":"Praesent eu ex sed nibh venenatis pretium."}],"attrs":{ }}],"type":"doc"}'
|
37
|
-
CodeJson = '{ "uid":"06ea490849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"83fba92c91b30002b","type":"code","attrs":{},"children":[{"text":"Code template."}]}],"type":"doc"}'
|
38
|
-
TableJson = '{ "uid": "06e481190849d7fcd", "_version": 13, "attrs": { }, "children": [ { "uid": "6dd64343bf634bfadd4", "type": "table", "attrs": { "rows": 4, "cols": 2, "colWidths": [ 250, 250 ] }, "children": [ { "uid": "b9082", "type": "thead", "attrs": {}, "children": [ { "type": "tr", "attrs": {}, "children": [ { "type": "th", "attrs": {}, "children": [ { "type": "p", "attrs": {}, "children": [ { "text": "Header 1" } ], "uid": "daa3ef" } ], "uid": "4b3124414a3" }, { "type": "th", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Header 2" } ], "uid": "eae83c5797d" } ], "uid": "bca9b6f037a04fb485" } ], "uid": "b91ae7a48ef2e9da1" } ] }, { "type": "tbody", "attrs": { }, "children": [ { "type": "tr", "attrs": { }, "children": [ { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 1 data 1" } ], "uid": "ec674ccc5ce70b7cab" } ], "uid": "2a70bdeeb99a" }, { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 1 data 2" } ], "uid": "769a 3f9db34 ce8ec 10486d50" } ], "uid": "d6407 34a5c6 1ab1e5f7d1" } ], "uid": "77f6 b951c68 7f9eb397c5" }, { "type": "tr", "attrs": { }, "children": [ { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 2 data 1" } ], "uid": "a6bf 11bb48 630e87d721c0" } ], "uid": "3da39838b0feaf" }, { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 2 data 2" } ], "uid": "3b7d12 1f694202 49029e86313" } ], "uid": "95b38b04abcbc25e94f" } ], "uid": "b 227fea 8d247013 4f1e1e8" } ], "uid": "fd5ab86aa642798451b" } ] } ], "type": "doc" }'
|
39
|
-
LinkInPJson = '{ "uid":"06e34a7190849d7f2acd", "_version":13, "attrs":{ }, "children":[{"type":"p","attrs":{"style":{"text-align":"left"},"redactor-attributes":{ }},"uid":"d88dcdf4590dff2d","children":[{"text":"","bold":true,"italic":true,"underline":true,"subscript":true},{ "uid":"0d06598201aa8b47","type":"a","attrs":{ "href":"LINK.com","target":"_self"},"children":[{ "text":"LINK"}]},{ "text":""}]}],"type":"doc"}'
|
40
|
-
EmbedJson = '{ "uid":"06e34a7190849d7f2acd", "_version":13, "attrs":{ }, "children":[{"uid":"251017315905c35d42c9","type":"embed","attrs":{"src":"https://www.youtube.com/watch?v=AOP0yARiW8U"},"children":[{"text":""}]}],"type":"doc"}'
|
41
|
-
AssetReferenceJson = '{"uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{}, "children":[{ "uid": "4f7e33 3390a955 de10c1 c836", "type":"reference","attrs":{"display-type":"display","asset-uid":"asset_uid_1","content-type-uid":"sys_assets","asset-link":"https://images.contentstack.com/v3/11.jpg","asset-name":"11.jpg","asset-type":"image/jpeg","type":"asset","class-name":"embedded-asset","width":25.16914749661705,"className":"dsd","id":"sdf"},"children":[{"text":""}]}],"type":"doc"}'
|
42
|
-
EntryReferenceBlockJson = '{ "uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{ }, "children":[{"uid":"70f9b 325075d43 128c0d0 aa3eb7f291f","type":"reference","attrs":{"display-type":"block","entry-uid":"entry_uid_1","content-type-uid":"content_block","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
|
43
|
-
EntryReferenceLinkJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"7626ea98e0e95d602210","type":"reference","attrs":{"target":"_self","href":"/copy-of-entry-final-02","display-type":"link","entry-uid":"entry_uid_2","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":"/copy-of-entry-final-02"}]}],"type":"doc"}'
|
44
|
-
EntryReferenceInlineJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"506 4878f3f46 s21f0cbc aff","type":"reference","attrs":{"display-type":"inline","entry-uid":"entry_uid_3","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
|
45
|
-
HRJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"f5a7b57 40a8a5c3 576828276b","type":"hr","children":[{"text":""}],"attrs":{ }}],"type":"doc"}'
|
46
|
-
H1NonChildJson = '{ "uid":"06e34a7a449d7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h1","attrs":{ },"uid":"c2dfed70 4d7030c65e2e1"}],"type":"doc"}'
|
47
|
-
|
48
|
-
JSON_EMBEDDED_ITEMS_ENTRY= {
|
49
|
-
"title"=> 'one',
|
50
|
-
"url"=> '/one',
|
51
|
-
"locale"=> 'en-us',
|
52
|
-
"uid"=> 'entry_uid_4',
|
53
|
-
"created_by"=> 'created_at_date',
|
54
|
-
"updated_by"=> 'created_at_date',
|
55
|
-
"created_at"=> '2020-08-13T06:18:18.989Z',
|
56
|
-
"updated_at"=> '2020-08-31T06:06:31.258Z',
|
57
|
-
"markdown"=> '',
|
58
|
-
"_embedded_items"=> {
|
59
|
-
"rich_text_editor"=> [
|
60
|
-
{
|
61
|
-
"_content_type_uid"=> 'sys_assets',
|
62
|
-
"uid"=> 'asset_uid_1',
|
63
|
-
"created_at"=> '2020-08-19T09:13:32.785Z',
|
64
|
-
"updated_at"=> '2020-08-19T09:13:32.785Z',
|
65
|
-
"created_by"=> 'created_at_date',
|
66
|
-
"updated_by"=> 'created_at_date',
|
67
|
-
"content_type"=> 'application/pdf',
|
68
|
-
"file_size"=> '13264',
|
69
|
-
"filename"=> 'dummy.pdf',
|
70
|
-
"url"=> '/v3/dummy.pdf',
|
71
|
-
"_version"=> 1,
|
72
|
-
"title"=> 'dummy.pdf'
|
73
|
-
},
|
74
|
-
{
|
75
|
-
"title"=> 'Update this title',
|
76
|
-
"url"=> '',
|
77
|
-
"locale"=> 'en-us',
|
78
|
-
"uid"=> 'entry_uid_1',
|
79
|
-
"_content_type_uid"=> 'content_block',
|
80
|
-
"_version"=> 5,
|
81
|
-
"_in_progress"=> false,
|
82
|
-
"multi_line"=> '',
|
83
|
-
"_embedded_items"=> {
|
84
|
-
"rich_text_editor"=> [
|
85
|
-
{
|
86
|
-
"uid"=> 'entry_uid_1',
|
87
|
-
"_content_type_uid"=> 'content_block'
|
88
|
-
}
|
89
|
-
]
|
90
|
-
},
|
91
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
|
92
|
-
},
|
93
|
-
{
|
94
|
-
"title"=> 'updated title',
|
95
|
-
"rich_text_editor"=> [
|
96
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
97
|
-
],
|
98
|
-
"locale"=> 'en-us',
|
99
|
-
"uid"=> 'entry_uid_3',
|
100
|
-
"_content_type_uid"=> 'embeddedrte',
|
101
|
-
"_in_progress"=> false,
|
102
|
-
"_embedded_items"=> {
|
103
|
-
"rich_text_editor"=>[
|
104
|
-
{
|
105
|
-
"_content_type_uid"=> 'sys_assets',
|
106
|
-
"uid"=> 'asset_uid_2',
|
107
|
-
"content_type"=> 'image/png',
|
108
|
-
"file_size"=> '36743',
|
109
|
-
"filename"=> 'svg-logo-text.png',
|
110
|
-
"url"=> '/v3/svg-logo-text.png',
|
111
|
-
"title"=> 'svg-logo-text.png',
|
112
|
-
"description"=> ''
|
113
|
-
}
|
114
|
-
]
|
115
|
-
}
|
116
|
-
},
|
117
|
-
{
|
118
|
-
"title"=> 'Entry with embedded entry',
|
119
|
-
"rich_text_editor"=> [
|
120
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="inline" type="entry"></figure>\n<p><br><br></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
121
|
-
],
|
122
|
-
"locale"=> 'en-us',
|
123
|
-
"uid"=> 'entry_uid_2',
|
124
|
-
"_content_type_uid"=> 'embeddedrte',
|
125
|
-
"_in_progress"=> false,
|
126
|
-
"_embedded_items"=> {
|
127
|
-
"rich_text_editor"=>[
|
128
|
-
{
|
129
|
-
"uid"=> 'entry_uid_4',
|
130
|
-
"_content_type_uid"=> '1234'
|
131
|
-
},
|
132
|
-
{
|
133
|
-
"uid"=> 'entry_uid_4',
|
134
|
-
"_content_type_uid"=> '1234'
|
135
|
-
},
|
136
|
-
{
|
137
|
-
"uid"=> 'asset_uid_3',
|
138
|
-
"_content_type_uid"=> 'sys_assets'
|
139
|
-
}
|
140
|
-
]
|
141
|
-
},
|
142
|
-
}
|
143
|
-
]
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
1
|
+
|
2
|
+
PlainTextHtml = "<strong>Aliquam sit amet libero dapibus, eleifend ligula at, varius justo</strong><strong><em>Lorem ipsum</em></strong><strong><em><u>dolor sit amet</u></em></strong><strong><em><u><strike>consectetur adipiscing elit.</strike></u></em></strong><strong><em><u><span>Sed condimentum iaculis magna in vehicula. </span></u></em></strong><strong><em><u><sup>Vestibulum vitae convallis </sup></u></em></strong><strong><em><u><sub> lacus. </sub></u></em></strong>"
|
3
|
+
ParagraphHtml = "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum iaculis magna in vehicula. Vestibulum vitae convallis lacus. Praesent a diam iaculis turpis rhoncus faucibus. Aliquam sed pulvinar sem.</p>"
|
4
|
+
H1Html = "<h1><strong><em><u><sub>Lorem ipsum dolor sit amet.</sub></u></em></strong></h1>"
|
5
|
+
H2Html = "<h2><strong><em><u><sub>Vestibulum a ligula eget massa sagittis aliquam sit amet quis tortor. </sub></u></em></strong></h2>"
|
6
|
+
H3Html = "<h3><strong><em><u><sub>Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.</sub></u></em></strong></h3>"
|
7
|
+
H4Html = "<h4><strong><em><u><sub>MaNullam feugiat turpis quis elit interdum, vitae laoreet quam viverra</sub></u></em></strong></h4>"
|
8
|
+
H5Html = "<h5>Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.</h5>"
|
9
|
+
H6Html = "<h6>Nunc porta diam vitae purus semper, ut consequat lorem vehicula.</h6>"
|
10
|
+
OrderListHtml = "<ol><li>Morbi in quam molestie, fermentum diam vitae, bibendum ipsum.</li><li>Pellentesque mattis lacus in quam aliquam congue</li><li>Integer feugiat leo dignissim, lobortis enim vitae, mollis lectus.</li><li>Sed in ante lacinia, molestie metus eu, fringilla sapien.</li></ol>"
|
11
|
+
UnorderListHtml = "<ul><li>Sed quis metus sed mi hendrerit mollis vel et odio.</li><li>Integer vitae sem dignissim, elementum libero vel, fringilla massa.</li><li>Integer imperdiet arcu sit amet tortor faucibus aliquet.</li><li>Aenean scelerisque velit vitae dui vehicula, at congue massa sagittis.</li></ul>"
|
12
|
+
ImgHtml = "<img src='https://images.contentstack.com/v3/Donald.jog.png' />"
|
13
|
+
TableHtml = "<table><thead><tr><th><p>Header 1</p></th><th><p>Header 2</p></th></tr></thead><tbody><tr><td><p>Body row 1 data 1</p></td><td><p>Body row 1 data 2</p></td></tr><tr><td><p>Body row 2 data 1</p></td><td><p>Body row 2 data 2</p></td></tr></tbody></table>"
|
14
|
+
BlockquoteHtml = "<blockquote>Praesent eu ex sed nibh venenatis pretium.</blockquote>"
|
15
|
+
CodeHtml = "<code>Code template.</code>"
|
16
|
+
LinkInPHtml = "<p><strong><em><u><sub></sub></u></em></strong><a href='LINK.com'>LINK</a></p>"
|
17
|
+
EmbedHtml = "<iframe src='https://www.youtube.com/watch?v=AOP0yARiW8U'></iframe>"
|
18
|
+
AssetReferenceHtml = "<img src='/v3/dummy.pdf' alt='dummy.pdf' />"
|
19
|
+
EntryReferenceBlockHtml = "<div><p>Update this title</p><p>Content type: <span>content_block</span></p></div>"
|
20
|
+
EntryReferenceLinkHtml = "<a href='/copy-of-entry-final-02'>/copy-of-entry-final-02</a>"
|
21
|
+
EntryReferenceInlineHtml = "<span>updated title</span>"
|
22
|
+
|
23
|
+
BlankDocument = '{ "uid":"06e34a7a4e5d7fc2acd", "_version":13, "attrs":{ }, "children":[],"type":"doc"}'
|
24
|
+
PlainTextJson = '{ "uid":"06e34a7a4e5d7fc2acd", "_version":13, "attrs":{ }, "children":[{"text":"Aliquam sit amet libero dapibus, eleifend ligula at, varius justo","bold":true},{ "text":"Lorem ipsum","bold":true,"italic":true},{ "text":"dolor sit amet","bold":true,"italic":true,"underline":true},{ "text":"consectetur adipiscing elit.","bold":true,"italic":true,"underline":true,"strikethrough":true},{ "text":"Sed condimentum iaculis magna in vehicula. ","bold":true,"italic":true,"underline":true,"inlineCode":true},{ "text":"Vestibulum vitae convallis ","bold":true,"italic":true,"underline":true,"superscript":true},{ "text":" lacus. ","bold":true,"italic":true,"underline":true,"subscript":true}],"type":"doc"}'
|
25
|
+
H1Json = '{ "uid":"06e34a7a449d7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h1","attrs":{ },"uid":"c2dfed70 4d7030c65e2e1","children":[{ "text":"Lorem ipsum dolor sit amet.","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
26
|
+
H2Json = '{ "uid":"06e34a7a4e2acd","_version":13,"attrs":{ },"children":[{ "type":"h2","attrs":{ },"uid":"c2dfed9a7030c65e2e1","children":[{ "text":"Vestibulum a ligula eget massa sagittis aliquam sit amet quis tortor. ","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
27
|
+
H3Json = '{ "uid":"06e34ad7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h3","attrs":{ },"uid":"c2df42cfb70 4d7030c65e2e1","children":[{ "text":"Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
28
|
+
H4Json = '{ "uid":"06e34a7a4e54cd", "_version":13, "attrs":{ "style":{ "text-align":"center" }, "redactor-attributes":{ } }, "children":[{"type":"h4","attrs":{},"uid":"c2dfed4d7030c65e2e1","children":[{"text":"MaNullam feugiat turpis quis elit interdum, vitae laoreet quam viverra","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
|
29
|
+
H5Json = '{ "uid": "06e381190849dacd", "_version": 13, "attrs": { }, "children": [ { "type": "h5", "attrs": {}, "uid": "c2d672242cfb7045e2e1", "children": [ { "text": "Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum." } ] } ], "type": "doc" }'
|
30
|
+
H6Json = '{ "uid": "06e34a71190849d7fcd", "_version": 13, "attrs": { }, "children": [ { "type": "h6", "attrs": {}, "uid": "c2dfa672242cfb7e2e1", "children": [ { "text": "Nunc porta diam vitae purus semper, ut consequat lorem vehicula." } ] } ], "type": "doc" }'
|
31
|
+
OrderListJson = '{ "uid":"06e35 48119084 9d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"2b5b4acbb3cfce02d3e","type":"ol","children":[{"type":"li","attrs":{"style":{"text-align":"justify"},"redactor-attributes":{ }},"uid":"160bbd7430b98bd3d996","children":[{"text":"Morbi in quam molestie, fermentum diam vitae, bibendum ipsum."}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"a15f4d749bc2903d","children":[{ "text":"Pellentesque mattis lacus in quam aliquam congue"}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"e54224bbcb6f9e8f1e43","children":[{ "text":"Integer feugiat leo dignissim, lobortis enim vitae, mollis lectus."}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"c0148bab9af758784","children":[{ "text":"Sed in ante lacinia, molestie metus eu, fringilla sapien."}]}],"id":"7f413d448a","attrs":{ }}],"type":"doc"}'
|
32
|
+
UnorderListJson = '{ "uid":"0e5481190849a", "_version":13, "attrs":{ }, "children":[{"uid":"a3a2b443ebffc867b","type":"ul","children":[{"uid":"f67354d4eed64451922","type":"li","children":[{"text":"Sed quis metus sed mi hendrerit mollis vel et odio."}],"attrs":{ }},{ "uid":"5 50cba5 bea92f23e36fd1","type":"li","children":[{ "text":"Integer vitae sem dignissim, elementum libero vel, fringilla massa."}],"attrs":{ } },{ "uid":"0e5c9b4cd983e8fd543","type":"li","children":[{ "text":"Integer imperdiet arcu sit amet tortor faucibus aliquet."}],"attrs":{ } },{ "uid":"6d9a43a3816bd83a9a","type":"li","children":[{ "text":"Aenean scelerisque velit vitae dui vehicula, at congue massa sagittis."}],"attrs":{ } }],"id":"b083fa46ef899420ab19","attrs":{ }}],"type":"doc"}'
|
33
|
+
ImgJson = '{ "uid":"06e34a7a4849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"f3be74be3b64646e626","type":"img","attrs":{"src":"https://images.contentstack.com/v3/Donald.jog.png","width":33.69418132611637,"height":"auto","redactor-attributes":{"asset_uid":"47f1aa5ae422cd1"}},"children":[{"text":""}]}],"type":"doc"}'
|
34
|
+
ImgJsonURL = '{ "uid":"06e34a7a4849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"f3be74be3b64646e626","type":"img","attrs":{"url":"https://images.contentstack.com/v3/Donald.jog.png","width":33.69418132611637,"height":"auto","redactor-attributes":{"asset_uid":"47f1aa5ae422cd1"}},"children":[{"text":""}]}],"type":"doc"}'
|
35
|
+
ParagraphJson = '{ "uid":"0d7fd", "_version":13, "attrs":{ }, "children":[{"type":"p","attrs":{},"uid":"0a1b5676aa510e5a","children":[{"text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum iaculis magna in vehicula. Vestibulum vitae convallis lacus. Praesent a diam iaculis turpis rhoncus faucibus. Aliquam sed pulvinar sem."}]}],"type":"doc"}'
|
36
|
+
BlockquoteJson = '{ "uid":"06084d7fd", "_version":13, "attrs":{ }, "children":[{"uid":"503f9cc97534db55","type":"blockquote","id":"431f78e567161460","children":[{"text":"Praesent eu ex sed nibh venenatis pretium."}],"attrs":{ }}],"type":"doc"}'
|
37
|
+
CodeJson = '{ "uid":"06ea490849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"83fba92c91b30002b","type":"code","attrs":{},"children":[{"text":"Code template."}]}],"type":"doc"}'
|
38
|
+
TableJson = '{ "uid": "06e481190849d7fcd", "_version": 13, "attrs": { }, "children": [ { "uid": "6dd64343bf634bfadd4", "type": "table", "attrs": { "rows": 4, "cols": 2, "colWidths": [ 250, 250 ] }, "children": [ { "uid": "b9082", "type": "thead", "attrs": {}, "children": [ { "type": "tr", "attrs": {}, "children": [ { "type": "th", "attrs": {}, "children": [ { "type": "p", "attrs": {}, "children": [ { "text": "Header 1" } ], "uid": "daa3ef" } ], "uid": "4b3124414a3" }, { "type": "th", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Header 2" } ], "uid": "eae83c5797d" } ], "uid": "bca9b6f037a04fb485" } ], "uid": "b91ae7a48ef2e9da1" } ] }, { "type": "tbody", "attrs": { }, "children": [ { "type": "tr", "attrs": { }, "children": [ { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 1 data 1" } ], "uid": "ec674ccc5ce70b7cab" } ], "uid": "2a70bdeeb99a" }, { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 1 data 2" } ], "uid": "769a 3f9db34 ce8ec 10486d50" } ], "uid": "d6407 34a5c6 1ab1e5f7d1" } ], "uid": "77f6 b951c68 7f9eb397c5" }, { "type": "tr", "attrs": { }, "children": [ { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 2 data 1" } ], "uid": "a6bf 11bb48 630e87d721c0" } ], "uid": "3da39838b0feaf" }, { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 2 data 2" } ], "uid": "3b7d12 1f694202 49029e86313" } ], "uid": "95b38b04abcbc25e94f" } ], "uid": "b 227fea 8d247013 4f1e1e8" } ], "uid": "fd5ab86aa642798451b" } ] } ], "type": "doc" }'
|
39
|
+
LinkInPJson = '{ "uid":"06e34a7190849d7f2acd", "_version":13, "attrs":{ }, "children":[{"type":"p","attrs":{"style":{"text-align":"left"},"redactor-attributes":{ }},"uid":"d88dcdf4590dff2d","children":[{"text":"","bold":true,"italic":true,"underline":true,"subscript":true},{ "uid":"0d06598201aa8b47","type":"a","attrs":{ "href":"LINK.com","target":"_self"},"children":[{ "text":"LINK"}]},{ "text":""}]}],"type":"doc"}'
|
40
|
+
EmbedJson = '{ "uid":"06e34a7190849d7f2acd", "_version":13, "attrs":{ }, "children":[{"uid":"251017315905c35d42c9","type":"embed","attrs":{"src":"https://www.youtube.com/watch?v=AOP0yARiW8U"},"children":[{"text":""}]}],"type":"doc"}'
|
41
|
+
AssetReferenceJson = '{"uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{}, "children":[{ "uid": "4f7e33 3390a955 de10c1 c836", "type":"reference","attrs":{"display-type":"display","asset-uid":"asset_uid_1","content-type-uid":"sys_assets","asset-link":"https://images.contentstack.com/v3/11.jpg","asset-name":"11.jpg","asset-type":"image/jpeg","type":"asset","class-name":"embedded-asset","width":25.16914749661705,"className":"dsd","id":"sdf"},"children":[{"text":""}]}],"type":"doc"}'
|
42
|
+
EntryReferenceBlockJson = '{ "uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{ }, "children":[{"uid":"70f9b 325075d43 128c0d0 aa3eb7f291f","type":"reference","attrs":{"display-type":"block","entry-uid":"entry_uid_1","content-type-uid":"content_block","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
|
43
|
+
EntryReferenceLinkJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"7626ea98e0e95d602210","type":"reference","attrs":{"target":"_self","href":"/copy-of-entry-final-02","display-type":"link","entry-uid":"entry_uid_2","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":"/copy-of-entry-final-02"}]}],"type":"doc"}'
|
44
|
+
EntryReferenceInlineJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"506 4878f3f46 s21f0cbc aff","type":"reference","attrs":{"display-type":"inline","entry-uid":"entry_uid_3","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
|
45
|
+
HRJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"f5a7b57 40a8a5c3 576828276b","type":"hr","children":[{"text":""}],"attrs":{ }}],"type":"doc"}'
|
46
|
+
H1NonChildJson = '{ "uid":"06e34a7a449d7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h1","attrs":{ },"uid":"c2dfed70 4d7030c65e2e1"}],"type":"doc"}'
|
47
|
+
|
48
|
+
JSON_EMBEDDED_ITEMS_ENTRY= {
|
49
|
+
"title"=> 'one',
|
50
|
+
"url"=> '/one',
|
51
|
+
"locale"=> 'en-us',
|
52
|
+
"uid"=> 'entry_uid_4',
|
53
|
+
"created_by"=> 'created_at_date',
|
54
|
+
"updated_by"=> 'created_at_date',
|
55
|
+
"created_at"=> '2020-08-13T06:18:18.989Z',
|
56
|
+
"updated_at"=> '2020-08-31T06:06:31.258Z',
|
57
|
+
"markdown"=> '',
|
58
|
+
"_embedded_items"=> {
|
59
|
+
"rich_text_editor"=> [
|
60
|
+
{
|
61
|
+
"_content_type_uid"=> 'sys_assets',
|
62
|
+
"uid"=> 'asset_uid_1',
|
63
|
+
"created_at"=> '2020-08-19T09:13:32.785Z',
|
64
|
+
"updated_at"=> '2020-08-19T09:13:32.785Z',
|
65
|
+
"created_by"=> 'created_at_date',
|
66
|
+
"updated_by"=> 'created_at_date',
|
67
|
+
"content_type"=> 'application/pdf',
|
68
|
+
"file_size"=> '13264',
|
69
|
+
"filename"=> 'dummy.pdf',
|
70
|
+
"url"=> '/v3/dummy.pdf',
|
71
|
+
"_version"=> 1,
|
72
|
+
"title"=> 'dummy.pdf'
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"title"=> 'Update this title',
|
76
|
+
"url"=> '',
|
77
|
+
"locale"=> 'en-us',
|
78
|
+
"uid"=> 'entry_uid_1',
|
79
|
+
"_content_type_uid"=> 'content_block',
|
80
|
+
"_version"=> 5,
|
81
|
+
"_in_progress"=> false,
|
82
|
+
"multi_line"=> '',
|
83
|
+
"_embedded_items"=> {
|
84
|
+
"rich_text_editor"=> [
|
85
|
+
{
|
86
|
+
"uid"=> 'entry_uid_1',
|
87
|
+
"_content_type_uid"=> 'content_block'
|
88
|
+
}
|
89
|
+
]
|
90
|
+
},
|
91
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"title"=> 'updated title',
|
95
|
+
"rich_text_editor"=> [
|
96
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
97
|
+
],
|
98
|
+
"locale"=> 'en-us',
|
99
|
+
"uid"=> 'entry_uid_3',
|
100
|
+
"_content_type_uid"=> 'embeddedrte',
|
101
|
+
"_in_progress"=> false,
|
102
|
+
"_embedded_items"=> {
|
103
|
+
"rich_text_editor"=>[
|
104
|
+
{
|
105
|
+
"_content_type_uid"=> 'sys_assets',
|
106
|
+
"uid"=> 'asset_uid_2',
|
107
|
+
"content_type"=> 'image/png',
|
108
|
+
"file_size"=> '36743',
|
109
|
+
"filename"=> 'svg-logo-text.png',
|
110
|
+
"url"=> '/v3/svg-logo-text.png',
|
111
|
+
"title"=> 'svg-logo-text.png',
|
112
|
+
"description"=> ''
|
113
|
+
}
|
114
|
+
]
|
115
|
+
}
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"title"=> 'Entry with embedded entry',
|
119
|
+
"rich_text_editor"=> [
|
120
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="inline" type="entry"></figure>\n<p><br><br></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
121
|
+
],
|
122
|
+
"locale"=> 'en-us',
|
123
|
+
"uid"=> 'entry_uid_2',
|
124
|
+
"_content_type_uid"=> 'embeddedrte',
|
125
|
+
"_in_progress"=> false,
|
126
|
+
"_embedded_items"=> {
|
127
|
+
"rich_text_editor"=>[
|
128
|
+
{
|
129
|
+
"uid"=> 'entry_uid_4',
|
130
|
+
"_content_type_uid"=> '1234'
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"uid"=> 'entry_uid_4',
|
134
|
+
"_content_type_uid"=> '1234'
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"uid"=> 'asset_uid_3',
|
138
|
+
"_content_type_uid"=> 'sys_assets'
|
139
|
+
}
|
140
|
+
]
|
141
|
+
},
|
142
|
+
}
|
143
|
+
]
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
147
|
EmbedEdges = '{"edges":[{"node":{"system":{"content_type_uid":"sys_assets","uid":"entry_uid_5"},"created_at":"2020-08-19T09:13:05.864Z","updated_at":"2020-09-10T09:35:28.393Z","created_by":"created_at_date","updated_by":"created_at_date","content_type":"image/png","file_size":"36743","filename":"svg-logo-text.png","url":"/v3/svg-logo-text.png","_version":7,"title":"svg-logo-text.png","description":""}},{"node":{"system":{"content_type_uid":"sys_assets","uid":"asset_uid_1"},"created_at":"2020-08-19T09:13:32.785Z","updated_at":"2020-08-19T09:13:32.785Z","created_by":"created_at_date","updated_by":"created_at_date","content_type":"application/pdf","file_size":"13264","filename":"title","url":"/v3/dummy.pdf","_version":1,"title":"dummy.pdf"}},{"node":{"title":"Update this title","url":"","locale":"en-us","system":{"uid":"entry_uid_1","content_type_uid":"content_block"},"_version":5,"_in_progress":false,"multi_line":"","rich_text_editor":""}},{"node":{"title":"updated title","rich_text_editor":[""],"locale":"en-us","system":{"uid":"entry_uid_3","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"title":"Entry with embedded entry","rich_text_editor":[""],"locale":"en-us","system":{"uid":"entry_uid_2","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"system":{"uid":"entry_uid_6","content_type_uid":"sys_assets"},"content_type":"image/png","file_size":"36743","filename":"svg-logo-text.png","url":"/v3/svg-logo-text.png","title":"svg-logo-text.png","description":""}},{"node":{"title":"Update this title","url":"","locale":"en-us","system":{"uid":"entry_uid_1","content_type_uid":"content_block"},"_version":5,"_in_progress":false,"multi_line":"","rich_text_editor":""}},{"node":{"title":"updated title","rich_text_editor":[""],"locale":"en-us","system":{"uid":"entry_uid_3","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"title":"Entry with embedded entry","rich_text_editor":[""],"locale":"en-us","system":{"uid":"entry_uid_2","content_type_uid":"embeddedrte"},"_in_progress":false}}]}'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
require 'simplecov'
|
2
|
-
SimpleCov.add_filter ["spec/", "lib/contentstack_utils/support"]
|
3
|
-
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
|
7
|
-
|
8
|
-
Dir[File.dirname(__FILE__) + '/
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.add_filter ["spec/", "lib/contentstack_utils/support"]
|
3
|
+
SimpleCov.start
|
4
|
+
require 'nokogiri'
|
5
|
+
require 'rspec'
|
6
|
+
require 'contentstack_utils'
|
7
|
+
require_relative './mock/custom_render_option'
|
8
|
+
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }
|
9
|
+
Dir[File.dirname(__FILE__) + '/mock/**/*.rb'].each { |f| require f }
|