Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally enforce a event alarm type #3997

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Feb 25, 2022

This contributes the second part of #3993.

  • Admins can enforce DISPLAY or EMAIL as alarm type
  • The value is used as new default for an reminder
  • If a reminder matches the enforced type, we hide the radio group all together (there would only be one option after all)
    Bildschirmfoto von 2022-02-25 11-49-12
  • If a reminder doesn't match the enforced type (event created before enforcement or another client) then the user decide to stay on the old value or switch to the enforced one
    Bildschirmfoto von 2022-02-25 11-49-05

I will update the Calendar admin docs for this.

occ config:app:set calendar forceEventAlarmType --value=EMAIL

@ChristophWurst ChristophWurst added the 3. to review Waiting for reviews label Feb 25, 2022
@ChristophWurst ChristophWurst added this to the v3.2.0 milestone Feb 25, 2022
@ChristophWurst ChristophWurst self-assigned this Feb 25, 2022
@tcitworld
Copy link
Member

Admins can enforce DISPLAY or EMAIL as alarm type

Not both, then ?

@@ -93,6 +94,10 @@ public function index():TemplateResponse {
$slotDuration = $this->config->getUserValue($this->userId, $this->appName, 'slotDuration', $defaultSlotDuration);
$defaultReminder = $this->config->getUserValue($this->userId, $this->appName, 'defaultReminder', $defaultDefaultReminder);
$showTasks = $this->config->getUserValue($this->userId, $this->appName, 'showTasks', $defaultShowTasks) === 'yes';
$forceEventAlarmType = $this->config->getAppValue($this->appName, 'force_event_alarm_type', '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase as well

@ChristophWurst
Copy link
Member Author

Not both, then ?

That would be equal to no enforcement. Right now you can also only pick between EMAIL/DISPLAY and nothing else unless that was already present in the event.

@ChristophWurst ChristophWurst force-pushed the enhancement/optionally-force-event-alarm-type branch from 93f68f3 to d90c27c Compare March 3, 2022 16:08
@szaimen szaimen requested review from st3iny and removed request for szaimen March 3, 2022 16:09
@ChristophWurst ChristophWurst force-pushed the enhancement/optionally-force-event-alarm-type branch from d90c27c to 6f66f34 Compare March 3, 2022 16:37
@ChristophWurst ChristophWurst requested a review from tcitworld March 3, 2022 16:37
@ChristophWurst ChristophWurst added the enhancement New feature request label Mar 3, 2022
Any other value set by another client still shows up. This only
"enforces" the alarm type for those who only use the Calendar app.

Signed-off-by: Christoph Wurst <[email protected]>
@ChristophWurst ChristophWurst force-pushed the enhancement/optionally-force-event-alarm-type branch from 6f66f34 to dfa5e8f Compare March 3, 2022 17:08
@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Mar 3, 2022
@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #3997 (dfa5e8f) into main (3633e7a) will increase coverage by 0.02%.
The diff coverage is 25.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3997      +/-   ##
============================================
+ Coverage     29.47%   29.49%   +0.02%     
- Complexity      323      324       +1     
============================================
  Files           220      220              
  Lines          7583     7594      +11     
  Branches       1002     1004       +2     
============================================
+ Hits           2235     2240       +5     
- Misses         5348     5354       +6     
Flag Coverage Δ
javascript 20.81% <25.00%> (-0.01%) ⬇️
php 67.54% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/components/Editor/Alarm/AlarmList.vue 0.00% <0.00%> (ø)
src/components/Editor/Alarm/AlarmListItem.vue 0.00% <0.00%> (ø)
src/views/Calendar.vue 0.00% <ø> (ø)
src/store/settings.js 100.00% <100.00%> (ø)
...ud/apps/calendar/lib/Controller/ViewController.php 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3633e7a...dfa5e8f. Read the comment docs.

@ChristophWurst ChristophWurst merged commit 676d119 into main Mar 3, 2022
@delete-merged-branch delete-merged-branch bot deleted the enhancement/optionally-force-event-alarm-type branch March 3, 2022 17:47
@max65482
Copy link
Contributor

By default I cannot select the reminder type anymore (no config switch set). Is this the expected behavior?

Otherwise, I would have expected this condition...

canChangeAlarmType() {
return this.forceEventAlarmType !== null && this.alarm.type !== this.forceEventAlarmType
},

... to be
return this.forceEventAlarmType === null || this.alarm.type !== this.forceEventAlarmType

@@ -114,6 +119,7 @@ public function index():TemplateResponse {
$this->initialStateService->provideInitialState('show_tasks', $showTasks);
$this->initialStateService->provideInitialState('tasks_enabled', $tasksEnabled);
$this->initialStateService->provideInitialState('hide_event_export', $hideEventExport);
$this->initialStateService->provideInitialState('force_event_alarm_type', $forceEventAlarmType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as mentioned in #4051, this causes log entries.

@miaulalala
Copy link
Contributor

Not sure if your occ command is intentionally using forceEventAlarm_type but the initial state checks for forceEventAlarmType just FYI

@m-a-v
Copy link

m-a-v commented Mar 14, 2022

But like this you force the reminder type to email. This changes the default behavior where you can choose the alarm type in the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement New feature request
Projects
Development

Successfully merging this pull request may close these issues.

7 participants