Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit c4fe96d6 authored by Anna's avatar Anna Committed by GitHub
Browse files

Merge pull request #4060 from nextcloud/fix/4032/alarm-type

Fix alarm type selection if forceAlarmType is null
parents 6b768845 81dc3340
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ class ViewController extends Controller {
		$hideEventExport = $this->config->getAppValue($this->appName, 'hideEventExport', 'no') === 'yes';
		$forceEventAlarmType = $this->config->getAppValue($this->appName, 'forceEventAlarmType', '');
		if (!in_array($forceEventAlarmType, ['DISPLAY', 'EMAIL'], true)) {
			$forceEventAlarmType = null;
			$forceEventAlarmType = false;
		}

		$talkEnabled = $this->appManager->isEnabledForUser('spreed');
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ export default {
		addAlarm(totalSeconds) {
			this.$store.commit('addAlarmToCalendarObjectInstance', {
				calendarObjectInstance: this.calendarObjectInstance,
				type: this.forceEventAlarmType ?? 'DISPLAY',
				type: this.forceEventAlarmType || 'DISPLAY',
				totalSeconds,
			})
		},
+10 −3
Original line number Diff line number Diff line
@@ -98,14 +98,14 @@
			class="property-alarm-item__options">
			<Actions>
				<ActionRadio
					v-if="canChangeAlarmType && (isAlarmTypeDisplay || forceEventAlarmType === null || forceEventAlarmType === 'DISPLAY')"
					v-if="canChangeAlarmType || (!isAlarmTypeDisplay && forceEventAlarmType === 'DISPLAY')"
					:name="alarmTypeName"
					:checked="isAlarmTypeDisplay"
					@change="changeType('DISPLAY')">
					{{ $t('calendar', 'Notification') }}
				</ActionRadio>
				<ActionRadio
					v-if="canChangeAlarmType && (isAlarmTypeEmail || forceEventAlarmType === null || forceEventAlarmType === 'EMAIL')"
					v-if="canChangeAlarmType || (!isAlarmTypeEmail && forceEventAlarmType === 'EMAIL')"
					:name="alarmTypeName"
					:checked="isAlarmTypeEmail"
					@change="changeType('EMAIL')">
@@ -266,8 +266,15 @@ export default {

			return true
		},
		/**
		 * Changing the alarm type is allowed if the alarm type does
		 * not match the forceEventAlarmType (yet).
		 *
		 * If no alarm type is forced (forceEventAlarmType === false),
		 * this will return true as well.
		 */
		canChangeAlarmType() {
		  return this.forceEventAlarmType !== null && this.alarm.type !== this.forceEventAlarmType
			return this.alarm.type !== this.forceEventAlarmType
		},
		alarmTypeName() {
			return this._uid + '-radio-type-name'
+3 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ const state = {
	tasksEnabled: false,
	timezone: 'automatic',
	hideEventExport: false,
	forceEventAlarmType: null,
	forceEventAlarmType: false,
	// user-defined Nextcloud settings
	momentLocale: 'en',
}
@@ -162,6 +162,8 @@ Initial settings:
	- TalkEnabled: ${talkEnabled}
	- TasksEnabled: ${tasksEnabled}
	- Timezone: ${timezone}
	- HideEventExport: ${hideEventExport}
	- ForceEventAlarmType: ${forceEventAlarmType}
`)

		state.appVersion = appVersion
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ export default {
			timezone: loadState('calendar', 'timezone'),
			showTasks: loadState('calendar', 'show_tasks'),
			hideEventExport: loadState('calendar', 'hide_event_export'),
			forceEventAlarmType: loadState('calendar', 'force_event_alarm_type', null),
			forceEventAlarmType: loadState('calendar', 'force_event_alarm_type', false),
		})
		this.$store.dispatch('initializeCalendarJsConfig')

Loading