Skip to content

[BHP1-1368] Refactor to use Table Entity Form in All Views#107

Merged
Kcheung42 merged 46 commits intomainfrom
kc-BHP1-1368-refactor-table-entity-form
Mar 6, 2026
Merged

[BHP1-1368] Refactor to use Table Entity Form in All Views#107
Kcheung42 merged 46 commits intomainfrom
kc-BHP1-1368-refactor-table-entity-form

Conversation

@Kcheung42
Copy link
Copy Markdown
Collaborator

Purpose

Related Issues

Closes BHP1-1368

Submission Checklist

  • Included Jira issue in the PR title (e.g. BHP1-### <title>)
  • Code passes linter rules (clj-kondo --lint components/**/src bases/**/src projects/**/src)
  • Feature(s) work when compiled (clojure -M:compile-cljs)

Testing

There's quite a bit to views to test but there are two patterns to check

  1. A simple table entity form (i.e. Modules, variables, tools, etc..) where it does not trigger a secondary table
  2. A table entity form that triggers a second set of tables (i.e. Variable Domains, Lists, Tags, Units)

Testing Simple (Variables)

  1. Ensure all entities show as expected
  2. Ensure you can edit any selection
  3. Ensure you can add an entry

Testing Slightly less Simple (Variable Domains)

  1. Ensure when selecting a domain-set to edit a second table appears for the domains
  2. Ensure you can edit domain-sets and domains
  3. Ensure when changing a domain set to edit, the corresponding table also changes.

Screenshots

@rjsheperd
Copy link
Copy Markdown
Contributor

@Kcheung42 This is a ton of work to simplify this, so kudos to you on taking this on!

I noticed a few things when running through the app:

  1. After clicking "Update" within the "Entity Form", the form does not close. Can you add a "Cancel" button inside of the form that warns the user that any updates will be lost, and then closes the form?

  2. No longer able to update the following "nested" entities:

  • List Options inside of Lists
  • Tags inside of Tag Sets
  • Units inside of Domains
  • Domains inside of Domain Sets

I would suggest reverting these back, for now, and opening up a ticket to address these separately.

Lists / List Options

Screenshot_2026-03-04_at_7_30_03 AM

Tag Sets / Tags

image

Domains / Units

image

Domain Sets / Domains

image
  1. Inside of the "Variable" view, it looks like the "Add Entry" button is still appearing despite it not doing anything. Maybe it could be removed when the add-entry-fn is nil?
Screenshot_2026-03-04_at_7_39_15 AM
  1. Can you update the "Subtools" Table / Entity Form to also use this component? Seems like it is there but it's not quite hooked up:
Screenshot_2026-03-04_at_7_57_23 AM

@Kcheung42
Copy link
Copy Markdown
Collaborator Author

Ah thanks for catching this, I think I pushed an update that added a check for an on-select fn to be passed into the table-entity-form but forgot to bind it in the params, easy fix here. I've also updated subtools to use the new component

@Kcheung42
Copy link
Copy Markdown
Collaborator Author

Inside of the "Variable" view, it looks like the "Add Entry" button is still appearing despite it not doing anything. Maybe it could be removed when the add-entry-fn is nil?

ah missed this one, working on this now

@Kcheung42
Copy link
Copy Markdown
Collaborator Author

updated.

@rjsheperd
Copy link
Copy Markdown
Contributor

Last few things:

  1. Please consider Use cljfmt on Behave CMS files #191 to format the files (uses your .cljfmt.edn)
  2. Consider making it so after clicking "Update" after editing an entity, the form disappears (similar to when adding an entity)

@Kcheung42
Copy link
Copy Markdown
Collaborator Author

updated. New keys added to the table entity form :translation-config meant to be used by list views to automatically create a translation entry based on the name of the entity, (see tags page) :translations-attr a vector of label name and translation key attr that will display translations (see list options, surface fuel models)

@rjsheperd
Copy link
Copy Markdown
Contributor

rjsheperd commented Mar 5, 2026

Looks great! Approved 👍

…firelab/behave-app into kc-BHP1-1414-add-results-order-attr
@Kcheung42 Kcheung42 merged commit 706dbf5 into main Mar 6, 2026
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.

2 participants