mirror of https://github.com/nextcloud/calendar
Add tasks_enabled to Initial State Service
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
fbdcb859ca
commit
32c1e9e95a
|
@ -135,6 +135,7 @@ class PublicViewController extends Controller {
|
|||
$this->initialStateService->provideInitialState($this->appName, 'timezone', $defaultTimezone);
|
||||
$this->initialStateService->provideInitialState($this->appName, 'slot_duration', $defaultSlotDuration);
|
||||
$this->initialStateService->provideInitialState($this->appName, 'show_tasks', $defaultShowTasks === 'yes');
|
||||
$this->initialStateService->provideInitialState($this->appName, 'tasks_enabled', false);
|
||||
|
||||
return new TemplateResponse($this->appName, 'main', [
|
||||
'share_url' => $this->getShareURL(),
|
||||
|
|
|
@ -108,6 +108,7 @@ class ViewController extends Controller {
|
|||
$showTasks = $this->config->getUserValue($this->userId, $this->appName, 'showTasks', $defaultShowTasks) === 'yes';
|
||||
|
||||
$talkEnabled = $this->appManager->isEnabledForUser('spreed');
|
||||
$tasksEnabled = $this->appManager->isEnabledForUser('tasks');
|
||||
|
||||
$this->initialStateService->provideInitialState($this->appName, 'app_version', $appVersion);
|
||||
$this->initialStateService->provideInitialState($this->appName, 'event_limit', $eventLimit);
|
||||
|
@ -120,6 +121,7 @@ class ViewController extends Controller {
|
|||
$this->initialStateService->provideInitialState($this->appName, 'timezone', $timezone);
|
||||
$this->initialStateService->provideInitialState($this->appName, 'slot_duration', $slotDuration);
|
||||
$this->initialStateService->provideInitialState($this->appName, 'show_tasks', $showTasks);
|
||||
$this->initialStateService->provideInitialState($this->appName, 'tasks_enabled', $tasksEnabled);
|
||||
|
||||
return new TemplateResponse($this->appName, 'main');
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ const state = {
|
|||
skipPopover: null,
|
||||
slotDuration: null,
|
||||
talkEnabled: false,
|
||||
tasksEnabled: false,
|
||||
timezone: null,
|
||||
}
|
||||
|
||||
|
@ -127,6 +128,7 @@ const mutations = {
|
|||
state.skipPopover = settings.skipPopover
|
||||
state.slotDuration = settings.slotDuration
|
||||
state.talkEnabled = settings.talkEnabled
|
||||
state.tasksEnabled = settings.tasksEnabled
|
||||
state.timezone = settings.timezone
|
||||
},
|
||||
|
||||
|
|
|
@ -300,6 +300,7 @@ export default {
|
|||
skipPopover: loadState('calendar', 'skip_popover'),
|
||||
slotDuration: loadState('calendar', 'slot_duration'),
|
||||
talkEnabled: loadState('calendar', 'talk_enabled'),
|
||||
tasksEnabled: loadState('calendar', 'tasks_enabled'),
|
||||
timezone: loadState('calendar', 'timezone'),
|
||||
showTasks: loadState('calendar', 'show_tasks'),
|
||||
})
|
||||
|
|
|
@ -154,6 +154,9 @@ class PublicViewControllerTest extends TestCase {
|
|||
$this->initialStateService->expects($this->at(10))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'show_tasks', true);
|
||||
$this->initialStateService->expects($this->at(11))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'tasks_enabled', false);
|
||||
|
||||
$response = $this->controller->publicIndexWithBranding('');
|
||||
|
||||
|
@ -259,6 +262,9 @@ class PublicViewControllerTest extends TestCase {
|
|||
$this->initialStateService->expects($this->at(10))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'show_tasks', false);
|
||||
$this->initialStateService->expects($this->at(11))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'tasks_enabled', false);
|
||||
|
||||
$response = $this->controller->publicIndexForEmbedding('');
|
||||
|
||||
|
|
|
@ -142,6 +142,10 @@ class ViewControllerTest extends TestCase {
|
|||
->method('isEnabledForUser')
|
||||
->with('spreed')
|
||||
->willReturn(true);
|
||||
$this->appManager->expects($this->at(1))
|
||||
->method('isEnabledForUser')
|
||||
->with('tasks')
|
||||
->willReturn(true);
|
||||
|
||||
$this->initialStateService->expects($this->at(0))
|
||||
->method('provideInitialState')
|
||||
|
@ -176,6 +180,9 @@ class ViewControllerTest extends TestCase {
|
|||
$this->initialStateService->expects($this->at(10))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'show_tasks', false);
|
||||
$this->initialStateService->expects($this->at(11))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'tasks_enabled', true);
|
||||
|
||||
$response = $this->controller->index();
|
||||
|
||||
|
@ -268,6 +275,10 @@ class ViewControllerTest extends TestCase {
|
|||
->method('isEnabledForUser')
|
||||
->with('spreed')
|
||||
->willReturn(true);
|
||||
$this->appManager->expects($this->at(1))
|
||||
->method('isEnabledForUser')
|
||||
->with('tasks')
|
||||
->willReturn(false);
|
||||
|
||||
$this->initialStateService->expects($this->at(0))
|
||||
->method('provideInitialState')
|
||||
|
@ -302,6 +313,9 @@ class ViewControllerTest extends TestCase {
|
|||
$this->initialStateService->expects($this->at(10))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'show_tasks', false);
|
||||
$this->initialStateService->expects($this->at(11))
|
||||
->method('provideInitialState')
|
||||
->with('calendar', 'tasks_enabled', false);
|
||||
|
||||
$response = $this->controller->index();
|
||||
|
||||
|
|
Loading…
Reference in New Issue