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

New bulk ops in importer #2472

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

richardolsson
Copy link
Member

Description

This PR updates prepareImportOperations() to replace the person.import bulk operation with new ops being added to the backend in the near future, that separates the actions into separate ops:

  • person.get to find an existing person by ID (or create if it's missing)
  • person.create to create a person object when no ID exists
  • person.setfields to set fields on an existing or new person object
  • person.tag to tag an existing or new person object
  • person.addtoorg to add an existing or new person object to an organization

In doing so, it also replaces the test suite for prepareImportOperations() to be a little bit more lean.

Screenshots

None

Changes

  • Update prepareImportOperations() to use new ops
  • Replace prepareImportOperations() test suite
  • Improve the Gender type

Notes to reviewer

None

Related issues

Undocumented

Copy link
Contributor

@ziggabyte ziggabyte left a comment

Choose a reason for hiding this comment

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

I think this looks good - it's very satisfying to see all that test code minimised and simplified :)

RIP to "length" as valid gender 💀

@@ -3,7 +3,7 @@ import { useAppDispatch } from 'core/hooks';
import { CellData, Column, ColumnKind } from '../utils/types';

export const genders = ['f', 'm', 'o'] as const;
export type Gender = typeof genders[keyof typeof genders];
Copy link
Contributor

Choose a reason for hiding this comment

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

love that "length" was a valid gender in the Zetkin Universe for some time, without anyone noticing 😂

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.

2 participants