Fix secondaryType validation and add tests for convertFormulaSecondaryTypeToEvaluatorType#1839
Open
paustint wants to merge 1 commit into
Open
Fix secondaryType validation and add tests for convertFormulaSecondaryTypeToEvaluatorType#1839paustint wants to merge 1 commit into
paustint wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens formula secondaryType handling in the Create Fields workflow by preventing runtime errors when secondaryType is missing and by adding targeted unit tests to lock in the expected evaluator-type mapping.
Changes:
- Make
convertFormulaSecondaryTypeToEvaluatorTypetolerant ofundefined/nullsecondary types (defaulting to'string'). - Add Vitest coverage for secondary-type → evaluator-type mapping, including missing and unknown values.
- Ensure imported
secondaryTypevalues are always normalized viaensureValidSecondaryTypeduring import (even when the column/value is absent).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libs/shared/ui-core/src/create-fields/create-fields-utils.tsx | Makes secondary-type conversion resilient to missing values to avoid .toLowerCase() crashes. |
| libs/shared/ui-core/src/create-fields/tests/create-fields-utils.spec.ts | Adds unit tests verifying mapping behavior for known, missing, and unknown secondary types. |
| libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx | Always runs secondary-type normalization during import so downstream code sees a safe default. |
9fc5dd6 to
c333ed1
Compare
c333ed1 to
04fd81c
Compare
…SecondaryTypeToEvaluatorType Refs: Resolves betterstack error b6ef8c57fe46e77538723abcec6d649e1812a7ac8f4686727753c8351e0e4eae
04fd81c to
9063f52
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the validation for secondaryType to ensure it correctly handles various inputs. Add tests to verify the mapping of secondary types to evaluator types, including cases for undefined and unknown types. This resolves a BetterStack error related to secondaryType handling.