aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorjpl2017-04-19 12:35:54 +0200
committerjpl2017-04-19 12:35:54 +0200
commit59c35cb1d787d9c3a2eb76da0a22fcbeaa5fa003 (patch)
treeed018394fe6359fcf08e92dd46980c9d2bee4a47 /app/assets/javascripts
parentd0897010967fdb8c574e98f777b7a649c5488a93 (diff)
downloadchouette-core-59c35cb1d787d9c3a2eb76da0a22fcbeaa5fa003.tar.bz2
Refs #2982: add daytypes check for updateSynthesis method on tt#edit
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/es6_browserified/time_tables/actions/index.js4
-rw-r--r--app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js4
2 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/es6_browserified/time_tables/actions/index.js b/app/assets/javascripts/es6_browserified/time_tables/actions/index.js
index c6e822067..1a6b7d197 100644
--- a/app/assets/javascripts/es6_browserified/time_tables/actions/index.js
+++ b/app/assets/javascripts/es6_browserified/time_tables/actions/index.js
@@ -69,7 +69,7 @@ const actions = {
return monthList[date.getMonth()]
},
- updateSynthesis: (state) => {
+ updateSynthesis: (state, daytypes) => {
let periods = state.time_table_periods
let isInPeriod = function(d){
@@ -87,6 +87,8 @@ const actions = {
if(currentDate >= begin && currentDate <= end) {
if(d.excluded_date) {
testDate = false
+ } else if(daytypes[d.wday] === false) {
+ testDate = false
} else {
testDate = true
}
diff --git a/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js b/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js
index b2e5ad0be..1c492859f 100644
--- a/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js
+++ b/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js
@@ -10,12 +10,12 @@ const timetable = (state = {}, action) => {
periode_range: action.json.periode_range,
time_table_periods: action.json.time_table_periods
})
- return _.assign({}, fetchedState, {current_month: actions.updateSynthesis(fetchedState)})
+ return _.assign({}, fetchedState, {current_month: actions.updateSynthesis(fetchedState, actions.strToArrayDayTypes(action.json.day_types))})
case 'RECEIVE_MONTH':
let newState = _.assign({}, state, {
current_month: action.json.days
})
- return _.assign({}, newState, {current_month: actions.updateSynthesis(newState)})
+ return _.assign({}, newState, {current_month: actions.updateSynthesis(newState, actions.strToArrayDayTypes(action.json.day_types))})
case 'GO_TO_PREVIOUS_PAGE':
case 'GO_TO_NEXT_PAGE':
let nextPage = action.nextPage ? 1 : -1