@@ -279,14 +279,34 @@ private function buildConfigurationFormDistributionObject(): array {
279279 ],
280280 ];
281281
282+ $ section [DistributionObjectSettings::FILES ][DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_OVERRIDE ] = [
283+ '#title ' => $ this ->t ('Set %recipient_authority ' , [
284+ '%recipient_authority ' => $ this ->t ('Recipient authority ' ),
285+ ]),
286+ '#type ' => 'checkbox ' ,
287+ '#default_value ' => $ settings ->files ->recipientAuthorityOverride ,
288+ '#description ' => $ this ->t ('If %recipient_authority is not set here, the global %routing_myndighed_label value (@routing_myndighed_value) will be used. ' , [
289+ '%recipient_authority ' => $ this ->t ('Recipient authority ' ),
290+ '%routing_myndighed_label ' => $ this ->t ('Routing myndighed ' ),
291+ '@routing_myndighed_value ' => $ this ->settingsService ->getSenderSettings ()->routingMyndighed ,
292+ ]),
293+ ];
282294 $ section [DistributionObjectSettings::FILES ][DistributionObjectFilesSettings::RECIPIENT_AUTHORITY ] = [
283295 '#title ' => $ this ->t ('Recipient authority ' ),
284296 '#type ' => 'textfield ' ,
285297 '#attributes ' => [
286298 'pattern ' => DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_PATTERN ,
287299 ],
288300 '#default_value ' => $ settings ->files ->recipientAuthority ,
289- '#description ' => $ this ->t ('CVR for recipient ' ),
301+ '#description ' => $ this ->t ('CVR for recipient. ' ),
302+ '#states ' => [
303+ 'visible ' => [
304+ ':input[name="settings[ ' . DistributionObjectSettings::NAME . '][ ' . DistributionObjectSettings::FILES . '][ ' . DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_OVERRIDE . ']"] ' => ['checked ' => TRUE ],
305+ ],
306+ 'required ' => [
307+ ':input[name="settings[ ' . DistributionObjectSettings::NAME . '][ ' . DistributionObjectSettings::FILES . '][ ' . DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_OVERRIDE . ']"] ' => ['checked ' => TRUE ],
308+ ],
309+ ],
290310 ];
291311 $ setStates ($ section [DistributionObjectSettings::FILES ][DistributionObjectFilesSettings::RECIPIENT_AUTHORITY ], [
292312 DistributionObjectSettings::DISTRIBUTION_TYPE_FORMULAR ,
@@ -466,6 +486,15 @@ public function getSummary() {
466486 ]
467487 );
468488
489+ $ items [] = Link::createFromRoute (
490+ $ this ->t ('Preview trigger files ' ),
491+ 'os2forms_fordelingskomponent.fordelingskomponent_distribution_object.trigger_files.preview ' , [
492+ 'webform ' => $ this ->getWebform ()->id (),
493+ 'webform_handler ' => $ this ->getHandlerId (),
494+ 'webform_submission ' => $ submission ->id (),
495+ ]
496+ );
497+
469498 $ items [] = Link::createFromRoute (
470499 $ this ->t ('Distribution objects ' ),
471500 'os2forms_fordelingskomponent.distribution_object.index ' , [
0 commit comments