Skip to content

Commit

Permalink
fix: AU-2143: add phone number to private person applicantinfo (#1188)
Browse files Browse the repository at this point in the history
* AU-2143: add phone number to private person applicantinfo
* AU-2143: edit suffix
* AU-2143: edit suffix

---------

Co-authored-by: Suvi Kankare <suvi.kankare@vincit.fi>
  • Loading branch information
suvikankare and suvikankare authored Feb 15, 2024
1 parent 8eb43a4 commit 314d382
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ protected static function getPrivatePersonFormElements(AtvDocument $grantsProfil
$helsinkiProfiiliDataService = \Drupal::service('helfi_helsinki_profiili.userdata');
$userData = $helsinkiProfiiliDataService->getUserProfileData();

$suffix = array_key_exists('phone_number', $profileContent) ? '' : '</div>';

$elements['firstname'] = [
'#type' => 'textfield',
'#title' => t('First name'),
Expand Down Expand Up @@ -201,8 +203,21 @@ protected static function getPrivatePersonFormElements(AtvDocument $grantsProfil
'#wrapper_attributes' => [
'class' => ['grants-handler--prefilled-field'],
],
'#suffix' => '</div>',
'#suffix' => $suffix,
];
if (array_key_exists('phone_number', $profileContent)) {
$elements['phone_number'] = [
'#type' => 'textfield',
'#title' => t('Phone number'),
'#readonly' => TRUE,
'#required' => TRUE,
'#value' => $profileContent["phone_number"],
'#wrapper_attributes' => [
'class' => ['grants-handler--prefilled-field'],
],
'#suffix' => '</div>',
];
}
return $elements;
}

Expand Down

0 comments on commit 314d382

Please sign in to comment.