Skip to content

CE-738: Refactor Tree Field Type #557

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

Closed
wants to merge 6 commits into from

Conversation

MKwenhua
Copy link
Contributor

@MKwenhua MKwenhua commented Feb 28, 2018

Purpose
To allow nested tree fields/grouping and to simplify the TreeField datatype.
Make sure to read the extra details.

JIRA
https://careerbuilder.atlassian.net/browse/CE-738

Changes

  • Improvements and fixes

    • TreeFieldType is now an actual tree as in it supports arbitrary nesting
    • Improved lookup and indexing
    • Will be much easier to render in React and update values.
    • TreeBuilder makes it easier to nest fields
  • Changes to developer setup/environment
    *

  • Architectural changes
    *

  • Migrations or Steps to Take on Production
    *

  • Library changes

    • Removed pomona
  • Side effects
    *

Screenshots

  • Before

  • After
    tree_fields

Feature Server

How to Verify These Changes

  • Specific pages to visit
    *

  • Steps to take
    *

  • Responsive considerations
    *

Relevant PRs/Dependencies

Additional Information

Ok first I would like to bring up TreeBuilder which I know you do not want to have any complex custom logic, but I assure you that I only built it so that creating the Tree data structure could be more accessible. It generates the tree field ids and makes nesting easier.

for example Below I create a two top level head nodes for the topic "Gaming Setup":

tree = TreeBuilder.new
tree.add_value('Desktop PC')
tree.add_value('Gaming Console')
tree.find_node('Gaming Console').add_value('MS')
tree.find_node('Gaming Console').add_value('Nintendo')
tree.find_node('Gaming Console').add_value('Playstation')
tree.find_node('Gaming Console').find_node('Playstation').add_value('PS3')
tree.find_node('Gaming Console').find_node('Playstation').add_value('PS4')

tree.tree_data

Besides the rake seeding task there TreeBuilder is never used again.

Also I added some example code with the function TreeBranchClicked for branch selections.

Note: There seems to be an elusive bug where the data for Categories seems to disappear during validations, which is why I removed them in this repo

@toastercup
Copy link
Member

@MKwenhua unfortunately, this does not use RubyTree as we had discussed, so I don't know how much of this we can actually use. I like the resulting data structure you designed, but the business logic around it will need to be replaced with RubyTree before this can be merged. I'd suggest moving on to another story for now.

@toastercup
Copy link
Member

Closing this for now - we will revisit next quarter.

@toastercup toastercup closed this Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants