Skip to content

Fixed generic configuration item autocomplete and reflist autocomplet…#3852

Merged
IvanIlyichev merged 1 commit intomainfrom
f/ci-autocompletes
Sep 18, 2025
Merged

Fixed generic configuration item autocomplete and reflist autocomplet…#3852
IvanIlyichev merged 1 commit intomainfrom
f/ci-autocompletes

Conversation

@IvanIlyichev
Copy link
Copy Markdown
Contributor

@IvanIlyichev IvanIlyichev commented Sep 18, 2025

…e (were broken after domain model changes)

Summary by CodeRabbit

  • Refactor
    • Autocomplete option labels now use top‑level label/description; version info is no longer displayed.
    • Filtering updated: items without a module are excluded; search matches both item name and module name.
    • Form autocomplete now checks a top‑level isTemplate flag for filtering.
    • Data payloads simplified to top‑level fields; preselected value handling aligns with the new shape.
    • No changes to public component APIs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Filters and queried fields were refactored across autocomplete components: revision-based fields were removed in favor of top-level fields (e.g., label, description, isTemplate). A new baseListFilter excludes null modules. Single-editor runtime checks were simplified to rely on multi-editor logic. Item label rendering no longer includes version information.

Changes

Cohort / File(s) Summary of changes
Configurable Item Autocomplete
shesha-reactjs/src/components/configurableItemAutocomplete/generic.tsx
Removed versionNo and revision-based fields from types, queries, and UI; introduced baseListFilter and switched filtering to it; consolidated editor path logic to rely on isMultipleEditor; updated ITEM_CONFIG_PROPERTIES to id, name, module { id name }, label, description; simplified ItemLabel rendering.
Form Autocomplete Filtering
shesha-reactjs/src/components/configurableItemAutocomplete/formAutocomplete.tsx
Changed baseFormFilter path from revision.isTemplate to isTemplate for top-level filtering.
Reference List Autocomplete
shesha-reactjs/src/components/referenceListAutocomplete/index.tsx
Replaced baseItemFilter with baseListFilter; updated term filter composition; removed revision object from response shape; REFERENCE_LIST_PROPERTIES now include id, name, module, label, description; UI mapping now uses top-level label/description without version display.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant AutoComplete as Autocomplete Component
  participant Query as Query Builder
  participant API as Backend API

  User->>AutoComplete: Type search term
  AutoComplete->>Query: Build filter (baseListFilter + termFilter)
  Note over Query: baseListFilter excludes null module<br/>termFilter matches name or module.name
  Query->>API: Request items { id, name, module, label, description }
  API-->>Query: Items (no revision/versionNo)
  Query-->>AutoComplete: Mapped options
  AutoComplete->>User: Render ItemLabel (no version)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • James-Baloyi
  • AlexStepantsov

Poem

In fields of forms I hop with glee,
No versions nibble at the tree.
Filters trimmed, the modules neat,
Labels bloom with simpler sweet.
Tap-tap—autocomplete I roam,
Finding names to bring them home. 🐰✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch f/ci-autocompletes

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e178b54 and ab52fda.

📒 Files selected for processing (3)
  • shesha-reactjs/src/components/configurableItemAutocomplete/formAutocomplete.tsx (1 hunks)
  • shesha-reactjs/src/components/configurableItemAutocomplete/generic.tsx (5 hunks)
  • shesha-reactjs/src/components/referenceListAutocomplete/index.tsx (3 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@IvanIlyichev IvanIlyichev merged commit 5e27a09 into main Sep 18, 2025
1 of 2 checks passed
@IvanIlyichev IvanIlyichev deleted the f/ci-autocompletes branch September 18, 2025 08:25
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