@olea-bps/base 1.1.9 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ComponentJobsFilter/index.js +136 -135
- package/components/CourseDetailDialog/index.js +100 -100
- package/components/NewsDetail/index.js +229 -289
- package/components/NewsDetail/styles.js +3 -4
- package/components/RoomDetail/index.js +240 -212
- package/components/TimetableDay/index.js +211 -212
- package/components/TimetableMonth/index.js +57 -60
- package/components/TimetableWeek/index.js +72 -75
- package/package.json +10 -8
|
@@ -12,26 +12,26 @@
|
|
|
12
12
|
* limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { useMemo, useCallback } from 'react'
|
|
16
|
-
import { View, Text, TouchableOpacity, StyleSheet, useWindowDimensions } from 'react-native'
|
|
17
|
-
import { connect } from 'react-redux'
|
|
18
|
-
import { withTheme } from 'react-native-paper'
|
|
19
|
-
import { withTranslation } from 'react-i18next'
|
|
20
|
-
import { Calendar } from 'react-native-big-calendar'
|
|
21
|
-
import { useCourses } from '../../context/context-timetable'
|
|
22
|
-
import CalendarStrip from 'react-native-calendar-strip'
|
|
23
|
-
import { DateTime, Duration } from 'luxon'
|
|
24
|
-
import { TabView } from 'react-native-tab-view'
|
|
25
|
-
import { onUpdateRefreshing } from '../../libraries/core'
|
|
26
|
-
import moment from 'moment'
|
|
27
|
-
import 'moment/locale/de'
|
|
28
|
-
|
|
29
|
-
import componentStyles from './styles'
|
|
15
|
+
import { useMemo, useCallback } from 'react'
|
|
16
|
+
import { View, Text, TouchableOpacity, StyleSheet, useWindowDimensions } from 'react-native'
|
|
17
|
+
import { connect } from 'react-redux'
|
|
18
|
+
import { withTheme } from 'react-native-paper'
|
|
19
|
+
import { withTranslation } from 'react-i18next'
|
|
20
|
+
import { Calendar } from 'react-native-big-calendar'
|
|
21
|
+
import { useCourses } from '../../context/context-timetable'
|
|
22
|
+
import CalendarStrip from 'react-native-calendar-strip'
|
|
23
|
+
import { DateTime, Duration } from 'luxon'
|
|
24
|
+
import { TabView } from 'react-native-tab-view'
|
|
25
|
+
import { onUpdateRefreshing } from '../../libraries/core'
|
|
26
|
+
import moment from 'moment'
|
|
27
|
+
import 'moment/locale/de'
|
|
28
|
+
|
|
29
|
+
import componentStyles from './styles'
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Die Zeitspanne, welche vor und nach heute angezeigt werden soll.
|
|
33
33
|
*/
|
|
34
|
-
const daysTabDuration = Duration.fromISO('P6M')
|
|
34
|
+
const daysTabDuration = Duration.fromISO('P6M')
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
*
|
|
@@ -39,51 +39,51 @@ const daysTabDuration = Duration.fromISO('P6M');
|
|
|
39
39
|
* @param {(DateTime)=> void} props.onWeekChanged
|
|
40
40
|
* @returns
|
|
41
41
|
*/
|
|
42
|
-
function CalendarWeek(props) {
|
|
43
|
-
const { selectedISOWeek, theme, settings, calendarScrollOffsetMinutes, calendarHeight, onWeekChanged, onCourseSelected } = props
|
|
42
|
+
function CalendarWeek (props) {
|
|
43
|
+
const { selectedISOWeek, theme, settings, calendarScrollOffsetMinutes, calendarHeight, onWeekChanged, onCourseSelected } = props
|
|
44
44
|
|
|
45
45
|
const styles = useMemo(
|
|
46
46
|
() => StyleSheet.create(componentStyles(theme)),
|
|
47
47
|
[theme]
|
|
48
|
-
)
|
|
48
|
+
)
|
|
49
49
|
|
|
50
|
-
const { width } = useWindowDimensions()
|
|
50
|
+
const { width } = useWindowDimensions()
|
|
51
51
|
|
|
52
|
-
const [courses] = useCourses()
|
|
52
|
+
const [courses] = useCourses()
|
|
53
53
|
|
|
54
|
-
const language = settings?.settingsGeneral?.language
|
|
54
|
+
const language = settings?.settingsGeneral?.language
|
|
55
55
|
|
|
56
56
|
const selectedWeekDate = useMemo(
|
|
57
57
|
() => DateTime.fromISO(selectedISOWeek),
|
|
58
58
|
[selectedISOWeek]
|
|
59
|
-
)
|
|
59
|
+
)
|
|
60
60
|
|
|
61
61
|
const now = DateTime.now()
|
|
62
|
-
const todayWeekNumber = now.weekNumber
|
|
63
|
-
const todayWeekYearNumber = now.weekYear
|
|
62
|
+
const todayWeekNumber = now.weekNumber
|
|
63
|
+
const todayWeekYearNumber = now.weekYear
|
|
64
64
|
|
|
65
65
|
const weeksTabViewRoutes = useMemo(
|
|
66
66
|
() => {
|
|
67
|
-
const todayWeekYear = DateTime.fromObject({ weekNumber: todayWeekNumber, weekYear: todayWeekYearNumber }).startOf('week')
|
|
68
|
-
const beginWeekYear = todayWeekYear.minus(daysTabDuration).startOf('week')
|
|
69
|
-
const endWeekYear = todayWeekYear.plus(daysTabDuration).endOf('week')
|
|
70
|
-
let currentWeekYear = DateTime.fromObject(beginWeekYear.toObject())
|
|
67
|
+
const todayWeekYear = DateTime.fromObject({ weekNumber: todayWeekNumber, weekYear: todayWeekYearNumber }).startOf('week')
|
|
68
|
+
const beginWeekYear = todayWeekYear.minus(daysTabDuration).startOf('week')
|
|
69
|
+
const endWeekYear = todayWeekYear.plus(daysTabDuration).endOf('week')
|
|
70
|
+
let currentWeekYear = DateTime.fromObject(beginWeekYear.toObject())
|
|
71
71
|
|
|
72
|
-
const weekYearRoutes = []
|
|
72
|
+
const weekYearRoutes = []
|
|
73
73
|
|
|
74
74
|
while (currentWeekYear <= endWeekYear) {
|
|
75
|
-
const currentISOWeekYear = currentWeekYear.toISOWeekDate()
|
|
75
|
+
const currentISOWeekYear = currentWeekYear.toISOWeekDate()
|
|
76
76
|
|
|
77
|
-
const currentWeekYearBeginDate = currentWeekYear.startOf('week')
|
|
78
|
-
const currentWeekYearEndDate = currentWeekYear.endOf('week')
|
|
79
|
-
let currentWeekYearDate = DateTime.fromObject(currentWeekYearBeginDate.toObject())
|
|
77
|
+
const currentWeekYearBeginDate = currentWeekYear.startOf('week')
|
|
78
|
+
const currentWeekYearEndDate = currentWeekYear.endOf('week')
|
|
79
|
+
let currentWeekYearDate = DateTime.fromObject(currentWeekYearBeginDate.toObject())
|
|
80
80
|
|
|
81
|
-
const currentWeekYearCourses = []
|
|
81
|
+
const currentWeekYearCourses = []
|
|
82
82
|
|
|
83
|
-
const eventColor = theme.colors.eventContainerSidebar
|
|
83
|
+
const eventColor = theme.colors.eventContainerSidebar
|
|
84
84
|
|
|
85
85
|
while (currentWeekYearDate <= currentWeekYearEndDate) {
|
|
86
|
-
const currentWeekYearISODate = currentWeekYearDate.toISODate()
|
|
86
|
+
const currentWeekYearISODate = currentWeekYearDate.toISODate()
|
|
87
87
|
const currentWeekYearDateCourses = courses?.[currentWeekYearISODate]
|
|
88
88
|
?.map(
|
|
89
89
|
course => (
|
|
@@ -96,14 +96,14 @@ function CalendarWeek(props) {
|
|
|
96
96
|
professor: course.lecturer[0]?.data,
|
|
97
97
|
room: course.room.data,
|
|
98
98
|
// Anfügen des Ürsprügnlichen Vorlesungsobjektes, damit es beim Klick zur Verfügung steht
|
|
99
|
-
origine: course
|
|
99
|
+
origine: course
|
|
100
100
|
}
|
|
101
101
|
)
|
|
102
|
-
) ?? []
|
|
102
|
+
) ?? []
|
|
103
103
|
|
|
104
|
-
currentWeekYearCourses.push(currentWeekYearDateCourses)
|
|
104
|
+
currentWeekYearCourses.push(currentWeekYearDateCourses)
|
|
105
105
|
|
|
106
|
-
currentWeekYearDate = currentWeekYearDate.plus({ day: 1 })
|
|
106
|
+
currentWeekYearDate = currentWeekYearDate.plus({ day: 1 })
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
weekYearRoutes.push(
|
|
@@ -112,61 +112,58 @@ function CalendarWeek(props) {
|
|
|
112
112
|
weekbeginISODate: currentWeekYearBeginDate.toISODate(),
|
|
113
113
|
week: currentWeekYear.weekNumber,
|
|
114
114
|
weekYear: currentWeekYear.weekYear,
|
|
115
|
-
events: currentWeekYearCourses.flat()
|
|
115
|
+
events: currentWeekYearCourses.flat()
|
|
116
116
|
}
|
|
117
|
-
)
|
|
117
|
+
)
|
|
118
118
|
|
|
119
|
-
currentWeekYear = currentWeekYear.plus({ week: 1 })
|
|
119
|
+
currentWeekYear = currentWeekYear.plus({ week: 1 })
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
return weekYearRoutes
|
|
122
|
+
return weekYearRoutes
|
|
123
123
|
},
|
|
124
124
|
[todayWeekNumber, todayWeekYearNumber, courses]
|
|
125
|
-
)
|
|
125
|
+
)
|
|
126
126
|
|
|
127
127
|
const weeksTabViewIndexes = useMemo(
|
|
128
128
|
() => weeksTabViewRoutes
|
|
129
129
|
.reduce(
|
|
130
130
|
(accumulator, currentRoute, currentIndex) =>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
(
|
|
132
|
+
{
|
|
133
|
+
...accumulator,
|
|
134
|
+
[currentRoute.key]: currentIndex
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
137
|
{}
|
|
138
138
|
),
|
|
139
139
|
[weeksTabViewRoutes]
|
|
140
140
|
)
|
|
141
141
|
|
|
142
|
-
const weeksTabViewIndex = weeksTabViewIndexes[selectedISOWeek]
|
|
142
|
+
const weeksTabViewIndex = weeksTabViewIndexes[selectedISOWeek]
|
|
143
143
|
|
|
144
144
|
const renderEvent = useCallback((event, touchableOpacityProps) => {
|
|
145
|
-
const { style, ...restTouchableOpacityProps } = touchableOpacityProps
|
|
145
|
+
const { key, style, ...restTouchableOpacityProps } = touchableOpacityProps
|
|
146
146
|
return (
|
|
147
147
|
<>
|
|
148
|
-
<TouchableOpacity
|
|
149
|
-
{...restTouchableOpacityProps}
|
|
150
|
-
style={[style, styles.eventContainer, { borderTopColor: event.color || '#000' }]}
|
|
151
|
-
>
|
|
148
|
+
<TouchableOpacity key={key} {...restTouchableOpacityProps} style={[style, styles.eventContainer, { borderTopColor: event.color || '#000' }]}>
|
|
152
149
|
<View style={styles.eventHeader}>
|
|
153
|
-
<Text style={styles.eventTitle} numberOfLines={2} ellipsizeMode=
|
|
150
|
+
<Text style={styles.eventTitle} numberOfLines={2} ellipsizeMode='clip'>{event.title}</Text>
|
|
154
151
|
</View>
|
|
155
|
-
<Text style={styles.eventRoom} numberOfLines={1} ellipsizeMode=
|
|
152
|
+
<Text style={styles.eventRoom} numberOfLines={1} ellipsizeMode='clip'>{event.room}</Text>
|
|
156
153
|
</TouchableOpacity>
|
|
157
154
|
</>
|
|
158
|
-
)
|
|
159
|
-
}, [styles])
|
|
155
|
+
)
|
|
156
|
+
}, [styles])
|
|
160
157
|
|
|
161
158
|
const renderScene = useCallback(
|
|
162
159
|
({ route }) => {
|
|
163
160
|
return (
|
|
164
|
-
<View style={{ flex: 1, width
|
|
161
|
+
<View style={{ flex: 1, width }}>
|
|
165
162
|
<Calendar
|
|
166
163
|
events={route.events}
|
|
167
164
|
renderEvent={renderEvent}
|
|
168
165
|
renderHeader={() => null}
|
|
169
|
-
mode=
|
|
166
|
+
mode='week'
|
|
170
167
|
height={calendarHeight}
|
|
171
168
|
headerContentStyle={{ backgroundColor: 'transparent' }}
|
|
172
169
|
weekStartsOn={1}
|
|
@@ -180,15 +177,15 @@ function CalendarWeek(props) {
|
|
|
180
177
|
hourStyle={styles.hourStyle}
|
|
181
178
|
/>
|
|
182
179
|
</View>
|
|
183
|
-
)
|
|
180
|
+
)
|
|
184
181
|
},
|
|
185
182
|
[styles, width, courses, renderEvent]
|
|
186
|
-
)
|
|
183
|
+
)
|
|
187
184
|
|
|
188
185
|
return (
|
|
189
186
|
<>
|
|
190
187
|
<View style={styles.viewStrip}>
|
|
191
|
-
<View pointerEvents=
|
|
188
|
+
<View pointerEvents='none'>
|
|
192
189
|
<CalendarStrip
|
|
193
190
|
style={styles.strip}
|
|
194
191
|
locale={{
|
|
@@ -199,7 +196,7 @@ function CalendarWeek(props) {
|
|
|
199
196
|
showMonth={false}
|
|
200
197
|
iconStyle={{ display: 'none' }}
|
|
201
198
|
startingDate={selectedWeekDate.plus({ day: 1 }).toJSDate()}
|
|
202
|
-
pointerEvents=
|
|
199
|
+
pointerEvents='none'
|
|
203
200
|
/>
|
|
204
201
|
</View>
|
|
205
202
|
</View>
|
|
@@ -211,20 +208,20 @@ function CalendarWeek(props) {
|
|
|
211
208
|
lazyPreloadDistance={2}
|
|
212
209
|
onIndexChange={
|
|
213
210
|
(index) => {
|
|
214
|
-
const deltaISOWeekYear = weeksTabViewRoutes?.[index]?.key
|
|
215
|
-
onWeekChanged(deltaISOWeekYear)
|
|
211
|
+
const deltaISOWeekYear = weeksTabViewRoutes?.[index]?.key
|
|
212
|
+
onWeekChanged(deltaISOWeekYear)
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
215
|
renderScene={renderScene}
|
|
219
216
|
/>
|
|
220
217
|
</>
|
|
221
|
-
)
|
|
218
|
+
)
|
|
222
219
|
}
|
|
223
220
|
|
|
224
221
|
const mapStateToProps = (state) => {
|
|
225
222
|
return {
|
|
226
|
-
settings: state.settingReducer
|
|
227
|
-
}
|
|
228
|
-
}
|
|
223
|
+
settings: state.settingReducer
|
|
224
|
+
}
|
|
225
|
+
}
|
|
229
226
|
|
|
230
|
-
export default connect(mapStateToProps, { onUpdateRefreshing })(withTranslation()(withTheme(CalendarWeek)))
|
|
227
|
+
export default connect(mapStateToProps, { onUpdateRefreshing })(withTranslation()(withTheme(CalendarWeek)))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olea-bps/base",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "OLEA base library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"email": "support@hrz.tu-chemnitz.de",
|
|
15
15
|
"url": "https://www.tu-chemnitz.de/urz/"
|
|
16
16
|
},
|
|
17
|
+
{
|
|
18
|
+
"name": "HTWK Leipzig",
|
|
19
|
+
"email": "feedback.app@htwk-leipzig.de",
|
|
20
|
+
"url": "https://www.htwk-leipzig.de/htwk-app"
|
|
21
|
+
},
|
|
17
22
|
{
|
|
18
23
|
"name": "codeculture",
|
|
19
24
|
"email": "info@codeculture.de",
|
|
@@ -41,27 +46,24 @@
|
|
|
41
46
|
"expo-linear-gradient": "~56.0.4",
|
|
42
47
|
"expo-web-browser": "~56.0.6",
|
|
43
48
|
"jwt-decode": "4.0.0",
|
|
44
|
-
"moment": "^2.31.0",
|
|
45
49
|
"react-native-elements": "^3.4.3",
|
|
46
50
|
"react-native-enriched-markdown": "^0.7.4",
|
|
47
51
|
"react-native-modalbox": "^2.0.2",
|
|
48
|
-
"react-native-paper": "^5.15.3",
|
|
49
52
|
"react-native-svg": "15.15.4",
|
|
50
53
|
"react-native-swipe-gestures": "^1.0.5",
|
|
51
54
|
"react-native-tab-view": "^4.3.3",
|
|
52
55
|
"react-native-uuid": "^2.0.4",
|
|
53
56
|
"react-native-vector-icons": "^10.3.0",
|
|
54
57
|
"react-native-webview": "13.16.1",
|
|
55
|
-
"react-redux": "^9.3.0",
|
|
56
|
-
"redux": "^4.2.1",
|
|
57
58
|
"redux-persist": "^6.0.0"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
61
|
+
"moment": "^2.31.0",
|
|
60
62
|
"react": "^19.0.0",
|
|
61
63
|
"react-native": "^0.85.0",
|
|
62
|
-
"react-native-paper": "^5.
|
|
63
|
-
"react-redux": "^9.
|
|
64
|
-
"redux": "^4.
|
|
64
|
+
"react-native-paper": "^5.15.3",
|
|
65
|
+
"react-redux": "^9.3.0",
|
|
66
|
+
"redux": "^4.2.1"
|
|
65
67
|
},
|
|
66
68
|
"devDependencies": {
|
|
67
69
|
"@expo/vector-icons": "^15.1.1"
|