Skip to content

Affiliation-extras plugin: add Affiliation Catalogs#6

Open
duartegalvao wants to merge 26 commits into
indico:masterfrom
duartegalvao:affiliation-schemas
Open

Affiliation-extras plugin: add Affiliation Catalogs#6
duartegalvao wants to merge 26 commits into
indico:masterfrom
duartegalvao:affiliation-schemas

Conversation

@duartegalvao

Copy link
Copy Markdown
Member

This PR contains a second version of the affiliation-extras plugin.
Changelog:

  • Affiliation Catalogs: events can have set lists of affiliations categorized by type (e.g. Organizations, Institutes, etc.). Each list filters affiliations based on a list of groups, tags and ad-hoc affiliations. Catalogs can be set at category-level and inherited.
  • Representation Field: new field type for registration forms, which requests participants to select a representation type (linked to the event's Affiliation Catalog) before selecting an affiliation.

Depends on:

@moliholy moliholy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A few things that don't map to a single line:

  • No controller tests.
  • schemas_test.py stubs sys.modules and skips the catalog schemas entirely, so the catalog args + the uniqueness validators (the headline feature) are untested.
  • State/props are snake_case while one endpoint opts into camelize. Core camelizes at the boundary; worth picking one.

Comment thread affiliation_extras/indico_affiliation_extras/controllers/regform.py Outdated
Comment thread affiliation_extras/indico_affiliation_extras/controllers/regform.py Outdated
Comment thread affiliation_extras/indico_affiliation_extras/schemas.py
Comment thread affiliation_extras/indico_affiliation_extras/controllers/admin.py Outdated
Comment thread affiliation_extras/indico_affiliation_extras/util.py
Comment thread affiliation_extras/indico_affiliation_extras/blueprint.py Outdated
Comment thread affiliation_extras/indico_affiliation_extras/models/lists.py Outdated
Comment thread affiliation_extras/indico_affiliation_extras/client/index.js Outdated
Comment thread affiliation_extras/indico_affiliation_extras/controllers/access_test.py Outdated
duartegalvao and others added 14 commits June 23, 2026 10:36
* Add invite affiliations tab

Move AffiliationInvitations definition to another file

Improve AddItemsModal UI

Migrate invite dialog to use AffiliationListField

Replaces the regform-endpoint-based AffiliationsTab with AffiliationInvitations,
which delegates affiliation selection to the existing AffiliationListField component.
AddItemsModal is refactored from a generic data-URL modal to an affiliation-specific
search modal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Show user count per affiliation in AddItemsModal search results

Extends the affiliations search API to include user_count per affiliation.
AddItemsModal gains a showInviteCount prop that, when enabled, displays
the registration count per result item and a running total of registrations
for newly added affiliations in the footer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Fix send button to show correct invitation count

Adds a backend endpoint that counts unique users across the selected
affiliations, groups, and tags (deduplicating users who belong to
multiple entries). AffiliationListField fetches this count asynchronously
and stores it in _userCount so the synchronous getCount callback in
AffiliationInvitations can return the accurate value for the send
confirmation dialog.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Improve ui

Self review minor improvements

Turn the results column in a ternary expression

Decouple userCount from AffiliationListField and AddItemsModal

Disable search button if no search input

Change UserBasicSchema for BasicUserSchema

Remove comments

Use resolve_affiliations when necessary

Rename affiliationInvitations

Move AddItemsModal.jsx

Fix rebase problems

Convert AddItemsModal from JS to TS

Remove email attachments comments

Improve CSS for AddItemsModal.tsx

Small refactor

Self review fixes

* Small refactor to follow indico patterns

* Improve tags

* Refactor useEffect and variable names

* Add AddAffiliationsModal scss module

* Add AffiliationListField scss module

* Improve css styles

* Run biomejs

* Fix affiliation invitation schema import

* Fix conditional hook

* Add compatibility shim

* Apply code style improvements

---------

Co-authored-by: Duarte Galvão <duarte.galvao@unconventional.dev>
moliholy and others added 11 commits June 23, 2026 10:36
* test: mock plugin manifest so manage pages render in tests

* fix: keep unchanged representation value valid after catalog changes

* perf: resolve inherited default catalogs without per-ancestor queries

* fix: reject duplicate affiliation list names in a catalog

* refactor: register all models from the package init

* fix: handle failed affiliation resolve without crashing the list

* fix: use stable keys for unsaved catalog list rows

* fix: correct invalid contact emails warning condition
* perf: resolve affiliations in a constant number of queries

* perf: fetch invited users in a single query

* fix: let regform managers invite by affiliation

* refactor: simplify the email image upload handler

* refactor: drop the /api prefix from admin endpoints

* perf: load affiliation users in a single query

* fix: default the affiliation list position

* refactor: apply review feedback to the affiliation client

* fix: let regform managers see the affiliation user count

* test: drop schema stub and cover catalog validation

* test: add management endpoint access matrix

* chore: remove unused imports and void a floating promise

* fix: let managers read affiliation groups, tags and search

* style: drop the void on the affiliation search call

* test: cover the email image upload

* fix: scope affiliation reference endpoints to event or category

* refactor: use `SearchAffiliationsMixin` for the extended affiliation search
@duartegalvao
duartegalvao force-pushed the affiliation-schemas branch from 0012e73 to e8df8e6 Compare June 23, 2026 09:36
@duartegalvao
duartegalvao marked this pull request as ready for review June 23, 2026 09:38
tomako pushed a commit to wipo-digital-secretariat/indico-plugins-contrib that referenced this pull request Jul 14, 2026
…co#6)

7232300 Add missing i18n
e8df8e6 Fix visual bug where group/tag dropdowns get clipped by modal
fa10014 Refactor scoped RHs to match with Indico patterns
e12fbe7 Fix country API being admin-only
b5bf3bd Bump plugin version
6791494 Handle tagged groups in affiliation search
91db545 Refactor affiliation search into FinalForm
7e59835 Code improvements
1e0deb2 Apply review feedback to the Affiliation Catalogs plugin (indico#3)
d851273 Remove unnecessary i18n
4ba229d Fix param name mismatch
7707ed5 Review fixes for the Affiliation Catalogs plugin (indico#2)
13131b5 Improve log format
6b1af16 Run ruff format
ea9b01b Add reglist columns for representation affiliation and type
18fecc7 Allow inviting affiliations (indico#1)
73173db Cleanup code
7104de0 Add representation field
7f65c91 Rename category controllers to catalogs
f94ff54 Implement catalog editor for events
a8ac9c9 Rename presets to catalogs
fcd718b Allow setting a default preset
e659518 Allow cloning presets
5c962aa Show origin group and tags on affiliations list
4671831 Add affiliation presets
886f9e9 Use UploadFileMixin for picture attachments
tomako pushed a commit to wipo-digital-secretariat/indico-plugins-contrib that referenced this pull request Jul 15, 2026
…co#6)

7232300 Add missing i18n
e8df8e6 Fix visual bug where group/tag dropdowns get clipped by modal
fa10014 Refactor scoped RHs to match with Indico patterns
e12fbe7 Fix country API being admin-only
b5bf3bd Bump plugin version
6791494 Handle tagged groups in affiliation search
91db545 Refactor affiliation search into FinalForm
7e59835 Code improvements
1e0deb2 Apply review feedback to the Affiliation Catalogs plugin (indico#3)
d851273 Remove unnecessary i18n
4ba229d Fix param name mismatch
7707ed5 Review fixes for the Affiliation Catalogs plugin (indico#2)
13131b5 Improve log format
6b1af16 Run ruff format
ea9b01b Add reglist columns for representation affiliation and type
18fecc7 Allow inviting affiliations (indico#1)
73173db Cleanup code
7104de0 Add representation field
7f65c91 Rename category controllers to catalogs
f94ff54 Implement catalog editor for events
a8ac9c9 Rename presets to catalogs
fcd718b Allow setting a default preset
e659518 Allow cloning presets
5c962aa Show origin group and tags on affiliations list
4671831 Add affiliation presets
886f9e9 Use UploadFileMixin for picture attachments
tomako pushed a commit to wipo-digital-secretariat/indico-plugins-contrib that referenced this pull request Jul 22, 2026
…co#6)

7232300 Add missing i18n
e8df8e6 Fix visual bug where group/tag dropdowns get clipped by modal
fa10014 Refactor scoped RHs to match with Indico patterns
e12fbe7 Fix country API being admin-only
b5bf3bd Bump plugin version
6791494 Handle tagged groups in affiliation search
91db545 Refactor affiliation search into FinalForm
7e59835 Code improvements
1e0deb2 Apply review feedback to the Affiliation Catalogs plugin (indico#3)
d851273 Remove unnecessary i18n
4ba229d Fix param name mismatch
7707ed5 Review fixes for the Affiliation Catalogs plugin (indico#2)
13131b5 Improve log format
6b1af16 Run ruff format
ea9b01b Add reglist columns for representation affiliation and type
18fecc7 Allow inviting affiliations (indico#1)
73173db Cleanup code
7104de0 Add representation field
7f65c91 Rename category controllers to catalogs
f94ff54 Implement catalog editor for events
a8ac9c9 Rename presets to catalogs
fcd718b Allow setting a default preset
e659518 Allow cloning presets
5c962aa Show origin group and tags on affiliations list
4671831 Add affiliation presets
886f9e9 Use UploadFileMixin for picture attachments
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.

3 participants