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

Import: Gender field has no mapping configuration #2348

Open
richardolsson opened this issue Nov 12, 2024 · 2 comments · May be fixed by #2401
Open

Import: Gender field has no mapping configuration #2348

richardolsson opened this issue Nov 12, 2024 · 2 comments · May be fixed by #2401
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue.

Comments

@richardolsson
Copy link
Member

Description

Zetkin has native fields on person object (e.g. first name and email), that exist in all organizations, and custom fields, which is a way for an organization to create additional fields on a person object. The "gender" field is a native field in Zetkin. It allows four values, 'm' (male), 'f' (female), 'o' (other) and null (unknown).

The import feature in Zetkin allows admin users to import data from a CSV or Excel file, usually exported from some other system. Those systems rarely have the exact same conventions for the gender field, so there needs to be some sort of way for users of the importer to map from values in the file to one of the allowed values in Zetkin.

Similar mapping already exists for several other types of data, such as custom fields of the "enum" type, tags and organizations.

Steps to reproduce

  1. Go to https://app.dev.zetkin.org/organize/1/people
  2. Click on "CREATE"
  3. Click on "Import people"
  4. Drop any small CSV file (see example below)
  5. For the "GENDER" column, pick "Gender" from the drop-down

Sample CSV

FIRST,LAST,GENDER
Clara,Zetkin,woman
Richard,Olsson,man
Someone,Else,nb
Lesser,Known,unknown

Expected Behaviour

There should be a "Configure" option under the dropdown, and the configuration should open to the right. The configuration should allow the user to map the values that exist in the column ("woman", "man", "nb" and "unknown") to the allowed values in Zetkin. Compare with how the "tag" filter or "extra enum" filter works.

Actual Behaviour

No configuration on the right hand side.

Screenshots (if you have any)

image

Proposed solution

Have a look at how the configuration for tags, organizations and enum fields work.

@richardolsson richardolsson added 🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue. labels Nov 12, 2024
@k-nut
Copy link
Collaborator

k-nut commented Nov 24, 2024

I'd like to give this a shot :)

@richardolsson
Copy link
Member Author

Awesome @k-nut! PR #2210 contains (among other things) UI similar to what this would need to do, but for enum fields. The ("native", as opposed to "custom") gender field is basically like a (custom) enum field but with hard-coded values.

@k-nut k-nut linked a pull request Dec 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants