Skip to content

Commit

Permalink
fix 77: txt not found (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
okaufman authored Dec 12, 2022
1 parent 65157ad commit bc0c8fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function getGeneralParametersInForm(): array
* @param bool $as_admin
* @return Input
*/
public function getFormSectionForObjId(int $obj_id, bool $as_admin): ?Input
public function getFormSectionForObjId(int $obj_id, bool $as_admin, string $workflow_section_title): ?Input
{
$items = [];
foreach ($this->getParametersInFormForObjId($obj_id, $as_admin) as $id => $data) {
Expand All @@ -209,7 +209,7 @@ public function getFormSectionForObjId(int $obj_id, bool $as_admin): ?Input
if (empty($items)) {
return null;
}
return $this->buildFormSection($items);
return $this->buildFormSection($items, $workflow_section_title);
}


Expand Down Expand Up @@ -308,7 +308,7 @@ public function syncAvailableParameters($obj_id)
* TODO: refactor into a form builder
* @return Input
*/
public function getGeneralFormSection(): ?Input
public function getGeneralFormSection(string $workflow_section_title): ?Input
{
$items = [];
foreach ($this->getGeneralParametersInForm() as $id => $data) {
Expand All @@ -319,12 +319,12 @@ public function getGeneralFormSection(): ?Input
if (empty($items)) {
return null;
}
return $this->buildFormSection($items);
return $this->buildFormSection($items, $workflow_section_title);
}

private function buildFormSection(array $items): Input
private function buildFormSection(array $items, string $workflow_section_title): Input
{
return $this->ui_factory->input()->field()->section($items, $this->plugin->txt('processing_settings'))
return $this->ui_factory->input()->field()->section($items, $workflow_section_title)
->withAdditionalTransformation($this->refinery->custom()->transformation(function ($vs) {
$vs['object'] = $this->workflowParameterParser->configurationFromFormData($vs);
return $vs;
Expand Down
8 changes: 4 additions & 4 deletions src/UI/EventFormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ function ($file) use ($upload_storage_service) {
$this->plugin->txt('file')
);
$workflow_param_section = $obj_id == 0 ?
$this->workflowParameterRepository->getGeneralFormSection()
: $this->workflowParameterRepository->getFormSectionForObjId($obj_id, $as_admin);
$this->workflowParameterRepository->getGeneralFormSection( $this->plugin->txt('processing_settings'))
: $this->workflowParameterRepository->getFormSectionForObjId($obj_id, $as_admin, $this->plugin->txt('processing_settings'));
$inputs = [
'file' => $file_section,
'metadata' => $this->formItemBuilder->create_section($as_admin),
Expand Down Expand Up @@ -219,8 +219,8 @@ public function update(string $form_action, Metadata $metadata, bool $as_admin):
public function schedule(string $form_action, bool $with_terms_of_use, int $obj_id = 0, bool $as_admin = false): Form
{
$workflow_param_section = $obj_id == 0 ?
$this->workflowParameterRepository->getGeneralFormSection()
: $this->workflowParameterRepository->getFormSectionForObjId($obj_id, $as_admin);
$this->workflowParameterRepository->getGeneralFormSection( $this->plugin->txt('processing_settings'))
: $this->workflowParameterRepository->getFormSectionForObjId($obj_id, $as_admin, $this->plugin->txt('processing_settings'));
$inputs = [
'metadata' => $this->formItemBuilder->schedule_section($as_admin),
'scheduling' => $this->schedulingFormItemBuilder->create()
Expand Down

0 comments on commit bc0c8fc

Please sign in to comment.