Skip to content

Commit

Permalink
Update missed jsdoc comments 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPhura committed Jan 16, 2025
1 parent 1c5f733 commit a9ff7b5
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ interface IDualAutocompleteFieldProps<TCategory extends string | number, TUnit e
categoryFormikFieldName: string;
/**
* Callback to get the data type of the category field.
*
* If not provided, the default data type will be 'quantitative'.
*/
getCategoryDataType?: (categoryId: TCategory) => 'quantitative' | 'qualitative';
/**
* Callback to get the options to display in the unit field, based on the selected category.
* Callback to get the options to display in the unit field, based on the selected category. Only called when a
* category is selected and the category data type is qualitative.
*/
getUnitOptions: (categoryId: TCategory) => { label: string; value: TUnit }[];
/**
* The options to display in the unit field, based on the selected category.
*
* If not provided, the default label for the unit field will be "Value".
*/
getUnitAutocompleteLabel?: (categoryId: TCategory) => string;
/**
Expand Down Expand Up @@ -74,7 +79,7 @@ export const DualAutocompleteField = <TCategory extends string | number, TUnit e
const categoryId: TCategory | null = get(values, categoryFormikFieldName);

Check warning on line 79 in app/src/components/fields/dual-autocomplete-field/DualAutocompleteField.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/fields/dual-autocomplete-field/DualAutocompleteField.tsx#L79

Added line #L79 was not covered by tests

// The category data type (quantitative or qualitative)
const categoryDataType = getCategoryDataType ? getCategoryDataType(categoryId as TCategory) : undefined;
const categoryDataType = getCategoryDataType ? getCategoryDataType(categoryId as TCategory) : 'quantitative';

// The label units field, which defaults to "Value" unless set with the getUnitAutocompleteLabel prop
const [unitLabel, setUnitLabel] = useState<string>('Value');

Check warning on line 85 in app/src/components/fields/dual-autocomplete-field/DualAutocompleteField.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/fields/dual-autocomplete-field/DualAutocompleteField.tsx#L85

Added line #L85 was not covered by tests
Expand Down

0 comments on commit a9ff7b5

Please sign in to comment.