+
@@ -65,7 +60,7 @@ export const ListView = ({ data, timeZone }: Props): React.ReactElement => {
- {`${startWeekDate} - ${endWeekDate}`}
+ {startEndWeekLabel}
@@ -73,7 +68,7 @@ export const ListView = ({ data, timeZone }: Props): React.ReactElement => {
- {weekElements(data, currentWeek, timeZone)}
+ {getWeekElements(data, currentWeek, timeZone)}
);
@@ -121,7 +116,7 @@ const mapToWeek = (events: CourseEvent[], timeZone: string) => {
let eventDay = moment(event.dateTime).tz(timeZone).day();
if (eventDay === 0) {
- eventDay = 6;
+ eventDay = LAST_WEEK_DAY;
} else {
eventDay -= 1;
}
@@ -139,7 +134,7 @@ const mapToWeek = (events: CourseEvent[], timeZone: string) => {
return weekMap;
};
-const dayEvents = (events: CourseEvent[], timeZone: string) => {
+const getDayEvents = (events: CourseEvent[], timeZone: string) => {
return events.map((data: CourseEvent) => {
const { id, event, dateTime } = data;
const { type, name } = event;
@@ -161,7 +156,7 @@ const dayEvents = (events: CourseEvent[], timeZone: string) => {
});
};
-const weekElements = (events: CourseEvent[], selectedWeek: number, timeZone: string) => {
+const getWeekElements = (events: CourseEvent[], selectedWeek: number, timeZone: string) => {
const currentWeek = events.filter((event: CourseEvent) => isCurrentWeek(event.dateTime, timeZone, selectedWeek));
const weekMap = mapToWeek(currentWeek, timeZone);
@@ -178,8 +173,8 @@ const weekElements = (events: CourseEvent[], selectedWeek: number, timeZone: str
if (eventCount) {
return (
-
- {dayEvents(eventsPerDay, timeZone)}
+
+ {getDayEvents(eventsPerDay, timeZone)}
From 4a894c32787b93000bc96d180e226db73ac11995 Mon Sep 17 00:00:00 2001
From: Artem Uspenski
Date: Mon, 11 Jan 2021 20:45:18 +0300
Subject: [PATCH 19/68] fix: fix bracket in filterComponent
---
client/src/components/Table/FilterComponent.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/src/components/Table/FilterComponent.tsx b/client/src/components/Table/FilterComponent.tsx
index 466e4d7761..b33735b053 100644
--- a/client/src/components/Table/FilterComponent.tsx
+++ b/client/src/components/Table/FilterComponent.tsx
@@ -29,7 +29,7 @@ const FilterComponent: React.FC = ({setHiddenColumn, hiddenColumn}) => {
columnsName.map((el, ind) => {
return {el};
})
- }
+ }
);
}
From c869c349c09af9549eaf21555c5aafd71e254666 Mon Sep 17 00:00:00 2001
From: Pavel
Date: Wed, 16 Dec 2020 19:23:08 +0300
Subject: [PATCH 20/68] feat: implement set of tags, change variable for better
reading
---
.../src/components/UserSettings/TagColor.tsx | 22 +++++++++++--------
.../components/UserSettings/UserSettings.tsx | 8 +++++--
.../UserSettings/userSettingsHandlers.ts | 22 -------------------
3 files changed, 19 insertions(+), 33 deletions(-)
diff --git a/client/src/components/UserSettings/TagColor.tsx b/client/src/components/UserSettings/TagColor.tsx
index 5ec6ddde94..fff8496c45 100644
--- a/client/src/components/UserSettings/TagColor.tsx
+++ b/client/src/components/UserSettings/TagColor.tsx
@@ -2,40 +2,44 @@ import React, { useCallback } from 'react';
import TagColorIcon from './TagColorIcon';
import { Collapse, Tag } from 'antd';
import { GithubPicker } from 'react-color';
-import { pickerColors, mockedTags as tags, setTagColor, getTagStyle, DEFAULT_COLOR } from './userSettingsHandlers';
+import { pickerColors, setTagColor, getTagStyle, DEFAULT_COLOR } from './userSettingsHandlers';
import { useLocalStorage } from 'react-use';
import { ColorState as IColorState } from 'react-color';
-const TagColor: React.FC = () => {
+type Props = {
+ tags: string[];
+};
+
+const TagColor = ({ tags }: Props) => {
const { Panel } = Collapse;
const [storedTagColors, setStoredTagColors] = useLocalStorage