Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_validation
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
field_validation
Commits
e276d46e
Commit
e276d46e
authored
6 years ago
by
Manuel Adán
Committed by
Manuel Adán
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3001796
by manuel.adan: Translation support (missed schema)
parent
a9df015a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/schema/field_validation.schema.yml
+129
-8
129 additions, 8 deletions
config/schema/field_validation.schema.yml
field_validation.install
+11
-1
11 additions, 1 deletion
field_validation.install
src/Entity/FieldValidationRuleSet.php
+1
-1
1 addition, 1 deletion
src/Entity/FieldValidationRuleSet.php
with
141 additions
and
10 deletions
config/schema/field_validation.schema.yml
+
129
−
8
View file @
e276d46e
field_validation.
field_validation_
rule_set.*
:
field_validation.rule_set.*
:
type
:
config_entity
type
:
config_entity
label
:
'
f
ield
validation
rule
set'
label
:
'
F
ield
validation
rule
set'
mapping
:
mapping
:
name
:
name
:
type
:
string
type
:
string
label
:
'
Name'
label
:
label
:
type
:
string
type
:
string
label
:
'
Label'
label
:
'
Label'
...
@@ -12,7 +13,7 @@ field_validation.field_validation_rule_set.*:
...
@@ -12,7 +13,7 @@ field_validation.field_validation_rule_set.*:
label
:
'
Entity
type'
label
:
'
Entity
type'
bundle
:
bundle
:
type
:
string
type
:
string
label
:
'
Entity
typ
e'
label
:
'
Entity
bundl
e'
field_validation_rules
:
field_validation_rules
:
type
:
sequence
type
:
sequence
sequence
:
sequence
:
...
@@ -20,22 +21,142 @@ field_validation.field_validation_rule_set.*:
...
@@ -20,22 +21,142 @@ field_validation.field_validation_rule_set.*:
mapping
:
mapping
:
id
:
id
:
type
:
string
type
:
string
label
:
'
ID'
title
:
title
:
type
:
string
type
:
label
label
:
'
field
validation
titl
e'
label
:
'
Rule
nam
e'
data
:
data
:
type
:
field_validation.field_validation_rule.[%parent.id]
type
:
field_validation.rule.[%parent.id]
label
:
'
Data'
weight
:
weight
:
type
:
integer
type
:
integer
label
:
'
Weight'
uuid
:
uuid
:
type
:
string
type
:
string
label
:
'
UUID'
field_name
:
field_name
:
type
:
string
type
:
string
label
:
'
Field
name'
column
:
column
:
type
:
string
type
:
string
label
:
'
Field
column'
error_message
:
error_message
:
type
:
string
type
:
label
field_validation.field_validation_rule.*
:
label
:
'
Error
message'
field_validation.rule.*
:
type
:
mapping
type
:
mapping
label
:
'
Field
validation
rule'
label
:
'
Field
validation
rule'
field_validation.rule.blacklist_field_validation_rule
:
type
:
mapping
label
:
'
Words
blacklist
validation
rule'
mapping
:
setting
:
type
:
string
label
:
'
Blacklisted
words'
field_validation.rule.date_range_field_validation_rule
:
type
:
mapping
label
:
'
Date
range
validation
rule'
mapping
:
min
:
type
:
string
label
:
'
Minimum
date'
max
:
type
:
string
label
:
'
Maximum
date'
cycle
:
type
:
string
label
:
'
Cycle
of
date'
field_validation.rule.email_field_validation_rule
:
type
:
mapping
label
:
'
Email
validation
rule'
field_validation.rule.integer_field_validation_rule
:
type
:
mapping
label
:
'
Integer
field
validation
rule'
mapping
:
min
:
type
:
string
label
:
'
Minimum
value'
max
:
type
:
string
label
:
'
Maximum
value'
field_validation.rule.ip_field_validation_rule
:
type
:
mapping
label
:
'
IP
address
validation
rule'
mapping
:
version
:
type
:
string
label
:
'
IP
Version'
field_validation.rule.length_field_validation_rule
:
type
:
mapping
label
:
'
Length
field
validation
rule'
mapping
:
min
:
type
:
string
label
:
'
Minimum
value'
max
:
type
:
string
label
:
'
Maximum
value'
field_validation.rule.must_be_empty_field_validation_rule
:
type
:
mapping
label
:
'
Must
be
empty
field
validation
rule'
field_validation.rule.numeric_field_validation_rule
:
type
:
mapping
label
:
'
Numeric
field
validation
rule'
mapping
:
min
:
type
:
string
label
:
'
Minimum
value'
max
:
type
:
string
label
:
'
Maximum
value'
step
:
type
:
string
label
:
'
Step'
field_validation.rule.phone_field_validation_rule
:
type
:
mapping
label
:
'
Phone
field
validation
rule'
mapping
:
country
:
type
:
string
label
:
'
Country'
field_validation.rule.plain_text_field_validation_rule
:
type
:
mapping
label
:
'
Plain
text
field
validation
rule'
field_validation.rule.regex_field_validation_rule
:
type
:
mapping
label
:
'
Regular
expression
field
validation
rule'
mapping
:
setting
:
type
:
string
label
:
'
Pattern'
field_validation.rule.unique_field_validation_rule
:
type
:
mapping
label
:
'
Unique
field
validation
rule'
mapping
:
scope
:
type
:
string
label
:
'
Scope
of
unique'
field_validation.rule.words_field_validation_rule
:
type
:
mapping
label
:
'
Number
of
words
field
validation
rule'
mapping
:
min
:
type
:
string
label
:
'
Minimum
number
of
words'
max
:
type
:
string
label
:
'
Maximum
number
of
words'
This diff is collapsed.
Click to expand it.
field_validation.install
+
11
−
1
View file @
e276d46e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/**
/**
* @file
* @file
* Install, update and uninstall functions for the
Ba
n module.
* Install, update and uninstall functions for the
Field Validatio
n module.
*/
*/
/**
/**
...
@@ -12,3 +12,13 @@ function field_validation_uninstall() {
...
@@ -12,3 +12,13 @@ function field_validation_uninstall() {
}
}
/**
* Renames validation rules config prefix from "fv" to "rule_set".
*/
function
field_validation_update_8001
()
{
$config_factory
=
\Drupal
::
configFactory
();
foreach
(
$config_factory
->
listAll
(
'field_validation.fv.'
)
as
$old_name
)
{
$new_name
=
'field_validation.rule_set.'
.
substr
(
$old_name
,
20
);
$config_factory
->
rename
(
$old_name
,
$new_name
);
}
}
This diff is collapsed.
Click to expand it.
src/Entity/FieldValidationRuleSet.php
+
1
−
1
View file @
e276d46e
...
@@ -24,7 +24,7 @@ use Drupal\field_validation\FieldValidationRulePluginCollection;
...
@@ -24,7 +24,7 @@ use Drupal\field_validation\FieldValidationRulePluginCollection;
* "list_builder" = "Drupal\field_validation\FieldValidationRuleSetListBuilder",
* "list_builder" = "Drupal\field_validation\FieldValidationRuleSetListBuilder",
* },
* },
* admin_permission = "administer field validation rule set",
* admin_permission = "administer field validation rule set",
* config_prefix = "
fv
",
* config_prefix = "
rule_set
",
* entity_keys = {
* entity_keys = {
* "id" = "name",
* "id" = "name",
* "label" = "label"
* "label" = "label"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment