Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ui_patterns
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
ui_patterns
Merge requests
!344
Add initial component configuration
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add initial component configuration
issue/ui_patterns-3511027:3511027-field-storage-for
into
2.0.x
Overview
5
Commits
21
Pipelines
23
Changes
18
Merged
christian.wiedemann
requested to merge
issue/ui_patterns-3511027:3511027-field-storage-for
into
2.0.x
3 months ago
Overview
5
Commits
21
Pipelines
23
Changes
18
Expand
Closes
#3511027
0
0
Merge request reports
Compare
2.0.x
version 22
e63819fe
2 months ago
version 21
d460d0d3
2 months ago
version 20
3d9f1902
2 months ago
version 19
4b1c0d3f
2 months ago
version 18
915a9f55
2 months ago
version 17
164980f0
2 months ago
version 16
129232f6
2 months ago
version 15
1b31a779
2 months ago
version 14
991dd8af
2 months ago
version 13
38f8cc74
2 months ago
version 12
c1f23702
2 months ago
version 11
575e8cd6
2 months ago
version 10
e19b0baf
2 months ago
version 9
8fcb519c
2 months ago
version 8
a85f06f3
2 months ago
version 7
3f352b74
2 months ago
version 6
e9f36ee7
2 months ago
version 5
6ec7a376
2 months ago
version 4
fdb3ec62
2 months ago
version 3
d82a7977
2 months ago
version 2
55cc6fd0
2 months ago
version 1
d8e722dd
3 months ago
2.0.x (base)
and
latest version
latest version
229c2899
21 commits,
2 months ago
version 22
e63819fe
21 commits,
2 months ago
version 21
d460d0d3
20 commits,
2 months ago
version 20
3d9f1902
19 commits,
2 months ago
version 19
4b1c0d3f
18 commits,
2 months ago
version 18
915a9f55
17 commits,
2 months ago
version 17
164980f0
16 commits,
2 months ago
version 16
129232f6
15 commits,
2 months ago
version 15
1b31a779
14 commits,
2 months ago
version 14
991dd8af
13 commits,
2 months ago
version 13
38f8cc74
12 commits,
2 months ago
version 12
c1f23702
11 commits,
2 months ago
version 11
575e8cd6
10 commits,
2 months ago
version 10
e19b0baf
9 commits,
2 months ago
version 9
8fcb519c
8 commits,
2 months ago
version 8
a85f06f3
7 commits,
2 months ago
version 7
3f352b74
6 commits,
2 months ago
version 6
e9f36ee7
7 commits,
2 months ago
version 5
6ec7a376
6 commits,
2 months ago
version 4
fdb3ec62
5 commits,
2 months ago
version 3
d82a7977
4 commits,
2 months ago
version 2
55cc6fd0
3 commits,
2 months ago
version 1
d8e722dd
1 commit,
3 months ago
18 files
+
1040
−
151
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
18
Search (e.g. *.vue) (Ctrl+P)
modules/ui_patterns_field/src/Plugin/Derivative/UIPatternsSourceFieldPropertySourceDeriver.php
0 → 100644
+
40
−
0
Options
<?php
namespace
Drupal\ui_patterns_field\Plugin\Derivative
;
use
Drupal\Component\Plugin\PluginBase
;
use
Drupal\Core\Plugin\Context\ContextDefinition
;
use
Drupal\ui_patterns
\Plugin\Derivative\EntityFieldSourceDeriverBase
;
/**
* Provides Plugin for every field property of type ui_patterns_source.
*/
class
UIPatternsSourceFieldPropertySourceDeriver
extends
EntityFieldSourceDeriverBase
{
/**
* {@inheritdoc}
*/
protected
function
getDerivativeDefinitionsForEntityStorageField
(
string
$entity_type_id
,
string
$field_name
,
array
$base_plugin_derivative
):
void
{
$id
=
implode
(
PluginBase
::
DERIVATIVE_SEPARATOR
,
[
$entity_type_id
,
$field_name
,
]);
$field_type
=
$this
->
entityFieldsMetadata
[
$entity_type_id
][
"field_storages"
][
$field_name
][
"metadata"
][
"type"
];
if
(
$field_type
===
"ui_patterns_source"
)
{
$this
->
derivatives
[
$id
]
=
array_merge
(
$base_plugin_derivative
,
[
"id"
=>
$id
,
"tags"
=>
array_merge
(
$base_plugin_derivative
[
"tags"
],
[
"ui_patterns_source"
]),
]);
$field_storage_data
=
$this
->
entityFieldsMetadata
[
$entity_type_id
][
"field_storages"
][
$field_name
];
$bundle_context_for_properties
=
(
new
ContextDefinition
(
'string'
))
->
setRequired
()
->
setLabel
(
"Bundle"
)
->
addConstraint
(
'AllowedValues'
,
array_merge
(
$field_storage_data
[
"bundles"
]
??
[],
[
""
]));
$this
->
derivatives
[
$id
][
"context_definitions"
][
"bundle"
]
=
$bundle_context_for_properties
;
}
}
}
Loading