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

[ENHANCEMENT] Category related improvements #36

Closed
5 of 7 tasks
SethCram opened this issue Mar 17, 2023 · 0 comments
Closed
5 of 7 tasks

[ENHANCEMENT] Category related improvements #36

SethCram opened this issue Mar 17, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@SethCram
Copy link
Owner

SethCram commented Mar 17, 2023

Is your feature request related to a problem? Please describe.

  • yes, categories can't be created and have some display problems

Describe the solution you'd like

  • allow category creation and display them well

Additional context

Development

  • allow regular users to create new categories/tags

    • then could sort by most used in dropdown

    • if desired tag/category not within dropdown, could create one at post publish time

      • would have to allow its creation + selection in dropdown first tho
      • but could prevent from publishing it till submission
      • could perform actions "onSearch()"
        • should figure out if this is triggered when enter pressed
        • or if triggered everytime something typed in
          • acted as onChange()
          • created local cat names + added them to list
          • but dropdown didnt immediately rerender new items
    • could post new category to db when enter key using onKeyPressFn() and checking for enter key

      • needa retrieve what's held in textbox too
      • was able to post new category to database alright, but couldn't manually update selected values
      • only able to updated manually selected values thru catching + posting on enter key
        • then updated selectedOptions passed into multselect comp
        • had to prevent default w/ enter key pressed to prevent form submission
        • doesn't work on edit page bc preSelectedOptions being concatted w/ selected ones
        • so undid concat and init'd in state var
    • for some reason, posting a new cat on the write page erases all other selected items

      • but doesn't happen on edit page
      • works perfectly on edit page for some reason
      • also doesn't even set the newly posted category name properly
      • leaves textbox entirely blank
  • display total posts tagged w/each category when selecting categories for post

    • for each option displayed, search thru entire array of categories
      • so pretty rsrc intensive
      • also reruns everytime dropdown is opened or closed
      • but can't store the number within the option since don't want count w/ post new category to db
      • so used decorator to dress up display of options
  • fix glitchy posting of categories on write page

    • for some reason, posting a new cat on the write page erases all other selected items
      • but doesn't happen on edit page
      • works perfectly on edit page for some reason
      • also doesn't even set the newly posted category name properly
      • leaves textbox entirely blank
      • only difference between edit and write page is that write page passes in empty preSelectedOptions arr
    • fixed thru temporary fix of initing each write page with first category option
      • should always be atleast one category present in db
  • fix categories with too long of words messed up sidebar display

    • used different CSS to lower chances of improper display
    • aligned text to the center of their respective inline block
  • disallow spaces in category names

    • they may become needed though?
    • did client prevention and serverside validation
      • used regex for both along with .test()
  • establish more solid implementation

  • remove word(s) in textbox once new category created via enter

@SethCram SethCram added the enhancement New feature or request label Mar 17, 2023
@SethCram SethCram self-assigned this Mar 17, 2023
@SethCram SethCram closed this as completed Apr 3, 2023
@SethCram SethCram added the help wanted Extra attention is needed label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

1 participant