Skip to content

Fix issue with AssetType filters - #136

Open
prestoncraw wants to merge 4 commits into
developmentfrom
PQB-114
Open

Fix issue with AssetType filters#136
prestoncraw wants to merge 4 commits into
developmentfrom
PQB-114

Conversation

@prestoncraw

@prestoncraw prestoncraw commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add AssetType model and read-only API controller.
  • Populate the Asset Type search filter with the available asset types.

Copilot AI 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.

Pull request overview

Adds backend and frontend support to populate the Asset Type filter from a dedicated read-only AssetType API endpoint, enabling the Asset search UI to show available asset types dynamically.

Changes:

  • Added AssetTypes model and a read-only AssetTypeController endpoint under api/openXDA/AssetType.
  • Added a shared AssetTypeController client in TS and wired getEnum to fetch Asset Types from the new endpoint.
  • Updated the default Asset search definition so the AssetType field is treated as an enum and can be populated.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
SEBrowser/Scripts/TSX/Store/ControllerFunctions.ts Adds AssetType API path and shared read-only controller wrapper.
SEBrowser/Scripts/TSX/Components/TrendData/NavBar/TrendDataNavbar.tsx Reuses the shared getEnum implementation instead of maintaining a local copy.
SEBrowser/Scripts/TSX/Components/EventSearch/Navbar/EventSearchNavbar.tsx Exports a generic getEnum and adds special handling to populate AssetType options via the new controller.
SEBrowser/Scripts/TSX/Components/Common/DefaultSearch.tsx Configures the AssetType field as an enum so the dropdown can be populated.
SEBrowser/Controllers/OpenXDA/ModelControlers.cs Exposes a new read-only AssetTypeController route.
Libraries/openXDA.Model/TransmissionElements/AssetTypes.cs Introduces the AssetType table model (and enum).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Libraries/openXDA.Model/TransmissionElements/AssetTypes.cs

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (1)

SEBrowser/Scripts/TSX/Components/EventSearch/Navbar/EventSearchNavbar.tsx:476

  • getEnum is now exported from (and imported from) EventSearchNavbar.tsx, which is a heavy UI module with many unrelated dependencies. Using it as a shared helper couples TrendData to EventSearch and can increase bundle size / risk of unintended side effects from module initialization.

Consider moving getEnum (and its helper types like ValueListItemResponse / getValueListGroup) into a small shared utility module (e.g., Components/Common/SearchEnumUtils.ts) and importing it from both navbars.

export const getEnum = <T,>(setOptions: (options: Gemstone.TSX.Interfaces.ILabelValue<string>[]) => void, field: Search.IField<T>) => {
    if (field.type != 'enum' || field.enum == undefined || field.enum.length != 1)
        return () => {/*Do Nothing*/ };

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.

3 participants