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

Remove empty content when at least one related resrouce exists. #3760

Merged
merged 1 commit into from
Jan 3, 2024
Merged
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
16 changes: 11 additions & 5 deletions src/components/ContactDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!-- org, title -->
<template #subtitle>
<template v-if="isReadOnly">
<span v-html="formattedSubtitle" />

Check warning on line 68 in src/components/ContactDetails.vue

View workflow job for this annotation

GitHub Actions / eslint

'v-html' directive can lead to XSS attack
</template>
<template v-else>
<input id="contact-title"
Expand Down Expand Up @@ -230,7 +230,7 @@
<template #icon>
<IconMail :size="20" />
</template>
<ActionLink v-for="emailAddress in emailAddressList"

Check warning on line 233 in src/components/ContactDetails.vue

View workflow job for this annotation

GitHub Actions / eslint

Variable 'emailAddress' is already declared in the upper scope
:key="emailAddress"
:href="'mailto:' + emailAddress">
<template #icon>
Expand Down Expand Up @@ -318,7 +318,7 @@
:header="t('contacts', 'Media shares with you')"
:item-id="contact.uid"
:primary="true"
@has-resources="value => hasRelatedResources = value"
@has-resources="value => hasFilesResources = value"

Check warning on line 321 in src/components/ContactDetails.vue

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L321

Added line #L321 was not covered by tests
@has-error="value => filesPanelHasError = value" />
<NcRelatedResourcesPanel v-if="!talkPanelHasError"
provider-id="account"
Expand All @@ -328,7 +328,7 @@
:header="t('contacts', 'Talk conversations with you')"
:item-id="contact.uid"
:primary="true"
@has-resources="value => hasRelatedResources = value"
@has-resources="value => hasTalkResources = value"
@has-error="value => talkPanelHasError = value" />
<NcRelatedResourcesPanel v-if="!calendarPanelHasError"
provider-id="account"
Expand All @@ -338,7 +338,7 @@
:header="t('contacts', 'Calendar events with you')"
:item-id="contact.uid"
:primary="true"
@has-resources="value => hasRelatedResources = value"
@has-resources="value => hasCalendarResources = value"
@has-error="value => calendarPanelHasError = value" />
<NcRelatedResourcesPanel v-if="!deckPanelHasError"
provider-id="account"
Expand All @@ -348,7 +348,7 @@
:header="t('contacts', 'Deck cards with you')"
:item-id="contact.uid"
:primary="true"
@has-resources="value => hasRelatedResources = value"
@has-resources="value => hasDeckResources = value"
@has-error="value => deckPanelHasError = value" />
<NcEmptyContent v-if="!hasRelatedResources && !loadingData"
:name="t('contacts', 'No shared items with this contact')">
Expand Down Expand Up @@ -504,7 +504,10 @@
showMenuPopover: false,
profileEnabled,
isTalkEnabled,
hasRelatedResources: false,
hasFilesResources: false,

Check warning on line 507 in src/components/ContactDetails.vue

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L507

Added line #L507 was not covered by tests
hasTalkResources: false,
hasCalendarResources: false,
hasDeckResources: false,

Check warning on line 510 in src/components/ContactDetails.vue

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L509-L510

Added lines #L509 - L510 were not covered by tests
deckPanelHasError: false,
filesPanelHasError: false,
talkPanelHasError: false,
Expand All @@ -514,6 +517,9 @@
},

computed: {
hasRelatedResources() {
return this.hasFilesResources || this.hasTalkResources || this.hasCalendarResources || this.hasDeckResources
},
/**
* The address book is read-only (e.g. shared with me).
*
Expand Down Expand Up @@ -965,7 +971,7 @@
/**
* Update this.localContact and set this.fixed
*
* @param {Contact} contact the contact to clone

Check warning on line 974 in src/components/ContactDetails.vue

View workflow job for this annotation

GitHub Actions / eslint

The type 'Contact' is undefined
*/
async updateLocalContact(contact) {
// create empty contact and copy inner data
Expand Down Expand Up @@ -1016,7 +1022,7 @@
/**
* Should display the property
*
* @param {Property} property the property to check

Check warning on line 1025 in src/components/ContactDetails.vue

View workflow job for this annotation

GitHub Actions / eslint

The type 'Property' is undefined
* @return {boolean}
*/
canDisplay(property) {
Expand Down
Loading