Make the map input text field title invisible.

This commit is contained in:
Michael Stenta 2022-06-16 21:18:53 -04:00
parent b6744a3cd3
commit 388a0f43b1
2 changed files with 4 additions and 1 deletions

View File

@ -85,6 +85,7 @@ class FarmMapInput extends FormElement {
$element['value'] = [
'#type' => $display_raw_geometry ? 'textarea' : 'hidden',
'#title' => $element_title . ' ' . t('WKT'),
'#title_display' => 'invisible',
'#attributes' => [
'data-map-geometry-field' => TRUE,
],

View File

@ -31,11 +31,13 @@ class MapFormTest extends FarmBrowserTestBase {
$this->drupalLogin($user);
// Go to the test quick form and confirm that both of the geometry fields
// are visible.
// are visible, and only the second field's WKT text field is visible.
$this->drupalGet('quick/test');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains($this->t('Geometry 1'));
$this->assertSession()->pageTextContains($this->t('Geometry 2'));
$this->assertSession()->pageTextNotContains($this->t('Geometry 1 WKT'));
$this->assertSession()->pageTextContains($this->t('Geometry 2 WKT'));
// Submit the form with a value for the second geometry.
$edit = ['geometry2[value]' => 'POINT(-45.967095060886315 32.77503850904169)'];