Skip to content

feat: ROR: add support for ROR#6949

Merged
NicolasCARPi merged 20 commits into
masterfrom
nico/260607-teamror
Jun 14, 2026
Merged

feat: ROR: add support for ROR#6949
NicolasCARPi merged 20 commits into
masterfrom
nico/260607-teamror

Conversation

@NicolasCARPi

@NicolasCARPi NicolasCARPi commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

fix #5569

Pull Request Checklist


Pull Request Description

Please provide clear context for your proposed change:

  • What issue or need does this PR address?
    Add support for ROR at instance, team and user levels.

  • How did you approach the solution?
    Create three tables, expose new submodel endpoints for rors on /instance/rors, /teams/current/rors and /users/me/rors, use one svelte component on sysconfig, admin and profile pages.
    Add it in .eln exports too.

  • If applicable, include screenshots or examples (especially for UI changes).

2026-06-14-011311_982x533_scrot

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Research Organization Registry (ROR) management for instances, teams, and users with new dedicated interface sections.
    • ROR affiliations now display in PDF exports and ELN documents.
    • New ROR association endpoints available via API.
  • UI Updates

    • Added ROR management sections to Admin settings, Server configuration, and User profile pages.
    • Added team-level ROR association management interface.
  • Internationalization

    • Updated translations across all supported languages for new ROR-related UI labels and messages.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91d73f4e-b60b-48a1-b17e-64c5a0e22763

📥 Commits

Reviewing files that changed from the base of the PR and between 7364ab3 and d5e9185.

📒 Files selected for processing (2)
  • src/Commands/ExportEln.php
  • tests/unit/models/TeamsTest.php

📝 Walkthrough

Walkthrough

Adds Research Organization Registry (ROR) association management at instance, team, and user scope levels. Three new database tables (instance2rors, teams2rors, users2rors) store validated ROR identifiers. New PHP models, an abstract base class, API routing, and a Svelte UI component provide CRUD operations. ELN and PDF exports are enriched with ROR affiliation data. Translation keys are added across 22 locales.

Changes

ROR Association Feature

Layer / File(s) Summary
Database schema and migration
src/sql/schema212.sql, src/sql/schema212-down.sql, src/sql/structure.sql, src/Elabftw/SchemaVersionChecker.php
Introduces three new InnoDB tables with primary keys, CHECK REGEXP ROR-format constraints, foreign-key cascades, and indexes. Schema version is bumped to 212 with a matching rollback script.
Abstract2Rors base class and ROR validator
src/Models/Abstract2Rors.php, src/Services/Check.php
Adds the Abstract2Rors abstract model extending AbstractRest, centralizing DB wiring, postAction() gating, canwriteOrExplode(), and abstract create(). Adds Check::ror() static regex validator.
Concrete ROR models
src/Models/Instance2Rors.php, src/Models/Teams2Rors.php, src/Models/Users2Rors.php
Implements CRUD SQL operations (INSERT IGNORE, read-one, read-all, delete) with permission enforcement and API path generation for all three scope levels.
Teams.canWrite() refactor
src/Models/Teams.php
Extracts a public canWrite(): bool method from canWriteOrExplode(), allowing permission queries without throwing; removes RuntimeException usage for null team id.
API enum and controller routing
src/Enums/ApiSubModels.php, src/Controllers/Apiv2Controller.php
Adds ApiSubModels::Rors case, getInstanceCases(), and updates Apiv2Controller to parse subIdString, handle Instance-scoped routes, and dispatch Teams2Rors/Users2Rors/Instance2Rors with appropriate permission context.
ELN export ROR enrichment
src/Make/AbstractMakeEln.php, src/Make/MakeEln.php, src/Make/MakeElnHtml.php, src/Make/MakeTeamEln.php
Extends ELN constructors to accept ROR dependencies; adds getInstanceRors() for memberOf JSON-LD output and getUserRors() for per-author affiliation nodes; bumps INTERNAL_ELN_VERSION to 107.
PDF export ROR enrichment
src/Make/MakePdf.php, src/Make/MakeStreamZip.php, src/Make/AbstractMakeTimestamp.php, src/templates/pdf.html
Extends MakePdf with three ROR dependencies and a getRors() helper; injects ROR data into template render array; adds an "Affiliations" block to pdf.html.
Export entry-point and DSpace wiring
src/Make/Exports.php, src/Controllers/MakeController.php, src/Commands/ExportEln.php, src/Models/Dspace.php
Updates all MakeEln, MakeElnHtml, MakeMultiPdf, and MakePdf instantiation sites to inject the three ROR model objects.
Rors Svelte component and mounting
src/ts/components/Rors.svelte, src/ts/misc.ts, src/ts/common.ts, containers/elabimg/nginx/common.conf
Adds Rors.svelte with full CRUD UI, external api.ror.org name lookup, and relativeMoment integration. Exports mountRors() from misc.ts, wires it into startup, and adds https://api.ror.org to the CSP connect-src.
HTML template mount points
src/templates/admin.html, src/templates/sysconfig.html, src/templates/profile.html, src/templates/edit-user-modal.html
Inserts data-svelte-component='rors' placeholders and section headings for all three scope levels across admin, sysconfig, profile, and user-modal pages.
i18n translations
src/Elabftw/i18n4Js.php, src/ts/langs/*
Adds action, association-date, existing-ror-associations, no-rors, organisation-name, and five ror-* keys to the PHP terms source and all 22 TypeScript locale files.
Unit and integration tests
tests/unit/models/Instance2RorsTest.php, tests/unit/models/Teams2RorsTest.php, tests/unit/models/Users2RorsTest.php, tests/unit/models/TeamsTest.php, tests/unit/Make/*, tests/cypress/integration/rors.cy.ts
New PHPUnit tests cover CRUD lifecycle and exception paths for all three ROR models; existing Make tests are wired with new dependencies; TeamsTest updated for IllegalActionException; Cypress e2e test verifies add/delete flows across sysconfig, admin, and profile routes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • elabftw/elabftw#6802: Both PRs modify the Nginx Content-Security-Policy connect-src allowlist in containers/elabimg/nginx/common.conf.
  • elabftw/elabftw#6648: Both PRs touch src/Make/AbstractMakeEln.php by changing INTERNAL_ELN_VERSION and ELN metadata generation.
  • elabftw/elabftw#6484: Both PRs modify src/Elabftw/i18n4Js.php's generated i18n terms list, touching the same term-generation code path.

Suggested reviewers

  • MoustaphaCamara

Poem

🖖 Number One to all decks — new orders from the bridge:
ROR identifiers now warp through every ridge,
Three tables stand like bulkheads in the core,
Each team and user logged from shore to shore.
The ELN and PDF carry affiliation true,
Engage all locales — make it so, all 22! 🚀

@NicolasCARPi NicolasCARPi marked this pull request as ready for review June 14, 2026 10:32

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 12

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/ts/misc.ts (1)

235-240: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Number One: this thrown validation error is not safely absorbed by async handlers.

Line 240 now throws, but several async UI actions call collectForm() without local try/catch, and the central click dispatcher in src/ts/common.ts (Line 1567) does not await handler promises. Result: invalid input can surface as unhandled rejections instead of controlled user feedback.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ts/misc.ts` around lines 235 - 240, The validation error thrown in the
collectForm() function when reportValidity() fails is not being safely handled
by its callers. Wrap all async calls to collectForm() with try/catch blocks to
catch the thrown Error from line 240, and update the central click dispatcher in
src/ts/common.ts at line 1567 to await handler promises so that any rejected
promises from validation errors are properly caught rather than surfacing as
unhandled rejections. This ensures invalid input triggers controlled user
feedback instead of unhandled promise rejections.
src/ts/langs/fr_FR.ts (1)

97-121: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the new ROR copy and make no-rors scope-neutral.

These locale files still ship English placeholders for the new ROR UI, so non-English users will see untranslated text. no-rors also says “this team” even though Rors.svelte reuses that key for instance, team, and user views.

  • src/ts/langs/fr_FR.ts#L97-L121: translate the new ROR keys and replace no-rors with a generic message.
  • src/ts/langs/id_ID.ts#L97-L121: translate the new ROR keys and replace no-rors with a generic message.
  • src/ts/langs/it_IT.ts#L97-L121: translate the new ROR keys and replace no-rors with a generic message.
  • src/ts/langs/ja_JP.ts#L97-L121: translate the new ROR keys and replace no-rors with a generic message.
  • src/ts/langs/ko_KR.ts#L97-L121: translate the new ROR keys and replace no-rors with a generic message.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ts/langs/fr_FR.ts` around lines 97 - 121, The ROR-related locale strings
contain untranslated English text and the `no-rors` key uses team-specific
language despite being reused across instance, team, and user views. In all five
language files (src/ts/langs/fr_FR.ts lines 97-121, src/ts/langs/id_ID.ts lines
97-121, src/ts/langs/it_IT.ts lines 97-121, src/ts/langs/ja_JP.ts lines 97-121,
and src/ts/langs/ko_KR.ts lines 97-121), translate the English placeholder
strings for the keys ror-description, ror-description-team,
ror-description-user, ror-input-label, and ror-input-title into the appropriate
language for each file. Additionally, replace the `no-rors` value in each file
with a scope-neutral generic message that does not mention "team" specifically,
since this key is reused across instance-level, team-level, and user-level views
in Rors.svelte.
src/ts/langs/ca_ES.ts (1)

62-121: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize the new ROR copy across all locale bundles.

The new ROR strings were added in English everywhere, and no-rors is also too team-specific for a key that Rors.svelte renders on instance, team, and user pages. That leaks English copy into localized UIs and shows the wrong empty-state wording outside team screens.

  • src/ts/langs/ca_ES.ts#L62-L121: translate the new ROR block and replace no-rors with neutral copy.
  • src/ts/langs/cs_CZ.ts#L62-L121: translate the new ROR block and replace no-rors with neutral copy.
  • src/ts/langs/de_DE.ts#L62-L121: translate the new ROR block and replace no-rors with neutral copy.
  • src/ts/langs/el_GR.ts#L62-L121: translate the new ROR block and replace no-rors with neutral copy.
  • src/ts/langs/sl_SI.ts#L62-L121: translate the new ROR block and replace no-rors with neutral copy.
  • src/ts/langs/uz_UZ.ts#L62-L121: translate the new ROR block and replace no-rors with neutral copy.
  • src/ts/langs/zh_CN.ts#L62-L121: translate the new ROR block and replace no-rors with neutral copy.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ts/langs/ca_ES.ts` around lines 62 - 121, Translate the new ROR-related
strings to their respective languages and fix the team-specific wording in all
locale files. In src/ts/langs/ca_ES.ts#L62-L121 (anchor),
src/ts/langs/cs_CZ.ts#L62-L121, src/ts/langs/de_DE.ts#L62-L121,
src/ts/langs/el_GR.ts#L62-L121, src/ts/langs/sl_SI.ts#L62-L121,
src/ts/langs/uz_UZ.ts#L62-L121, and src/ts/langs/zh_CN.ts#L62-L121 (siblings):
Translate the keys for "no-rors", "ror-description", "ror-description-team",
"ror-description-user", "ror-input-label", and "ror-input-title" into each
language. Replace the "no-rors" value with neutral wording instead of "No ROR
associated with this team yet." so it works correctly on instance, team, and
user pages without leaking English strings or team-specific language into
localized UIs.
🧹 Nitpick comments (1)
tests/unit/Make/MakeElnTest.php (1)

53-56: 🏗️ Heavy lift

Captain, add behavior assertions for ROR export content, not just constructor wiring.

These tests currently confirm instantiation/basic output shape, but not that ROR affiliations are actually emitted.

  • tests/unit/Make/MakeElnTest.php#L53-L56: assert ELN JSON-LD includes expected memberOf/affiliation ROR identifiers.
  • tests/unit/Make/MakePdfTest.php#L79-L87: assert generated PDF content/render payload includes affiliation block when RORs exist.
  • tests/unit/Make/MakeMultiPdfTest.php#L47-L50: add at least one assertion that multi-export output carries ROR affiliation text for included entities.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/Make/MakeElnTest.php` around lines 53 - 56, The three test methods
across multiple files currently only verify basic instantiation and output shape
but do not assert that ROR affiliation data is actually included in the exported
content. In tests/unit/Make/MakeElnTest.php (lines 53-56), the testGetElnExp
method must assert that the ELN JSON-LD output contains expected memberOf or
affiliation ROR identifiers after calling getStreamZip(). In
tests/unit/Make/MakePdfTest.php (lines 79-87), add assertions to verify the
generated PDF content or render payload includes an affiliation block when ROR
data exists. In tests/unit/Make/MakeMultiPdfTest.php (lines 47-50), add at least
one assertion that the multi-export output carries ROR affiliation text for the
included entities. Each test should move beyond verifying object construction to
actually inspect the exported data structures and confirm ROR affiliations are
present and properly formatted.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Controllers/Apiv2Controller.php`:
- Around line 173-174: The assignment of $submodel on line 173 directly accesses
$req[4] without a guard, which can trigger an undefined-offset notice when the
route segment is missing (such as for a plain /api/v2/instance request). Apply a
null coalescing operator with an empty string default to $req[4], matching the
pattern already used for $subIdString on line 174, so that missing segments are
safely handled without throwing notices.
- Around line 177-180: The issue is that $subIdString is unconditionally coerced
to an integer on line 177, which converts non-numeric string identifiers (like
"04t0gwh46") to 0, breaking single-resource GET routing for string-based
identifiers like RORs. Instead of always casting to int, check if $subIdString
contains only numeric characters before converting; if it's non-numeric,
preserve it as a string identifier in $this->subId. Then ensure the downstream
getArray() method and routing logic properly check for both numeric $this->subId
and string identifiers to correctly route to readOne() for single-resource
requests instead of collection reads.

In `@src/Elabftw/i18n4Js.php`:
- Line 141: The message string for the `no-rors` key in the i18n4Js.php file
contains "this team" which is scope-specific and inaccurate when the same key is
reused in instance and user page contexts via Rors.svelte. Replace the
scope-specific text with a neutral message that works correctly across all three
contexts (instance, team, and user pages) without referencing any particular
scope.

In `@src/Make/MakeEln.php`:
- Around line 446-460: The getUserRors method is using
$this->users2Rors->readAll() which reads RORs for the requester (the bound user
of this instance), but it should read RORs for the $user parameter passed into
the method. Replace the $this->users2Rors->readAll() call with a method that
reads RORs specific to $user by using $user->getUserid(), similar to how
$UsersHelper is used to fetch team RORs. This ensures each author gets their own
correct affiliations in the export instead of inheriting the requester's
affiliations.

In `@src/Make/MakePdf.php`:
- Line 285: The getRors() method call at the location where 'rors' is assigned
has its arguments reversed. The method signature expects getRors(int $teamid,
int $userid) with team ID first, but the call currently passes userid first and
team second. Reverse the order of arguments in the getRors() call so that the
team value is passed first and the userid value is passed second to ensure
correct team and user lookups.

In `@src/Models/Teams.php`:
- Around line 323-325: The canWrite() method currently throws a RuntimeException
when the team id is null, but since this method is used as a boolean probe in
API submodel routing, the exception can bubble into a 500 error instead of a
controlled permission denial. Modify the canWrite() method to return false when
the team id is null instead of throwing the exception. Move the throwing
behavior into a separate method named canWriteOrExplode() that performs the same
check and throws the RuntimeException, ensuring that code that explicitly wants
to fail on null team id can call that method instead.

In `@src/ts/components/Rors.svelte`:
- Around line 44-60: The `translateRor` function has unhandled async operations
that can throw exceptions during the fetch call and JSON parsing, causing
unhandled rejections that bubble up to `loadOrganizationNames()` and
`loadRors()` when the ROR API is unavailable. Wrap the entire body of
`translateRor` (starting from the fetch call through the data processing) in a
try-catch block, and in the catch block return the original `ror` parameter as a
graceful fallback. This ensures network failures and JSON parsing errors are
contained at the source instead of propagating as unhandled errors.

In `@src/ts/langs/en_US.ts`:
- Line 107: The en_US locale file contains British English spelling for the
"organisation-name" key. Change "Organisation name" to "Organization name" to
use the correct American English spelling for US users in the en_US locale.

In `@src/ts/langs/nl_BE.ts`:
- Line 97: The `"no-rors"` translation string in the nl_BE locale file is
currently team-specific ("No ROR associated with this team yet.") but this key
is shared across multiple contexts including team, instance, and user endpoints,
making the message inaccurate in most use cases. Change the message to be
scope-neutral (for example, "No ROR associations yet.") that works across all
contexts, then regenerate all locale files to propagate this change
consistently.

In `@src/ts/langs/pl_PL.ts`:
- Line 12: Remove the trailing whitespace from the "add-user-error" translation
string in the Polish language file. The string currently ends with a space after
"użytkownika " which should be removed so it reads "użytkownika" without the
trailing space to prevent rendering issues in UI concatenations and tooltips.

In `@src/ts/misc.ts`:
- Around line 1036-1069: The mountRors function currently mounts all ROR
components eagerly by querying and processing all elements with the
data-svelte-component attribute in a single operation, which causes unnecessary
API loads on startup especially when many ROR components are inside collapsed
details elements. Instead of mounting all components immediately, refactor
mountRors to attach event listeners to parent details elements and mount the
corresponding ROR component lazily only when a details element is opened. This
will defer component initialization and API calls until the user actually
expands a details section, reducing startup load on large instances.

In `@tests/unit/models/Instance2RorsTest.php`:
- Around line 41-49: To ensure test cleanup is guaranteed even if assertions
fail, refactor each test to use a try/finally pattern. In
tests/unit/models/Instance2RorsTest.php#L41-L49 in method testAll(), wrap the
postAction() call and subsequent assertions in a try block with
$this->Instance2Rors->destroy() in the finally block. Apply the identical
try/finally cleanup pattern to tests/unit/models/Teams2RorsTest.php#L39-L48 and
tests/unit/models/Users2RorsTest.php#L45-L54, placing the destroy() call in the
finally block to guarantee cleanup occurs regardless of assertion success or
failure, preventing state leakage between tests.

---

Outside diff comments:
In `@src/ts/langs/ca_ES.ts`:
- Around line 62-121: Translate the new ROR-related strings to their respective
languages and fix the team-specific wording in all locale files. In
src/ts/langs/ca_ES.ts#L62-L121 (anchor), src/ts/langs/cs_CZ.ts#L62-L121,
src/ts/langs/de_DE.ts#L62-L121, src/ts/langs/el_GR.ts#L62-L121,
src/ts/langs/sl_SI.ts#L62-L121, src/ts/langs/uz_UZ.ts#L62-L121, and
src/ts/langs/zh_CN.ts#L62-L121 (siblings): Translate the keys for "no-rors",
"ror-description", "ror-description-team", "ror-description-user",
"ror-input-label", and "ror-input-title" into each language. Replace the
"no-rors" value with neutral wording instead of "No ROR associated with this
team yet." so it works correctly on instance, team, and user pages without
leaking English strings or team-specific language into localized UIs.

In `@src/ts/langs/fr_FR.ts`:
- Around line 97-121: The ROR-related locale strings contain untranslated
English text and the `no-rors` key uses team-specific language despite being
reused across instance, team, and user views. In all five language files
(src/ts/langs/fr_FR.ts lines 97-121, src/ts/langs/id_ID.ts lines 97-121,
src/ts/langs/it_IT.ts lines 97-121, src/ts/langs/ja_JP.ts lines 97-121, and
src/ts/langs/ko_KR.ts lines 97-121), translate the English placeholder strings
for the keys ror-description, ror-description-team, ror-description-user,
ror-input-label, and ror-input-title into the appropriate language for each
file. Additionally, replace the `no-rors` value in each file with a
scope-neutral generic message that does not mention "team" specifically, since
this key is reused across instance-level, team-level, and user-level views in
Rors.svelte.

In `@src/ts/misc.ts`:
- Around line 235-240: The validation error thrown in the collectForm() function
when reportValidity() fails is not being safely handled by its callers. Wrap all
async calls to collectForm() with try/catch blocks to catch the thrown Error
from line 240, and update the central click dispatcher in src/ts/common.ts at
line 1567 to await handler promises so that any rejected promises from
validation errors are properly caught rather than surfacing as unhandled
rejections. This ensures invalid input triggers controlled user feedback instead
of unhandled promise rejections.

---

Nitpick comments:
In `@tests/unit/Make/MakeElnTest.php`:
- Around line 53-56: The three test methods across multiple files currently only
verify basic instantiation and output shape but do not assert that ROR
affiliation data is actually included in the exported content. In
tests/unit/Make/MakeElnTest.php (lines 53-56), the testGetElnExp method must
assert that the ELN JSON-LD output contains expected memberOf or affiliation ROR
identifiers after calling getStreamZip(). In tests/unit/Make/MakePdfTest.php
(lines 79-87), add assertions to verify the generated PDF content or render
payload includes an affiliation block when ROR data exists. In
tests/unit/Make/MakeMultiPdfTest.php (lines 47-50), add at least one assertion
that the multi-export output carries ROR affiliation text for the included
entities. Each test should move beyond verifying object construction to actually
inspect the exported data structures and confirm ROR affiliations are present
and properly formatted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9a7a988-e1e7-40bb-bb20-479243e56190

📥 Commits

Reviewing files that changed from the base of the PR and between 6cb960b and e91edb9.

📒 Files selected for processing (66)
  • containers/elabimg/nginx/common.conf
  • src/Commands/ExportEln.php
  • src/Controllers/Apiv2Controller.php
  • src/Controllers/MakeController.php
  • src/Elabftw/SchemaVersionChecker.php
  • src/Elabftw/i18n4Js.php
  • src/Enums/Action.php
  • src/Enums/ApiSubModels.php
  • src/Make/AbstractMakeEln.php
  • src/Make/AbstractMakeTimestamp.php
  • src/Make/Exports.php
  • src/Make/MakeEln.php
  • src/Make/MakeElnHtml.php
  • src/Make/MakePdf.php
  • src/Make/MakeStreamZip.php
  • src/Make/MakeTeamEln.php
  • src/Models/Abstract2Rors.php
  • src/Models/Dspace.php
  • src/Models/Instance2Rors.php
  • src/Models/Teams.php
  • src/Models/Teams2Rors.php
  • src/Models/Users2Rors.php
  • src/Services/Check.php
  • src/sql/schema212-down.sql
  • src/sql/schema212.sql
  • src/sql/structure.sql
  • src/templates/admin.html
  • src/templates/edit-user-modal.html
  • src/templates/pdf.html
  • src/templates/profile.html
  • src/templates/sysconfig.html
  • src/ts/common.ts
  • src/ts/components/Rors.svelte
  • src/ts/langs/ca_ES.ts
  • src/ts/langs/cs_CZ.ts
  • src/ts/langs/de_DE.ts
  • src/ts/langs/el_GR.ts
  • src/ts/langs/en_GB.ts
  • src/ts/langs/en_US.ts
  • src/ts/langs/es_ES.ts
  • src/ts/langs/et_EE.ts
  • src/ts/langs/fi_FI.ts
  • src/ts/langs/fr_FR.ts
  • src/ts/langs/id_ID.ts
  • src/ts/langs/it_IT.ts
  • src/ts/langs/ja_JP.ts
  • src/ts/langs/ko_KR.ts
  • src/ts/langs/nl_BE.ts
  • src/ts/langs/pl_PL.ts
  • src/ts/langs/pt_BR.ts
  • src/ts/langs/pt_PT.ts
  • src/ts/langs/ru_RU.ts
  • src/ts/langs/sk_SK.ts
  • src/ts/langs/sl_SI.ts
  • src/ts/langs/uz_UZ.ts
  • src/ts/langs/zh_CN.ts
  • src/ts/langs/zh_TW.ts
  • src/ts/misc.ts
  • tests/cypress/integration/rors.cy.ts
  • tests/unit/Make/MakeElnTest.php
  • tests/unit/Make/MakeMultiPdfTest.php
  • tests/unit/Make/MakePdfTest.php
  • tests/unit/models/Instance2RorsTest.php
  • tests/unit/models/Teams2RorsTest.php
  • tests/unit/models/Users2RorsTest.php
  • web/admin.php
💤 Files with no reviewable changes (1)
  • web/admin.php

Comment thread src/Controllers/Apiv2Controller.php Outdated
Comment thread src/Controllers/Apiv2Controller.php
Comment thread src/Elabftw/i18n4Js.php Outdated
Comment thread src/Make/MakeEln.php
Comment thread src/Make/MakePdf.php Outdated
Comment thread src/ts/langs/en_US.ts
"only-a-sysadmin": "Only a Sysadmin can modify this.",
"owner": "Owner",
"ownership-transfer": "Your entry has been successfully transferred to the selected user.",
"organisation-name": "Organisation name",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Number One: use American spelling in en_US.

This locale should not ship “Organisation”; US users will see the wrong copy for their locale.

💡 Suggested edit
-    "organisation-name": "Organisation name",
+    "organisation-name": "Organization name",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"organisation-name": "Organisation name",
"organisation-name": "Organization name",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ts/langs/en_US.ts` at line 107, The en_US locale file contains British
English spelling for the "organisation-name" key. Change "Organisation name" to
"Organization name" to use the correct American English spelling for US users in
the en_US locale.

Comment thread src/ts/langs/nl_BE.ts Outdated
Comment thread src/ts/langs/pl_PL.ts
"add-task": "Add task",
"add-team": "Dodaj zespół",
"add-to-team": "Dodaj wybranych użytkowników do zespołu",
"add-user-error": "Użyj menu autowypełniania by dodać użytkownika ",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Trim trailing whitespace in localized error copy.

At Line 12, the translation ends with a trailing space ("…użytkownika "), which can render awkwardly in UI concatenations/tooltips. Please remove the trailing space.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ts/langs/pl_PL.ts` at line 12, Remove the trailing whitespace from the
"add-user-error" translation string in the Polish language file. The string
currently ends with a space after "użytkownika " which should be removed so it
reads "użytkownika" without the trailing space to prevent rendering issues in UI
concatenations and tooltips.

Comment thread src/ts/misc.ts
Comment on lines +41 to +49
public function testAll(): void
{
$rors = $this->Instance2Rors->readAll();
$initialCount = count($rors);
$this->Instance2Rors->postAction(Action::Create, array());
$this->assertEquals($initialCount + 1, count($this->Instance2Rors->readAll()));
$this->assertEquals($this->ror, $this->Instance2Rors->readOne()['ror']);
$this->Instance2Rors->destroy();
$this->assertEquals($initialCount, count($this->Instance2Rors->readAll()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Captain, secure deterministic test cleanup for ROR lifecycle cases.

If an assertion fails before destroy(), state can leak into subsequent tests and create flaky order-dependent failures.

  • tests/unit/models/Instance2RorsTest.php#L41-L49: wrap create/assert block in try { ... } finally { $this->Instance2Rors->destroy(); }.
  • tests/unit/models/Teams2RorsTest.php#L39-L48: use try/finally cleanup around the created ROR row.
  • tests/unit/models/Users2RorsTest.php#L45-L54: apply the same guaranteed cleanup pattern.
📍 Affects 3 files
  • tests/unit/models/Instance2RorsTest.php#L41-L49 (this comment)
  • tests/unit/models/Teams2RorsTest.php#L39-L48
  • tests/unit/models/Users2RorsTest.php#L45-L54
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/models/Instance2RorsTest.php` around lines 41 - 49, To ensure test
cleanup is guaranteed even if assertions fail, refactor each test to use a
try/finally pattern. In tests/unit/models/Instance2RorsTest.php#L41-L49 in
method testAll(), wrap the postAction() call and subsequent assertions in a try
block with $this->Instance2Rors->destroy() in the finally block. Apply the
identical try/finally cleanup pattern to
tests/unit/models/Teams2RorsTest.php#L39-L48 and
tests/unit/models/Users2RorsTest.php#L45-L54, placing the destroy() call in the
finally block to guarantee cleanup occurs regardless of assertion success or
failure, preventing state leakage between tests.

@NicolasCARPi NicolasCARPi merged commit ac4d48b into master Jun 14, 2026
11 checks passed
@NicolasCARPi NicolasCARPi deleted the nico/260607-teamror branch June 14, 2026 14:31
NicolasCARPi added a commit that referenced this pull request Jun 15, 2026
* master:
  feat: ROR: add support for ROR (#6949)
  bug/medium: search query: fix helpers (#6948)
  feat: add Archive action back: will archive user in all teams (#6934)
  bug/minor: tables: fix thead transparent (#6943)
  ux: ag-grid: increase default pagination (#6939)
  api: enable extended mode on search (#6927)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Account Settings: Affiliation

1 participant