Skip to content

Commit 18cd1d8

Browse files
jrockowitzjrockowitz
jrockowitz
authored andcommitted
Issue #2951001 by jrockowitz: Move Contribute module's message into the Webform module and remove the dependency
1 parent 87b00e3 commit 18cd1d8

35 files changed

+1711
-577
lines changed

Diff for: composer.json

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
"docs": "https://www.drupal.org/docs/8/modules/webform",
2424
"forum": "https://drupal.stackexchange.com/questions/tagged/webform"
2525
},
26-
"require": {
27-
"drupal/contribute": "^1.0"
28-
},
2926
"extra": {
3027
"drush": {
3128
"services": {

Diff for: config/install/webform.settings.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ ui:
244244
details_save: true
245245
dialog_disabled: false
246246
offcanvas_disabled: false
247-
about_disabled: false
247+
contribute_disabled: false
248248
promotions_disabled: false
249249
description_help: true
250250
libraries:
@@ -255,5 +255,8 @@ requirements:
255255
cdn: true
256256
bootstrap: true
257257
spam: true
258+
contribute:
259+
account_type: user
260+
account_id: null
258261
langcode: en
259262
third_party_settings: { }

Diff for: config/install/webform.webform_options.education.yml

-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ likert: false
1111
options: |
1212
High School: High School
1313
Associate Degree: Associate Degree
14-
Associate Degree: Associate Degree
1514
Graduate or Professional Degree: Graduate or Professional Degree
1615
Some College: Some College

Diff for: config/schema/webform.settings.schema.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ webform.settings:
389389
dialog_disabled:
390390
type: boolean
391391
label: 'Disable dialogs'
392-
about_disabled:
392+
contribute_disabled:
393393
type: boolean
394-
label: 'Disable about'
394+
label: 'Disable contribute'
395395
offcanvas_disabled:
396396
type: boolean
397397
label: 'Disable system tray'
@@ -427,6 +427,16 @@ webform.settings:
427427
spam:
428428
type: boolean
429429
label: 'Check if SPAM protection module is installed'
430+
contribute:
431+
type: mapping
432+
label: 'Contribute'
433+
mapping:
434+
account_type:
435+
type: string
436+
label: 'Account type'
437+
account_id:
438+
type: string
439+
label: 'Account ID'
430440
third_party_settings:
431441
type: sequence
432442
label: 'Third party settings'

Diff for: css/webform.about.css

-49
This file was deleted.

Diff for: css/webform.contribute.css

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/**
2+
* @file
3+
* Contribute styles.
4+
*/
5+
6+
/**
7+
* Content.
8+
*/
9+
.webform-contribute-content {
10+
max-width: 1000px;
11+
}
12+
13+
/**
14+
* Image.
15+
*/
16+
img.webform-contribute-image {
17+
width: 100%;
18+
}
19+
20+
/**
21+
* Quote.
22+
*/
23+
blockquote.webform-contribute-quote {
24+
margin: 2em 40px;
25+
font-size: 1.385em;
26+
font-weight: bold;
27+
}
28+
29+
blockquote.webform-contribute-quote:before {
30+
color: rgb(6, 120, 190);
31+
content: "“";
32+
float: left;
33+
font-size: 3em;
34+
margin: 0.2em 0 0 -0.6em;
35+
}
36+
37+
/**
38+
* Community Information.
39+
* @see core/themes/seven/css/components/system-status-report-general-info.css
40+
*/
41+
.webform-contribute-community-info {
42+
border: 1px solid #ccc;
43+
border-radius: 3px;
44+
margin-bottom: 25px;
45+
}
46+
47+
.webform-contribute-community-info__header {
48+
background-color: #f5f5f2;
49+
padding: 10px;
50+
margin: 0;
51+
overflow: hidden;
52+
border-top-left-radius: 3px;
53+
border-top-right-radius: 3px;
54+
font-size: 14px;
55+
text-transform: uppercase;
56+
}
57+
58+
.webform-contribute-community-info__item {
59+
background: #fcfcfa;
60+
border-top: 1px solid #ccc;
61+
padding: 10px 10px 20px;
62+
box-sizing: border-box;
63+
overflow-x: auto;
64+
}
65+
66+
.webform-contribute-community-info__item-icon {
67+
display: inline-block;
68+
height: 55px;
69+
width: 55px;
70+
vertical-align: top;
71+
}
72+
.webform-contribute-community-info__item-icon:before {
73+
content: "";
74+
background-size: 45px;
75+
background-position: 50% center;
76+
background-repeat: no-repeat;
77+
width: 100%;
78+
height: 100%;
79+
display: block;
80+
}
81+
.webform-contribute-community-info__item-icon--account:before {
82+
background-image: url(../images/contribute/icons/cccccc/account.svg);
83+
}
84+
.webform-contribute-community-info__item-icon--membership:before {
85+
background-image: url(../images/contribute/icons/cccccc/membership.svg);
86+
}
87+
.webform-contribute-community-info__item-icon--contribution:before {
88+
background-image: url(../images/contribute/icons/cccccc/contribution.svg);
89+
}
90+
91+
.webform-contribute-community-info__item-details {
92+
box-sizing: border-box;
93+
display: inline-block;
94+
width: calc(100% - 60px);
95+
padding-left: 10px; /* LTR */
96+
position: relative;
97+
}
98+
[dir="rtl"] .webform-contribute-community-info__item-details {
99+
padding-right: 10px;
100+
padding-left: 0;
101+
}
102+
103+
.webform-contribute-community-info__item-details .button {
104+
margin: 1em 0 0 0;
105+
}
106+
107+
@media screen and (min-width: 48em) {
108+
.webform-contribute-community-info__items {
109+
display: flex;
110+
flex-wrap: wrap;
111+
overflow-x: hidden;
112+
}
113+
114+
.webform-contribute-community-info__item {
115+
flex: 1;
116+
flex-basis: 33%;
117+
width: 33%;
118+
}
119+
120+
.webform-contribute-community-info__item:nth-child(2),
121+
.webform-contribute-community-info__item:nth-child(3) {
122+
border-left: 1px solid #ccc; /* LTR */
123+
}
124+
[dir="rtl"] .webform-contribute-community-info__item:nth-child(1),
125+
[dir="rtl"] .webform-contribute-community-info__item:nth-child(2) {
126+
border-left: 1px solid #ccc;
127+
}
128+
}
129+
130+
@media screen and (min-width: 60em) {
131+
.webform-contribute-community-info__item-icon {
132+
width: 55px;
133+
height: 55px;
134+
}
135+
.webform-contribute-community-info__item-icon:before {
136+
background-size: 45px;
137+
}
138+
}
139+
140+
@media screen and (max-width: 48em) {
141+
.webform-contribute-community-info__header {
142+
display: none;
143+
}
144+
.webform-contribute-community-info {
145+
border-top: 0;
146+
margin-top: 25px;
147+
}
148+
}

Diff for: docs/RELEASE-NOTES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ Tidy YAML files
5959

6060
# Run all tests
6161
cd /var/www/sites/d8_webform
62-
php core/scripts/run-tests.sh --url http://localhost/wf --module webform --dburl mysql://drupal_d8_webform:drupal.@dm1n@localhost/drupal_d8_webform
62+
php core/scripts/run-tests.sh --suppress-deprecations --url http://localhost/wf --module webform --dburl mysql://drupal_d8_webform:drupal.@dm1n@localhost/drupal_d8_webform
6363

6464
# Run single tests
6565
cd /var/www/sites/d8_webform
66-
php core/scripts/run-tests.sh --url http://localhost/wf --verbose --class "Drupal\Tests\webform\Functional\WebformListBuilderTest"
66+
php core/scripts/run-tests.sh --suppress-deprecations --url http://localhost/wf --verbose --class "Drupal\Tests\webform\Functional\WebformListBuilderTest"
6767

6868
[PHPUnit](https://www.drupal.org/node/2116263)
6969

Diff for: images/about/drupal-association.png

-16.4 KB
Binary file not shown.

Diff for: images/about/jrockowitz.png

-101 KB
Binary file not shown.

Diff for: images/contribute/contribute.png

967 KB
Loading

Diff for: images/contribute/icons/cccccc/account.svg

+15
Loading

Diff for: images/contribute/icons/cccccc/contribution.svg

+53
Loading

Diff for: images/contribute/icons/cccccc/membership.svg

+1
Loading

Diff for: images/contribute/icons/drupal.svg

+1
Loading

Diff for: includes/webform.install.update.inc

+11-2
Original file line numberDiff line numberDiff line change
@@ -1589,10 +1589,10 @@ function webform_update_8078() {
15891589
* Issue #2911329: Create 'About' tab.
15901590
*/
15911591
function webform_update_8079() {
1592-
// Convert ui.help_menu_disabled to ui.about_disabled.
1592+
// Convert ui.help_menu_disabled to ui.contribute_disabled.
15931593
$admin_config = \Drupal::configFactory()->getEditable('webform.settings');
15941594
$help_menu_disabled = $admin_config->get('ui.help_menu_disabled') ?: FALSE;
1595-
$admin_config->set('ui.about_disabled', $help_menu_disabled);
1595+
$admin_config->set('ui.contribute_disabled', $help_menu_disabled);
15961596
$admin_config->clear('ui.help_menu_disabled');
15971597
$admin_config->save();
15981598
}
@@ -2085,3 +2085,12 @@ function webform_update_8112() {
20852085
}
20862086
}
20872087
}
2088+
2089+
/**
2090+
* Issue #????: Convert About section into Contribute section.
2091+
*/
2092+
function webform_update_8113() {
2093+
$config = \Drupal::configFactory()->getEditable('webform.settings');
2094+
$config->set('ui.contribute_disabled', $config->get('ui.about_disabled') ?: FALSE);
2095+
$config->save();
2096+
}

0 commit comments

Comments
 (0)