Skip to content

Conversation

@maribethb
Copy link
Contributor

The basics

The details

Resolves

Fixes #8863

Proposed Changes

  • Fixes the bug where variable fields in flyouts weren't allowing setting their types correctly
  • Adds test for the above case
  • Fixes a test for the case where variableTypes was undefined in the constructor. The old test comments were incorrect and the test only passed because the test case block did not have a sourceBlock property. The correct behavior is that passing undefined behaves the same as passing null.
  • Updated the type signature and tsdoc to explictly allow passing null since that's what we say to do if you want to see all the variable types.
  • Moved the code checking that you don't set an empty array to the setTypes method with the rest of the validation instead of the getTypes method.
  • Removes @internal from workspace.getPotentialVariableMap since it is called from FieldVariable which may be subclassed.

Reason for Changes

  • Fixing bugs and improving tests

Test Coverage

Added tests and tested manually using the test block from the issue description

Documentation

Additional Information

@maribethb maribethb requested a review from a team as a code owner April 7, 2025 23:11
@maribethb maribethb added the PR: fix Fixes a bug label Apr 7, 2025

if (variableTypes) return variableTypes;

// If variableTypes is null, return all variable types in the workspace.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this comment to after this if, so that it's closer to the code it describes.

@maribethb maribethb merged commit 89194b2 into RaspberryPiFoundation:rc/v12.0.0 Apr 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants