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

feat: add example contact on first login #50156

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

hamza221
Copy link
Contributor

@hamza221 hamza221 commented Jan 13, 2025

Checklist

@hamza221 hamza221 marked this pull request as ready for review January 21, 2025 12:30
@hamza221 hamza221 self-assigned this Jan 21, 2025
@hamza221 hamza221 added enhancement 3. to review Waiting for reviews feature: carddav Related to CardDAV internals labels Jan 21, 2025
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 force-pushed the feat/cardav-example-contact branch from b237d7a to 3af4fc4 Compare January 22, 2025 12:47
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 marked this pull request as draft January 23, 2025 09:45
@hamza221 hamza221 added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jan 23, 2025
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 marked this pull request as ready for review January 23, 2025 14:33
@hamza221 hamza221 requested a review from st3iny January 23, 2025 14:33
Comment on lines +39 to +41
if ($event->getAddressBookData()['uri'] === CardDavBackend::PERSONAL_ADDRESSBOOK_URI) {
$this->defaultContactService->createDefaultContact((string)$event->getAddressBookId());
}
Copy link
Member

Choose a reason for hiding this comment

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

Btw, I fixed the problem of the address book not being available during first login. In case you want to go back to the first login event handler.

Ref #50369

console.log('Event:', event)

const file = event.target.files[0]
console.log('Selected file:', file)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log('Selected file:', file)

this.$refs.exampleContactImportInput.click()
},
processFile(event) {
console.log('processFile triggered')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log('processFile triggered')

processFile(event) {
console.log('processFile triggered')
this.loading = true
console.log('Event:', event)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log('Event:', event)

Comment on lines +51 to +54
public function getName(): ?string {
return 'Example Content';
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public function getName(): ?string {
return 'Example Content';
}

This method does not exist in ISettings.

Comment on lines +17 to +25
<NcButton v-if="enableDefaultContact"
class="import-button"
type="primary"
@click="toggleModal">
<template #icon>
<IconUpload :size="20" />
</template>
{{ $t('dav', 'Import contact') }}
</NcButton>
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps also add a button to clear the custom contact? To reset the example contact to the built-in default value.

*/
public function setAppConfig($key, $allow) {
if ($allow === 'yes' && $key === 'enableDefaultContact' && !$this->defaultContactExists()) {
$this->setInitialDefaultContact();
Copy link
Member

Choose a reason for hiding this comment

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

This method does not exist.

Call to undefined method OCA\DAV\Controller\ExampleContentController::setInitialDefaultContact() in file '/master/apps/dav/lib/Controller/ExampleContentController.php' line 44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement feature: carddav Related to CardDAV internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an example contact
2 participants