Skip to content

Commit

Permalink
Fix Find Datasheet functionality (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
jguevarra authored Apr 22, 2024
1 parent f2ff46c commit 661747f
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/app-pages/data-entry/datasheets/pages/find-data-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const FindDataSheet = connect(
'doFetchTelemetryDataEntry',
'doFetchProcedureDataEntry',
'doUpdateUrl',
'doUpdateCurrentTab',
'selectUserRole',
({
doFetchMoRiverDataEntry,
Expand All @@ -27,6 +28,7 @@ const FindDataSheet = connect(
doFetchTelemetryDataEntry,
doFetchProcedureDataEntry,
doUpdateUrl,
doUpdateCurrentTab,
userRole,
}) => {
const [pitTag, setPitTag] = useState('');
Expand All @@ -49,24 +51,30 @@ const FindDataSheet = connect(
id: userRole.id,
};

switch(dataSheetType) {
switch (dataSheetType) {
case 'missouriRiver':
doFetchMoRiverDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/missouriRiver-edit'), true);
doUpdateCurrentTab(0);
break;
case 'fish':
doFetchFishDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/fish-edit'), true);
doFetchFishDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/missouriRiver-edit'), true);
doUpdateCurrentTab(1);
break;
case 'supplemental':
doFetchSupplementalDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/supplemental-edit'), true);
doFetchSupplementalDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/missouriRiver-edit'), true);
doUpdateCurrentTab(2);
break;
case 'missouriRiver':
doFetchMoRiverDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/missouriRiver-edit'), true);
case 'procedures':
doFetchProcedureDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/missouriRiver-edit'), true);
doUpdateCurrentTab(3);
break;
case 'searchEffort':
doFetchSearchDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/searchEffort-edit'), true);
doUpdateCurrentTab(0);
break;
case 'telemetry':
doFetchTelemetryDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/telemetry-edit'), true);
break;
case 'procedures':
doFetchProcedureDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/procedure-edit'), true);
doFetchTelemetryDataEntry(params, () => doUpdateUrl('/sites-list/datasheet/searchEffort-edit'), true);
doUpdateCurrentTab(1);
break;
default:
console.log('Select a datasheet type');
Expand Down

0 comments on commit 661747f

Please sign in to comment.