Merge branch 'release/0.16' of https://github.com/tainacan/tainacan into release/0.16

This commit is contained in:
vnmedeiros 2020-05-05 16:56:27 -03:00
commit 5514f2b5e0
7 changed files with 81 additions and 47 deletions

View File

@ -747,7 +747,7 @@ class Collection extends Entity {
}
if( $this->is_cover_page_enabled() && !is_numeric( $this->get_cover_page_id() ) ) {
$this->add_error($this->get_id(), __('cover page is enabled, please inform the page', 'tainacan'));
$this->add_error('cover_page_id', __('cover page is enabled, please inform the page', 'tainacan'));
return false;
}

View File

@ -463,7 +463,7 @@
type="button"
@click="cancelBack">{{ $i18n.get('cancel') }}</button>
</div>
<p class="help is-danger">{{ formErrorMessage }}</p>
<div
style="margin-left: auto;"
class="control">
@ -487,7 +487,7 @@
class="button is-success">{{ $i18n.get('finish') }}</button>
</div>
</div>
<p class="help is-danger">{{ formErrorMessage }}</p>
<br>
</form>
<div v-if="!isLoading && ((isNewCollection && !$userCaps.hasCapability('tnc_rep_edit_collections')) || (!isNewCollection && collection && collection.current_user_can_edit != undefined && collection.current_user_can_edit == false))">
@ -711,48 +711,49 @@ export default {
this.fillExtraFormData(data);
this.updateCollection({collection_id: this.collectionId, collection: data })
.then(updatedCollection => {
this.collection = updatedCollection;
.then(updatedCollection => {
this.collection = updatedCollection;
// Fills hook forms with it's real values
this.updateExtraFormData(this.collection);
// Fill this.form data with current data.
this.form.name = this.collection.name;
this.form.slug = this.collection.slug;
this.form.description = this.collection.description;
this.form.status = this.collection.status;
this.form.cover_page_id = this.collection.cover_page_id;
this.form.enable_cover_page = this.collection.enable_cover_page;
this.form.enabled_view_modes = this.collection.enabled_view_modes.map((viewMode) => viewMode.viewMode);
this.form.default_view_mode = this.collection.default_view_mode;
this.form.allow_comments = this.collection.allow_comments;
this.isLoading = false;
this.formErrorMessage = '';
this.editFormErrors = {};
// Fills hook forms with it's real values
this.updateExtraFormData(this.collection);
// Fill this.form data with current data.
this.form.name = this.collection.name;
this.form.slug = this.collection.slug;
this.form.description = this.collection.description;
this.form.status = this.collection.status;
this.form.cover_page_id = this.collection.cover_page_id;
this.form.enable_cover_page = this.collection.enable_cover_page;
this.form.enabled_view_modes = this.collection.enabled_view_modes.map((viewMode) => viewMode.viewMode);
this.form.default_view_mode = this.collection.default_view_mode;
this.form.allow_comments = this.collection.allow_comments;
this.isLoading = false;
this.formErrorMessage = '';
this.editFormErrors = {};
if (this.fromImporter)
this.$router.go(-1);
else {
if (goTo == 'metadata')
this.$router.push(this.$routerHelper.getCollectionMetadataPath(this.collectionId));
else if (goTo == 'filters')
this.$router.push(this.$routerHelper.getCollectionFiltersPath(this.collectionId));
else
this.$router.push(this.$routerHelper.getCollectionPath(this.collectionId));
}
})
.catch((errors) => {
for (let error of errors.errors) {
for (let attribute of Object.keys(error))
this.editFormErrors[attribute] = error[attribute];
}
this.formErrorMessage = errors.error_message;
if (this.fromImporter)
this.$router.go(-1);
else {
if (goTo == 'metadata')
this.$router.push(this.$routerHelper.getCollectionMetadataPath(this.collectionId));
else if (goTo == 'filters')
this.$router.push(this.$routerHelper.getCollectionFiltersPath(this.collectionId));
else
this.$router.push(this.$routerHelper.getCollectionPath(this.collectionId));
}
})
.catch((errors) => {
for (let error of errors.errors) {
for (let attribute of Object.keys(error))
this.editFormErrors[attribute] = error[attribute];
}
this.formErrorMessage = errors.error_message;
this.isLoading = false;
});
this.isLoading = false;
});
},
createNewCollection() {
// Puts loading on Draft Collection creation

View File

@ -22,6 +22,7 @@
:label="$i18n.get('label_name')"
:type="editFormErrors['name'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['name'] != undefined ? editFormErrors['name'] : ''">
<span class="required-metadatum-asterisk">*</span>
<help-button
:title="$i18n.getHelperTitle('taxonomies', 'name')"
:message="$i18n.getHelperMessage('taxonomies', 'name')"/>
@ -178,6 +179,11 @@
type="button"
@click="cancelBack">{{ $i18n.get('cancel') }}</button>
</div>
<p
style="margin: 0 12px;"
class="help is-danger">
{{ formErrorMessage }}
</p>
<p
v-if="updatedAt != undefined"
class="updated-at">
@ -191,7 +197,6 @@
class="button is-success">{{ $i18n.get('save') }}</button>
</div>
</div>
<p class="help is-danger">{{ formErrorMessage }}</p>
</form>
<div v-if="!isLoading && (($route.name == 'TaxonomyCreationForm' && !$userCaps.hasCapability('tnc_rep_edit_taxonomies')) || ($route.name == 'TaxonomyEditionForm' && taxonomy && taxonomy.current_user_can_edit != undefined && !taxonomy.current_user_can_edit))">

View File

@ -93,6 +93,7 @@
<style lang="scss">
.filter-item-forms {
break-inside: avoid;
.collapse-trigger {
margin-left: -5px;

View File

@ -35,7 +35,7 @@
<div
v-if="!isLoadingFilters &&
((filters.length >= 0 && isRepositoryLevel) || filters.length > 0)"
class="extra-margin">
class="filters-components-list">
<!-- TERM ITEMS PAGE FILTERS -->
<template v-if="taxonomy && taxonomyFilters">
@ -464,7 +464,7 @@
align-items: center;
font-size: 0.75em !important;
}
.extra-margin {
.filters-components-list {
margin-bottom: 64px;
}
.collection-name {

View File

@ -294,7 +294,7 @@
<b-field>
<label
class="label is-hidden-touch is-hidden-desktop-only"
style="margin-right: -10px;">
:style="{ marginRight: showInlineViewModeOptions ? '' : '-10px'}">
{{ $i18n.get('label_visualization') + ':&nbsp; ' }}
</label>
<label

View File

@ -44,9 +44,36 @@
background: var(--tainacan-white);
width: 100%;
#filters-modal .modal-close {
right: var(--tainacan-one-column) !important;
right: 4.1666667vw !important;
}
.modal-content {
padding: 42px 4.1666667vw !important;
.filters-components-list {
column-count: 3;
column-gap: 3em;
column-rule: 1px solid var(--tainacan-gray2);
}
}
@media screen and (max-width: 1024px) {
.modal-content {
.filters-components-list {
column-count: 2;
}
}
}
@media screen and (max-width: 768px) {
.modal-content {
margin-right: 0px !important;
margin-right: 0px !important;
.filters-components-list {
column-count: 1;
}
}
}
}