fix(calendar): don't allow RDATE unless already defined

Since RDATE are not properly supported in EAS, hide the possibility to
specify recurring dates unless the component being edited already
contains RDATE(s).
This commit is contained in:
Francis Lachapelle committed 2019-10-30 11:04:59 -04:00
1 parent 42bb3b288b
commit f6ca946058
5 files changed
+28 -9

No files matched your search

@@ -205,8 +205,8 @@
/**
* @ngInject
*/
ComponentEditorController.$inject = ['$rootScope', '$scope', '$log', '$timeout', '$element', '$mdDialog', 'sgFocus', 'User', 'CalendarSettings', 'Calendar', 'Component', 'Attendees', 'AddressBook', 'Card', 'Alarm', 'Preferences', 'stateComponent'];
function ComponentEditorController($rootScope, $scope, $log, $timeout, $element, $mdDialog, focus, User, CalendarSettings, Calendar, Component, Attendees, AddressBook, Card, Alarm, Preferences, stateComponent) {
ComponentEditorController.$inject = ['$rootScope', '$scope', '$log', '$timeout', '$window', '$element', '$mdDialog', 'sgFocus', 'User', 'CalendarSettings', 'Calendar', 'Component', 'Attendees', 'AddressBook', 'Card', 'Alarm', 'Preferences', 'stateComponent'];
function ComponentEditorController($rootScope, $scope, $log, $timeout, $window, $element, $mdDialog, focus, User, CalendarSettings, Calendar, Component, Attendees, AddressBook, Card, Alarm, Preferences, stateComponent) {
var vm = this, component, oldStartDate, oldEndDate, oldDueDate, dayStartTime, dayEndTime;
this.$onInit = function () {
@@ -264,6 +264,12 @@
this.component.repeat.month.type == 'bymonthday';
};
this.frequencies = function () {
return _.filter($window.repeatFrequencies, function (frequency) {
return frequency[0] != 'custom' || vm.component.repeat.frequency == 'custom';
});
};
this.changeFrequency = function () {
if (this.component.repeat.frequency == 'custom')
this.showRecurrenceEditor = true;