Merge pull request #3422 from nextcloud/enhanc/hide-empty-properties

Hide empty properties in view mode
This commit is contained in:
Daniel 2023-06-01 11:23:38 +02:00 committed by GitHub
commit 830f179339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 20 deletions

View File

@ -226,6 +226,7 @@
<section v-else class="contact-details">
<!-- properties iteration -->
<!-- using contact.key in the key and index as key to avoid conflicts between similar data and exact key -->
<div v-for="(properties, name) in groupedProperties"
:key="name">
<ContactDetailsProperty v-for="(property, index) in properties"
@ -569,6 +570,7 @@ export default {
return ''
},
},
watch: {

View File

@ -95,16 +95,18 @@
<div v-for="index in propModel.displayOrder"
:key="index"
class="property__row">
<div class="property__label">
<span>{{ propModel.readableValues[index] }}</span>
</div>
<div class="property__value">
<input v-model.trim="localValue[index]"
:readonly="isReadOnly"
type="text"
@input="updateValue">
</div>
<div class="property__actions" />
<template v-if="(isReadOnly && localValue[index]) || !isReadOnly">
<div class="property__label">
<span>{{ propModel.readableValues[index] }}</span>
</div>
<div class="property__value">
<input v-model.trim="localValue[index]"
:readonly="isReadOnly"
type="text"
@input="updateValue">
</div>
<div class="property__actions" />
</template>
</div>
</template>
@ -113,14 +115,16 @@
<div v-for="(value, index) in filteredValue"
:key="index"
class="property__row">
<div class="property__label" />
<div class="property__value">
<input v-model.trim="filteredValue[index]"
:readonly="isReadOnly"
type="text"
@input="updateValue">
</div>
<div class="property__actions" />
<template v-if="(isReadOnly && filteredValue[index]) || !isReadOnly">
<div class="property__label" />
<div class="property__value">
<input v-model.trim="filteredValue[index]"
:readonly="isReadOnly"
type="text"
@input="updateValue">
</div>
<div class="property__actions" />
</template>
</div>
</template>
</div>

View File

@ -22,7 +22,7 @@
-->
<template>
<div v-if="propModel" class="property">
<div v-if="propModel && showProperty" class="property">
<!-- title if first element -->
<PropertyTitle v-if="isFirstProperty && propModel.icon"
:property="property"
@ -97,6 +97,9 @@ export default {
},
computed: {
showProperty() {
return (this.isReadOnly && this.localValue) || !this.isReadOnly
},
/**
* Store getters filtered and mapped to usable object
* This is the list of addressbooks that are available to write

View File

@ -22,7 +22,7 @@
-->
<template>
<div v-if="propModel" class="property">
<div v-if="propModel && showProperty" class="property">
<!-- title if first element -->
<PropertyTitle v-if="isFirstProperty && propModel.icon"
:property="property"
@ -139,6 +139,9 @@ export default {
},
computed: {
showProperty() {
return (this.isReadOnly && this.localValue) || !this.isReadOnly
},
inputmode() {
if (this.propName === 'tel') {
return 'tel'