Skip to content

Commit

Permalink
fixup! Add quick actions for contacts
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Jul 27, 2023
1 parent 03cbd6f commit 8bc1765
Showing 1 changed file with 38 additions and 27 deletions.
65 changes: 38 additions & 27 deletions src/components/ContactDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,12 @@

<!-- contact details loading -->
<IconLoading v-if="loadingData" :size="20" class="contact-details" />
<!-- contact details -->
<!-- quick actions -->
<div v-else-if="!loadingData" class="contact-details-wrapper">
<div v-if="!editMode" class="quick-actions">
<Actions v-if="emailAddressProperties">
<Actions v-if="emailAddressProperties"
type="secondary"
:menu-name="(t('contacts', 'Mail'))">
<template #icon>
<IconMail :size="20" />
</template>
Expand All @@ -235,7 +237,8 @@
{{ emailAddress }}
</ActionLink>
</Actions>
<Actions v-if="phoneNumberProperties">
<Actions v-if="phoneNumberProperties"
:menu-name="(t('contacts', 'Phone'))">
<template #icon>
<IconCall :size="20" />
</template>
Expand All @@ -248,17 +251,22 @@
{{ phoneNumber }}
</ActionLink>
</Actions>
<NcButton v-if="isTalkEnabled && isInSystemAddressBook"
class="icon-talk"
:href="callUrl" />

<Actions>
<ActionButton v-if="isTalkEnabled && isInSystemAddressBook"
class="icon-talk"
:href="callUrl">
{{ (t('contacts', 'Talk')) }}
</ActionButton>
</Actions>
<NcButton v-if="profilePageLink"
:href="profilePageLink">
<template #icon>
<IconAccount :size="20" />
</template>
{{ (t('contacts', 'Profile')) }}
</NcButton>
</div>
<!-- contact details -->
<section class="contact-details">
<!-- properties iteration -->
<!-- using contact.key in the key and index as key to avoid conflicts between similar data and exact key -->
Expand All @@ -277,27 +285,28 @@
:is-read-only="isReadOnly" />
</div>
</section>
</div>
<!-- addressbook change select - no last property because class is not applied here,

<!-- addressbook change select - no last property because class is not applied here,
empty property because this is a required prop on regular property-select. But since
we are hijacking this... (this is supposed to be used with a ICAL.property, but to avoid code
duplication, we created a fake propModel and property with our own options here) -->
<PropertySelect :prop-model="addressbookModel"
:options="addressbooksOptions"
:value.sync="addressbook"
:is-first-property="true"
:is-last-property="true"
:property="{}"
:hide-actions="true"
:is-read-only="isReadOnly"
class="property--addressbooks property--last" />

<!-- Groups always visible -->
<PropertyGroups :prop-model="groupsModel"
:value.sync="localContact.groups"
:contact="contact"
:is-read-only="isReadOnly"
class="property--groups property--last" />
<PropertySelect :prop-model="addressbookModel"
:options="addressbooksOptions"
:value.sync="addressbook"
:is-first-property="true"
:is-last-property="true"
:property="{}"
:hide-actions="true"
:is-read-only="isReadOnly"
class="property--addressbooks property--last" />

<!-- Groups always visible -->
<PropertyGroups :prop-model="groupsModel"
:value.sync="localContact.groups"
:contact="contact"
:is-read-only="isReadOnly"
class="property--groups property--last" />
</div>
<!-- new property select -->
<AddNewProp v-if="!isReadOnly"
:bus="bus"
Expand Down Expand Up @@ -974,7 +983,7 @@ export default {
<style lang="scss" scoped>
// List of all properties
.contact-details-wrapper {
display: block;
display: inline;
align-items: flex-start;
padding: 50px 0 20px;
gap: 15px;

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L988-L989

Added lines #L988 - L989 were not covered by tests
Expand All @@ -994,11 +1003,13 @@ section.contact-details {
flex: 1 0 auto;

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L1001-L1003

Added lines #L1001 - L1003 were not covered by tests
gap: 15px;
float: right;
margin-right: 100px;
margin-top: 40px;

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L1006-L1007

Added lines #L1006 - L1007 were not covered by tests
}
@media only screen and (max-width: 600px) {
.quick-actions {
margin-right:103px;
float: left;
margin-top: -44px;

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

View check run for this annotation

Codecov / codecov/patch

src/components/ContactDetails.vue#L1009-L1013

Added lines #L1009 - L1013 were not covered by tests
}
}
Expand Down

0 comments on commit 8bc1765

Please sign in to comment.