Skip to content

fix(dav): Always show example content section #61483

Open
kesselb wants to merge 2 commits into
masterfrom
fix-example-content-without-contacts-or-calendar
Open

fix(dav): Always show example content section #61483
kesselb wants to merge 2 commits into
masterfrom
fix-example-content-without-contacts-or-calendar

Conversation

@kesselb

@kesselb kesselb commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Close #61256
Close #61259

Summary

The implementation is within the dav app and indendent of calendar or
contacts app.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

kesselb added 2 commits June 21, 2026 19:13
The implementation is within the dav app and indendent of calendar or
contacts app.

Assisted-by: ClaudeCode:claude-sonnet-4-6

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb requested review from a team as code owners June 21, 2026 17:23
@kesselb kesselb requested review from icewind1991, leftybournes, nfebe, provokateurin, skjnldsv and susnux and removed request for a team June 21, 2026 17:23
@kesselb kesselb self-assigned this Jun 21, 2026
@kesselb kesselb added bug 3. to review Waiting for reviews labels Jun 21, 2026
@kesselb kesselb requested a review from Copilot June 21, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the DAV admin settings UI so the “Example content” settings section is always displayed, independent of whether Calendar/Contacts apps are enabled, and ensures the necessary initial state is always provided from the backend.

Changes:

  • Always render the Example Contact and Example Event settings UI (no longer gated by contactsEnabled / calendarEnabled initial-state flags).
  • Always provide initial-state values for example contact/event settings and always return the groupware section for the settings entry.
  • Update built frontend assets (dist/) to reflect the source changes.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
dist/dav-settings-admin-example-content.mjs.map Updated source map output for the always-visible settings section.
dist/dav-settings-admin-example-content.mjs Updated compiled JS bundle reflecting unconditional rendering.
apps/dav/src/views/ExampleContentSettingsSection.vue Removes conditional rendering so both settings components are always shown.
apps/dav/lib/Settings/ExampleContentSettings.php Removes app-enabled checks; always provides initial state and always registers under groupware.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 31 to +35
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'));
Comment on lines 13 to 20
<template>
<NcSettingsSection
id="example-content"
:name="t('dav', 'Example content')"
:description="t('dav', 'Example content serves to showcase the features of Nextcloud. Default content is shipped with Nextcloud, and can be replaced by custom content.')">
<ExampleContactSettings v-if="hasContactsApp" />
<ExampleEventSettings v-if="hasCalendarApp" />
<ExampleContactSettings />
<ExampleEventSettings />
</NcSettingsSection>
@kesselb

kesselb commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@kesselb

kesselb commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Example events and contacts are created on first login even w/o Calendar/Contacts being installed

4 participants