-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SD-345] Implement Ability to Remove Quick Exit from Specific Site Se…
…ctions (#524) * SD-345 Site specific quick exit change * Reverted previous update hook * Fixed review comments * updated link (#521) * [SD-418] add validation delete bulk approver (#527) * added validation to current user * Fix parent field name * Changes in field label * Null check for editing fields * Behat test update * Reorder new site specific field * lints --------- Co-authored-by: Sahil Sharma <[email protected]> Co-authored-by: Md Nadim Hossain <[email protected]> Co-authored-by: Yeni Atencio <[email protected]> Co-authored-by: Sahil Sharma <[email protected]> Co-authored-by: Vincent Gao <[email protected]>
- Loading branch information
1 parent
da58426
commit b4f3247
Showing
11 changed files
with
162 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
config/install/field.field.taxonomy_term.sites.field_show_exit_site_specific.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- field.storage.taxonomy_term.field_show_exit_site_specific | ||
- taxonomy.vocabulary.sites | ||
module: | ||
- options | ||
id: taxonomy_term.sites.field_show_exit_site_specific | ||
field_name: field_show_exit_site_specific | ||
entity_type: taxonomy_term | ||
bundle: sites | ||
label: 'Show Quick exit button on pages in this site section?' | ||
description: 'You can turn the Quick exit button on or off for a site section only, separate from the setting for the whole site.' | ||
required: false | ||
translatable: false | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: { } | ||
field_type: list_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
config/install/field.storage.taxonomy_term.field_show_exit_site_specific.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
module: | ||
- options | ||
- taxonomy | ||
id: taxonomy_term.field_show_exit_site_specific | ||
field_name: field_show_exit_site_specific | ||
entity_type: taxonomy_term | ||
type: list_string | ||
settings: | ||
allowed_values: | ||
- | ||
value: 'yes' | ||
label: 'Yes' | ||
- | ||
value: 'no' | ||
label: 'No' | ||
allowed_values_function: '' | ||
module: options | ||
locked: false | ||
cardinality: 1 | ||
translatable: true | ||
indexes: { } | ||
persist_with_no_fields: false | ||
custom_storage: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(function ($, Drupal) { | ||
|
||
'use strict'; | ||
|
||
Drupal.behaviors.siteQuickExitFields = { | ||
attach: function (context, settings) { | ||
var parentField = ($('.taxonomy-term-sites-form #edit-parent')); | ||
var parentVal = parentField.val(); | ||
if (parentVal == 0) { | ||
$('.field--name-field-show-exit-site-specific').hide(); | ||
} | ||
else { | ||
$('.field--name-field-site-show-exit-site').hide(); | ||
} | ||
$(parent).change(function() { | ||
var selectedValue = $(this).val(); | ||
if (selectedValue == 0) { | ||
$('#edit-field-show-exit-site-specific option:selected').prop('selected', false); | ||
$('#edit-field-show-exit-site-specific').val('_none'); | ||
$('.field--name-field-show-exit-site-specific').hide(); | ||
$('.field--name-field-site-show-exit-site').show(); | ||
} | ||
else { | ||
$('#edit-field-site-show-exit-site-value').prop('checked', false); | ||
$('.field--name-field-site-show-exit-site').hide(); | ||
$('.field--name-field-show-exit-site-specific').show(); | ||
} | ||
}); | ||
} | ||
}; | ||
})(jQuery, Drupal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters