Skip to content

Commit 858d345

Browse files
Merge pull request #3846 from OneCommunityGlobal/Anthony/Fix-Timelog-Times-Not-Totaling-Task-Time-Worked-on-Dashboard-Tasks-Tab
Anthony/Fix Timelog Times Not Totaling Task Time Worked on Dashboard Tasks Tab
2 parents bf4a56d + 4ef852f commit 858d345

4 files changed

Lines changed: 34 additions & 10 deletions

File tree

src/components/Timelog/TimeEntry.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import DeleteModal from './DeleteModal';
1414

1515
import { editTimeEntry, getTimeEntriesForWeek } from '../../actions/timeEntries';
1616
import { editTeamMemberTimeEntry } from '../../actions/task';
17+
import { updateIndividualTaskTime } from '../TeamMemberTasks/actions';
1718

1819
/**
1920
* This component can be imported in TimeLog component's week tabs and Tasks tab
@@ -92,6 +93,13 @@ function TimeEntry(props) {
9293
} else if (from === 'WeeklyTab') {
9394
await dispatch(editTimeEntry(timeEntryId, newData));
9495
await dispatch(getTimeEntriesForWeek(timeEntryUserId, tab));
96+
dispatch(
97+
updateIndividualTaskTime({
98+
newTime: { hours: newData.isTangible ? newData.hours : -newData.hours, minutes: newData.isTangible ? newData.minutes : -newData.minutes },
99+
taskId: newData.taskId,
100+
personId: newData.personId,
101+
}),
102+
);
95103
}
96104
} catch (error) {
97105
toast.error(`Error: ${error.message}`);

src/components/Timelog/TimeEntryForm/TimeEntryForm.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ function TimeEntryForm(props) {
346346
return;
347347
}
348348

349-
const { hours: formHours, minutes: formMinutes, personId, taskId } = formValues;
349+
const { hours: formHours, minutes: formMinutes, personId, taskId, isTangible } = formValues;
350350
const timeEntry = { ...formValues };
351351
const isTimeModified = edit && (initialHours !== formHours || initialMinutes !== formMinutes);
352352

@@ -403,6 +403,16 @@ function TimeEntryForm(props) {
403403
const offset = today.week() - date.week();
404404
props.getTimeEntriesForWeek(timeEntryUserId, Math.min(offset, 3));
405405
clearForm();
406+
407+
if(isTangible) {
408+
dispatch(
409+
updateIndividualTaskTime({
410+
newTime: { hours: formHours, minutes: formMinutes },
411+
taskId,
412+
personId,
413+
}),
414+
);
415+
}
406416
break;
407417
}
408418
case 'WeeklyTab':

src/components/Timelog/Timelog.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import pdfMake from 'pdfmake/build/pdfmake';
77
import 'pdfmake/build/vfs_fonts';
88
import htmlToPdfmake from 'html-to-pdfmake';
99
import tipStyles from './TimeEntryTooltip.module.css';
10+
import leaderboardStyles from '../LeaderBoard/Leaderboard.module.css';
1011
import TooltipPortal from "./TooltipPortal";
1112
import {
1213
Container,
@@ -809,7 +810,7 @@ return (
809810
</div>
810811
</div>
811812
) : null}
812-
<Row className='row' style={{ minWidth: '100%' }}>
813+
<Row className={`row ${leaderboardStyles.row}`} style={{ minWidth: '100%' }}> {/* Maybe here */}
813814
<Col md={12} className="px-0 mx-0">
814815
<Card className={darkMode ? 'border-0' : ''}>
815816
<CardHeader

yarn.lock

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@
807807
integrity sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==
808808
dependencies:
809809
"@babel/template" "^7.27.2"
810-
"@babel/types" "^7.28.2"
810+
"@babel/types" "^7.27.6"
811811

812812
"@babel/helpers@^7.28.4":
813813
version "7.28.4"
@@ -2166,7 +2166,7 @@
21662166
resolved "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz"
21672167
integrity sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==
21682168
dependencies:
2169-
"@floating-ui/core" "^1.7.3"
2169+
"@floating-ui/core" "^1.7.2"
21702170
"@floating-ui/utils" "^0.2.10"
21712171

21722172
"@floating-ui/utils@^0.2.10":
@@ -2308,8 +2308,8 @@
23082308
resolved "https://registry.npmjs.org/@inquirer/core/-/core-10.2.0.tgz"
23092309
integrity sha512-NyDSjPqhSvpZEMZrLCYUquWNl+XC/moEcVFqS55IEYIYsY0a1cUCevSqk7ctOlnm/RaSBU5psFryNlxcmGrjaA==
23102310
dependencies:
2311-
"@inquirer/figures" "^1.0.13"
2312-
"@inquirer/type" "^3.0.8"
2311+
"@inquirer/figures" "^1.0.12"
2312+
"@inquirer/type" "^3.0.7"
23132313
ansi-escapes "^4.3.2"
23142314
cli-width "^4.1.0"
23152315
mute-stream "^2.0.0"
@@ -2882,7 +2882,6 @@
28822882
"@babel/runtime" "^7.28.2"
28832883
"@mui/utils" "^7.3.1"
28842884
reselect "^5.1.1"
2885-
use-sync-external-store "^1.5.0"
28862885

28872886
"@naoak/workerize-transferable@^0.1.0":
28882887
version "0.1.0"
@@ -3388,9 +3387,9 @@
33883387
"@babel/runtime" "^7.12.5"
33893388
"@types/aria-query" "^5.0.1"
33903389
aria-query "5.3.0"
3390+
chalk "^4.1.0"
33913391
dom-accessibility-api "^0.5.9"
33923392
lz-string "^1.5.0"
3393-
picocolors "1.1.1"
33943393
pretty-format "^27.0.2"
33953394

33963395
"@testing-library/dom@^7.22.3":
@@ -3674,6 +3673,7 @@
36743673
resolved "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.7.tgz"
36753674
integrity sha512-PQTyIulDkIDro8P+IHbKCsw7U2xxBYflVzW/FgWdCAePD9xGSidgA76/GeJ6lBKoblyhf9pBY763gbrN+1dI8g==
36763675
dependencies:
3676+
"@types/react" "*"
36773677
hoist-non-react-statics "^3.3.0"
36783678

36793679
"@types/html-to-pdfmake@^2.4.4":
@@ -4690,7 +4690,7 @@ axios@^1.11.0:
46904690
integrity sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==
46914691
dependencies:
46924692
follow-redirects "^1.15.6"
4693-
form-data "^4.0.4"
4693+
form-data "^4.0.0"
46944694
proxy-from-env "^1.1.0"
46954695

46964696
axobject-query@^4.1.0:
@@ -5344,6 +5344,11 @@ colorette@^2.0.20:
53445344
resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz"
53455345
integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==
53465346

5347+
color-name@1.1.3:
5348+
version "1.1.3"
5349+
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
5350+
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
5351+
53475352
combined-stream@^1.0.8:
53485353
version "1.0.8"
53495354
resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"
@@ -12124,7 +12129,7 @@ use-isomorphic-layout-effect@^1.2.0:
1212412129
resolved "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.1.tgz"
1212512130
integrity sha512-tpZZ+EX0gaghDAiFR37hj5MgY6ZN55kLiPkJsKxBMZ6GZdOSPJXiOzPM984oPYZ5AnehYx5WQp1+ME8I/P/pRA==
1212612131

12127-
use-sync-external-store@^1.4.0, use-sync-external-store@^1.5.0:
12132+
use-sync-external-store@^1.4.0:
1212812133
version "1.5.0"
1212912134
resolved "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz"
1213012135
integrity sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==

0 commit comments

Comments
 (0)