Skip to content

Urb 3487 move decisional delay vocabulary to config#549

Open
WBoudabous wants to merge 4 commits into
2.9.xfrom
URB-3487_move_decisional_delay_vocabulary_to_config
Open

Urb 3487 move decisional delay vocabulary to config#549
WBoudabous wants to merge 4 commits into
2.9.xfrom
URB-3487_move_decisional_delay_vocabulary_to_config

Conversation

@WBoudabous

@WBoudabous WBoudabous commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

This PR extracts the decision delay vocabulary from the code.

Summary by CodeRabbit

  • New Features

    • Decisional delay options for road decrees are now managed through a configurable vocabulary system instead of hardcoded values, enabling greater flexibility and maintainability.
  • Localization

    • Updated French translations for decisional delay terminology to align with the new vocabulary system.

@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This change extracts the "decisional delay" vocabulary from hardcoded values in the RoadDecree class to a managed vocabulary system. It removes the legacy list_decisional_delay method, updates the schema to use UrbanVocabulary, adds migration logic to create and populate the vocabulary folder, updates translations, and increments the version to 2911.

Changes

Cohort / File(s) Summary
Configuration & Vocabulary Setup
src/Products/urban/profiles/extra/config_default_values.py
Added new RoadDecree.decisionaldelay vocabulary configuration with five delay option terms (75j, 105j, 150j, 210j, ukn) and their localized titles.
Schema & Content Type
src/Products/urban/content/licence/RoadDecree.py
Replaced hardcoded list_decisional_delay() method with UrbanVocabulary("decisionaldelay", inUrbanConfig=True) reference; removes public method declaration and implementation.
Localization
src/Products/urban/locales/fr/LC_MESSAGES/urban.po
Removed French translations for four day-duration messages and "unknown"; added new decisionaldelay_folder_title translation for "Délai de décision du conseil".
Migration & Upgrade
src/Products/urban/migration/update_290.py, upgrades_290.zcml
Added extract_decision_delay_vocabulary() function to create and populate the decisionaldelay vocabulary folder during upgrade; registered upgrade transitions 2908→2909 and 2910→2911 in ZCML.
Version & Release Notes
src/Products/urban/profiles/default/metadata.xml, news/URB-3487.feature
Incremented profile version from 2910 to 2911; added feature note documenting vocabulary extraction.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • mpeeters

Poem

🐰 From hardcoded lists to vocabulary's grace,
A refactoring hops through this PR's space,
Delay terms now managed, not scattered about,
Migration scripts dig, vocabularies sprout!
Version to 2911, our progress is clear—
Urban's decisional delays are here! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving the decisional delay vocabulary from hardcoded code to configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch URB-3487_move_decisional_delay_vocabulary_to_config

Comment @coderabbitai help to get the list of available commands and usage tips.

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/Products/urban/locales/fr/LC_MESSAGES/urban.po`:
- Around line 5702-5703: The translated string for msgid
"decisionaldelay_folder_title" contains leading/trailing spaces in its msgstr;
remove the surrounding whitespace so msgstr is "Délai de décision du conseil"
(no leading or trailing spaces) to prevent extra spaces appearing in the UI.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1107cc61-a0b1-4294-ab9c-0f35e2b79e68

📥 Commits

Reviewing files that changed from the base of the PR and between 7281f3f and 4e9686d.

📒 Files selected for processing (7)
  • news/URB-3487.feature
  • src/Products/urban/content/licence/RoadDecree.py
  • src/Products/urban/locales/fr/LC_MESSAGES/urban.po
  • src/Products/urban/migration/update_290.py
  • src/Products/urban/migration/upgrades_290.zcml
  • src/Products/urban/profiles/default/metadata.xml
  • src/Products/urban/profiles/extra/config_default_values.py

Comment on lines +5702 to +5703
msgid "decisionaldelay_folder_title"
msgstr " Délai de décision du conseil " No newline at end of file

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

Remove surrounding whitespace from the translation value.

Line 5703 has leading/trailing spaces in msgstr, which can show up in UI labels.

💡 Proposed fix
 msgid "decisionaldelay_folder_title"
-msgstr " Délai de décision du conseil "
+msgstr "Délai de décision du conseil"
📝 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
msgid "decisionaldelay_folder_title"
msgstr " Délai de décision du conseil "
msgid "decisionaldelay_folder_title"
msgstr "Délai de décision du conseil"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Products/urban/locales/fr/LC_MESSAGES/urban.po` around lines 5702 - 5703,
The translated string for msgid "decisionaldelay_folder_title" contains
leading/trailing spaces in its msgstr; remove the surrounding whitespace so
msgstr is "Délai de décision du conseil" (no leading or trailing spaces) to
prevent extra spaces appearing in the UI.

@WBoudabous WBoudabous requested a review from mpeeters April 20, 2026 09:08
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.

1 participant