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

fix: adjust spacing and alignment in the contact details view #4041

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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
104 changes: 42 additions & 62 deletions src/components/ContactDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<!-- org, title -->
<template #subtitle>
<template v-if="isReadOnly">
<span v-html="formattedSubtitle" />

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

View workflow job for this annotation

GitHub Actions / NPM lint

'v-html' directive can lead to XSS attack
</template>
<template v-else>
<input id="contact-title"
Expand All @@ -70,6 +70,46 @@
</template>
</template>

<template #quick-actions>
<div v-if="!editMode && !loadingData">
<Actions :inline="6"
type="secondary">
<ActionButton v-if="isTalkEnabled && isInSystemAddressBook"
:aria-label="(t('contacts', 'Go to talk conversation'))"
:name="(t('contacts', 'Go to talk conversation'))"
class="icon-talk quick-action"
:href="callUrl" />
<ActionButton v-if="profilePageLink"
class="quick-action"
:aria-label="(t('contacts','View profile'))"
:name="(t('contacts','View profile'))"
:href="profilePageLink">
<template #icon>
<IconAccount :size="20" />
</template>
</ActionButton>
<ActionLink v-for="emailAddress in emailAddressList"

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

View workflow job for this annotation

GitHub Actions / NPM lint

Variable 'emailAddress' is already declared in the upper scope
:key="emailAddress"
class="quick-action"
:href="'mailto:' + emailAddress">
<template #icon>
<IconMail :size="20" />
</template>
{{ emailAddress }}
</ActionLink>
<ActionLink v-for="phoneNumber in phoneNumberList"
:key="phoneNumber"
class="quick-action"
:href="'tel:' + phoneNumber">
<template #icon>
<IconCall :size="20" />
</template>
{{ phoneNumber }}
</ActionLink>
</Actions>
</div>
</template>

<!-- actions -->
<template #actions>
<!-- warning message -->
Expand Down Expand Up @@ -207,49 +247,6 @@
<IconLoading v-if="loadingData" :size="20" class="contact-details" />
<!-- quick actions -->
<div v-else-if="!loadingData" class="contact-details-wrapper">
<div v-if="!editMode" class="quick-actions">
<Actions v-if="emailAddressProperties"
type="secondary">
<template #icon>
<IconMail :size="20" />
</template>
<ActionLink v-for="emailAddress in emailAddressList"
:key="emailAddress"
:href="'mailto:' + emailAddress">
<template #icon>
<IconMail :size="20" />
</template>
{{ emailAddress }}
</ActionLink>
</Actions>
<Actions v-if="phoneNumberProperties"
type="secondary">
<template #icon>
<IconCall :size="20" />
</template>
<ActionLink v-for="phoneNumber in phoneNumberList"
:key="phoneNumber"
:href="'tel:' + phoneNumber">
<template #icon>
<IconCall :size="20" />
</template>
{{ phoneNumber }}
</ActionLink>
</Actions>
<NcButton v-if="isTalkEnabled && isInSystemAddressBook"
:aria-label="(t('contacts', 'Go to talk conversation'))"
:name="(t('contacts', 'Go to talk conversation'))"
class="icon-talk"
:href="callUrl" />
<NcButton v-if="profilePageLink"
:aria-label="(t('contacts','View profile'))"
:name="(t('contacts','View profile'))"
:href="profilePageLink">
<template #icon>
<IconAccount :size="20" />
</template>
</NcButton>
</div>
<!-- contact details -->
<section class="contact-details">
<!-- properties iteration -->
Expand Down Expand Up @@ -956,7 +953,7 @@
/**
* Update this.localContact and set this.fixed
*
* @param {Contact} contact the contact to clone

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

View workflow job for this annotation

GitHub Actions / NPM lint

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

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

View workflow job for this annotation

GitHub Actions / NPM lint

The type 'Property' is undefined
* @return {boolean}
*/
canDisplay(property) {
Expand Down Expand Up @@ -1046,7 +1043,7 @@
.contact-details-wrapper {
display: inline;
align-items: flex-start;
padding: 50px 0 20px;
padding: 20px 0 20px;
gap: 15px;
float: left;
}
Expand All @@ -1059,24 +1056,7 @@
section.contact-details {
display: flex;
flex-direction: column;
gap: 40px;
}

.quick-actions {
display: flex;
flex: 1 0 auto;
gap: 15px;
margin-top: 40px;
margin-left: 204px;
padding-bottom: 30px;
}
@media only screen and (max-width: 600px) {
.quick-actions {
justify-content: center;
display: flex;
margin-top: -44px;
margin-left: 0;
}
gap: 10px;
}

#qrcode-modal {
Expand Down
10 changes: 10 additions & 0 deletions src/components/DetailsHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<div v-if="$slots.subtitle" class="contact-header__infos-subtitle">
<slot name="subtitle" />
</div>
<div class="contact-header__quick-actions">
<slot name="quick-actions" />
</div>
</div>
</div>

Expand Down Expand Up @@ -74,6 +77,9 @@ $top-padding: 50px;
align-items: center;
padding: $top-padding 0 20px;
gap: $contact-details-row-gap;
&__quick-actions{
padding: 5px 0;
}

@media (max-width: 1024px) {
// Top padding of 44px is already included in AppContent by default on mobile
Expand Down Expand Up @@ -127,6 +133,10 @@ $top-padding: 50px;
margin: 0;
}

&__quick-actions {
padding: 5px 0;
}

:deep(input) {
flex: 1 auto;
}
Expand Down
4 changes: 4 additions & 0 deletions src/css/ContactDetailsLayout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
$contact-details-label-max-width: 200px;
$contact-details-value-max-width: 300px;
$contact-details-row-gap: 15px;

.quick-action {
margin-right: 5px;
}
Loading