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

FORSLAG-77: More checkboxes #353

Merged
merged 4 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

* [PR-353](https://github.com/itk-dev/hoeringsportal/pull/353)
Added “Allow email” checkboxes
* [PR-351](https://github.com/itk-dev/hoeringsportal/pull/351)
Added and used citizen proposal text format
* [PR-350](https://github.com/itk-dev/hoeringsportal/pull/350)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ langcode: da
status: true
dependencies:
config:
- field.field.node.citizen_proposal.field_author_allow_email
- field.field.node.citizen_proposal.field_author_email
- field.field.node.citizen_proposal.field_author_email_display
- field.field.node.citizen_proposal.field_author_name
Expand Down Expand Up @@ -42,6 +43,13 @@ targetEntityType: node
bundle: citizen_proposal
mode: default
content:
field_author_allow_email:
type: boolean_checkbox
weight: 4
region: content
settings:
display_label: true
third_party_settings: { }
field_author_email:
type: email_default
weight: 2
Expand Down Expand Up @@ -83,7 +91,7 @@ content:
third_party_settings: { }
field_more_info:
type: text_textarea
weight: 7
weight: 8
region: content
settings:
rows: 5
Expand All @@ -94,7 +102,7 @@ content:
hide_guidelines: '1'
field_proposal:
type: text_textarea
weight: 5
weight: 6
region: content
settings:
rows: 5
Expand All @@ -105,7 +113,7 @@ content:
hide_guidelines: '1'
field_remarks:
type: text_textarea
weight: 6
weight: 7
region: content
settings:
rows: 5
Expand All @@ -116,14 +124,14 @@ content:
hide_guidelines: '1'
status:
type: boolean_checkbox
weight: 8
weight: 9
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: 4
weight: 5
region: content
settings:
size: 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.citizen_proposal_add
- field.field.node.citizen_proposal.field_author_allow_email
- field.field.node.citizen_proposal.field_author_email
- field.field.node.citizen_proposal.field_author_email_display
- field.field.node.citizen_proposal.field_author_name
Expand Down Expand Up @@ -122,6 +123,7 @@ content:
weight: 100
region: content
hidden:
field_author_allow_email: true
field_author_email_display: true
field_author_phone: true
field_author_uuid: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.citizen_proposal_approval
- field.field.node.citizen_proposal.field_author_allow_email
- field.field.node.citizen_proposal.field_author_email
- field.field.node.citizen_proposal.field_author_email_display
- field.field.node.citizen_proposal.field_author_name
Expand Down Expand Up @@ -55,6 +56,7 @@ content:
weight: 1
region: content
hidden:
field_author_allow_email: true
field_author_email_display: true
field_author_phone: true
field_author_uuid: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ content:
weight: 9
region: right
hidden:
field_author_allow_email: true
field_author_email_display: true
field_author_phone: true
field_author_uuid: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.list_display
- field.field.node.citizen_proposal.field_author_allow_email
- field.field.node.citizen_proposal.field_author_email
- field.field.node.citizen_proposal.field_author_email_display
- field.field.node.citizen_proposal.field_author_name
Expand Down Expand Up @@ -103,6 +104,7 @@ content:
weight: 100
region: content
hidden:
field_author_allow_email: true
field_author_email_display: true
field_author_phone: true
field_author_uuid: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.citizen_proposal.field_author_allow_email
- field.field.node.citizen_proposal.field_author_email
- field.field.node.citizen_proposal.field_author_email_display
- field.field.node.citizen_proposal.field_author_name
Expand Down Expand Up @@ -51,6 +52,7 @@ content:
weight: 1
region: content
hidden:
field_author_allow_email: true
field_author_email: true
field_author_email_display: true
field_author_phone: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: 8d3748de-e723-46a5-b473-0135dd28153e
langcode: da
status: true
dependencies:
config:
- field.storage.node.field_author_allow_email
- node.type.citizen_proposal
id: node.citizen_proposal.field_author_allow_email
field_name: field_author_allow_email
entity_type: node
bundle: citizen_proposal
label: 'Allow email'
description: 'Author accepts receiving emails.'
required: false
translatable: false
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
18 changes: 18 additions & 0 deletions config/sync/field.storage.node.field_author_allow_email.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
uuid: a831ce9e-944a-45fa-a981-3978c9841237
langcode: da
status: true
dependencies:
module:
- node
id: node.field_author_allow_email
field_name: field_author_allow_email
entity_type: node
type: boolean
settings: { }
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
118 changes: 116 additions & 2 deletions config/sync/views.view.citizen_proposal_support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,63 @@ display:
hide_empty: false
empty_zero: false
hide_alter_empty: true
allow_email:
id: allow_email
table: hoeringsportal_citizen_proposal_support
field: allow_email
relationship: none
group_type: group
admin_label: ''
plugin_id: numeric
label: 'Tillad e-mail'
exclude: false
alter:
alter_text: true
text: '{{ allow_email ? ''ja'' }}'
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
set_precision: false
precision: 0
decimal: .
separator: ''
format_plural: false
format_plural_string: !!binary MQNAY291bnQ=
prefix: ''
suffix: ''
created:
id: created
table: hoeringsportal_citizen_proposal_support
Expand Down Expand Up @@ -366,7 +423,7 @@ display:
group_type: group
admin_label: ''
plugin_id: standard
label: Name
label: Navn
exclude: false
alter:
alter_text: false
Expand Down Expand Up @@ -415,7 +472,7 @@ display:
group_type: group
admin_label: ''
plugin_id: standard
label: Email
label: E-mail
exclude: false
alter:
alter_text: false
Expand Down Expand Up @@ -456,6 +513,63 @@ display:
hide_empty: false
empty_zero: false
hide_alter_empty: true
allow_email:
id: allow_email
table: hoeringsportal_citizen_proposal_support
field: allow_email
relationship: none
group_type: group
admin_label: ''
plugin_id: numeric
label: 'Tillad e-mail'
exclude: false
alter:
alter_text: true
text: '{{ allow_email ? 1 }}'
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
set_precision: false
precision: 0
decimal: .
separator: ''
format_plural: false
format_plural_string: !!binary MQNAY291bnQ=
prefix: ''
suffix: ''
style:
type: data_export
options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ function hoeringsportal_citizen_proposal_schema(): array {
'length' => 255,
'not null' => FALSE,
],
'allow_email' => [
'description' => 'The proposal supporter allows email',
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'created' => [
'description' => 'The time of creation',
'type' => 'int',
Expand Down Expand Up @@ -183,3 +191,22 @@ function hoeringsportal_citizen_proposal_update_9003(): void {
'symfony_mailer',
]);
}

/**
* Adds allow email column.
*/
function hoeringsportal_citizen_proposal_update_9004(): void {
$schema = \Drupal::database()->schema();

$table_name = 'hoeringsportal_citizen_proposal_support';
$field_name = 'allow_email';
$spec = [
'description' => 'The proposal supporter allows email',
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
];
$schema->addField($table_name, $field_name, $spec);
}
Loading
Loading