Skip to content

Conversation

@Dmitriy-Litvinenko
Copy link
Contributor

@Dmitriy-Litvinenko Dmitriy-Litvinenko commented Dec 30, 2025

Purpose

Migrate config values from mod-configuration

Refs

https://issues.folio.org/browse/UIREQ-1346

@github-actions
Copy link

github-actions bot commented Dec 30, 2025

Jest Unit Test Results

    1 files  ±0     66 suites  ±0   1m 38s ⏱️ -1s
  849 tests +4    849 ✅ +4  0 💤 ±0  0 ❌ ±0 
1 211 runs  +1  1 211 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit efd4007. ± Comparison against base commit 678f141.

This pull request removes 3 and adds 7 tests. Note that renamed tests count towards both.
RequestsRoute getPrintHoldRequestsEnabled should return false when printHoldRequestsEnabled is false ‑ RequestsRoute getPrintHoldRequestsEnabled should return false when printHoldRequestsEnabled is false
RequestsRoute getPrintHoldRequestsEnabled should return false when value absent ‑ RequestsRoute getPrintHoldRequestsEnabled should return false when value absent
RequestsRoute getPrintHoldRequestsEnabled should return true when printHoldRequestsEnabled is true ‑ RequestsRoute getPrintHoldRequestsEnabled should return true when printHoldRequestsEnabled is true
utils getPrintHoldRequestsEnabled should return false if input is undefined ‑ utils getPrintHoldRequestsEnabled should return false if input is undefined
utils getPrintHoldRequestsEnabled should return false if printHoldRequestsEnabled is false ‑ utils getPrintHoldRequestsEnabled should return false if printHoldRequestsEnabled is false
utils getPrintHoldRequestsEnabled should return false if printHoldRequestsEnabled is missing in value ‑ utils getPrintHoldRequestsEnabled should return false if printHoldRequestsEnabled is missing in value
utils getPrintHoldRequestsEnabled should return false if records array is empty ‑ utils getPrintHoldRequestsEnabled should return false if records array is empty
utils getPrintHoldRequestsEnabled should return false if records is missing ‑ utils getPrintHoldRequestsEnabled should return false if records is missing
utils getPrintHoldRequestsEnabled should return false if value is missing in records[0] ‑ utils getPrintHoldRequestsEnabled should return false if value is missing in records[0]
utils getPrintHoldRequestsEnabled should return true if printHoldRequestsEnabled is true ‑ utils getPrintHoldRequestsEnabled should return true if printHoldRequestsEnabled is true

♻️ This comment has been updated with latest results.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
34.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@Dmitriy-Litvinenko Dmitriy-Litvinenko requested a review from a team December 30, 2025 12:14
@zburke
Copy link
Member

zburke commented Dec 30, 2025

It is now more than a year after PR #1224 implemented the "temporary" feature flag that moved non-ECS functionality into a directory misleadingly named deprecated and there has been no effort to address this abomination despite repeated complaints. This requires extra effort from developers who must implement things twice, it loads the codebase with tech debt, and it requires devs to ignore Sonar's advice about duplicated code.

It was a bad idea then and remains one now. When will this be fixed?

Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

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

What of these permissions:

ui-requests/package.json

Lines 126 to 128 in 678f141

"mod-settings.global.read.circulation",
"mod-settings.entries.collection.get",
"mod-settings.entries.item.get",

Can these lines be removed too?

* When creating or viewing a request, show whether the a loan on the item would be use-at-location. Fixes UIREQ-1327.
* Added global permissions for get read-access to values such as tenant’s locale, timezone, and currency. Refs UIREQ-1341.
* Migrate tag flag from mod-configuration to mod-settings. Refs UIREQ-1344.
* *BREAKING* Migrate config values from mod-configuration and mod-settings. Refs UIREQ-1346.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "Migrate from mod-configuration and mod-settings to mod-circulation" or "Consolidate config values within mod-circulation"? What you are migrating to (i.e. the status the code will be in once this PR merges) is more important than what you are migrating from (i.e. the status of the code that will be gone once this PR merges).

records: 'configs',
path: 'configurations/entries',
records: 'circulationSettings',
path: 'circulation/settings',
Copy link
Contributor

Choose a reason for hiding this comment

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

The TLR setting should be stored in mod-settings, not mod-circulation. TLR is not a local setting, it is used in many modules. When migrating from mod-configuration to mod-settings, global settings should be stored in mod-settings, and local settings should be stored in the module-specific settings.

Copy link
Member

Choose a reason for hiding this comment

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

This is an interesting point, @Dmytro-Melnyshyn. It increasingly feels like "global" permissions -- tenant-locale is another example -- fell into a gap in the analysis when deciding to abandon mod-configuration.

Do you think even mod-settings provides a good way to handle this? If we moved these values into mod-settings, we'd end up with a permission like, say, mod-settings.global.read.ui-requests.tlr.manage. A consequence is that other entities then become dependent on ui-requests (which instantiates this permission), which we may not want if "other entities" could mean "other backend modules", because it seems upside-down for BE things to depend on FE things.

CC: @okolawole-ebsco

Copy link
Contributor

Choose a reason for hiding this comment

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

@zburke If this setting is also used on the BE, it should be created by the BE, not the UI, to avoid tenant-locale issues like we had when UI-created settings were used by the BE. mod-tlr can be used instead of ui-requests, but I don't think it's needed at all if the setting is implemented on the BE side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexanderkurash Could you please take a look on comment above?

Choose a reason for hiding this comment

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

@Dmytro-Melnyshyn @zburke
We consider this setting to be specific to circulation domain only, which makes it quite local in scope of FOLIO. Yes, it is used by multiple modules, but only those that are responsible for circulation (more precisely - requests). For example, it's very unlikely that this setting is ever going to be needed by something like inventory, data import, acquisition etc. That was our justification for moving it to mod-circulation-storage's settings.
To the question of which module should create this setting - mod-circulation-storage is responsible for the migration of the current value from mod-configuration to it's own database. Here's the migration SQL script: https://github.com/folio-org/mod-circulation-storage/pull/539/files#diff-074397d7eda53d5ae81dec338c0ec750555d85316e5bd2be266399e8dce05362. We're not merging this PR yet because BE and FE should be merged together.
From our perspective, the purpose of the FE work is to stop using mod-configuration for CRUD operations with this setting and switch to mod-circulation-storage's API.
cc @Dmitriy-Litvinenko

Copy link
Contributor

Choose a reason for hiding this comment

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

@alexanderkurash The TLR setting is primarily relevant to the circulation/requests domain and keeping it in mod-circulation-storage makes sense. However, ui-inventory already depends on this setting today. Moving it from mod-configuration to a module-specific settings store will be a breaking change for at least one consumer. Please either update dependent modules too, or announce the breaking change on Slack and coordinate a short migration plan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello For ui-inventory we already create pull folio-org/ui-inventory#2949 which is associated with these changes

@Dmytro-Melnyshyn Dmytro-Melnyshyn self-requested a review January 9, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants