Merge branch 'develop' of github.com:tainacan/tainacan into develop

This commit is contained in:
vnmedeiros 2022-08-11 11:33:48 -03:00
commit 4b04575dab
3 changed files with 18 additions and 9 deletions

View File

@ -227,7 +227,7 @@
if ( (metadatum.metadata_type_object.component !== 'tainacan-relationship' || this.isMetaqueryRelationshipEnabled) ) {
this.metadata.push( metadatum );
this.hasMetadata = true;
this.checkMetadata();
this.checkSearchMetadatum();
}
}
@ -259,15 +259,17 @@
});
},
checkMetadata(){
checkSearchMetadatum() {
if ( this.value && this.value.search ) {
this.modelSearch = this.value.search;
} else {
try {
const json = JSON.parse( this.search );
this.modelSearch = json;
} catch(e){
this.modelSearch = '';
const titleMetadatumIndex = this.metadata.findIndex(metadatum => metadatum.metadata_type == 'Tainacan\\Metadata_Types\\Core_Title');
if (titleMetadatumIndex >= 0)
this.modelSearch = this.metadata[titleMetadatumIndex].id;
else {
const nonCompountMetadatumIndex = this.metadata.findIndex(metadatum => metadatum.metadata_type_object.component !== 'tainacan-compound');
if (nonCompountMetadatumIndex >= 0)
this.modelSearch = this.metadata[nonCompountMetadatumIndex].id;
}
}
},

View File

@ -213,9 +213,9 @@ export const clearPlaceholderMetadataSection = (state) => {
}
export const deleteMetadataSection = ( state, metadataSection ) => {
let index = state.metadataSection.findIndex(deletedMetadataSection => deletedMetadataSection.id == metadataSection.id);
let index = state.metadataSections.findIndex(deletedMetadataSection => deletedMetadataSection.id == metadataSection.id);
if (index >= 0)
state.metadataSection.splice(index, 1);
state.metadataSections.splice(index, 1);
}
export const cleanMetadataSections = (state) => {

View File

@ -187,6 +187,8 @@ export default {
section.field.is-grouped-centered.section {
position: absolute;
width: 63%;
background: var(--tainacan-background-color);
padding-top: 5em;
}
&:not(.available-metadata-types-area){
@ -271,6 +273,11 @@ export default {
.active-metadata-area,
.active-metadata-sections-area {
min-height: 3em;
transition: min-height 0.2s ease;
&:empty {
min-height: 220px;
}
@media screen and (max-width: 769px) {
min-height: 45px;