Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/Controller/PublicViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @author Georg Ehrke
* @copyright 2019 Georg Ehrke <oc.list@georgehrke.com>
* @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Expand Down Expand Up @@ -128,6 +129,7 @@ private function publicIndex(string $token,
$defaultSlotDuration = $this->config->getAppValue($this->appName, 'slotDuration', '00:30:00');
$defaultDefaultReminder = $this->config->getAppValue($this->appName, 'defaultReminder', 'none');
$defaultShowTasks = $this->config->getAppValue($this->appName, 'showTasks', 'yes');
$defaultSendInvitations = $this->config->getAppValue('dav', 'sendInvitations', 'yes');

$appVersion = $this->config->getAppValue($this->appName, 'installed_version', null);

Expand All @@ -146,6 +148,7 @@ private function publicIndex(string $token,
$this->initialStateService->provideInitialState($this->appName, 'show_tasks', $defaultShowTasks === 'yes');
$this->initialStateService->provideInitialState($this->appName, 'tasks_enabled', false);
$this->initialStateService->provideInitialState($this->appName, 'hide_event_export', false);
$this->initialStateService->provideInitialState($this->appName, 'send_invitations', $defaultSendInvitations);

return new TemplateResponse($this->appName, 'main', [
'share_url' => $this->getShareURL(),
Expand Down
3 changes: 3 additions & 0 deletions lib/Controller/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @author Georg Ehrke
* @copyright 2019 Georg Ehrke <oc.list@georgehrke.com>
* @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Expand Down Expand Up @@ -100,6 +101,7 @@ public function index():TemplateResponse {
if (!in_array($forceEventAlarmType, ['DISPLAY', 'EMAIL'], true)) {
$forceEventAlarmType = false;
}
$sendInvitations = $this->config->getAppValue('dav', 'sendInvitations', 'yes') === 'yes';

$talkEnabled = $this->appManager->isEnabledForUser('spreed');
$talkApiVersion = version_compare($this->appManager->getAppVersion('spreed'), '12.0.0', '>=') ? 'v4' : 'v1';
Expand All @@ -121,6 +123,7 @@ public function index():TemplateResponse {
$this->initialStateService->provideInitialState('tasks_enabled', $tasksEnabled);
$this->initialStateService->provideInitialState('hide_event_export', $hideEventExport);
$this->initialStateService->provideInitialState('force_event_alarm_type', $forceEventAlarmType);
$this->initialStateService->provideInitialState('send_invitations', $sendInvitations);
$this->initialStateService->provideInitialState('appointmentConfigs', $this->appointmentConfigService->getAllAppointmentConfigurations($this->userId));
$this->initialStateService->provideInitialState('disable_appointments', $disableAppointments);

Expand Down
18 changes: 6 additions & 12 deletions src/components/Editor/AvatarParticipationStatus.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
- @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
-
- @author Georg Ehrke <oc.list@georgehrke.com>
-
Expand Down Expand Up @@ -145,18 +146,11 @@ export default {
}
}

if (this.isViewedByOrganizer) {
return {
indicatorClass: ['no-response', 'icon', 'icon-invitees-no-response-white'],
label: t('calendar', 'Invitation sent'),
}
} else {
return {
indicatorClass: ['no-response', 'icon', 'icon-invitees-no-response-white'],
label: t('calendar', 'Has not responded to {organizerName}\'s invitation yet', {
organizerName: this.organizerDisplayName,
}),
}
return {
indicatorClass: ['no-response', 'icon', 'icon-invitees-no-response-white'],
label: t('calendar', 'Has not responded to {organizerName}\'s invitation yet', {
organizerName: this.organizerDisplayName,
}),
}
},
},
Expand Down
8 changes: 7 additions & 1 deletion src/components/Editor/Invitees/InviteesListItem.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
- @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
-
- @author Georg Ehrke <oc.list@georgehrke.com>
- @author Richard Steinmetz <richard@steinmetz.cloud>
Expand Down Expand Up @@ -35,7 +36,8 @@
</div>
<div class="invitees-list-item__actions">
<Actions v-if="isViewedByOrganizer">
<ActionCheckbox :checked="attendee.rsvp"
<ActionCheckbox v-show="sendInvitations"
:checked="attendee.rsvp"
@change="toggleRSVP">
{{ $t('calendar', 'Send email') }}
</ActionCheckbox>
Expand Down Expand Up @@ -73,6 +75,7 @@
</template>

<script>
import { mapState } from 'vuex'
import AvatarParticipationStatus from '../AvatarParticipationStatus'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
Expand Down Expand Up @@ -107,6 +110,9 @@ export default {
},
},
computed: {
...mapState({
sendInvitations: state => state.settings.sendInvitations,
}),
/**
* @return {string}
*/
Expand Down
7 changes: 6 additions & 1 deletion src/store/settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @copyright Copyright (c) 2020 Georg Ehrke
* @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* @author Georg Ehrke <oc.list@georgehrke.com>
*
Expand Down Expand Up @@ -45,6 +46,7 @@ const state = {
timezone: 'automatic',
hideEventExport: false,
forceEventAlarmType: false,
sendInvitations: true,
// user-defined Nextcloud settings
momentLocale: 'en',
}
Expand Down Expand Up @@ -149,8 +151,9 @@ const mutations = {
* @param {boolean} data.hideEventExport
* @param {string} data.forceEventAlarmType
* @param {boolean} data.disableAppointments Allow to disable the appointments feature
* @param {boolean} data.sendInvitations
*/
loadSettingsFromServer(state, { appVersion, eventLimit, firstRun, showWeekNumbers, showTasks, showWeekends, skipPopover, slotDuration, defaultReminder, talkEnabled, tasksEnabled, timezone, hideEventExport, forceEventAlarmType, disableAppointments }) {
loadSettingsFromServer(state, { appVersion, eventLimit, firstRun, showWeekNumbers, showTasks, showWeekends, skipPopover, slotDuration, defaultReminder, talkEnabled, tasksEnabled, timezone, hideEventExport, forceEventAlarmType, disableAppointments, sendInvitations }) {
logInfo(`
Initial settings:
- AppVersion: ${appVersion}
Expand All @@ -168,6 +171,7 @@ Initial settings:
- HideEventExport: ${hideEventExport}
- ForceEventAlarmType: ${forceEventAlarmType}
- disableAppointments: ${disableAppointments}
- SendInvitations: ${sendInvitations}
`)

state.appVersion = appVersion
Expand All @@ -185,6 +189,7 @@ Initial settings:
state.hideEventExport = hideEventExport
state.forceEventAlarmType = forceEventAlarmType
state.disableAppointments = disableAppointments
state.sendInvitations = sendInvitations
},

/**
Expand Down
2 changes: 2 additions & 0 deletions src/views/Calendar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!--
- @copyright Copyright (c) 2020 Georg Ehrke <oc.list@georgehrke.com>
- @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
- @author Georg Ehrke <oc.list@georgehrke.com>
-
- @license GNU AGPL version 3 or any later version
Expand Down Expand Up @@ -218,6 +219,7 @@ export default {
hideEventExport: loadState('calendar', 'hide_event_export'),
forceEventAlarmType: loadState('calendar', 'force_event_alarm_type', false),
disableAppointments: loadState('calendar', 'disable_appointments', false),
sendInvitations: loadState('calendar', 'send_invitations'),
})
this.$store.dispatch('initializeCalendarJsConfig')

Expand Down
6 changes: 6 additions & 0 deletions tests/javascript/unit/store/settings.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @copyright Copyright (c) 2019 Georg Ehrke
* @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* @author Georg Ehrke <oc.list@georgehrke.com>
*
Expand Down Expand Up @@ -63,6 +64,7 @@ describe('store/settings test suite', () => {
timezone: 'automatic',
momentLocale: 'en',
disableAppointments: false,
sendInvitations: true,
})
})

Expand Down Expand Up @@ -172,6 +174,7 @@ describe('store/settings test suite', () => {
hideEventExport: false,
forceEventAlarmType: false,
disableAppointments: false,
sendInvitations: true,
}

const settings = {
Expand All @@ -191,6 +194,7 @@ describe('store/settings test suite', () => {
hideEventExport: false,
forceEventAlarmType: false,
disableAppointments: false,
sendInvitations: true,
}

settingsStore.mutations.loadSettingsFromServer(state, settings)
Expand All @@ -213,6 +217,7 @@ Initial settings:
- HideEventExport: false
- ForceEventAlarmType: false
- disableAppointments: false
- SendInvitations: true
`)
expect(state).toEqual({
appVersion: '2.1.0',
Expand All @@ -232,6 +237,7 @@ Initial settings:
hideEventExport: false,
forceEventAlarmType: false,
disableAppointments: false,
sendInvitations: true,
})
})

Expand Down
2 changes: 1 addition & 1 deletion tests/php/unit/Controller/PublicViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function setUp():void {
}

public function testPublicIndexWithBranding():void {
$this->config->expects(self::exactly(10))
$this->config->expects(self::exactly(11))
->method('getAppValue')
->willReturnMap([
['calendar', 'eventLimit', 'yes', 'no'],
Expand Down
3 changes: 3 additions & 0 deletions tests/php/unit/Controller/ViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @author Georg Ehrke
* @copyright 2019 Georg Ehrke <oc.list@georgehrke.com>
* @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Expand Down Expand Up @@ -96,6 +97,7 @@ public function testIndex(): void {
['calendar', 'showTasks', 'yes', 'defaultShowTasks'],
['calendar', 'hideEventExport', 'no', 'yes'],
['calendar', 'forceEventAlarmType', '', ''],
['calendar', 'sendInvitations', 'yes', 'defaultSendInvitations'],
['calendar', 'installed_version', null, '1.0.0'],
]);
$this->config
Expand Down Expand Up @@ -147,6 +149,7 @@ public function testIndex(): void {
['tasks_enabled', true],
['hide_event_export', true],
['force_event_alarm_type', null],
['send_invitations', false],
['appointmentConfigs', [new AppointmentConfig()]],
);

Expand Down