mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-06 11:09:29 +00:00
Allow to disable the extraction of parameters out of part description and notes
Fixes issue #747
This commit is contained in:
parent
c7ec8adc31
commit
8ff2fc5a82
3 changed files with 23 additions and 4 deletions
|
|
@ -46,6 +46,7 @@ use App\Services\Parameters\ParameterExtractor;
|
|||
use App\Services\Parts\PartLotWithdrawAddHelper;
|
||||
use App\Services\Parts\PricedetailHelper;
|
||||
use App\Services\ProjectSystem\ProjectBuildPartHelper;
|
||||
use App\Settings\BehaviorSettings\PartInfoSettings;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Exception;
|
||||
|
|
@ -69,7 +70,7 @@ class PartController extends AbstractController
|
|||
protected PartPreviewGenerator $partPreviewGenerator,
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly AttachmentSubmitHandler $attachmentSubmitHandler, private readonly EntityManagerInterface $em,
|
||||
protected EventCommentHelper $commentHelper)
|
||||
protected EventCommentHelper $commentHelper, private readonly PartInfoSettings $partInfoSettings)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -119,8 +120,8 @@ class PartController extends AbstractController
|
|||
'pricedetail_helper' => $this->pricedetailHelper,
|
||||
'pictures' => $this->partPreviewGenerator->getPreviewAttachments($part),
|
||||
'timeTravel' => $timeTravel_timestamp,
|
||||
'description_params' => $parameterExtractor->extractParameters($part->getDescription()),
|
||||
'comment_params' => $parameterExtractor->extractParameters($part->getComment()),
|
||||
'description_params' => $this->partInfoSettings->extractParamsFromDescription ? $parameterExtractor->extractParameters($part->getDescription()) : [],
|
||||
'comment_params' => $this->partInfoSettings->extractParamsFromNotes ? $parameterExtractor->extractParameters($part->getComment()) : [],
|
||||
'withdraw_add_helper' => $withdrawAddHelper,
|
||||
]
|
||||
);
|
||||
|
|
|
|||
|
|
@ -40,4 +40,10 @@ class PartInfoSettings
|
|||
#[SettingsParameter(label: new TM("settings.behavior.part_info.show_part_image_overlay"), description: new TM("settings.behavior.part_info.show_part_image_overlay.help"),
|
||||
envVar: "bool:SHOW_PART_IMAGE_OVERLAY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public bool $showPartImageOverlay = true;
|
||||
|
||||
#[SettingsParameter(label: new TM("settings.behavior.part_info.extract_params_from_description"))]
|
||||
public bool $extractParamsFromDescription = true;
|
||||
|
||||
#[SettingsParameter(label: new TM("settings.behavior.part_info.extract_params_from_notes"))]
|
||||
public bool $extractParamsFromNotes = true;
|
||||
}
|
||||
|
|
@ -13459,5 +13459,17 @@ Please note, that you can not impersonate a disabled user. If you try you will g
|
|||
<target>Show Part-DB version on homepage</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="GLYhV9m" name="settings.behavior.part_info.extract_params_from_description">
|
||||
<segment>
|
||||
<source>settings.behavior.part_info.extract_params_from_description</source>
|
||||
<target>Extract parameters from part description</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="aYOedkN" name="settings.behavior.part_info.extract_params_from_notes">
|
||||
<segment>
|
||||
<source>settings.behavior.part_info.extract_params_from_notes</source>
|
||||
<target>Extract parameters from part notes</target>
|
||||
</segment>
|
||||
</unit>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue