debtcollective / parent

1 stars 0 forks source link

Show signup wizard custom fields in user profile only for staff #250

Closed orlando closed 5 years ago

orlando commented 5 years ago

Right now we are asking the user for additional information after they signup. This information is saved to the database, but we are not showing it in the user profile.

We want this information to be available for the user to edit in their profile, and this information to be available only for staff members and the user. The information we are collecting from the user at the moment is:

Notes

Discourse has some settings for this, but looks like is only to make them available in the user serializer and not to show it in the UI. https://meta.discourse.org/t/how-does-staff-user-custom-fields-work/45959

Tasks

Acceptance criteria

duranmla commented 5 years ago

At this point I have make some research around and find that we can achieve this using only the tools that we have without writing code (of course it has some limitations), but to solve the need in the fastest way, I quote from the document linked below:

Embracing the current limitations related to custom input types and validations we can satisfy the need for the information in the following way:

  1. Create the set of fields using the built-in admin console for extra information such as: phone number, address and zip code. (Should be added those fields into the signup modal if needed or keep then into the wizard flow)
  2. IF the wizard is keeped THEN make sure to define an action that take place once the user save the step values (this is possible into the wizard config) to update the fields defined above.
  3. IF the wizard is removed THEN we leave then into the profile for being filled by the user at some point on time (but we have no way to ensure they will do that unless we force it to be part of the signup modal)

Get more context about the research done here

duranmla commented 5 years ago

As there is a plan then that will satisfy the need itself using the Discourse configuration panel, I thing we can go ahead a do so, then we can define is we will preserve or not the wizard and that will shape the next iteration where we will possible do things like:

OR

duranmla commented 5 years ago

I will mark this as closed, in any case, if the proposed approach is not going to be taken we can reopen this ticket.

orlando commented 5 years ago

After a call with @duranmla, we will reopen this ticket and follow the approach described here https://www.notion.so/duranmla/250-Show-signup-wizard-custom-fields-in-user-profile-only-for-staff-a8ed2455308b44619c9f76fe5755ec5d

We will remove the first step of the wizard (User personal information) and combine it with the signup modal and leave the collectives selection in the wizard. The wizard will be changed to be an onboarding, teaching the users how to get around and the concept of collectives

duranmla commented 5 years ago

Currently, the code related to this has been developed with an isolated plugin at https://github.com/duranmla/discourse-us-extras we can change the ownership of the repo to debt collective one but basically is a plugin to create the custom field types we need.

At this point, the only missing piece is how to being able to hook to the submit event when validations fail and minor update of styling UI when validation is failing

duranmla commented 5 years ago

I have pushed the code to our new plugin at https://github.com/debtcollective/discourse-debtcollective-signup-fields/tree/1.0.0 follow the README in order to use it on production, in order to see the expected behavior check: