@@ -36,6 +36,7 @@ import TimeLogConfirmationModal from './TimeLogConfirmationModal';
3636import { ENDPOINTS } from '../../../utils/URL' ;
3737import '../../Header/DarkMode.css' ;
3838import { updateIndividualTaskTime } from '../../TeamMemberTasks/actions' ;
39+ import '../Timelog.css' ;
3940
4041// Images are not allowed in timelog
4142const 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 = {
791828const mapStateToProps = state => ( {
792829 authUser : state . auth . user ,
793830 darkMode : state . theme . darkMode ,
831+ timeEntriesPeriod : state . timeEntries . period ,
794832} ) ;
795833
796834export default connect ( mapStateToProps , {
0 commit comments