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

Resolve #441: Improve relationship party selection widget #542

Merged
merged 1 commit into from
Aug 11, 2016

Conversation

seav
Copy link
Contributor

@seav seav commented Aug 10, 2016

Proposed changes in this pull request

  • Resolve Improve party selection widget #441:
    • Use Select2 to convert the table of selectable parties used in creating a new tenure relationship into a searchable select box. Select2 was used instead of Selectize that was suggested by @clash99 because Select2 has its CSS and JS files hosted on a CDN. Both support the features that we might want in a party selection widget and it's easy to switch to Selectize if that is desired.
    • Update the SelectPartyWidget widget to output <select> instead of <table>.
    • Update the NewEntityWidget widget to show the "Add party" button as a button instead of as a link, and to make the button text translatable.
    • Update the relationship_add.html template to load Select2 into the party <select> tag, and to make the widget <label>s translatable.
    • Update main.scss to style the updated widgets.
    • Update the widget unit tests.

Screenshots

Default view of the "Add New Relationship" modal showing the Select2 in action.

screen shot 2016-08-11 at 04 47 56

When the select box is clicked, we get a nice list of parties with their names and types shown. This can be easily updated in the future to include as many party attributes as needed.

screen shot 2016-08-11 at 04 48 33

Clicking on a party locks that selection in.

screen shot 2016-08-11 at 04 48 45

Clicking on the "Add party" button allows us to create a new party instead. This is the same as the previous behavior.

screen shot 2016-08-11 at 04 48 49

When there are more than 5—this is customizable—parties in the project, the Select2 widget displays a search box that can filter the parties that can be selected.

screen shot 2016-08-11 at 05 15 48

When should this PR be merged

It would be nice if @clash99 can take a look and see if the updated widget is up to the task. Alternatively, this can be merged now and then updated in the future.

Risks

No risks foreseen

Follow up actions

None.

@clash99
Copy link
Contributor

clash99 commented Aug 10, 2016

Looks good! I think this is a big improvement. Its very intuitive and I think the search box will help a lot as our party list grows.

I have two small suggestions:

  • Add a glyphicon-plus to the add button
  • Remove comma after "or"

Otherwise its good to go!

@seav seav force-pushed the enhancement/#441 branch from 78d4440 to aae4908 Compare August 10, 2016 22:04
@seav
Copy link
Contributor Author

seav commented Aug 10, 2016

Suggestions have been applied:

screen shot 2016-08-11 at 06 04 40

@seav seav force-pushed the enhancement/#441 branch from aae4908 to 0c23b3f Compare August 10, 2016 22:25
@ian-ross ian-ross self-assigned this Aug 11, 2016
@ian-ross ian-ross merged commit 0cbd05c into master Aug 11, 2016
@ian-ross ian-ross deleted the enhancement/#441 branch August 11, 2016 10:02
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

Successfully merging this pull request may close these issues.

4 participants