Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #2886642 by bojanz: Create a new condition UI
- Loading branch information
Showing
9 changed files
with
519 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
conditions: | ||
version: VERSION | ||
js: | ||
js/conditions.js: {} | ||
|
||
toolbar: | ||
version: VERSION | ||
css: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @file | ||
* Condition UI behaviors. | ||
*/ | ||
|
||
(function ($, window, Drupal) { | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Provides the summary information for the condition vertical tabs. | ||
* | ||
* @type {Drupal~behavior} | ||
* | ||
* @prop {Drupal~behaviorAttach} attach | ||
* Attaches the behavior for the condition summaries. | ||
*/ | ||
Drupal.behaviors.conditionSummary = { | ||
attach: function () { | ||
$('.vertical-tabs__pane').each(function () { | ||
$(this).drupalSetSummary(function (context) { | ||
if ($(context).find('input.enable:checked').length) { | ||
return Drupal.t('Restricted'); | ||
} | ||
else { | ||
return Drupal.t('Not restricted'); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
|
||
})(jQuery, window, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Drupal\commerce; | ||
|
||
use Drupal\Component\Plugin\CategorizingPluginManagerInterface; | ||
|
||
/** | ||
* Defines the interface for commerce_condition plugin managers. | ||
*/ | ||
interface ConditionManagerInterface extends CategorizingPluginManagerInterface { | ||
|
||
/** | ||
* Gets the plugin definitions for the given entity types. | ||
* | ||
* @param array $entity_types | ||
* The entity type IDs. | ||
* | ||
* @return array | ||
* The plugin definitions. | ||
*/ | ||
public function getDefinitionsByEntityTypes(array $entity_types); | ||
|
||
} |
Oops, something went wrong.