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

Add shared items and events for each contact #3670

Merged
merged 1 commit into from
Nov 10, 2023
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
98 changes: 96 additions & 2 deletions src/components/ContactDetails.vue
Original file line number Diff line number Diff line change
@@ -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

GitHub Actions / eslint

Variable 'emailAddress' is already declared in the upper scope
:key="emailAddress"
:href="'mailto:' + emailAddress">
<template #icon>
@@ -309,13 +309,61 @@
class="property--groups property--last"
@update:value="updateGroups" />
</div>
<div v-if="nextcloudVersionAtLeast28" class="related-resources">
<NcRelatedResourcesPanel v-if="!filesPanelHasError"
provider-id="account"

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L313-L314

Added lines #L313 - L314 were not covered by tests
resource-type="files"
:description="desc"
:limit="5"
:header="t('contacts', 'Media shares with you')"
:item-id="contact.uid"
:primary="true"
@has-resources="value => hasRelatedResources = value"
@has-error="value => filesPanelHasError = value" />
<NcRelatedResourcesPanel v-if="!talkPanelHasError"

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L322-L323

Added lines #L322 - L323 were not covered by tests
provider-id="account"
resource-type="talk"
:description="desc"
:limit="5"

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L326-L327

Added lines #L326 - L327 were not covered by tests
:header="t('contacts', 'Talk conversations with you')"
:item-id="contact.uid"
:primary="true"

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L330

Added line #L330 was not covered by tests
@has-resources="value => hasRelatedResources = value"
@has-error="value => talkPanelHasError = value" />
<NcRelatedResourcesPanel v-if="!calendarPanelHasError"
provider-id="account"

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L334

Added line #L334 was not covered by tests
resource-type="calendar"
:description="desc"
:limit="5"
:header="t('contacts', 'Calendar events with you')"
:item-id="contact.uid"
:primary="true"
@has-resources="value => hasRelatedResources = value"
@has-error="value => calendarPanelHasError = value" />
<NcRelatedResourcesPanel v-if="!deckPanelHasError"
provider-id="account"
resource-type="deck"
:description="desc"
:limit="5"
:header="t('contacts', 'Deck cards with you')"
:item-id="contact.uid"
:primary="true"
@has-resources="value => hasRelatedResources = value"

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L349-L351

Added lines #L349 - L351 were not covered by tests
@has-error="value => deckPanelHasError = value" />
<NcEmptyContent v-if="!hasRelatedResources"

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L353

Added line #L353 was not covered by tests
:name="t('contacts', 'No shared items with this contact')">
<template #icon>
<FolderMultipleImage :size="20" />
</template>
</NcEmptyContent>

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L358

Added line #L358 was not covered by tests
</div>
<!-- new property select -->
<AddNewProp v-if="!isReadOnly"
:bus="bus"
:contact="contact" />

<!-- Last modified-->
<PropertyRev v-if="contact.rev" :value="contact.rev" />
<PropertyRev v-if="contact.rev" :value="contact.rev" class="last-edit" />

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L366

Added line #L366 was not covered by tests
</template>
</AppContentDetails>
</template>
@@ -336,7 +384,9 @@
NcSelect,
NcLoadingIcon as IconLoading,
NcButton,
NcRelatedResourcesPanel,
isMobile,
NcEmptyContent,

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L389

Added line #L389 was not covered by tests
} from '@nextcloud/vue'
import IconContact from 'vue-material-design-icons/AccountMultiple.vue'
import IconDownload from 'vue-material-design-icons/Download.vue'
@@ -351,6 +401,7 @@
import PencilIcon from 'vue-material-design-icons/Pencil.vue'
import CheckIcon from 'vue-material-design-icons/Check.vue'
import EyeCircleIcon from 'vue-material-design-icons/EyeCircle.vue'
import FolderMultipleImage from 'vue-material-design-icons/FolderMultipleImage.vue'

import rfcProps from '../models/rfcProps.js'
import validate from '../services/validate.js'
@@ -400,6 +451,9 @@
PropertyRev,
PropertySelect,
NcButton,
NcRelatedResourcesPanel,

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L454

Added line #L454 was not covered by tests
NcEmptyContent,
FolderMultipleImage,

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L456

Added line #L456 was not covered by tests
},

mixins: [isMobile],
@@ -417,6 +471,11 @@
type: Object,
required: true,
},
desc: {
type: String,
required: true,
default: '',
},

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L477-L478

Added lines #L477 - L478 were not covered by tests
},

data() {
@@ -437,7 +496,6 @@
pickedAddressbook: null,
editMode: false,
newGroupsValue: [],

contactDetailsSelector: '.contact-details',
excludeFromBirthdayKey: 'x-nc-exclude-from-birthday-calendar',

@@ -446,6 +504,12 @@
showMenuPopover: false,
profileEnabled,
isTalkEnabled,
hasRelatedResources: false,
deckPanelHasError: false,
filesPanelHasError: false,
talkPanelHasError: false,
calendarPanelHasError: false,

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L510-L512

Added lines #L510 - L512 were not covered by tests
}
},

@@ -678,6 +742,9 @@
isInSystemAddressBook() {
return this.contact.addressbook.id === 'z-server-generated--system'
},
nextcloudVersionAtLeast28() {

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L745

Added line #L745 was not covered by tests
return parseInt(OC.config.version.split('.')[0]) >= 28
},

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L747

Added line #L747 was not covered by tests
},

watch: {
@@ -898,7 +965,7 @@
/**
* Update this.localContact and set this.fixed
*
* @param {Contact} contact the contact to clone

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

GitHub Actions / eslint

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

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

GitHub Actions / eslint

The type 'Property' is undefined
* @return {boolean}
*/
canDisplay(property) {
@@ -990,6 +1057,7 @@
align-items: flex-start;
padding: 50px 0 20px;
gap: 15px;
float: left;
}
@media only screen and (max-width: 600px) {
.contact-details-wrapper {
@@ -1059,6 +1127,32 @@
background-color: var(--color-primary-element-light-hover) !important;

}
.related-resources {
display:inline-grid;
margin-top: 88px;
flex-direction: column;
margin-bottom: -30px;
}
@media only screen and (max-width: 1600px) {
.related-resources {

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L1137

Added line #L1137 was not covered by tests
float: left;
display: inline-grid;
margin-left: 80px;

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

Codecov / codecov/patch

src/components/ContactDetails.vue#L1140

Added line #L1140 was not covered by tests
flex-direction: column;
margin-bottom: 0;
margin-top: 40px;
}
}
.last-edit {
display: inline-flex;
}
// forcing the size only for contacts app to fit the text size of the contacts app
::v-deep .related-resources__header h5 {
font-size: medium;
opacity: .7;
color: var(--color-primary-element);
}

.address-book {
min-width: 260px !important;
}
Loading