Skip to content

Commit 6968722

Browse files
committed
fix(FR-1786): fix session launcher resource form initialization (#4811)
### Resolves #4821 ([FR-1786](https://lablup.atlassian.net/browse/FR-1786)) Add RESOURCE_ALLOCATION_INITIAL_FORM_VALUES to SessionLauncherPage This PR adds the `RESOURCE_ALLOCATION_INITIAL_FORM_VALUES` constant to the merged initial values in the `SessionLauncherPage` component. This ensures that resource allocation form values are properly initialized when the page loads. ## Changes - Import `RESOURCE_ALLOCATION_INITIAL_FORM_VALUES` from ResourceAllocationFormItems - Include this constant in the merged initial values calculation to ensure proper resource allocation defaults This change helps maintain consistent resource allocation values during page initialization and prevents potential undefined values in the form. [FR-1786]: https://lablup.atlassian.net/browse/FR-1786?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent c14b769 commit 6968722

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

react/src/pages/SessionLauncherPage.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import PortSelectFormItem, {
1313
} from '../components/PortSelectFormItem';
1414
import ResourceNumber from '../components/ResourceNumber';
1515
import ResourceAllocationFormItems, {
16+
RESOURCE_ALLOCATION_INITIAL_FORM_VALUES,
1617
ResourceAllocationFormValue,
1718
} from '../components/SessionFormItems/ResourceAllocationFormItems';
1819
import SessionLauncherValidationTour from '../components/SessionLauncherErrorTourProps';
@@ -280,7 +281,12 @@ const SessionLauncherPage = () => {
280281
}, []);
281282

282283
const mergedInitialValues: SessionLauncherFormValue = useMemo(() => {
283-
return _.merge({}, defaultFormValues, formValuesFromQueryParams);
284+
return _.merge(
285+
{},
286+
defaultFormValues,
287+
formValuesFromQueryParams,
288+
RESOURCE_ALLOCATION_INITIAL_FORM_VALUES,
289+
);
284290
}, [defaultFormValues, formValuesFromQueryParams]);
285291

286292
// ScrollTo top when step is changed

0 commit comments

Comments
 (0)