wcc-contentful-app 0.4.0.pre.alpha → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rspec +2 -2
- data/README.md +11 -0
- data/Rakefile +125 -0
- data/app/assets/config/manifest.js +5 -0
- data/app/assets/images/down-arrow-primary.svg +3 -0
- data/app/assets/images/up-arrow-primary.svg +3 -0
- data/app/assets/javascripts/wcc/contentful/app/contact-form.js +70 -0
- data/app/assets/javascripts/wcc/contentful/app/index.js +1 -0
- data/app/assets/stylesheets/_wcc-contentful-app.scss +7 -0
- data/app/assets/stylesheets/components/_menu-item.scss +5 -0
- data/app/assets/stylesheets/sections/_faq.scss +39 -0
- data/app/controllers/wcc/contentful/app/contact_form_controller.rb +39 -0
- data/app/controllers/wcc/contentful/app/pages_controller.rb +48 -0
- data/app/helpers/wcc/contentful/app/menu_helper.rb +85 -0
- data/app/helpers/wcc/contentful/app/section_helper.rb +135 -0
- data/app/mailers/wcc/contentful/app/contact_mailer.rb +11 -0
- data/app/models/concerns/wcc/contentful/app/preview_password.rb +19 -0
- data/app/models/wcc/contentful/app/contact_form_submission.rb +9 -0
- data/app/models/wcc/contentful/app/custom_markdown_render.rb +43 -0
- data/app/views/components/_faq_row.html.erb +21 -0
- data/app/views/components/_menu-item.html.erb +41 -0
- data/app/views/components/_other-menu-item.html.erb +4 -0
- data/app/views/components/_section.html.erb +11 -0
- data/app/views/layouts/mailer.html.erb +9 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/pages/show.html.erb +4 -0
- data/app/views/sections/_block_text.html.erb +5 -0
- data/app/views/sections/_code_widget.html.erb +3 -0
- data/app/views/sections/_contact_form.html.erb +53 -0
- data/app/views/sections/_faq.html.erb +36 -0
- data/app/views/sections/_http_error.html.erb +13 -0
- data/app/views/sections/_marquee_text.html.erb +12 -0
- data/app/views/sections/_testimonials.html.erb +38 -0
- data/app/views/sections/_video.html.erb +12 -0
- data/app/views/sections/_video_highlight.html.erb +18 -0
- data/app/views/wcc/contentful/app/contact_mailer/contact_form_email.html.erb +7 -0
- data/bin/rails +14 -0
- data/config/routes.rb +7 -0
- data/doc +1 -0
- data/lib/generators/wcc/model_generator.rb +16 -6
- data/lib/generators/wcc/templates/menu/migrations/generated_add_menus.ts +285 -0
- data/lib/generators/wcc/templates/menu/models/dropdown_menu.rb +19 -0
- data/lib/generators/wcc/templates/menu/models/menu.rb +0 -4
- data/lib/generators/wcc/templates/menu/models/menu_button.rb +0 -4
- data/lib/generators/wcc/templates/page/migrations/generated_add_pages.ts +147 -0
- data/lib/generators/wcc/templates/page/models/page.rb +0 -4
- data/lib/generators/wcc/templates/page/models/redirect.rb +19 -0
- data/lib/generators/wcc/templates/section-block-text/migrations/generated_add_section-block-texts.ts +40 -0
- data/lib/generators/wcc/templates/section-block-text/models/section_block_text.rb +19 -0
- data/lib/generators/wcc/templates/section-code-widget/migrations/generated_add_section-code-widget.ts +90 -0
- data/lib/generators/wcc/templates/section-code-widget/models/section_code_widget.rb +23 -0
- data/lib/generators/wcc/templates/section-contact-form/migrations/create_wcc_contentful_app_contact_form_submissions.rb +12 -0
- data/lib/generators/wcc/templates/section-contact-form/migrations/generated_add_section-contact-forms.ts +147 -0
- data/lib/generators/wcc/templates/section-contact-form/models/form_field.rb +19 -0
- data/lib/generators/wcc/templates/section-contact-form/models/section_contact_form.rb +19 -0
- data/lib/generators/wcc/templates/section-faq/migrations/generated_add_section-faqs.ts +148 -0
- data/lib/generators/wcc/templates/section-faq/models/section_faq.rb +19 -0
- data/lib/generators/wcc/templates/section-http-error/migrations/generated_add_section-http-errors.ts +87 -0
- data/lib/generators/wcc/templates/section-http-error/models/section_http_error.rb +19 -0
- data/lib/generators/wcc/templates/section-marquee-text/migrations/generated_add_section-marquee-texts.ts +64 -0
- data/lib/generators/wcc/templates/section-marquee-text/models/section_marquee_text.rb +19 -0
- data/lib/generators/wcc/templates/section-testimonial/migrations/generated_add_section-testimonials.ts +182 -0
- data/lib/generators/wcc/templates/section-testimonial/models/section_testimonial.rb +19 -0
- data/lib/generators/wcc/templates/section-video-highlight/migrations/generated_add_section-video-highlights.ts +80 -0
- data/lib/generators/wcc/templates/section-video-highlight/models/section_video_highlight.rb +19 -0
- data/lib/generators/wcc/templates/section-video/migrations/generated_add_section-videos.ts +77 -0
- data/lib/generators/wcc/templates/section-video/models/section_video.rb +19 -0
- data/lib/generators/wcc/templates/site-config/migrations/generated_add_site-configs.ts +97 -0
- data/lib/generators/wcc/templates/site-config/models/site_config.rb +19 -0
- data/lib/generators/wcc/templates/wcc_contentful.rb +1 -1
- data/lib/wcc/contentful/app.rb +46 -3
- data/lib/wcc/contentful/app/configuration.rb +60 -0
- data/lib/wcc/contentful/app/engine.rb +15 -0
- data/lib/wcc/contentful/app/exceptions.rb +9 -0
- data/lib/wcc/contentful/app/rails.rb +6 -0
- data/lib/wcc/contentful/app/version.rb +1 -1
- data/lib/wcc/contentful/model/dropdown_menu.rb +0 -3
- data/lib/wcc/contentful/model/form_field.rb +4 -0
- data/lib/wcc/contentful/model/menu.rb +0 -2
- data/lib/wcc/contentful/model/menu_button.rb +18 -5
- data/lib/wcc/contentful/model/page.rb +0 -4
- data/lib/wcc/contentful/model/redirect.rb +21 -11
- data/lib/wcc/contentful/model/section_contact_form.rb +42 -0
- data/lib/wcc/contentful/model/site_config.rb +7 -0
- data/wcc-contentful-app.gemspec +23 -15
- metadata +169 -106
- data/Gemfile +0 -8
- data/lib/generators/wcc/templates/menu/generated_add_menus.ts +0 -192
- data/lib/generators/wcc/templates/page/generated_add_pages.ts +0 -50
- data/lib/tasks/validate.rake +0 -20
- data/lib/wcc/contentful/app/model_validators.rb +0 -121
- data/lib/wcc/contentful/app/model_validators/dsl.rb +0 -166
- data/lib/wcc/contentful/ext/model.rb +0 -5
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This model represents the 'formField' content type in Contentful. Any linked
|
4
|
+
# entries of the 'formField' content type will be resolved as instances of this class.
|
5
|
+
# It exposes #find, #find_by, and #find_all methods to query Contentful.
|
6
|
+
class FormField < WCC::Contentful::Model::FormField
|
7
|
+
# Override functionality or add utilities
|
8
|
+
#
|
9
|
+
# # Example: override equality
|
10
|
+
# def ===(other)
|
11
|
+
# ...
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# # Example: override "name" attribute to always be camelized.
|
15
|
+
# # `@name` is populated by the gem in the initializer.
|
16
|
+
# def name
|
17
|
+
# @name_camelized ||= @name.camelize(true)
|
18
|
+
# end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This model represents the 'section-contact-form' content type in Contentful. Any linked
|
4
|
+
# entries of the 'section-contact-form' content type will be resolved as instances of this class.
|
5
|
+
# It exposes .find, .find_by, and .find_all methods to query Contentful.
|
6
|
+
class SectionContactForm < WCC::Contentful::Model::SectionContactForm
|
7
|
+
# Override functionality or add utilities
|
8
|
+
#
|
9
|
+
# # Example: override equality
|
10
|
+
# def ===(other)
|
11
|
+
# ...
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# # Example: override "title" attribute to always be titlecase.
|
15
|
+
# # `@title` is populated by the gem in the initializer.
|
16
|
+
# def title
|
17
|
+
# @title_titlecased ||= @title.titlecase
|
18
|
+
# end
|
19
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
import Migration, { MigrationFunction } from '@watermarkchurch/contentful-migration'
|
2
|
+
|
3
|
+
// Generated by contentful-schema-diff
|
4
|
+
// from empty-export.json
|
5
|
+
// to 4gyidsb2jx1u
|
6
|
+
export = function(migration : Migration, { makeRequest, spaceId, accessToken }) {
|
7
|
+
|
8
|
+
/************ faq ******************/
|
9
|
+
|
10
|
+
var faq = migration.createContentType('faq', {
|
11
|
+
displayField: 'internalTitle',
|
12
|
+
name: 'FAQ',
|
13
|
+
description: ''
|
14
|
+
})
|
15
|
+
|
16
|
+
faq.createField('internalTitle', {
|
17
|
+
name: 'Internal Title (Contentful Only)',
|
18
|
+
type: 'Symbol',
|
19
|
+
localized: false,
|
20
|
+
required: true,
|
21
|
+
validations: [],
|
22
|
+
disabled: false,
|
23
|
+
omitted: true,
|
24
|
+
})
|
25
|
+
|
26
|
+
faq.createField('questions', {
|
27
|
+
name: 'Questions',
|
28
|
+
type: 'Text',
|
29
|
+
localized: false,
|
30
|
+
required: false,
|
31
|
+
validations: [],
|
32
|
+
disabled: false,
|
33
|
+
omitted: false
|
34
|
+
})
|
35
|
+
|
36
|
+
faq.createField('answers', {
|
37
|
+
name: 'Answers',
|
38
|
+
type: 'Text',
|
39
|
+
localized: false,
|
40
|
+
required: false,
|
41
|
+
validations: [],
|
42
|
+
disabled: false,
|
43
|
+
omitted: false
|
44
|
+
})
|
45
|
+
|
46
|
+
faq.changeEditorInterface('questions', 'multipleLine')
|
47
|
+
|
48
|
+
faq.changeEditorInterface('answers', 'markdown')
|
49
|
+
|
50
|
+
/************ section-faq ******************/
|
51
|
+
|
52
|
+
var sectionFaq = migration.createContentType('section-faq', {
|
53
|
+
displayField: 'internalTitle',
|
54
|
+
name: 'Section: FAQ',
|
55
|
+
description: '(v2) A section containing a number of expandable frequently asked questions'
|
56
|
+
})
|
57
|
+
|
58
|
+
sectionFaq.createField('internalTitle', {
|
59
|
+
name: 'Internal Title (Contentful Only)',
|
60
|
+
type: 'Symbol',
|
61
|
+
localized: false,
|
62
|
+
required: true,
|
63
|
+
validations: [],
|
64
|
+
disabled: false,
|
65
|
+
omitted: true
|
66
|
+
})
|
67
|
+
|
68
|
+
sectionFaq.createField('title', {
|
69
|
+
name: 'Title',
|
70
|
+
type: 'Symbol',
|
71
|
+
localized: false,
|
72
|
+
required: false,
|
73
|
+
validations: [],
|
74
|
+
disabled: false,
|
75
|
+
omitted: false
|
76
|
+
})
|
77
|
+
|
78
|
+
sectionFaq.createField('bookmarkTitle', {
|
79
|
+
name: 'Bookmark Title',
|
80
|
+
type: 'Symbol',
|
81
|
+
localized: false,
|
82
|
+
required: false,
|
83
|
+
validations: [],
|
84
|
+
disabled: false,
|
85
|
+
omitted: false
|
86
|
+
})
|
87
|
+
|
88
|
+
sectionFaq.createField('numberOfFaqsBeforeFold', {
|
89
|
+
name: 'Number of Faqs Before Fold',
|
90
|
+
type: 'Integer',
|
91
|
+
localized: false,
|
92
|
+
required: false,
|
93
|
+
validations: [{ range: { min: 1, max: Infinity } }],
|
94
|
+
disabled: false,
|
95
|
+
omitted: false
|
96
|
+
})
|
97
|
+
|
98
|
+
sectionFaq.createField('faqs', {
|
99
|
+
name: 'FAQs',
|
100
|
+
type: 'Array',
|
101
|
+
localized: false,
|
102
|
+
required: true,
|
103
|
+
validations: [],
|
104
|
+
disabled: false,
|
105
|
+
omitted: false,
|
106
|
+
items:
|
107
|
+
{
|
108
|
+
type: 'Link',
|
109
|
+
validations: [{ linkContentType: ['faq'] }],
|
110
|
+
linkType: 'Entry'
|
111
|
+
}
|
112
|
+
})
|
113
|
+
|
114
|
+
sectionFaq.createField('foldButtonShowText', {
|
115
|
+
name: 'Fold Button Show More Text',
|
116
|
+
type: 'Symbol',
|
117
|
+
localized: false,
|
118
|
+
required: false,
|
119
|
+
validations: [],
|
120
|
+
disabled: false,
|
121
|
+
omitted: false
|
122
|
+
})
|
123
|
+
|
124
|
+
sectionFaq.createField('foldButtonHideText', {
|
125
|
+
name: 'Fold Button Show Less Text',
|
126
|
+
type: 'Symbol',
|
127
|
+
localized: false,
|
128
|
+
required: false,
|
129
|
+
validations: [],
|
130
|
+
disabled: false,
|
131
|
+
omitted: false
|
132
|
+
})
|
133
|
+
|
134
|
+
sectionFaq.changeEditorInterface('internalTitle', 'singleLine')
|
135
|
+
|
136
|
+
sectionFaq.changeEditorInterface('title', 'singleLine')
|
137
|
+
|
138
|
+
sectionFaq.changeEditorInterface('bookmarkTitle', 'singleLine')
|
139
|
+
|
140
|
+
sectionFaq.changeEditorInterface('numberOfFaqsBeforeFold', 'numberEditor')
|
141
|
+
|
142
|
+
sectionFaq.changeEditorInterface('faqs', 'entryLinksEditor')
|
143
|
+
|
144
|
+
sectionFaq.changeEditorInterface('foldButtonShowText', 'singleLine')
|
145
|
+
|
146
|
+
sectionFaq.changeEditorInterface('foldButtonHideText', 'singleLine')
|
147
|
+
|
148
|
+
} as MigrationFunction
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This model represents the 'section-faq' content type in Contentful. Any linked
|
4
|
+
# entries of the 'section-faq' content type will be resolved as instances of this class.
|
5
|
+
# It exposes .find, .find_by, and .find_all methods to query Contentful.
|
6
|
+
class SectionFaq < WCC::Contentful::Model::SectionFaq
|
7
|
+
# Override functionality or add utilities
|
8
|
+
#
|
9
|
+
# # Example: override equality
|
10
|
+
# def ===(other)
|
11
|
+
# ...
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# # Example: override "title" attribute to always be titlecase.
|
15
|
+
# # `@title` is populated by the gem in the initializer.
|
16
|
+
# def title
|
17
|
+
# @title_titlecased ||= @title.titlecase
|
18
|
+
# end
|
19
|
+
end
|
data/lib/generators/wcc/templates/section-http-error/migrations/generated_add_section-http-errors.ts
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
import Migration, { MigrationFunction } from '@watermarkchurch/contentful-migration'
|
2
|
+
|
3
|
+
// Generated by contentful-schema-diff
|
4
|
+
// from empty-export.json
|
5
|
+
// to 7yx6ovlj39n5
|
6
|
+
export = function(migration : Migration, { makeRequest, spaceId, accessToken }) {
|
7
|
+
|
8
|
+
/************ section-http-error ******************/
|
9
|
+
|
10
|
+
var sectionHttpError = migration.createContentType('section-http-error', {
|
11
|
+
displayField: 'internalTitle',
|
12
|
+
name: 'Section: Http Error',
|
13
|
+
description: ''
|
14
|
+
})
|
15
|
+
|
16
|
+
sectionHttpError.createField('internalTitle', {
|
17
|
+
name: 'Internal Title (Contentful Only)',
|
18
|
+
type: 'Symbol',
|
19
|
+
localized: false,
|
20
|
+
required: true,
|
21
|
+
validations: [],
|
22
|
+
disabled: false,
|
23
|
+
omitted: true
|
24
|
+
})
|
25
|
+
|
26
|
+
sectionHttpError.createField('errorCode', {
|
27
|
+
name: 'Error Code',
|
28
|
+
type: 'Integer',
|
29
|
+
localized: false,
|
30
|
+
required: true,
|
31
|
+
validations: [],
|
32
|
+
disabled: false,
|
33
|
+
omitted: false
|
34
|
+
})
|
35
|
+
|
36
|
+
sectionHttpError.createField('text', {
|
37
|
+
name: 'Text',
|
38
|
+
type: 'Text',
|
39
|
+
localized: false,
|
40
|
+
required: true,
|
41
|
+
validations: [],
|
42
|
+
disabled: false,
|
43
|
+
omitted: false
|
44
|
+
})
|
45
|
+
|
46
|
+
sectionHttpError.createField('actionButton', {
|
47
|
+
name: 'Action Button',
|
48
|
+
type: 'Array',
|
49
|
+
localized: false,
|
50
|
+
required: false,
|
51
|
+
validations: [],
|
52
|
+
disabled: false,
|
53
|
+
omitted: false,
|
54
|
+
items:
|
55
|
+
{
|
56
|
+
type: 'Link',
|
57
|
+
validations: [{ linkContentType: ['menuButton'] }],
|
58
|
+
linkType: 'Entry'
|
59
|
+
}
|
60
|
+
})
|
61
|
+
|
62
|
+
sectionHttpError.createField('backgroundImage', {
|
63
|
+
name: 'Background Image',
|
64
|
+
type: 'Link',
|
65
|
+
localized: false,
|
66
|
+
required: true,
|
67
|
+
validations:
|
68
|
+
[{
|
69
|
+
linkMimetypeGroup: ['image'],
|
70
|
+
message: 'Must be an image'
|
71
|
+
}],
|
72
|
+
disabled: false,
|
73
|
+
omitted: false,
|
74
|
+
linkType: 'Asset'
|
75
|
+
})
|
76
|
+
|
77
|
+
sectionHttpError.changeEditorInterface('internalTitle', 'singleLine')
|
78
|
+
|
79
|
+
sectionHttpError.changeEditorInterface('errorCode', 'numberEditor')
|
80
|
+
|
81
|
+
sectionHttpError.changeEditorInterface('text', 'markdown')
|
82
|
+
|
83
|
+
sectionHttpError.changeEditorInterface('actionButton', 'entryLinksEditor', { bulkEditing: false })
|
84
|
+
|
85
|
+
sectionHttpError.changeEditorInterface('backgroundImage', 'assetLinkEditor')
|
86
|
+
|
87
|
+
} as MigrationFunction
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This model represents the 'section-http-error' content type in Contentful. Any linked
|
4
|
+
# entries of the 'section-http-error' content type will be resolved as instances of this class.
|
5
|
+
# It exposes .find, .find_by, and .find_all methods to query Contentful.
|
6
|
+
class SectionHttpError < WCC::Contentful::Model::SectionHttpError
|
7
|
+
# Override functionality or add utilities
|
8
|
+
#
|
9
|
+
# # Example: override equality
|
10
|
+
# def ===(other)
|
11
|
+
# ...
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# # Example: override "title" attribute to always be titlecase.
|
15
|
+
# # `@title` is populated by the gem in the initializer.
|
16
|
+
# def title
|
17
|
+
# @title_titlecased ||= @title.titlecase
|
18
|
+
# end
|
19
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import Migration, { MigrationFunction } from '@watermarkchurch/contentful-migration'
|
2
|
+
|
3
|
+
// Generated by contentful-schema-diff
|
4
|
+
// from empty-export.json
|
5
|
+
// to 7yx6ovlj39n5
|
6
|
+
export = function(migration : Migration, { makeRequest, spaceId, accessToken }) {
|
7
|
+
|
8
|
+
/************ section-marquee-text ******************/
|
9
|
+
|
10
|
+
var sectionMarqueeText = migration.createContentType('section-marquee-text', {
|
11
|
+
displayField: 'internalTitle',
|
12
|
+
name: 'Section: Marquee Text',
|
13
|
+
description: 'Display a large section title and an enlarged single paragraph along with an optional tagline at the top.'
|
14
|
+
})
|
15
|
+
|
16
|
+
sectionMarqueeText.createField('internalTitle', {
|
17
|
+
name: 'Internal Title (Contentful Only)',
|
18
|
+
type: 'Symbol',
|
19
|
+
localized: false,
|
20
|
+
required: true,
|
21
|
+
validations: [],
|
22
|
+
disabled: false,
|
23
|
+
omitted: true
|
24
|
+
})
|
25
|
+
|
26
|
+
sectionMarqueeText.createField('tag', {
|
27
|
+
name: 'Tag',
|
28
|
+
type: 'Symbol',
|
29
|
+
localized: true,
|
30
|
+
required: false,
|
31
|
+
validations: [{ size: { min: 0, max: 50 } }],
|
32
|
+
disabled: false,
|
33
|
+
omitted: false
|
34
|
+
})
|
35
|
+
|
36
|
+
sectionMarqueeText.createField('title', {
|
37
|
+
name: 'Title',
|
38
|
+
type: 'Symbol',
|
39
|
+
localized: true,
|
40
|
+
required: true,
|
41
|
+
validations: [{ size: { min: 0, max: 150 } }],
|
42
|
+
disabled: false,
|
43
|
+
omitted: false
|
44
|
+
})
|
45
|
+
|
46
|
+
sectionMarqueeText.createField('body', {
|
47
|
+
name: 'Body',
|
48
|
+
type: 'Text',
|
49
|
+
localized: true,
|
50
|
+
required: false,
|
51
|
+
validations: [],
|
52
|
+
disabled: false,
|
53
|
+
omitted: false
|
54
|
+
})
|
55
|
+
|
56
|
+
sectionMarqueeText.changeEditorInterface('tag', 'singleLine')
|
57
|
+
|
58
|
+
sectionMarqueeText.changeEditorInterface('title', 'singleLine')
|
59
|
+
|
60
|
+
sectionMarqueeText.changeEditorInterface('body', 'multipleLine')
|
61
|
+
|
62
|
+
sectionMarqueeText.changeEditorInterface('internalTitle', 'singleLine')
|
63
|
+
|
64
|
+
} as MigrationFunction
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This model represents the 'section-marquee-text' content type in Contentful. Any linked
|
4
|
+
# entries of the 'section-marquee-text' content type will be resolved as instances of this class.
|
5
|
+
# It exposes .find, .find_by, and .find_all methods to query Contentful.
|
6
|
+
class SectionMarqueeText < WCC::Contentful::Model::SectionMarqueeText
|
7
|
+
# Override functionality or add utilities
|
8
|
+
#
|
9
|
+
# # Example: override equality
|
10
|
+
# def ===(other)
|
11
|
+
# ...
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# # Example: override "title" attribute to always be titlecase.
|
15
|
+
# # `@title` is populated by the gem in the initializer.
|
16
|
+
# def title
|
17
|
+
# @title_titlecased ||= @title.titlecase
|
18
|
+
# end
|
19
|
+
end
|
@@ -0,0 +1,182 @@
|
|
1
|
+
import Migration, { MigrationFunction } from '@watermarkchurch/contentful-migration'
|
2
|
+
|
3
|
+
// Generated by contentful-schema-diff
|
4
|
+
// from empty-export.json
|
5
|
+
// to 7yx6ovlj39n5
|
6
|
+
export = function(migration : Migration, { makeRequest, spaceId, accessToken }) {
|
7
|
+
|
8
|
+
/************ section-testimonials ******************/
|
9
|
+
|
10
|
+
var sectionTestimonials = migration.createContentType('section-testimonials', {
|
11
|
+
displayField: 'internalTitle',
|
12
|
+
name: 'Section: Testimonials',
|
13
|
+
description: 'A Testimonials section can show one or many Testimonials written by leaders, partners, or members who have participated in the Ministry or Conference.'
|
14
|
+
})
|
15
|
+
|
16
|
+
sectionTestimonials.createField('internalTitle', {
|
17
|
+
name: 'Internal Title (Contentful Only)',
|
18
|
+
type: 'Symbol',
|
19
|
+
localized: false,
|
20
|
+
required: true,
|
21
|
+
validations: [],
|
22
|
+
disabled: false,
|
23
|
+
omitted: true
|
24
|
+
})
|
25
|
+
|
26
|
+
sectionTestimonials.createField('bookmarkTitle', {
|
27
|
+
name: 'Bookmark Title',
|
28
|
+
type: 'Symbol',
|
29
|
+
localized: false,
|
30
|
+
required: true,
|
31
|
+
validations: [],
|
32
|
+
disabled: false,
|
33
|
+
omitted: false
|
34
|
+
})
|
35
|
+
|
36
|
+
sectionTestimonials.createField('testimonials', {
|
37
|
+
name: 'Testimonials',
|
38
|
+
type: 'Array',
|
39
|
+
localized: false,
|
40
|
+
required: true,
|
41
|
+
validations: [],
|
42
|
+
disabled: false,
|
43
|
+
omitted: false,
|
44
|
+
items:
|
45
|
+
{
|
46
|
+
type: 'Link',
|
47
|
+
validations: [{ linkContentType: ['testimonial'] }],
|
48
|
+
linkType: 'Entry'
|
49
|
+
}
|
50
|
+
})
|
51
|
+
|
52
|
+
sectionTestimonials.createField('style', {
|
53
|
+
name: 'Style',
|
54
|
+
type: 'Symbol',
|
55
|
+
localized: false,
|
56
|
+
required: false,
|
57
|
+
validations:
|
58
|
+
[{
|
59
|
+
in:
|
60
|
+
['default',
|
61
|
+
'jumbo']
|
62
|
+
}],
|
63
|
+
disabled: false,
|
64
|
+
omitted: false
|
65
|
+
})
|
66
|
+
|
67
|
+
sectionTestimonials.changeEditorInterface('bookmarkTitle', 'singleLine')
|
68
|
+
|
69
|
+
sectionTestimonials.changeEditorInterface('testimonials', 'entryLinksEditor')
|
70
|
+
|
71
|
+
sectionTestimonials.changeEditorInterface('style', 'dropdown')
|
72
|
+
|
73
|
+
sectionTestimonials.changeEditorInterface('internalTitle', 'singleLine')
|
74
|
+
|
75
|
+
/************ testimonial ******************/
|
76
|
+
|
77
|
+
var testimonial = migration.createContentType('testimonial', {
|
78
|
+
displayField: 'internalTitle',
|
79
|
+
name: 'Testimonial',
|
80
|
+
description: 'A Testimonial must be attached to a Testimonial Section to be displayed.'
|
81
|
+
})
|
82
|
+
|
83
|
+
testimonial.createField('internalTitle', {
|
84
|
+
name: 'Internal Title (Contentful Only)',
|
85
|
+
type: 'Symbol',
|
86
|
+
localized: false,
|
87
|
+
required: true,
|
88
|
+
validations: [],
|
89
|
+
disabled: false,
|
90
|
+
omitted: true
|
91
|
+
})
|
92
|
+
|
93
|
+
testimonial.createField('name', {
|
94
|
+
name: 'Name',
|
95
|
+
type: 'Symbol',
|
96
|
+
localized: false,
|
97
|
+
required: true,
|
98
|
+
validations: [],
|
99
|
+
disabled: false,
|
100
|
+
omitted: false
|
101
|
+
})
|
102
|
+
|
103
|
+
testimonial.createField('miniBio', {
|
104
|
+
name: 'Mini Bio',
|
105
|
+
type: 'Text',
|
106
|
+
localized: false,
|
107
|
+
required: false,
|
108
|
+
validations: [],
|
109
|
+
disabled: false,
|
110
|
+
omitted: false
|
111
|
+
})
|
112
|
+
|
113
|
+
testimonial.createField('photo', {
|
114
|
+
name: 'Photo',
|
115
|
+
type: 'Link',
|
116
|
+
localized: false,
|
117
|
+
required: false,
|
118
|
+
validations:
|
119
|
+
[{ linkMimetypeGroup: ['image'] },
|
120
|
+
{
|
121
|
+
assetImageDimensions:
|
122
|
+
{
|
123
|
+
width: { min: 480, max: Infinity },
|
124
|
+
height: { min: 480, max: Infinity }
|
125
|
+
},
|
126
|
+
message: 'Your image needs to be bigger! Lots of people have high resolution displays. Please submit an image at least 480 by 480 pixels.'
|
127
|
+
},
|
128
|
+
{
|
129
|
+
assetFileSize: { min: 0, max: 1048576 },
|
130
|
+
message: 'Your image needs to be compressed! Typically, large high quality images should be kept between 100 and 60 Kilobytes. Smaller images should be closer to 30 Kilobytes and lower. Think of the poor souls who only get 1GB/mo of 3G!'
|
131
|
+
}],
|
132
|
+
disabled: false,
|
133
|
+
omitted: false,
|
134
|
+
linkType: 'Asset'
|
135
|
+
})
|
136
|
+
|
137
|
+
testimonial.createField('quote', {
|
138
|
+
name: 'Quote',
|
139
|
+
type: 'Text',
|
140
|
+
localized: false,
|
141
|
+
required: true,
|
142
|
+
validations: [],
|
143
|
+
disabled: false,
|
144
|
+
omitted: false
|
145
|
+
})
|
146
|
+
|
147
|
+
testimonial.createField('linkedVideo', {
|
148
|
+
name: 'Linked Video',
|
149
|
+
type: 'Link',
|
150
|
+
localized: false,
|
151
|
+
required: false,
|
152
|
+
validations: [{ linkContentType: ['video'] }],
|
153
|
+
disabled: false,
|
154
|
+
omitted: false,
|
155
|
+
linkType: 'Entry'
|
156
|
+
})
|
157
|
+
|
158
|
+
testimonial.createField('linkText', {
|
159
|
+
name: 'Link Text',
|
160
|
+
type: 'Symbol',
|
161
|
+
localized: false,
|
162
|
+
required: false,
|
163
|
+
validations: [],
|
164
|
+
disabled: false,
|
165
|
+
omitted: false
|
166
|
+
})
|
167
|
+
|
168
|
+
testimonial.changeEditorInterface('internalTitle', 'singleLine')
|
169
|
+
|
170
|
+
testimonial.changeEditorInterface('name', 'singleLine')
|
171
|
+
|
172
|
+
testimonial.changeEditorInterface('miniBio', 'markdown')
|
173
|
+
|
174
|
+
testimonial.changeEditorInterface('photo', 'assetLinkEditor')
|
175
|
+
|
176
|
+
testimonial.changeEditorInterface('quote', 'multipleLine')
|
177
|
+
|
178
|
+
testimonial.changeEditorInterface('linkedVideo', 'entryLinkEditor')
|
179
|
+
|
180
|
+
testimonial.changeEditorInterface('linkText', 'singleLine')
|
181
|
+
|
182
|
+
} as MigrationFunction
|