diff --git a/frontend/src/components/admin/OrganizationManagement/OrganizationAddModify.js b/frontend/src/components/admin/OrganizationManagement/OrganizationAddModify.js index 367f320574..bdcce4d193 100644 --- a/frontend/src/components/admin/OrganizationManagement/OrganizationAddModify.js +++ b/frontend/src/components/admin/OrganizationManagement/OrganizationAddModify.js @@ -230,6 +230,42 @@ function OrganizationAddModify() { })); } + function handleStreetAddressChange(e) { + setSaveButton(false); + setOrgInfoPost((prevOrgInfoPost) => ({ + ...prevOrgInfoPost, + streetAddress: e.target.value, + })); + setOrgInfo((prevOrgInfo) => ({ + ...prevOrgInfo, + streetAddress: e.target.value, + })); + } + + function handleCityChange(e) { + setSaveButton(false); + setOrgInfoPost((prevOrgInfoPost) => ({ + ...prevOrgInfoPost, + city: e.target.value, + })); + setOrgInfo((prevOrgInfo) => ({ + ...prevOrgInfo, + city: e.target.value, + })); + } + + function handleCliaNumberChange(e) { + setSaveButton(false); + setOrgInfoPost((prevOrgInfoPost) => ({ + ...prevOrgInfoPost, + cliaNum: e.target.value, + })); + setOrgInfo((prevOrgInfo) => ({ + ...prevOrgInfo, + cliaNum: e.target.value, + })); + } + function handleIsActiveChange(e) { setSaveButton(false); setOrgInfoPost((prevOrgInfoPost) => ({ @@ -501,7 +537,7 @@ function OrganizationAddModify() { + + + <> + : + + + + handleStreetAddressChange(e)} + /> + + + + + <> + : + + + + handleCityChange(e)} + /> + + + + + <> + : + + + + handleCliaNumberChange(e)} + /> + + <> @@ -623,16 +733,10 @@ function OrganizationAddModify() { - !row.disabled && - selectedRowIds.includes(row.id), - ).length === pageSize - } + checked={typeOfActivityShow + .slice((page - 1) * pageSize, page * pageSize) + .filter((row) => !row.disabled) + .every((row) => selectedRowIds.includes(row.id))} indeterminate={ selectedRowIds.length > 0 && selectedRowIds.length < diff --git a/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js b/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js index 9cb0d76c23..23f2775200 100644 --- a/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js +++ b/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js @@ -180,9 +180,10 @@ function OrganizationManagement() { : "", orgPrefix: item.shortName || "", active: item.isActive || "", - streetAddress: item.internetAddress || "", - city: item.state || "", - cliaNumber: item.cliaNumber || "", + internetAddress: item.internetAddress || "", + streetAddress: item.streetAddress || "", + city: item.city || "", + cliaNumber: item.cliaNum || "", }; }); const newOrganizationsManagementListArray = Object.values( @@ -212,9 +213,10 @@ function OrganizationManagement() { : "", orgPrefix: item.shortName || "", active: item.isActive || "", - streetAddress: item.internetAddress || "", - city: item.state || "", - cliaNumber: item.cliaNumber || "", + internetAddress: item.internetAddress || "", + streetAddress: item.streetAddress || "", + city: item.city || "", + cliaNumber: item.cliaNum || "", }; }, ); @@ -393,6 +395,12 @@ function OrganizationManagement() { id: "organization.isActive", }), }, + { + key: "internetAddress", + header: intl.formatMessage({ + id: "organization.internetaddress", + }), + }, { key: "streetAddress", header: intl.formatMessage({ @@ -612,6 +620,12 @@ function OrganizationManagement() { id: "organization.isActive", }), }, + { + key: "internetAddress", + header: intl.formatMessage({ + id: "organization.internetaddress", + }), + }, { key: "streetAddress", header: intl.formatMessage({ diff --git a/frontend/src/components/common/AutoComplete.js b/frontend/src/components/common/AutoComplete.js index 1cb61892d2..c43e787db3 100644 --- a/frontend/src/components/common/AutoComplete.js +++ b/frontend/src/components/common/AutoComplete.js @@ -67,17 +67,25 @@ function AutoComplete(props) { }; const onKeyDown = (e) => { + // Handeling enter key if (e.keyCode === 13) { - setActiveSuggestion(0); - setUserInput(filteredSuggestions[activeSuggestion]); - setShowSuggestions(false); - } else if (e.keyCode === 38) { + e.preventDefault(); + if (filteredSuggestions[activeSuggestion]) { + const selectedValue = filteredSuggestions[activeSuggestion].value; + setTextValue(selectedValue); // Update local state + setShowSuggestions(false); + } + } + // Handeling up arrow + else if (e.keyCode === 38) { if (activeSuggestion === 0) { return; } setActiveSuggestion(activeSuggestion - 1); - } else if (e.keyCode === 40) { - if (activeSuggestion - 1 === filteredSuggestions.length) { + } + // Handeling down arrow + else if (e.keyCode === 40) { + if (activeSuggestion === filteredSuggestions.length - 1) { return; } setActiveSuggestion(activeSuggestion + 1);