Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
cbcf354d
Commit
cbcf354d
authored
Dec 26, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#132
добавил 24 часа, пофиксил вылезавшие баги
parent
572b2feb
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
15 deletions
+23
-15
Task.ts
planner-api/src/models/Task.ts
+1
-1
CalendarRowDay.js
...lendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
+4
-1
CalendarModalTaskContent.js
...s/UI/CalendarModalTaskContent/CalendarModalTaskContent.js
+1
-1
Helpers.js
...mponents/Calendars/UI/CalendarModalTaskContent/Helpers.js
+4
-4
CalendarColumnDayWeek.js
...lendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
+1
-1
constants.js
planner-front/src/constants.js
+5
-1
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+3
-2
WeekCalendar.js
planner-front/src/containers/WeekCalendar/WeekCalendar.js
+4
-4
No files found.
planner-api/src/models/Task.ts
View file @
cbcf354d
...
...
@@ -40,7 +40,7 @@ import { DateTimeTask } from './DateTimeTask';
id
!
:
string
@
Column
({
name
:
'title'
,
type
:
'varchar'
,
length
:
50
,
nullable
:
false
})
title
!
:
string
@
Column
({
name
:
'description'
,
type
:
'varchar'
,
length
:
5
0
,
nullable
:
true
})
@
Column
({
name
:
'description'
,
type
:
'varchar'
,
length
:
10
0
,
nullable
:
true
})
description
!
:
string
@
Column
({
name
:
'note'
,
type
:
'varchar'
,
length
:
100
,
nullable
:
true
})
note
!
:
string
...
...
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
View file @
cbcf354d
...
...
@@ -89,5 +89,8 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
<
/
>
};
export
default
memo
(
CalendarRowDay
);
export
default
memo
(
CalendarRowDay
,
(
prevProps
,
nextProps
)
=>
{
if
(
!
prevProps
.
modal
)
return
false
if
(
nextProps
.
modal
)
return
true
});
planner-front/src/components/Calendars/UI/CalendarModalTaskContent/CalendarModalTaskContent.js
View file @
cbcf354d
...
...
@@ -72,7 +72,7 @@ function CalendarModalTaskContent({ title, onChangeCurrentTaskHandler, descripti
/
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
margin
:
'10px 0'
}}
>
<
Button
id
=
'test_button_save_task'
onClick
=
{
sendNewTaskHandler
}
disabled
=
{
!
isValidate
(
title
,
project
,
startHour
,
endHour
)}
>
Сохранить
<
/Button
>
<
Button
id
=
'test_button_save_task'
onClick
=
{
sendNewTaskHandler
}
disabled
=
{
!
isValidate
(
title
,
project
,
startHour
,
endHour
,
description
)}
>
Сохранить
<
/Button
>
<
Button
onClick
=
{
deleteTaskHandler
}
disabled
=
{
!
id
}
>
Удалить
<
/Button
>
<
/div
>
<
/>
)
;
...
...
planner-front/src/components/Calendars/UI/CalendarModalTaskContent/Helpers.js
View file @
cbcf354d
export
const
isValidate
=
(
title
,
project
,
startHour
,
endHour
)
=>
{
if
(
title
&&
project
)
{
export
const
isValidate
=
(
title
,
project
,
startHour
,
endHour
,
description
)
=>
{
if
(
(
title
&&
project
)
&&
(
title
?.
length
<=
50
&&
(
description
?.
length
<=
100
||
!
description
)
)
)
{
const
startHourInt
=
parseInt
(
startHour
)
const
endHourInt
=
parseInt
(
endHour
)
if
(
startHourInt
>=
8
&&
startHourInt
<=
24
)
{
if
(
endHourInt
>=
8
&&
endHourInt
<=
24
)
{
if
(
startHourInt
>=
0
&&
startHourInt
<=
24
)
{
if
(
endHourInt
>=
0
&&
endHourInt
<=
24
)
{
if
(
startHourInt
<
endHourInt
)
{
return
true
}
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
View file @
cbcf354d
...
...
@@ -11,7 +11,7 @@ import { getTasksWithInfoForPosition, getWidthLeftZIndex } from "./Helpers";
function
CalendarColumnDayWeek
({
hoursInDay
,
tasks
,
month
,
year
,
day
,
hourFormat
,
handleOpen
,
setCurrentTask
,
copyTask
,
setCopyTask
,
createCopyTask
,
createTaskInCellHandler
,
modal
,
dragTaskHandler
})
{
const
[
columnDaySize
,
setColumnDaySize
]
=
useState
({
width
:
0
,
height
:
0
})
console
.
log
(
month
,
year
)
const
dayColumnRef
=
useRef
(
''
)
useEffect
(()
=>
{
setColumnDaySize
(
prev
=>
{
return
{
height
:
dayColumnRef
.
current
.
offsetHeight
,
width
:
dayColumnRef
.
current
.
offsetWidth
}
})
...
...
planner-front/src/constants.js
View file @
cbcf354d
...
...
@@ -20,3 +20,7 @@ export const priorities = [
{
value
:
'B'
,
text
:
'B'
},
{
value
:
'C'
,
text
:
'C'
}
]
export
const
AllHoursOneHourFormat
=
[
'0:00'
,
'1:00'
,
'2:00'
,
'3:00'
,
'4:00'
,
'5:00'
,
'6:00'
,
'7:00'
,
'8:00'
,
'9:00'
,
'10:00'
,
'11:00'
,
'12:00'
,
'13:00'
,
'14:00'
,
'15:00'
,
'16:00'
,
'17:00'
,
'18:00'
,
'19:00'
,
'20:00'
,
'21:00'
,
'22:00'
,
'23:00'
]
export
const
AllHoursTwoHourFormat
=
[
'0:00'
,
'2:00'
,
'4:00'
,
'6:00'
,
'8:00'
,
'10:00'
,
'12:00'
,
'14:00'
,
'16:00'
,
'18:00'
,
'20:00'
,
'22:00'
]
\ No newline at end of file
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
cbcf354d
...
...
@@ -8,6 +8,7 @@ import { dateToISOLikeButLocal, getCurrentMonthString, getDaysInMonth } from '..
import
{
fetchAllUserProjects
,
fetchProject
}
from
'../../store/actions/projectsActions'
;
import
{
addCalendarTask
,
addCopyCalendarTask
,
deleteCalendarTask
,
editCalendarTask
,
fetchCalendarTasks
}
from
'../../store/actions/tasksActions'
;
import
{
fetchCurrentCalendarDisplayName
}
from
'../../store/actions/usersActions'
;
import
{
AllHoursOneHourFormat
,
AllHoursTwoHourFormat
}
from
'../../constants'
;
function
MonthCalendar
()
{
const
dispatch
=
useDispatch
();
...
...
@@ -56,9 +57,9 @@ function MonthCalendar() {
const
hoursInDay
=
useMemo
(()
=>
{
let
arr
if
(
hourFormat
)
{
arr
=
[
'8:00'
,
'9:00'
,
'10:00'
,
'11:00'
,
'12:00'
,
'13:00'
,
'14:00'
,
'15:00'
,
'16:00'
,
'17:00'
,
'18:00'
,
'19:00'
,
'20:00'
,
'21:00'
,
'22:00'
]
arr
=
AllHoursOneHourFormat
}
else
{
arr
=
[
'8:00'
,
'10:00'
,
'12:00'
,
'14:00'
,
'16:00'
,
'18:00'
,
'20:00'
,
'22:00'
]
arr
=
AllHoursTwoHourFormat
}
const
cells
=
arr
.
length
const
xs
=
10.8
/
cells
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
cbcf354d
...
...
@@ -5,12 +5,12 @@ import CalendarModalWorkerContent from '../../components/Calendars/UI/CalendarMo
import
WeekCalendarBody
from
'../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody'
;
import
WeekCalendarHeader
from
'../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader'
;
import
DefaultModal
from
'../../components/UI/DefaultModal/DefaultModal'
;
import
{
AllHoursOneHourFormat
,
AllHoursTwoHourFormat
}
from
'../../constants'
;
import
{
getWeekInfoString
,
getWeekFromCurrentDate
,
dateToISOLikeButLocal
}
from
'../../helpers/CalendarHelpers'
;
import
{
fetchAllUserProjects
}
from
'../../store/actions/projectsActions'
;
import
{
addCalendarTask
,
addCopyCalendarTask
,
deleteCalendarTask
,
editCalendarTask
,
fetchCalendarTasks
}
from
'../../store/actions/tasksActions'
;
import
{
fetchCurrentCalendarDisplayName
}
from
'../../store/actions/usersActions'
;
function
WeekCalendar
()
{
const
dispatch
=
useDispatch
();
const
{
calendarTasks
}
=
useSelector
(
state
=>
state
.
tasks
);
...
...
@@ -54,9 +54,9 @@ function WeekCalendar() {
const
hoursInDay
=
useMemo
(()
=>
{
let
arr
if
(
hourFormat
)
{
arr
=
[
'8:00'
,
'9:00'
,
'10:00'
,
'11:00'
,
'12:00'
,
'13:00'
,
'14:00'
,
'15:00'
,
'16:00'
,
'17:00'
,
'18:00'
,
'19:00'
,
'20:00'
,
'21:00'
,
'22:00'
]
arr
=
AllHoursOneHourFormat
}
else
{
arr
=
[
'8:00'
,
'10:00'
,
'12:00'
,
'14:00'
,
'16:00'
,
'18:00'
,
'20:00'
,
'22:00'
]
arr
=
AllHoursTwoHourFormat
}
return
arr
},
[
hourFormat
])
...
...
@@ -160,7 +160,7 @@ function WeekCalendar() {
endHour
:
hourDue
,
startDay
:
dayNumber
,
month
:
month
,
y
ear
:
year
,
startY
ear
:
year
,
},
project
:
allUserProjects
[
0
]?.
id
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment