From e0e4efaa8d596f1a40dc53457bb758cde09fc9b3 Mon Sep 17 00:00:00 2001 From: Jazlene Rae Guevarra <43012576+jguevarra@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:16:12 -0400 Subject: [PATCH] Pallid release 6/25/2024 (v1.5.0) (#116) * bugfixes for supplemental tab fields * telemetry bendrivermile display only in table (#115) --- src/app-bundles/data-entry-bundle.js | 18 ++++++++++++++++++ .../datasheets/tables/telemetryDsTable.js | 11 ++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/app-bundles/data-entry-bundle.js b/src/app-bundles/data-entry-bundle.js index 0607906..1dfce5d 100644 --- a/src/app-bundles/data-entry-bundle.js +++ b/src/app-bundles/data-entry-bundle.js @@ -212,6 +212,9 @@ export default { type: 'missouriRiver', }, }); + + // Update base data + store.doSitesFetch(body?.items?.[0]?.siteId); dispatch({ type: 'UPDATE_BASE_DATA', payload: { mrId: body?.items?.[0]?.mrId, mrFid: body?.items?.[0]?.mrFid } }); if (store.selectDataEntryTotalCount() === 0) { @@ -242,6 +245,9 @@ export default { payload: body, }); + // Update base data + store.doSitesFetch(body?.items?.[0]?.siteId); + if (store.selectDataEntryFishTotalCount() === 0) { if (ignoreToast) { tWarning(toastId, 'No Fish datasheet(s) found.'); } } else { @@ -270,6 +276,9 @@ export default { payload: body, }); + // Update base data + store.doSitesFetch(body?.items?.[0]?.siteId); + if (store.selectDataEntrySupplementalTotalCount() === 0) { if (ignoreToast) { tWarning(toastId, 'No Supplemental datasheet(s) found.'); } } else { @@ -298,6 +307,9 @@ export default { payload: body, }); + // Update base data + store.doSitesFetch(body?.items?.[0]?.siteId); + if (store.selectDataEntryProcedureTotalCount() === 0) { if (ignoreToast) { tWarning(toastId, 'No Procedure datasheet(s) found.'); } } else { @@ -329,6 +341,9 @@ export default { }, }); + // Update base data + store.doSitesFetch(body?.items?.[0]?.siteId); + if (store.selectDataEntryTotalCount() === 0) { if (ignoreToast) { tWarning(toastId, 'No Search Effort datasheet(s) found'); } } else { @@ -357,6 +372,9 @@ export default { payload: body, }); + // Update base data + store.doSitesFetch(body?.items?.[0]?.siteId); + if (store.selectDataEntryTelemetryTotalCount() === 0) { if (ignoreToast) { tWarning(toastId, 'No Telemetry datasheet(s) found.'); } } else { diff --git a/src/app-pages/data-entry/datasheets/tables/telemetryDsTable.js b/src/app-pages/data-entry/datasheets/tables/telemetryDsTable.js index a43e338..428431b 100644 --- a/src/app-pages/data-entry/datasheets/tables/telemetryDsTable.js +++ b/src/app-pages/data-entry/datasheets/tables/telemetryDsTable.js @@ -29,24 +29,28 @@ const TelemetryDsTable = connect( 'selectDataEntryTelemetryData', 'selectDataEntryLastParams', 'selectUserRole', + 'selectBaseData', ({ doModalOpen, doSaveTelemetryDataEntry, doUpdateTelemetryDataEntry, dataEntryTelemetryData, dataEntryLastParams, - userRole + userRole, + baseData }) => { const { items } = dataEntryTelemetryData; const gridRef = useRef(); + const rowData = items?.map(item => ({ ...item, bendRiverMile: baseData?.bendRiverMile })); + const lastRow = dataEntryTelemetryData.items[dataEntryTelemetryData.totalCount - 1]; const initialState = { seId: dataEntryLastParams.seId }; const addRow = useCallback(() => { - gridRef.current.api.applyTransaction({ add: [{}] }); + gridRef.current.api.applyTransaction({ add: [{ bendRiverMile: baseData?.bendRiverMile }] }); }, []); const copyLastRow = () => { @@ -107,7 +111,7 @@ const TelemetryDsTable = connect( editType='fullRow' onRowValueChanged={({ data }) => !data.tId ? doSaveTelemetryDataEntry({...initialState ,...data}, { seId: dataEntryLastParams.seId, id: userRole.id }) : doUpdateTelemetryDataEntry(data, { seId: dataEntryLastParams.seId, id: userRole.id })} rowHeight={35} - rowData={items} + rowData={rowData} frameworkComponents={{ editCellRenderer: EditCellRenderer, selectEditor: SelectEditor, @@ -137,6 +141,7 @@ const TelemetryDsTable = connect( /> +