Skip to content

Commit

Permalink
Add shared items and events for each contact
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Nov 10, 2023
1 parent 49e252d commit 43de764
Showing 1 changed file with 96 additions and 2 deletions.
98 changes: 96 additions & 2 deletions src/components/ContactDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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

View check run for this annotation

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

View check run for this annotation

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

View check run for this annotation

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

View check run for this annotation

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

View check run for this annotation

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

View check run for this annotation

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

View check run for this annotation

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

View check run for this annotation

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L366

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

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

View check run for this annotation

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'
Expand All @@ -351,6 +401,7 @@ import IconCopy from 'vue-material-design-icons/ContentCopy.vue'
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'
Expand Down Expand Up @@ -400,6 +451,9 @@ export default {
PropertyRev,
PropertySelect,
NcButton,
NcRelatedResourcesPanel,

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

View check run for this annotation

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L456

Added line #L456 was not covered by tests
},

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

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L477-L478

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

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

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

Expand All @@ -446,6 +504,12 @@ export default {
showMenuPopover: false,
profileEnabled,
isTalkEnabled,
hasRelatedResources: false,
deckPanelHasError: false,
filesPanelHasError: false,
talkPanelHasError: false,
calendarPanelHasError: false,

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L510-L512

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

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

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

View check run for this annotation

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L747

Added line #L747 was not covered by tests
},

watch: {
Expand Down Expand Up @@ -990,6 +1057,7 @@ export default {
align-items: flex-start;
padding: 50px 0 20px;
gap: 15px;
float: left;
}
@media only screen and (max-width: 600px) {
.contact-details-wrapper {
Expand Down Expand Up @@ -1059,6 +1127,32 @@ section.contact-details {
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

View check run for this annotation

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

View check run for this annotation

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;
}
Expand Down

0 comments on commit 43de764

Please sign in to comment.