Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait for the select to have a selection before calling clearSelection #1787

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

labkey-chrisj
Copy link
Contributor

@labkey-chrisj labkey-chrisj commented Jan 10, 2024

Rationale

BiologicsAutoPopulateAssayJobSamplesTest.testAssociateTaskToExistingAssayRun has been intermittently failing (23.11, starter) because the opens a detailTable for edit, calls clearSelectValue to empty the Workflow Task select, and expects to be able to click the 'Save Run Details' button.

It happens that BaseReactSelect.clearSelection() does not check to ensure there is a selection (if there isn't, it No-ops). This means it is probably likely that the test called it before the select was populated and then failed to save changes because there were no changes and the save button never became enabled.

This change tells DetailTableEdit.clearSelectValue() to wait for the select to have any selection before calling clearSelection()

While doing this refactor, I discovered that DetailTableEdit has two clearSelectValue methods, this eliminates one and the related PR consolidates usages in biologics

Targeting develop for this fix, will consider backporting after

Related Pull Requests

https://github.com/LabKey/biologics/pull/2634

Changes

  • eliminate redundant method
  • add readyTimeout member, make it settable
  • use readyTimeout to await value before clearing
  • wait for select to have a selection before calling clearSelection

Sorry, something went wrong.

Copy link
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

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

You sure we never call this just in case there's a selection to clear but might not?

@labkey-chrisj
Copy link
Contributor Author

I'm not 100% sure there won't be a use case for the just-in-case clear of the select that might-or-might-not have a selection, but it would be really simple to telescope the method to default to wait, but provide the option to skip waiting.

Or, if we want more-complete work, we could push that logic upstream into BaseReactSelect.clearSelection (that is, give the caller the option to await a selection, vs not)

@labkey-chrisj labkey-chrisj merged commit d7b97e8 into develop Jan 10, 2024
@labkey-chrisj labkey-chrisj deleted the fb_detailTableWaitBeforeClearSelection branch January 10, 2024 22:56
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.

None yet

2 participants