Skip to content

feat(Organization): add organization types and unify entity presentation - #1580

Open
Paul-AUB wants to merge 22 commits into
developfrom
feat/organization-types
Open

Paul-AUB wants to merge 22 commits into
developfrom
feat/organization-types

Conversation

@Paul-AUB

@Paul-AUB Paul-AUB commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

feat(Organization): add organization types and unify entity presentation

🤔 What

Add seven organization types across forms, search, document references and maps. Present organization and person types consistently in their properties, with generic entity icons in page headers.

Closes #1374.

🤷‍♂️ Why

Distinguish an organization's principal type from its document roles and partner status. Preserve readable fallbacks and existing club behavior for unclassified organizations.

🔍 How

  • Share type selectors, labels and pictograms, with translations in all 15 languages and Storybook examples.
  • Require classification on creation and editing, including inline and association flows; retain editable document-context defaults.
  • Save organization fields, name and language in one request. Keep the custom message and country optional, allow clearing the country, validate email/URL formats and preserve failed submissions.
  • Gate membership/exploration controls by type, preserve historical relations and invalidate affected caches.
  • Use the shared organization type icons for document editors and organization authors; keep icons aligned to the first text line in compact table cells.
  • Use a building with orange windows for generic organizations and the former house for speleology clubs. Derive every map pictogram, including the generic fallback, from the same SVG artwork.
  • Preserve country focus and localized inline errors wherever the shared country selector is required. Replace the unsafe Emotion selector with :first-of-type.
  • Exclude bundled Yarn and generated local builds from ESLint.

See the implementation plan and presentation study.

🔗 Related API PR

GrottoCenter/grottocenter-api#1895 is merged. The organization type filter depends on completing the Typesense schema migration and reindexing in the target environment.

🧪 Testing

  • Focused unit tests covering organization forms, associations, types, cache invalidation and map markers.
  • Additional form and country-selector checks: 20 tests; document editor/author rendering: 45 tests.
  • Latest organization SVG and map-marker changes: 46 tests across organization type resolution, shared icons, marker construction and marker replacement.
  • SVG artwork visually checked at 18 px and 24 px.
  • 18 Cypress scenarios across organization type forms, organization presentation and person presentation, including responsive layouts, search, map pins and fullscreen maps.
  • Production build (yarn.cmd build).
  • Translation synchronization and sorting checks for all 15 languages.
  • ESLint on modified JavaScript files and git diff --check.
  • Full repository lint (yarn.cmd lint): zero errors or warnings.
  • Verify advanced search type filtering against the migrated Typesense schema.

Targeted unit tests use --pool=threads --maxWorkers=1 --testTimeout=15000; the threads pool avoids the observed fork-worker startup timeout. Cypress used Electron with a 10-second command timeout.

📸 Previews

Shared organization pictograms

Generic organization Speleology club
Generic organization building with orange windows Speleology club house

The screenshots below illustrate page layouts with demonstration API data; the pictograms above show the current artwork.

Organization type selection

Seven organization types in the creation form

Organization details

Desktop: publisher Mobile: caving club
Publisher details with type and document statistics Caving club summary, statistics and map on mobile

Organization search

Desktop: type filter and results Mobile: type filter and cards
Organization search with type filter and type column Organization search and result cards on mobile

Map pictograms and popup

Yellow organization markers with white club and rescue pictograms, and a typed popup

Person type in properties

Generic person header with the Author type in properties

@Paul-AUB Paul-AUB self-assigned this Oct 17, 2026
@Paul-AUB
Paul-AUB requested review from ClemRz and urien October 17, 2026 23:30
@Paul-AUB

Copy link
Copy Markdown
Contributor Author

Pour le moment pas d'env de staging de dispo.
J'ai changé les Persons également pour essayer de gérer les sous types de manière cohérente.
Je ne suis pas satisfait à 100% de la gestion des sous types pour les Persons et les Organizations, du coup si vous avez des retours à faire n'hésitez pas !

@urien

urien commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Dans les organisations je me demande s'il ne faut pas permettre qu'une organisation demeure sans type : on peut avoir des commerçants ou des groupes informels ou peut être d'autres trucs

Ainsi Bertrand aimerait pouvoir créer des "organisations" qui correspondent aux groupes prospection qui sont des groupes informels. Il souhaiterait ainsi qu’il soit possible d'avoir sur la page de ce type d'"organisation" la liste des contributions des membres de l'"organisation". Sur le modele de ce qui est en page d'accueil mais seulement avec ce qui est générer par les membres de l'"organisation"

Peut être qu'il y a d'autres services qu'on proposera d'associer aux organisations comme l'envoi de message et qu'il serait pertinent de proposer à des groupes informels

@urien

urien commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Les pictos me plaisent beaucoup

@Paul-AUB

Copy link
Copy Markdown
Contributor Author

Dans les organisations je me demande s'il ne faut pas permettre qu'une organisation demeure sans type : on peut avoir des commerçants ou des groupes informels ou peut être d'autres trucs

En fait pour le moment on 99,9999% des orgas qui sont sans type. Il va falloir un gros travail pour les catégoriser. Je propose de forcer à définir un type pour pouvoir trier et afficher une vue dédiée en conséquence. Typiquement si on veut "Il souhaiterait ainsi qu’il soit possible d'avoir sur la page de ce type d'"organisation" la liste des contributions des membres de l'"organisation"." , il faut un type dédié à rajouter.

Je propose donc de forcer les nouvelles orgas ou les orgas modifiées à devoir définir un type pour résorber au fur et à mesure les types. Un type "Groupe de prospection" pourrait être défini dans une autre feature.

Je ne suis pas certain qu'on veuille des orgas "Commerçant", mais à la limite on peut faire une catégorie "Autre" si besoin, ce serait mieux que ne pas déclarer de type (au moins on a un tri valide).

Du coup pour résumer la proposition:

  • Garder les types obligatoires
  • Si besoin d'une vue dédiée, créer une feature pour rajouter un type "Groupe de prospection" ; si pas de vue dédiée, ou dans une premier temps, soit réutiliser "Club de spéléo", ou "Organisation de recheche" par exemple.
  • Si besoin de gérer des types en mode "foure-tout", créer une feature pour créer un type "Autre". Je suis dubitatif là dessus.

Quel est ton avis sur la question @urien ?

@urien

urien commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Ok
Je vais me charger d'attribuer des types aux organisations et essayer de compléter les infos
La difficulté viendra pour les organisations qui ne correspondent a aucun type mais on peut garder cela pour un développement ultértieur

@Paul-AUB

Copy link
Copy Markdown
Contributor Author

Ok Je vais me charger d'attribuer des types aux organisations et essayer de compléter les infos La difficulté viendra pour les organisations qui ne correspondent a aucun type mais on peut garder cela pour un développement ultértieur

Si tu veux, je peux créer une vue dans les outils de gestion pour aider à la catégorisation, parce que là y'a +3000 orgas, c'est un travail de titan ! Je le fais de temps en temps à la main, mais il y a aussi bcp de doublons, écris plus ou moins pareils.

ça pourrait être une panneau de config temporaire le temps de gérer ça, qui recherche les doublons potentiels, propose un type conseillé à partir du nom, etc.

@urien

urien commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Ce serait parfait
Clément a fait un truc de ce genre sous forme d'un fichier html qui m'a permis de mettre a jour les données du Bresil

On peut aussi imaginer un truc vite fait dans les outils de gestion qui serait progressivement consolidé. Cela me plairait mieux. Il suffirait de le rendre uniquement accessible aux admins pour l'instant.
On a vraiment besoin d'un outil de mise à jour en masse, de gestion des doublons,....

@Paul-AUB

Copy link
Copy Markdown
Contributor Author

Je vais voir ce que je peux faire pour les orgas, en mode "temporaire".
Pour des outils plus globaux de gestion et modération des doublons et de modif de masse, je te propose de rédiger une Issue avec l'attendu utilisateur, comme ça on pourra dépiler petit à petit

@Paul-AUB

Copy link
Copy Markdown
Contributor Author

J'avais dans l'idée un truc dans ce gout là @urien :
image

Temporaire, le temps de catégoriser

@urien

urien commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Parfait.
Je m'occupe de catégoriser dès que c'est disponible

@Paul-AUB
Paul-AUB force-pushed the feat/organization-types branch from 9621ae3 to 63c7563 Compare October 19, 2026 16:08
@Paul-AUB

Copy link
Copy Markdown
Contributor Author

A few details about the moderator dashboard and the organization management tool:

The dashboard is the entry point for moderation tasks: document validation, duplicate management, guidelines, organization management and CSV import. Tools are displayed according to the user's permissions, with counters for pending documents and duplicates.

The Organization management tool is restricted to moderators and provides two tabs:

  • Types / organizations to classify: lists organizations without a type, with useful context (location, members, email and website). Moderators can preview an organization, open its edit form in a new tab, select a type and save it directly from the list. Successfully classified organizations disappear from the queue.
  • Duplicates: an explicit, cancellable scan suggests potential duplicates using shared contact details, normalized or similar names, location and acronyms. Moderators can inspect the reasons, compare records side by side, ignore a suggestion for the current tab session, or choose the organization to keep and confirm soft deletion of a duplicate with redirection to the retained record. Suggestions always require a moderator's decision.

The “Types” part is deliberately temporary and disposable. It is a cleanup aid for classifying existing organizations, and will be removed once all organizations have been assigned the correct type. The organization types themselves remain part of the application; it is this temporary classification interface that will go away.

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@Paul-AUB

Paul-AUB commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

J'ai aussi ajouter un proto-résolveur de duplication pour les orgas. C'est pas idéal car c'est uniquement côté front et pas fiable à 100%, faut plus voir ça comme une aide à la décision. Et les orgas dupliquées... il y en a PLEIN ! ça fait juste un "soft delete", donc pas de risque de tout casser, il faut aller confirmer la suppression.
J'ai fait ça rapidement, donc si tu vois des trucs pas pratiques dis moi.

Je te laisse le choix des armes suivant si tu préfères supprimer les doublons en premier ou gérer les types avant 🥲

image image image

@Paul-AUB

Copy link
Copy Markdown
Contributor Author

@urien c'est dispo sur le staging si tu veux expérimenter :)

@urien urien left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tout fonctionne très bien,

Je vais essayer de type le max d'organisation avant de communiquer
Pour la fusion il serait utile de pouvoir faire un hard delete des organisations en doublons afin que tous les documents soient attachés a une seule organisation. Eventuellement pouvoir retrouver les organisations qui ont été supprimées pour leur appliquer un hard delete

@Paul-AUB

Copy link
Copy Markdown
Contributor Author

Super !
Pour la suppression hard des orgas, j’ai fait remonter la priorité de deux tickets backends qui bloquent la possibilité actuellement a savoir:

  • supprimer et fusionner des orgas contenant des membres en faisant déplaçant les membres (actuellement tant qu’il y a des membres ça refuse la suppression)
  • permettre d’avoir la liste des orgas soft-deleted. Je pense que ça pourra être utile de toute facon d’avoir la liste des entités qui attendent une suppression définitive dans les outils de gestion

@Paul-AUB
Paul-AUB requested a review from urien October 20, 2026 09:19
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@urien urien left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

C'est bon pour moi.
Merci beaucoup

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1580.westeurope.azurestaticapps.net

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.

autoriser l'association d'une organisation avec une typologie d'organisation

2 participants