Allows compound metadata inside relationship metadata. #719.

This commit is contained in:
mateuswetah 2022-07-29 11:40:05 -03:00
parent 589847272c
commit 6f1c533fa7
5 changed files with 53 additions and 28 deletions

View File

@ -48,7 +48,7 @@
v-model="modelSearch"
expanded>
<option
v-for="(option, index) in metadata"
v-for="(option, index) in metadata.filter(metadatum => metadatum.metadata_type_object.component !== 'tainacan-compound')"
:key="index"
:value="option.id"
class="field">
@ -224,7 +224,7 @@
this.metadata = [];
for (let metadatum of metadata) {
if ( (metadatum.metadata_type_object.component !== 'tainacan-relationship' || this.isMetaqueryRelationshipEnabled) && metadatum.metadata_type_object.component !== 'tainacan-compound' ) {
if ( (metadatum.metadata_type_object.component !== 'tainacan-relationship' || this.isMetaqueryRelationshipEnabled) ) {
this.metadata.push( metadatum );
this.hasMetadata = true;
this.checkMetadata();
@ -260,7 +260,7 @@
},
checkMetadata(){
if( this.value && this.value.search ){
if ( this.value && this.value.search ) {
this.modelSearch = this.value.search;
} else {
try {

View File

@ -218,6 +218,7 @@
.tainacan-relationship-metadatum {
display: inline-flex;
align-items: center;
max-height: 2.5em;
.tainacan-relationship-metadatum-header {
display: inline-flex;

View File

@ -264,6 +264,9 @@
margin-top: 8px;
margin-bottom: 2px;
}
.tainacan-compound-group {
font-size: 1em;
}
}
}
&>.multivalue-separator {

View File

@ -160,30 +160,6 @@ a:hover {
// Inside one of the view modes
.metadata-value {
.tainacan-compound-group {
margin-left: 2px;
padding-left: 0.875em;
border-left: 1px solid var(--tainacan-gray2);
.tainacan-compound-metadatum .label {
margin-bottom: 0.25em;
font-size: 1em;
color: var(--tainacan-info-color);
}
.tainacan-compound-metadatum p {
margin-bottom: 0.75em;
font-size: 1em;
}
.multivalue-separator {
display: block;
max-height: 1px;
width: 80px;
background: var(--tainacan-gray2);
content: none;
color: transparent;
margin: 1em auto 1em -0.875em;
}
}
.tainacan-relationship-group {
.tainacan-relationship-metadatum {
.tainacan-relationship-metadatum-header {
@ -205,6 +181,48 @@ a:hover {
}
}
}
.metadata-value,
.tainacan-relationship-group .tainacan-relationship-metadatum .tainacan-metadatum {
.tainacan-compound-group {
margin-left: 2px;
padding-left: 0.875em;
border-left: 1px solid var(--tainacan-gray2);
.tainacan-compound-metadatum .label {
margin-bottom: 0.25em;
font-size: 1em;
color: var(--tainacan-info-color);
}
.tainacan-compound-metadatum p {
margin-bottom: 0.75em;
font-size: 1em;
}
.tainacan-metadatum .label {
font-size: 1em;
}
.multivalue-separator {
display: block;
max-height: 1px;
width: 80px;
background: var(--tainacan-gray2);
content: none;
color: transparent;
margin: 1em auto 1em -0.875em;
}
}
}
.tainacan-relationship-group .tainacan-relationship-metadatum .tainacan-metadatum .tainacan-compound-group {
font-size: 0.75em;
.tainacan-metadatum {
margin-left: 20px;
.label {
font-size: 1em !important;
}
}
}
// Inside the admin item page
.metadata-type-textarea,
.metadata-type-compound {
@ -220,7 +238,7 @@ a:hover {
}
.metadata-type-compound {
padding-left: 15px;
margin-left: 15px;
margin-left: 0px;
border-left: 1px solid var(--tainacan-gray2);
.tainacan-metadatum {

View File

@ -277,6 +277,9 @@ export default {
margin-bottom: 0.75em;
font-size: 1em;
}
.tainacan-metadatum .label {
font-size: 1em;
}
.multivalue-separator {
display: block;
max-height: 1px;