Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fences
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
fences
Commits
8b057724
Commit
8b057724
authored
2 years ago
by
Julian Pustkuchen
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3307490
by Anybody, Grevil, thomas.frobieter: Increase classes field...
Issue
#3307490
by Anybody, Grevil, thomas.frobieter: Increase classes field length to 255 characters
parent
34ecdbbd
No related branches found
No related tags found
1 merge request
!19
Issue #3307490: Increase classes field length to 255 characters
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fences.module
+8
-0
8 additions, 0 deletions
fences.module
tests/src/FunctionalJavascript/IntegrationTest.php
+42
-1
42 additions, 1 deletion
tests/src/FunctionalJavascript/IntegrationTest.php
with
50 additions
and
1 deletion
fences.module
+
8
−
0
View file @
8b057724
...
...
@@ -64,6 +64,8 @@ function fences_field_formatter_third_party_settings_form(FormatterInterface $pl
'#type'
=>
'textfield'
,
'#default_value'
=>
$plugin
->
getThirdPartySetting
(
'fences'
,
'fences_field_classes'
),
'#states'
=>
$invisible_on_none
(
'fences_field_tag'
),
// Remove default maxlength of 128:
'#maxlength'
=>
NULL
,
];
$settings
[
'fences'
][
'fences_field_items_wrapper_tag'
]
=
[
'#title'
=>
t
(
'Field Items Wrapper Tag'
),
...
...
@@ -76,6 +78,8 @@ function fences_field_formatter_third_party_settings_form(FormatterInterface $pl
'#type'
=>
'textfield'
,
'#default_value'
=>
$plugin
->
getThirdPartySetting
(
'fences'
,
'fences_field_items_wrapper_classes'
),
'#states'
=>
$invisible_on_none
(
'fences_field_items_wrapper_tag'
),
// Remove default maxlength of 128:
'#maxlength'
=>
NULL
,
];
$settings
[
'fences'
][
'fences_field_item_tag'
]
=
[
'#title'
=>
t
(
'Field Item Tag'
),
...
...
@@ -88,6 +92,8 @@ function fences_field_formatter_third_party_settings_form(FormatterInterface $pl
'#type'
=>
'textfield'
,
'#default_value'
=>
$plugin
->
getThirdPartySetting
(
'fences'
,
'fences_field_item_classes'
),
'#states'
=>
$invisible_on_none
(
'fences_field_item_tag'
),
// Remove default maxlength of 128:
'#maxlength'
=>
NULL
,
];
$settings
[
'fences'
][
'fences_label_tag'
]
=
[
'#title'
=>
t
(
'Label Tag'
),
...
...
@@ -100,6 +106,8 @@ function fences_field_formatter_third_party_settings_form(FormatterInterface $pl
'#type'
=>
'textfield'
,
'#default_value'
=>
$plugin
->
getThirdPartySetting
(
'fences'
,
'fences_label_classes'
),
'#states'
=>
$invisible_on_none
(
'fences_label_tag'
),
// Remove default maxlength of 128:
'#maxlength'
=>
NULL
,
];
return
$settings
[
'fences'
];
}
...
...
This diff is collapsed.
Click to expand it.
tests/src/FunctionalJavascript/IntegrationTest.php
+
42
−
1
View file @
8b057724
...
...
@@ -88,6 +88,8 @@ class IntegrationTest extends WebDriverTestBase {
'fields[body][label]'
=>
'above'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_tag]'
=>
'article'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_classes]'
=>
'my-field-class'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_items_wrapper_tag]'
=>
'div'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_items_wrapper_classes]'
=>
'my-field-items-class'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_item_tag]'
=>
'code'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_item_classes]'
=>
'my-field-item-class'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_label_tag]'
=>
'h2'
,
...
...
@@ -101,7 +103,46 @@ class IntegrationTest extends WebDriverTestBase {
$this
->
assertTrue
(
$article
->
hasClass
(
'my-field-class'
),
'Custom field class is present.'
);
$label
=
$session
->
elementExists
(
'css'
,
'h2.my-label-class'
,
$article
);
$this
->
assertSame
(
$label
->
getText
(),
'Body'
,
'Field label is found in expected HTML element.'
);
$body
=
$session
->
elementExists
(
'css'
,
'code.my-field-item-class > p'
,
$article
);
$body
=
$session
->
elementExists
(
'css'
,
'div.my-field-items-class > code.my-field-item-class > p'
,
$article
);
$this
->
assertSame
(
$body
->
getText
(),
'Body field value.'
,
'Field text is found in expected HTML element.'
);
}
/**
* Tests if the max length attribute isn't present in the settings inputs.
*/
public
function
testMaxLengthRemoved
()
{
$session
=
$this
->
assertSession
();
$page
=
$this
->
getSession
()
->
getPage
();
$this
->
drupalGet
(
'/admin/structure/types/manage/article/display'
);
$page
->
pressButton
(
'edit-fields-body-settings-edit'
);
$session
->
waitForElementVisible
(
'css'
,
'div[id*="edit-fields-body-settings-edit-form"]'
);
$page
->
selectFieldOption
(
'Field Items Wrapper Tag'
,
'div'
);
$session
->
elementAttributeNotExists
(
'css'
,
'input[id*="edit-fields-body-settings-edit-form-third-party-settings-fences-fences-field-classes"]'
,
'maxlength'
);
$session
->
elementAttributeNotExists
(
'css'
,
'input[id*="edit-fields-body-settings-edit-form-third-party-settings-fences-fences-field-items-wrapper-classes"]'
,
'maxlength'
);
$session
->
elementAttributeNotExists
(
'css'
,
'input[id*="edit-fields-body-settings-edit-form-third-party-settings-fences-fences-field-item-classes"]'
,
'maxlength'
);
$session
->
elementAttributeNotExists
(
'css'
,
'input[id*="edit-fields-body-settings-edit-form-third-party-settings-fences-fences-label-classes"]'
,
'maxlength'
);
$this
->
submitForm
([
'fields[body][label]'
=>
'above'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_tag]'
=>
'article'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_classes]'
=>
'GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_items_wrapper_tag]'
=>
'div'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_items_wrapper_classes]'
=>
'GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_item_tag]'
=>
'code'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_field_item_classes]'
=>
'GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_label_tag]'
=>
'h2'
,
'fields[body][settings_edit_form][third_party_settings][fences][fences_label_classes]'
=>
'GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym'
,
],
'Update'
);
$session
->
waitForElementRemoved
(
'css'
,
'div[id*="edit-fields-body-settings-edit-form"]'
);
$page
->
pressButton
(
'edit-submit'
);
$page
=
$this
->
drupalGet
(
'/node/'
.
$this
->
node
->
id
());
$article
=
$session
->
elementExists
(
'css'
,
'.field--name-body'
);
$this
->
assertTrue
(
$article
->
hasClass
(
'GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym'
),
'Custom field class is present.'
);
$label
=
$session
->
elementExists
(
'css'
,
'h2.GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym'
,
$article
);
$this
->
assertSame
(
$label
->
getText
(),
'Body'
,
'Field label is found in expected HTML element.'
);
$body
=
$session
->
elementExists
(
'css'
,
'div.GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym > code.GBoSTDAZRWAxMHTSwzymJhCAvtUdiKaZYAdSreQdlDIhHjaItLGfzREtNUxcGsUnXqONSUrHaLpwXbdOshbZWhojazHApQYSFCDhPPKPAjJAxxEgIXdEFSejCdIwrWwMym > p'
,
$article
);
$this
->
assertSame
(
$body
->
getText
(),
'Body field value.'
,
'Field text is found in expected HTML element.'
);
}
...
...
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