Skip to content

feat(attributes): add "Other" option support for select and multiselect attributes#331

Open
moshenetsb wants to merge 13 commits into
mainfrom
feat/321-add-OTHER-option-in-select-type-attribute
Open

feat(attributes): add "Other" option support for select and multiselect attributes#331
moshenetsb wants to merge 13 commits into
mainfrom
feat/321-add-OTHER-option-in-select-type-attribute

Conversation

@moshenetsb
Copy link
Copy Markdown
Member

@moshenetsb moshenetsb commented Apr 8, 2026

Close #321

@solvro
Copy link
Copy Markdown

solvro Bot commented Apr 8, 2026

The preview deployment for Eventownik Frontend Preview is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-04-23 15:22:14 CET

@moshenetsb moshenetsb changed the title feat add other option in select type attribute feat(attributes): add "Other" option support for select and multiselect attributes Apr 8, 2026
@moshenetsb moshenetsb force-pushed the feat/321-add-OTHER-option-in-select-type-attribute branch from 57f6cfc to 6c239f6 Compare April 8, 2026 20:21
@moshenetsb moshenetsb requested a review from maciejkrol18 April 8, 2026 20:34
@moshenetsb moshenetsb self-assigned this Apr 8, 2026
Copy link
Copy Markdown
Member

@maciejkrol18 maciejkrol18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tak jak to opisałem w kolejnych komentarzach, aktualna implementacja nie działa prawidłowo w przypadku edycji formularza drugiego etapu. Pamiętaj żeby dogłębnie potestować nie tylko dla formularza rejestracyjnego.

Najwięcej problemów jest z multiselectem. Trzeba pamiętać o tym, że na backendzie wartość multiselecta jest postaci stringa, gdzie wybrane opcje są oddzielone przecinkami. Nawet teraz na prodzie nie działa edycja multiselectów swoją drogą xd

Ze zwykłym selectem jest prościej, nie działa jedynie przywracanie tego że jest wybrane "Inne" i wraz z tym wartość tego inne. Fix ze state'ami w komentarzu do attribute-input.tsx to naprawia bez wprowadzania dodatkowych błędów (przynajmniej wg. tego jak testowałem :trollface:).

Comment thread src/components/forms/event/attributes/attribute-item.tsx Outdated
Comment thread src/components/attribute-input.tsx Outdated
Comment thread src/components/forms/event/attributes/attribute-item.tsx
Comment thread src/components/attribute-input.tsx
Comment thread src/components/attribute-input.tsx Outdated
Comment thread src/components/attribute-input.tsx Outdated
Comment thread src/components/attribute-input.tsx
@moshenetsb moshenetsb force-pushed the feat/321-add-OTHER-option-in-select-type-attribute branch from b582658 to 4ef37fa Compare April 16, 2026 18:50
@moshenetsb moshenetsb requested a review from maciejkrol18 April 18, 2026 21:34
Copy link
Copy Markdown
Member

@maciejkrol18 maciejkrol18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Biorąc pod uwagę aktualne limitacje backendu sama implementacja dobrze zrobiona, aczkolwiek widać że jest to całkiem fragile rozwiązanie. Po namysłach czekamy aż na backendzie wartości multiselecta zostaną zrefaktorowane na jsonowy array zamiast wartości w stringu oddzielone przecinkami. W związku z tym, ten pr jest na razie wstrzymany zanim tam tego nie wprowadzą - jak już to zrobią, można tu wznowić pracę

Tłumaczenia

Na tym branchu nie róbmy tłumaczeń niezwiązanych z taskiem. Cofnij zmiany z commitów 9b837f0 i c9ead54. Przypiszę cię do taska z przetłumaczeniem dashboarda i będziesz mógł to tam na branch przerzucić. Możesz popróbować jakieś sztuczki z git stashem żeby to zrobić

Comment on lines +106 to +111
if (exists) {
toast({
variant: "default",
title: "Duplikat",
description: "Ta opcja znajduje się już na liście.",
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dobry dodatek

const addOption = () => {
const trimmedValue = optionsInput.trim();

if (trimmedValue.startsWith("other: ")) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trimmedValue jest trimmed - ma usunięte whitespaces wszystkie więc ten check nie ma sensu, bo jak wpiszemy other: to i tak do trimmedValue trafi other:.

Copy link
Copy Markdown
Member Author

@moshenetsb moshenetsb Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ta zmiana ma sens np. dla other:jakiś tekst (pozwala na mniejsze ograniczenia)

@moshenetsb moshenetsb force-pushed the feat/321-add-OTHER-option-in-select-type-attribute branch 2 times, most recently from 9b837f0 to 248da9e Compare April 23, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opcja "Inne" w atrybucie typu select

2 participants