Skip to content

Comments

remove default values from firebase editable fields#107

Merged
ascibisz merged 20 commits intomainfrom
feature/remove-default-values
Oct 16, 2025
Merged

remove default values from firebase editable fields#107
ascibisz merged 20 commits intomainfrom
feature/remove-default-values

Conversation

@ascibisz
Copy link
Contributor

@ascibisz ascibisz commented Oct 8, 2025

Problem

@interim17 already did all the work to make it easy to retrieve the current value of a field from the recipe object, removing the inherent need for a default value in firebase's editable_fields collection. The aim of this PR was to remove all references to editable_field's default field and fix any issues that would arise as a result.

Link to story or ticket

Solution

No problems really arose when stripping out the default fields, so this was easy!

Open Question

There was a small thing I had to add for type safety reasons, providing default values based on dataType if getCurrentValue() returns undefined. Do we like this? Right now, all of our editable_fields should exist in the recipe object, so if getCurrentValue() returns undefined, we're in an error state and perhaps we shouldn't even render the editable field as an option. If we think this is a truth going forward, we should instead remove these "default" cases and handle an undefined response as an error

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 24.38% 367 / 1505
🔵 Statements 24.38% 367 / 1505
🔵 Functions 38.98% 23 / 59
🔵 Branches 72.07% 80 / 111
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/components/InputSwitch/index.tsx 0% 0% 0% 0% 1-2, 9-11, 27-28, 30-33, 37, 40-42, 44-54, 57, 60-62, 64-67, 69-72, 74-79, 81-106, 108, 110-129, 131, 133-140, 142, 144, 146-158, 160-162, 164
src/components/RecipeForm/index.tsx 0% 0% 0% 0% 1-3, 8, 14-17, 19-40, 42-49, 51, 53, 55-56
src/types/index.ts 0% 100% 100% 0% 148, 163
src/utils/firebase.ts 34.16% 62.5% 22.22% 34.16% 32-33, 38-39, 73-78, 81-83, 86-91, 94-98, 101-106, 110-112, 115-117, 120-122, 125-127, 130-149, 152-168, 171-174, 188-189, 192-196, 198-205, 207, 209-211, 213-216
Generated in workflow #91

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-10-16 17:11 UTC

@ascibisz ascibisz marked this pull request as ready for review October 10, 2025 17:29
@ascibisz ascibisz requested review from interim17 and rugeli October 10, 2025 17:29
Base automatically changed from feature/show-radii-in-microns to main October 16, 2025 16:51
@ascibisz ascibisz force-pushed the feature/remove-default-values branch from 4ab0f75 to 3ec0099 Compare October 16, 2025 17:03
@ascibisz ascibisz merged commit 635e5c0 into main Oct 16, 2025
2 checks passed
@ascibisz ascibisz deleted the feature/remove-default-values branch October 16, 2025 17:11
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.

3 participants