From e8db3339f256b24dc70a190fd47add6ee3763013 Mon Sep 17 00:00:00 2001 From: Sartoric <6607379+Sartoric@users.noreply.github.com> Date: Fri, 17 Jul 2026 19:59:26 +0200 Subject: [PATCH 1/2] Refactor ProfileForms: Add utility profile toggle and extract reusable ProfileMainInformation component - Extracted `ProfileMainInformation` into a new reusable component. - Updated `ExtendedProfileForm` and `StandardProfileForm` to use `ProfileMainInformation`. - Added utility profile toggle --- .../pages/ProfileEdit/ExtendedProfileForm.jsx | 111 ++++++++++-------- .../ProfileEdit/ProfileMainInformation.jsx | 72 ++++++++++++ .../pages/ProfileEdit/StandardProfileForm.jsx | 59 ++-------- 3 files changed, 140 insertions(+), 102 deletions(-) create mode 100644 web/src/pages/ProfileEdit/ProfileMainInformation.jsx diff --git a/web/src/pages/ProfileEdit/ExtendedProfileForm.jsx b/web/src/pages/ProfileEdit/ExtendedProfileForm.jsx index 89da34ccd..ac6bff3f0 100644 --- a/web/src/pages/ProfileEdit/ExtendedProfileForm.jsx +++ b/web/src/pages/ProfileEdit/ExtendedProfileForm.jsx @@ -8,6 +8,7 @@ import { faChevronLeft } from '@fortawesome/free-solid-svg-icons/faChevronLeft'; import { faChevronRight } from '@fortawesome/free-solid-svg-icons/faChevronRight'; import { faPlus } from '@fortawesome/free-solid-svg-icons/faPlus'; import { faTrashCan } from '@fortawesome/free-solid-svg-icons/faTrashCan'; +import { ProfileMainInformation } from './ProfileMainInformation.jsx'; import { getProfilePhases, removePhaseAt, updatePhaseAt } from './profilePhases.js'; export function ExtendedProfileForm(props) { @@ -70,57 +71,65 @@ export function ExtendedProfileForm(props) { }} >
- -
- - onFieldChange('label', e.target.value)} - aria-label='Enter a name for this profile' - required - /> -
-
- - onFieldChange('description', e.target.value)} - aria-label='Optional description for this profile' - /> -
-
- -
- -
-
-
+ onFieldChange('label', e.target.value)} + onChangeDescription={e => onFieldChange('description', e.target.value)} + onChangeTemperature={e => onFieldChange('temperature', e.target.value)} + onChangeUtility={e => onFieldChange('utility', !!e.target.checked)} + /> + {/**/} + {/*
*/} + {/* */} + {/* onFieldChange('label', e.target.value)}*/} + {/* aria-label='Enter a name for this profile'*/} + {/* required*/} + {/* />*/} + {/*
*/} + {/*
*/} + {/* */} + {/* onFieldChange('description', e.target.value)}*/} + {/* aria-label='Optional description for this profile'*/} + {/* />*/} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} +
+ + +
+
+ +