Skip to content

Commit fb879b6

Browse files
Merge pull request #3373 from OneCommunityGlobal/Calvin-Fix-task-time-update
Calvin - Fix task time update
2 parents 270eefe + 0347e98 commit fb879b6

3 files changed

Lines changed: 84 additions & 12 deletions

File tree

src/components/Header/DarkMode.css

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,60 @@
66

77
.dark-mode .close {
88
color: white;
9-
opacity: 1;
9+
opacity: 1;
1010
}
1111

1212
.dark-mode .close:hover {
1313
color: #f0f0f0;
14-
opacity: 1;
14+
opacity: 1;
1515
}
16+
1617
/* Custom styles for datepicker in darkMode */
1718
.dark-mode .react-datepicker {
1819
background-color: #3A506B;
1920
color: #ffffff;
2021
}
22+
2123
.dark-mode .react-datepicker__header {
2224
background-color: #1C2541;
2325
border-bottom: 1px solid #555555;
2426
}
27+
2528
.dark-mode .react-datepicker__current-month {
2629
color: #ffffff;
2730
}
31+
2832
.dark-mode .react-datepicker__navigation--previous::before,
2933
.dark-mode .react-datepicker__navigation--next::before {
3034
border-color: #ffffff;
3135
}
36+
3237
.dark-mode .react-datepicker__month-container {
3338
background-color: #3A506B;
3439
}
40+
3541
.dark-mode .react-datepicker__day,
3642
.dark-mode .react-datepicker__time-name {
3743
color: #ffffff;
3844
}
45+
3946
.dark-mode .react-datepicker__day-name {
4047
background-color: #1C2541;
4148
color: #ffffff;
4249
}
50+
4351
.dark-mode .react-datepicker__day--selected,
4452
.dark-mode .react-datepicker__day--in-selecting-range,
4553
.dark-mode .react-datepicker__day--in-range,
4654
.dark-mode .react-datepicker__day:hover {
4755
background-color: #1C2541;
4856
color: #ffffff;
4957
}
58+
5059
.dark-mode .react-datepicker__navigation {
5160
background: none;
5261
}
62+
5363
.dark-mode .react-datepicker__navigation::before {
5464
border-color: #ffffff;
5565
}
@@ -60,42 +70,52 @@
6070
}
6171

6272
.hover-effect-reports-page-dark-mode:hover {
63-
background-color: #1C2541;
64-
color: #ffffff;
73+
background-color: #1C2541;
74+
color: #ffffff;
6575
}
6676

6777
/* Dark mode for DayPicker (AddTaskModal) */
6878
.dark-mode .DayPicker {
6979
background-color: #3A506B;
7080
color: #ffffff;
7181
}
82+
7283
/* .dark-mode .DayPicker-wrapper {
7384
background-color: #1C2541;
7485
} */
7586
.dark-mode .DayPicker-Caption {
7687
color: #ffffff;
7788
}
89+
7890
.dark-mode .DayPicker-NavButton {
7991
/* background: none; */
8092
}
93+
8194
.dark-mode .DayPicker-Month {
8295
background-color: #3A506B;
8396
}
97+
8498
.dark-mode .DayPicker-NavButton--prev::before,
8599
.dark-mode .DayPicker-NavButton--next::before {
86100
border-color: #ffffff;
87101
}
102+
88103
.dark-mode .DayPicker-Day {
89104
color: #ffffff;
90105
}
106+
91107
.dark-mode .DayPicker-Weekday {
92108
color: #ffffff;
93109
}
110+
94111
.dark-mode .DayPicker-Day:hover {
95-
background-color: #1C2541 !important; /* Remove background color on hover */
96-
color: #ffffff !important; /* Ensure text color remains white */
112+
background-color: #1C2541 !important;
113+
/* Remove background color on hover */
114+
color: #ffffff !important;
115+
/* Ensure text color remains white */
97116
}
98-
.dark-mode tr:hover{
117+
118+
.dark-mode tr:hover {
99119
background-color: #2f4157;
100120
}
101121

@@ -113,7 +133,8 @@
113133
transition: background-color 1000ms ease-in-out;
114134
}
115135

116-
.sunHoverIcon, .nightIcon {
136+
.sunHoverIcon,
137+
.nightIcon {
117138
height: 25px;
118139
padding: 2px;
119140
border-radius: 50%;
@@ -182,7 +203,8 @@
182203
transition: background-color 1000ms ease-in-out;
183204
}
184205

185-
.sunIcon, .nightHoverIcon {
206+
.sunIcon,
207+
.nightHoverIcon {
186208
height: 25px;
187209
padding: 2px;
188210
border-radius: 50%;
@@ -236,3 +258,9 @@
236258
opacity: 1;
237259
transition: opacity 200ms linear 800ms;
238260
}
261+
262+
/* Soft Refresh*/
263+
body.refreshing {
264+
opacity: 0;
265+
transition: opacity 0.3s ease;
266+
}

src/components/Timelog/TimeEntryForm/TimeEntryForm.jsx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import TimeLogConfirmationModal from './TimeLogConfirmationModal';
3636
import { ENDPOINTS } from '../../../utils/URL';
3737
import '../../Header/DarkMode.css';
3838
import { updateIndividualTaskTime } from '../../TeamMemberTasks/actions';
39+
import '../Timelog.css';
3940

4041
// Images are not allowed in timelog
4142
const customImageUploadHandler = () =>
@@ -44,6 +45,36 @@ const customImageUploadHandler = () =>
4445
reject({ message: 'Pictures are not allowed here!', remove: true });
4546
});
4647

48+
/*
49+
const TINY_MCE_INIT_OPTIONS = {
50+
license_key: 'gpl',
51+
menubar: false,
52+
placeholder: 'Description (10-word minimum) and reference link',
53+
plugins: 'advlist autolink autoresize lists link charmap table paste help wordcount',
54+
toolbar:
55+
// eslint-disable-next-line no-multi-str
56+
'bold italic underline link removeformat bullist numlist outdent indent |\
57+
styleselect fontsizeselect | table| strikethrough forecolor backcolor |\
58+
subscript superscript charmap | help',
59+
branding: false,
60+
toolbar_mode: 'sliding',
61+
min_height: 180,
62+
max_height: 300,
63+
autoresize_bottom_margin: 1,
64+
content_style: 'body { cursor: text !important; }',
65+
images_upload_handler: customImageUploadHandler,
66+
};
67+
*/
68+
69+
/* Soft Refresh */
70+
const softRefresh = () => {
71+
document.body.classList.add('refreshing');
72+
// console.log(document.body.classList);
73+
setTimeout(() => {
74+
window.location.reload();
75+
}, 300);
76+
};
77+
4778
/**
4879
* Modal used to submit and edit tangible and intangible time entries.
4980
* There are several use cases:
@@ -125,8 +156,8 @@ function TimeEntryForm(props) {
125156

126157
const timeEntryInitialProjectOrTaskId = edit
127158
? initialProjectId +
128-
(initialwbsId ? `/${initialwbsId}` : '') +
129-
(initialTaskId ? `/${initialTaskId}` : '')
159+
(initialwbsId ? `/${initialwbsId}` : '') +
160+
(initialTaskId ? `/${initialTaskId}` : '')
130161
: 'defaultProject';
131162

132163
const initialReminder = {
@@ -353,13 +384,17 @@ function TimeEntryForm(props) {
353384
const today = moment().tz('America/Los_Angeles');
354385
const offset = today.week() - date.week();
355386
props.getTimeEntriesForWeek(timeEntryUserId, Math.min(offset, 3));
387+
// Use GET_TIME_ENTRIES_WEEK, and fix offset to 0 (this week)
388+
// await props.getTimeEntriesForWeek(timeEntryUserId, 0);
389+
// dispatch(fetchTeamMembersTask(timeEntryUserId));
356390
clearForm();
357391
break;
358392
}
359393
case 'WeeklyTab':
360394
await Promise.all([
361395
props.getUserProfile(timeEntryUserId),
362396
props.getTimeEntriesForWeek(timeEntryUserId, tab),
397+
// props.getTimeEntriesForPeriod(timeEntryUserId, today, today),
363398
]);
364399
break;
365400
default:
@@ -372,6 +407,8 @@ function TimeEntryForm(props) {
372407
editLimitNotification: !r.editLimitNotification,
373408
}));
374409
}
410+
// Soft Refresh
411+
softRefresh();
375412
};
376413

377414
try {
@@ -699,7 +736,7 @@ function TimeEntryForm(props) {
699736

700737
{'notes' in errors && (
701738
<div className="text-danger">
702-
<small>{errors.notes}</small>
739+
<small>{errors.notes}</small>handlePostSubmitActions
703740
</div>
704741
)}
705742
</FormGroup>
@@ -791,6 +828,7 @@ TimeEntryForm.propTypes = {
791828
const mapStateToProps = state => ({
792829
authUser: state.auth.user,
793830
darkMode: state.theme.darkMode,
831+
timeEntriesPeriod: state.timeEntries.period,
794832
});
795833

796834
export default connect(mapStateToProps, {

src/components/Timelog/Timelog.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,10 @@
278278
font-size: 14px;
279279
margin-left: 5px;
280280
/* Add spacing between text and icon */
281+
}
282+
283+
/*Soft Refresh*/
284+
body.refreshing {
285+
opacity: 0;
286+
transition: opacity 0.3s ease;
281287
}

0 commit comments

Comments
 (0)