diff --git a/apps/dav/lib/Settings/ExampleContentSettings.php b/apps/dav/lib/Settings/ExampleContentSettings.php index c158ce1f13ca0..e1af52c1282f9 100644 --- a/apps/dav/lib/Settings/ExampleContentSettings.php +++ b/apps/dav/lib/Settings/ExampleContentSettings.php @@ -11,7 +11,6 @@ use OCA\DAV\AppInfo\Application; use OCA\DAV\Service\ExampleContactService; use OCA\DAV\Service\ExampleEventService; -use OCP\App\IAppManager; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IAppConfig; use OCP\AppFramework\Services\IInitialState; @@ -22,37 +21,16 @@ class ExampleContentSettings implements ISettings { public function __construct( private readonly IAppConfig $appConfig, private readonly IInitialState $initialState, - private readonly IAppManager $appManager, private readonly ExampleEventService $exampleEventService, private readonly ExampleContactService $exampleContactService, ) { } public function getForm(): TemplateResponse { - $calendarEnabled = $this->appManager->isEnabledForUser('calendar'); - $contactsEnabled = $this->appManager->isEnabledForUser('contacts'); - $this->initialState->provideInitialState('calendarEnabled', $calendarEnabled); - $this->initialState->provideInitialState('contactsEnabled', $contactsEnabled); - - if ($calendarEnabled) { - $enableDefaultEvent = $this->exampleEventService->shouldCreateExampleEvent(); - $this->initialState->provideInitialState('create_example_event', $enableDefaultEvent); - $this->initialState->provideInitialState( - 'has_custom_example_event', - $this->exampleEventService->hasCustomExampleEvent(), - ); - } - - if ($contactsEnabled) { - $this->initialState->provideInitialState( - 'enableDefaultContact', - $this->exampleContactService->isDefaultContactEnabled(), - ); - $this->initialState->provideInitialState( - 'hasCustomDefaultContact', - $this->appConfig->getAppValueBool('hasCustomDefaultContact'), - ); - } + $this->initialState->provideInitialState('create_example_event', $this->exampleEventService->shouldCreateExampleEvent()); + $this->initialState->provideInitialState('has_custom_example_event', $this->exampleEventService->hasCustomExampleEvent()); + $this->initialState->provideInitialState('enableDefaultContact', $this->exampleContactService->isDefaultContactEnabled()); + $this->initialState->provideInitialState('hasCustomDefaultContact', $this->appConfig->getAppValueBool('hasCustomDefaultContact')); Util::addStyle(Application::APP_ID, 'settings-admin-example-content'); Util::addScript(Application::APP_ID, 'settings-admin-example-content'); @@ -60,11 +38,6 @@ public function getForm(): TemplateResponse { } public function getSection(): ?string { - if (!$this->appManager->isEnabledForUser('contacts') - && !$this->appManager->isEnabledForUser('calendar')) { - return null; - } - return 'groupware'; } diff --git a/apps/dav/src/views/ExampleContentSettingsSection.vue b/apps/dav/src/views/ExampleContentSettingsSection.vue index fbf7371e22f81..abbc7b1c2c7a4 100644 --- a/apps/dav/src/views/ExampleContentSettingsSection.vue +++ b/apps/dav/src/views/ExampleContentSettingsSection.vue @@ -4,14 +4,10 @@ -->