Skip to content

Conversation

@HMS17
Copy link
Contributor

@HMS17 HMS17 commented Jul 24, 2025

Description

Story: BI-2630 - Improve Create Sub-Entity Pop-Up

Changes to improve and add validations for modal for creating new sub-entities.

  • Changed validation on repeated measures range to permit values 2-50 and updated corresponding text on modal
  • Added logic to retrieve entity names stored in program and entity/dataset names currently in experiment
  • Updated sub-entity modal field for dataset name to suggest entity names stored in the program that are not currently sub-entity names in the experiment
  • Added validation for sub-entity creation to prevent creating a sub-entity with the same name as an existing sub-entity in the experiment
  • Changed font color in sub-entity creation modal to meet WCAG AA color contrast standards

(Note: The suggested entity names are the program entity names as stored in the /observation-levels endpoint when creating an entity as part of an ontology term, not all the experiment-associated entity/sub-entity names. It might be worth considering whether experiment-associated entity/sub-entity names should be stored there rather than just in additionalInfo)

Dependencies

bi-api: develop

Testing

In experiment dataset view

  • Click Manage Experiment > Create Sub-entity Dataset
  • Check that the text beneath the repeated measures field says "Maximum expected between 2-50"
  • Check that a user can only create a sub-entity with repeated measures within the range of 2-50 and a validation error occurs otherwise
  • Click on sub-entity name field and check that a dropdown of entity names appears that is drawn from program entity names minus any entity/dataset names in the current experiment (try making a entity name when creating an ontology term that is the same as a dataset name for the experiment to test this)
  • Check that if one enters a sub-entity name that is already the name of an entity in the current experiment (case insensitive), on clicking save an error message banner is displayed and a new sub-entity is not added

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: <link to TAF run> (taf presently too broken)
  • I have run SiteImprove on pages impacted by changes

@HMS17 HMS17 marked this pull request as ready for review July 29, 2025 13:38
@HMS17 HMS17 requested review from a team, davedrp, nickpalladino and rob-ouser-bi and removed request for a team and rob-ouser-bi July 29, 2025 13:47
Copy link
Contributor

@davedrp davedrp left a comment

Choose a reason for hiding this comment

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

Test passed.
Code looks good.

Great work (as usual)!

async invokeCreate(){
//Check if sub-entity name is already in experiment
let nameAlreadyInExp = this.existingDatasetNames.map(y => y.toLowerCase()).includes(this.newSubEntity.name.toLowerCase());
Copy link
Member

Choose a reason for hiding this comment

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

We might want to have this check done in the backend in the POST /programs/{programId}/experiments/{experimentId}/dataset endpoint. I'd be ok having that in another card.

@HMS17 HMS17 merged commit f41068a into develop Aug 1, 2025
1 check passed
@HMS17 HMS17 deleted the feature/BI-2630 branch August 1, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants