Commit aa737dab authored by Martin Leblanc's avatar Martin Leblanc
Browse files

Merge branch 'feature/ISTWCMS-5214-ebremner-theme-opportunity-node' into '1.0.x'

Feature/istwcms 5214 ebremner theme opportunity node

See merge request !9
parents 9cefca09 6aa630df
......@@ -21,6 +21,7 @@ dependencies:
- field.field.node.uw_ct_opportunity.layout_builder__layout
- node.type.uw_ct_opportunity
module:
- content_moderation
- datetime
- field_group
- link
......@@ -35,7 +36,7 @@ third_party_settings:
- field_uw_opportunity_start_date
- field_uw_opportunity_end_date
parent_name: ''
weight: 8
weight: 4
format_type: fieldset
region: content
format_settings:
......@@ -45,6 +46,56 @@ third_party_settings:
description: ''
required_fields: true
label: Dates
group_uw_opportunity_type:
children:
- field_uw_opportunity_type
- field_uw_opportunity_employment
- field_uw_opportunity_pay_rate
- field_uw_opportunity_pay_type
- field_uw_opportunity_job_id
parent_name: ''
weight: 2
format_type: fieldset
region: content
format_settings:
description: ''
required_fields: true
id: ''
classes: ''
show_empty_fields: false
label: Opportunity
group_uw_opportunity_details:
children:
- field_uw_opportunity_post_by
- field_uw_opportunity_pos_number
- field_uw_opportunity_report
parent_name: ''
weight: 3
format_type: fieldset
region: content
format_settings:
show_empty_fields: false
id: ''
classes: ''
description: ''
required_fields: true
label: Details
group_uw_opportunity_links:
children:
- field_uw_opportunity_link
- field_uw_opportunity_additional
- field_uw_opportunity_contact
parent_name: ''
weight: 5
format_type: fieldset
region: content
format_settings:
show_empty_fields: false
id: ''
classes: ''
description: ''
required_fields: true
label: Links
id: node.uw_ct_opportunity.default
targetEntityType: node
bundle: uw_ct_opportunity
......@@ -52,12 +103,12 @@ mode: default
content:
created:
type: datetime_timestamp
weight: 16
weight: 11
region: content
settings: { }
third_party_settings: { }
field_uw_opportunity_additional:
weight: 12
weight: 6
settings:
placeholder_url: ''
placeholder_title: ''
......@@ -65,7 +116,7 @@ content:
type: link_default
region: content
field_uw_opportunity_contact:
weight: 13
weight: 7
settings:
placeholder_url: ''
placeholder_title: ''
......@@ -85,7 +136,7 @@ content:
type: datetime_default
region: content
field_uw_opportunity_employment:
weight: 2
weight: 3
settings: { }
third_party_settings: { }
type: options_select
......@@ -97,7 +148,7 @@ content:
settings: { }
third_party_settings: { }
field_uw_opportunity_job_id:
weight: 5
weight: 7
settings:
size: 60
placeholder: ''
......@@ -105,7 +156,7 @@ content:
type: string_textfield
region: content
field_uw_opportunity_link:
weight: 11
weight: 5
settings:
placeholder_url: ''
placeholder_title: ''
......@@ -113,7 +164,7 @@ content:
type: link_default
region: content
field_uw_opportunity_pay_rate:
weight: 3
weight: 4
settings:
size: 60
placeholder: ''
......@@ -122,7 +173,7 @@ content:
type: string_textfield
region: content
field_uw_opportunity_pay_type:
weight: 4
weight: 6
settings: { }
third_party_settings:
conditional_fields: { }
......@@ -130,12 +181,12 @@ content:
region: content
field_uw_opportunity_pos_number:
type: options_select
weight: 9
weight: 4
region: content
settings: { }
third_party_settings: { }
field_uw_opportunity_position:
weight: 7
weight: 1
settings:
rows: 5
placeholder: ''
......@@ -143,7 +194,7 @@ content:
type: text_textarea
region: content
field_uw_opportunity_post_by:
weight: 6
weight: 3
settings:
size: 60
placeholder: ''
......@@ -151,7 +202,7 @@ content:
type: string_textfield
region: content
field_uw_opportunity_report:
weight: 10
weight: 5
settings:
size: 60
placeholder: ''
......@@ -165,27 +216,27 @@ content:
settings: { }
third_party_settings: { }
field_uw_opportunity_type:
weight: 1
weight: 2
settings: { }
third_party_settings: { }
type: options_select
region: content
langcode:
type: language_select
weight: 14
weight: 9
region: content
settings:
include_locked: true
third_party_settings: { }
moderation_state:
type: moderation_state_default
weight: 21
weight: 16
settings: { }
region: content
third_party_settings: { }
path:
type: path
weight: 19
weight: 14
region: content
settings: { }
third_party_settings: { }
......@@ -193,21 +244,21 @@ content:
type: boolean_checkbox
settings:
display_label: true
weight: 17
weight: 12
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 22
weight: 17
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
weight: 18
weight: 13
region: content
third_party_settings: { }
title:
......@@ -220,7 +271,7 @@ content:
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 15
weight: 10
settings:
match_operator: CONTAINS
size: 60
......@@ -229,7 +280,7 @@ content:
region: content
third_party_settings: { }
url_redirects:
weight: 20
weight: 15
region: content
settings: { }
third_party_settings: { }
......
......@@ -11,7 +11,7 @@ entity_type: node
bundle: uw_ct_opportunity
label: 'Rate of pay type'
description: ''
required: true
required: false
translatable: false
default_value: { }
default_value_callback: ''
......
......@@ -2,6 +2,7 @@ langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.storage.node.field_uw_opportunity_additional
- field.storage.node.field_uw_opportunity_contact
- field.storage.node.field_uw_opportunity_date
......@@ -2003,6 +2004,8 @@ display:
defaults:
fields: false
sorts: false
style: false
row: false
sorts:
sticky:
id: sticky
......@@ -2073,6 +2076,14 @@ display:
entity_type: node
entity_field: created
plugin_id: date
style:
type: default
options: { }
row:
type: 'entity:node'
options:
relationship: none
view_mode: teaser
cache_metadata:
max-age: -1
contexts:
......
......@@ -15,12 +15,36 @@ function uw_ct_opportunities_form_alter(array &$form, FormStateInterface $form_s
// Modify help text of Contact for additional information field.
$form['field_uw_opportunity_contact']['widget'][0]['uri']['#description'] = t('You can also enter an internal path such as <em>/blog</em>, an email link such as <em>mailto:email@example.com</em>, or an external URL such as <em>https://example.com</em>.');
// Add ajax function for showing Rate of pay and Rate of pay rate
// when selecting opportunity type has show payment field checked.
$form['field_uw_opportunity_type']['widget']['#ajax'] = [
'callback' => '_uw_ct_opportunities_node_form_callback',
'event' => 'change',
'wrapper' => $form['#id'],
// Get the terms for the rate of pay.
$terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree('uw_vocab_opportunity_type');
// Get the tid for Paid rate of pay.
foreach ($terms as $term) {
if ($term->name == 'Paid') {
$tid = $term->tid;
break;
}
}
// Set the states for the pay rate.
$form['field_uw_opportunity_pay_rate']['#states'] = [
'visible' => [
'select[name="field_uw_opportunity_type"]' => ['value' => $tid],
],
];
// Set the states for the pay type.
$form['field_uw_opportunity_pay_type']['#states'] = [
'visible' => [
'select[name="field_uw_opportunity_type"]' => ['value' => $tid],
],
];
// Set the required.
$form['field_uw_opportunity_pay_type']['widget']['#states'] = [
'required' => [
'select[name="field_uw_opportunity_type"]' => ['value' => $tid],
],
];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment