Skip to content
This repository was archived by the owner on Nov 18, 2026. It is now read-only.

Fix data quality rules not labeling records - #129

Merged
kflemin merged 2 commits into
mainfrom
data-quality-rules-labels
Nov 17, 2026
Merged

kflemin merged 2 commits into
mainfrom
data-quality-rules-labels

Conversation

@kflemin

@kflemin kflemin commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Fixes tester issue 22: Data Quality rules didn't result in labeled records.

  • Derived-column rules never ran: the rule editor always saved for_derived_column: false, so the backend looked the derived column up in extra_data, got nothing, and skipped the rule. The flag now comes from the selected column.
  • Rule editor field list: now offers only the rule table's own columns. The columns endpoint also returns related Tax Lot/Property columns, which the legacy UI filters out.
  • Edit after switching tabs: the rules table read Properties/Tax Lots from the URL once, but the page is reused across tabs. Editing a rule after switching tabs saved it to the wrong table, where it stopped applying. The page now passes the active tab down.
  • Field names: related columns no longer overwrite same-named fields (e.g. "Custom ID 1 (Tax Lot)" on the Properties tab).
  • Added specs for the rule editor and the rules table.

Note: rules on derived columns already saved from the new UI still have the flag set to false in the database. Open each one and click Submit once to fix it.

Testing

  • pnpm lint, pnpm test (216 passing), pnpm build
  • On a local backend with seeded data, ran Run Check from the Inventory list with rules on a derived column, a regular numeric column and an extra-data column. Labels were applied as expected.
  • Edit after switching from Tax Lots to Properties now keeps the rule on PropertyState.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the derived-column rule and inventory-tab handling changes.

No open issues 🎉

What changed in this PR

Fixes data-quality rule handling so derived-column rules can apply labels and edits stay associated with the active inventory tab.

Changes:

  • Sets the derived-column flag from the selected field when saving a rule.
  • Filters field choices and display-name lookups to the rule’s own inventory table.
  • Passes the active tab to the rules table and adds regression tests.

The PR reports passing lint, 216 tests, a production build, and live-backend checks. Previously saved derived-column rules still need to be reopened and submitted to repair their stored flag.

File Description
src/​app/​modules/​organizations/​data-quality/​inventory/​modal/​form-modal.component.ts Sets the derived-column flag and filters selectable fields by table.
src/​app/​modules/​organizations/​data-quality/​inventory/​modal/​form-modal.component.spec.ts Tests field filtering and derived-column flag handling.
src/​app/​modules/​organizations/​data-quality/​inventory/​inventory-table.component.ts Uses the active tab and prevents related-column name collisions.
src/​app/​modules/​organizations/​data-quality/​inventory/​inventory-table.component.spec.ts Tests field-name lookups and editing after tab changes.
src/​app/​modules/​organizations/​data-quality/​data-quality.component.html Passes the active inventory type to the rules table.

Review effort: Balanced

@kflemin
kflemin merged commit 3a08aa9 into main Nov 17, 2026
3 checks passed
@kflemin
kflemin deleted the data-quality-rules-labels branch November 17, 2026 20:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants