Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split incoming tags #377

Open
alee opened this issue Jul 31, 2018 · 3 comments
Open

split incoming tags #377

alee opened this issue Jul 31, 2018 · 3 comments
Assignees

Comments

@alee
Copy link
Member

alee commented Jul 31, 2018

Multiple fixes for this:

  1. frontend shouldn't allow tags over 100 chars (always)
  2. frontend could split by ';' or ','
  3. backend serializer should raise a validation error if tag names > 100 chars (always)
  4. backend could split by ';' or ',' as well but this seems magical and could strip out legitimate semicolony tags (not sure if that should exist though)

Thoughts?

TagSerializer(data=[OrderedDict([('name', 'Energy security; energy landscape; Egypt; multi-criteria decision analysis; agent-based modeling; Geographic Information System')])], many=True):
    name = CharField()
@cpritcha
Copy link
Contributor

cpritcha commented Jul 31, 2018

  1. sure
  2. would take some work. There is an issue about 2 on Push tag when pressing comma or some other delimiter shentao/vue-multiselect#575 so maybe someone will get around to fixing it eventually (or I could attempt it as well). We would also need to split tags on the input event since it was likely that the tags from copy pasted from a journal article.
  3. from a serializer override so that's an easy fix
  4. splitting on ';' and ',' on the backend makes sense to me. I don't see why there would ever be commas or semicolons in a tag name

@cpritcha
Copy link
Contributor

cpritcha commented Aug 1, 2018

Actually 2 shouldn't be too hard either so long as it's acceptable to have a large search string and then when the user presses enter the incoming string is split by ';' and ','. An incremental split would be more difficult (creating a new tag as soon as the user presses ',' or ';').

cpritcha added a commit that referenced this issue Aug 1, 2018
@alee
Copy link
Member Author

alee commented Aug 1, 2018

Yes, split on enter / onBlur / whenever the submitter moves on from the tag input field

hwelsters pushed a commit to hwelsters/comses.net that referenced this issue May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants