mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 13:49:33 +00:00
Merge remote-tracking branch 'origin/feature/automatic-ipn-generation' into feature/all-features
# Conflicts: # assets/controllers/elements/ipn_suggestion_controller.js # config/services.yaml # docs/configuration.md # migrations/Version20250325073036.php # src/Controller/PartController.php # src/Controller/TypeaheadController.php # src/EventSubscriber/UserSystem/PartUniqueIpnSubscriber.php # src/Form/Part/PartBaseType.php # src/Repository/PartRepository.php # src/Settings/MiscSettings/MiscSettings.php # src/Validator/Constraints/UniquePartIpnConstraint.php # src/Validator/Constraints/UniquePartIpnValidator.php # templates/parts/edit/_advanced.html.twig # translations/messages.cs.xlf # translations/messages.de.xlf # translations/messages.el.xlf # translations/messages.en.xlf # translations/messages.fr.xlf # translations/messages.ja.xlf # translations/messages.nl.xlf
This commit is contained in:
commit
7a5885839e
16 changed files with 323 additions and 236 deletions
|
|
@ -184,7 +184,7 @@ export default class extends Controller {
|
|||
if (categoryField) {
|
||||
categoryField.addEventListener("change", () => {
|
||||
const categoryId = Number(categoryField.value);
|
||||
const description = String(descriptionField.value);
|
||||
const description = String(descriptionField?.value ?? '');
|
||||
|
||||
// Check whether the category has changed compared to the previous ID
|
||||
if (categoryId !== this.previousCategoryId) {
|
||||
|
|
@ -203,7 +203,7 @@ export default class extends Controller {
|
|||
if (descriptionField) {
|
||||
descriptionField.addEventListener("input", () => {
|
||||
const categoryId = Number(categoryField.value);
|
||||
const description = String(descriptionField.value);
|
||||
const description = String(descriptionField?.value ?? '');
|
||||
|
||||
// Check whether the description has changed compared to the previous one
|
||||
if (description !== this.previousDescription) {
|
||||
|
|
@ -219,7 +219,7 @@ export default class extends Controller {
|
|||
const partId = this.partIdValue;
|
||||
const truncatedDescription = description.length > 150 ? description.substring(0, 150) : description;
|
||||
const encodedDescription = this.base64EncodeUtf8(truncatedDescription);
|
||||
const url = `${baseUrl}?partId=${partId}&categoryId=${categoryId}&description=${encodedDescription}`;
|
||||
const url = `${baseUrl}?partId=${partId}&categoryId=${categoryId}` + (description !== '' ? `&description=${encodedDescription}` : '');
|
||||
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
|
|
@ -247,4 +247,4 @@ export default class extends Controller {
|
|||
const utf8Bytes = new TextEncoder().encode(text);
|
||||
return btoa(String.fromCharCode(...utf8Bytes));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue