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

EVENT-825 Campus Question Force Selection Option #837

Merged
merged 13 commits into from
Aug 15, 2023

Conversation

caleballdrin
Copy link
Contributor

@caleballdrin caleballdrin commented Aug 2, 2023

Description

https://jira.cru.org/browse/EVENT-825

With the Salesforce integration we need to encourage the use of the Cru Profile questions to ensure better data and ensure our constituents are known by Cru. The Current "Campus" default question pulls from a database of Campuses but does require the registrant to select anything on the drop down list. This leads to inconsistent data as the same school could be represented in many ways with unlimited free form response.

The proposed improvement is as follows:

Update the default name when the question is used: "Campus- Type the full name of your campus and choose from the list that appears”

Changes I made

  • Stopped accepting user input that does not match the campus database with typeahead-editable="false"
  • Changed debounce and wait time to 100ms so the list of options pops up sooner.
  • Added error message when a users input is not found in the campus list.
  • Add a default ExportFieldTitle and set it to "Campus".
  • Change the default title of the Campus Question
  • Add an admin checkbox to allow the admin to show International Campuses in the autocomplete.
  • Set a limit on the number of campuses that show up in the autocomplete. Set a maxheight.

Companion PR https://github.com/CruGlobal/ert-api/pull/1030

@caleballdrin caleballdrin added the On Staging Will be merged to the staging branch by Github Actions label Aug 2, 2023
@dr-bizz
Copy link
Contributor

dr-bizz commented Aug 2, 2023

In the description, it mentions adding an additional checkbox Option on the admin panel that would “Force Selection from Cru Database”. I can't see that in this PR.

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

The code looks good. There seems to be a few things missing on this PR.

The text added to the field when used. (I've mentioned this in another comment).

There isn't a checkbox on the admin panel to allow the admin to Force Selection from Cru Database

app/views/blocks/campusQuestion.html Show resolved Hide resolved
@dr-bizz
Copy link
Contributor

dr-bizz commented Aug 3, 2023

It's worth making the campus dropdown have a max-height so prevent the from having to scroll down the page to see all the options when it returns lots.

@caleballdrin
Copy link
Contributor Author

I was looking into setting max-height and came across this issue. Maybe we should just limit the results to 10 from the API.
ng-bootstrap/ng-bootstrap#1119

@dr-bizz
Copy link
Contributor

dr-bizz commented Aug 4, 2023

Seems like there is a way but you have to make it work - ng-bootstrap/ng-bootstrap#1119 (comment).
It's bad management of the package owners that they haven't added this as a feature already. Unless it's no longer supported.

test/spec/directives/block.spec.js Outdated Show resolved Hide resolved
app/scripts/directives/questionToolbar.js Outdated Show resolved Hide resolved
app/scripts/directives/questionToolbar.js Show resolved Hide resolved
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

Great work!

@caleballdrin caleballdrin merged commit 0b1e61e into master Aug 15, 2023
13 checks passed
@caleballdrin caleballdrin deleted the campus-force-selection branch August 15, 2023 20:54
caleballdrin added a commit that referenced this pull request Aug 15, 2023
Make the Campus Profile question require a predefined selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Staging Will be merged to the staging branch by Github Actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants