Skip to content

Commit

Permalink
fix: AU-1789: Show additional information data in print view (#931)
Browse files Browse the repository at this point in the history
* AU-1789 Show additional information data in print view
* AU-1789 Improve comments to lessen sonarcloud whining

---------

Co-authored-by: Paavo Kivistö <paavo.kivisto@brightlyworks.com>
  • Loading branch information
Puavo and Puavo authored Nov 16, 2023
1 parent 98cb700 commit a6fa1da
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private function transformField($field, &$pages, &$isSubventionType, &$subventio
// Handle application type field.
if ($field['ID'] === 'applicantType' && $field['value'] === 'registered_community') {
$field['value'] = '' . $this->t('Registered community', [], ['langcode' => $langcode]);
// @todo other types when needed.
// Add other types here when needed.
}
// Handle dates.
if (preg_match(self::ISO8601, $field['value'])) {
Expand Down Expand Up @@ -546,6 +546,33 @@ public function printViewAtv(string $submission_id): array {
});
}
}

if (isset($compensation['additionalInformation'])) {
$tOpts = [
'context' => 'grants_handler',
'langcode' => $langcode,
];
$field = [
'ID' => 'additionalInformationField',
'value' => $compensation['additionalInformation'],
'valueType' => 'string',
'label' => $this->t('Additional Information', [], $tOpts),
'weight' => 1,
];
$sections = [];
$sections['section'] = [
'label' => $this->t('Additional information concerning the application', [], $tOpts),
'id' => 'additionalInformationPageSection',
'weight' => 1,
'fields' => [$field],
];
$newPages['additionalInformation'] = [
'label' => t('Additional Information', [], $tOpts),
'id' => 'additionalInformationPage',
'sections' => $sections,
];
}

// Set correct template.
$build = [
'#theme' => 'grants_handler_print_atv_document',
Expand Down
8 changes: 8 additions & 0 deletions public/modules/custom/grants_handler/translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -581,3 +581,11 @@ msgstr "Keskeneräiseen hakemukseen ei voi lähettää viestejä."
msgctxt "grants_handler"
msgid "Messages cannot be sent to a resolved application."
msgstr "Ratkaistuun hakemukseen ei voi lähettää viestejä."

msgctxt "grants_handler"
msgid "Additional Information"
msgstr "Lisätiedot"

msgctxt "grants_handler"
msgid "Additional information concerning the application"
msgstr "Lisätietoja hakemukseen liittyen"
8 changes: 8 additions & 0 deletions public/modules/custom/grants_handler/translations/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -581,3 +581,11 @@ msgstr "Du kan inte skicka meddelanden till en pågående ansökan"
msgctxt "grants_handler"
msgid "Messages cannot be sent to a resolved application."
msgstr "Du kan inte skicka meddelanden till ett löst ansökan."

msgctxt "grants_handler"
msgid "Additional Information"
msgstr "Ytterligare information"

msgctxt "grants_handler"
msgid "Additional information concerning the application"
msgstr "Ytterligare information för ansökan"

0 comments on commit a6fa1da

Please sign in to comment.