9 Commits

Author SHA1 Message Date
61cfd689f8 2.4.4
All checks were successful
platform/bro/pipeline/head This commit looks good
2024-04-27 11:54:26 +03:00
82a54022b2 Merge pull request '#25 Отображение только времени в случае сгрупированных по дате лекций' (#26) from feature/lesson-date-time into master
All checks were successful
platform/bro/pipeline/head This commit looks good
Reviewed-on: https://git.inno-js.ru/bro-js/journal.pl/pulls/26
2024-04-15 13:48:39 +03:00
f28c644da5 #25 Отображение только времени в случае сгрупированных по дате лекций
All checks were successful
platform/bro/pipeline/head This commit looks good
platform/bro/pipeline/pr-master This commit looks good
2024-04-15 13:45:35 +03:00
50bf5b31b6 2.4.3
All checks were successful
platform/bro/pipeline/head This commit looks good
2024-04-11 13:03:27 +03:00
5670a96696 check jenkins script
All checks were successful
platform/bro/pipeline/head This commit looks good
2024-04-11 12:52:40 +03:00
3a13b68a3d 2.4.2
All checks were successful
platform/bro/pipeline/head This commit looks good
2024-04-09 23:38:59 +03:00
fc3366d52a gropu and sort lessons
All checks were successful
platform/bro/pipeline/head This commit looks good
2024-04-09 23:38:51 +03:00
99c95d0706 2.4.1
All checks were successful
platform/bro/pipeline/head This commit looks good
2024-04-09 22:56:02 +03:00
0bdae7fc23 bugfix sorting & grouping
All checks were successful
platform/bro/pipeline/head This commit looks good
2024-04-09 22:53:51 +03:00
4 changed files with 10 additions and 10 deletions

View File

@@ -12,7 +12,6 @@ module.exports = {
},
features: {
journal: {
// add your features here in the format [featureName]: { value: string }
'lesson.bar': {
on: true,
value: '',

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "journal.pl",
"version": "2.4.0",
"version": "2.4.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "journal.pl",
"version": "2.4.0",
"version": "2.4.4",
"license": "MIT",
"dependencies": {
"@chakra-ui/icons": "^2.1.1",

View File

@@ -1,6 +1,6 @@
{
"name": "journal.pl",
"version": "2.4.0",
"version": "2.4.4",
"description": "inno-js platform journal ui repo",
"main": "./src/index.tsx",
"scripts": {

View File

@@ -194,12 +194,13 @@ const LessonList = () => {
const toastRef = useRef(null)
const createdLessonRef = useRef(null)
const [editLesson, setEditLesson] = useState<Lesson>(null)
const sorted = useMemo(() => [...(data?.body || [])]?.sort((a, b) => a.date > b.date ? 1 : -1), [data, data?.body])
const lessonCalc = useMemo(() => {
if (!isSuccess) {
return []
}
const sorted = [...data?.body].sort((a, b) => a.date > b.date ? 1 : -1)
if (!groupByDate) {
return [{ date: '', data: sorted }]
@@ -222,8 +223,8 @@ const LessonList = () => {
}
}
return lessonsData
}, [groupByDate, isSuccess])
return lessonsData.sort((a, b) => a.date < b.date? 1 : -1)
}, [groupByDate, isSuccess, sorted])
const onSubmit = (lessonData) => {
toastRef.current = toast({
@@ -404,10 +405,10 @@ const LessonList = () => {
)}
</Box>
)}
{barFeature && (
{barFeature && sorted?.length && (
<Box height="300">
<Bar
data={data?.body.map((lesson, index) => ({
data={sorted.map((lesson, index) => ({
lessonIndex: `#${index + 1}`,
count: lesson.students.length,
}))}
@@ -452,7 +453,7 @@ const LessonList = () => {
</Td>
)}
<Td textAlign="center">
{dayjs(lesson.date).format('H:mm DD.MM.YY')}
{dayjs(lesson.date).format(groupByDate ? 'HH:mm' : 'HH:mm DD.MM.YY')}
</Td>
<Td>{lesson.name}</Td>
{isTeacher(user) && (