diff --git a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php index 2220cb62d..d725b11ee 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php @@ -750,13 +750,12 @@ class REST_Items_Controller extends REST_Controller { private function get_items_permissions_check_for_taxonomy($taxonomies) { foreach ($taxonomies as $tax) { - if( !isset($tax['taxonomy']) ) - return false; - $taxonomy = \tainacan_taxonomies()->fetch_by_db_identifier( $tax['taxonomy'] ); + if ( isset($tax['taxonomy']) ) { + $taxonomy = \tainacan_taxonomies()->fetch_by_db_identifier( $tax['taxonomy'] ); - if( $taxonomy instanceof Entities\Taxonomy ) { - if(!$taxonomy->can_read()) { - return false; + if ( $taxonomy instanceof Entities\Taxonomy ) { + if (!$taxonomy->can_read()) + return false; } } } diff --git a/src/views/admin/components/edition/metadatum-edition-form.vue b/src/views/admin/components/edition/metadatum-edition-form.vue index 34fa74f94..96994206a 100644 --- a/src/views/admin/components/edition/metadatum-edition-form.vue +++ b/src/views/admin/components/edition/metadatum-edition-form.vue @@ -429,7 +429,6 @@ this.isUpdating = false; this.closedByForm = true; - this.$root.$emit('metadatumUpdated', this.isRepositoryLevel); this.$emit('onEditionFinished'); }) .catch((errors) => { @@ -468,7 +467,6 @@ this.isUpdating = false; this.closedByForm = true; - this.$root.$emit('metadatumUpdated', this.isRepositoryLevel); this.$emit('onEditionFinished'); }) .catch((errors) => { diff --git a/src/views/admin/components/navigation/tainacan-header.vue b/src/views/admin/components/navigation/tainacan-header.vue index 78c376a9f..5acd04511 100644 --- a/src/views/admin/components/navigation/tainacan-header.vue +++ b/src/views/admin/components/navigation/tainacan-header.vue @@ -59,38 +59,12 @@ icon-right="magnify" icon-right-clickable @icon-right-click="updateSearch()" /> - - - {{ $i18n.get('advanced_search') }} - - -
-

{{ $i18n.get('advanced_search') }}

- - - -
-
-
- - - -
+ class="advanced-search-text" + :to="$routerHelper.getItemsPath({ advancedSearch: true })"> + {{ $i18n.get('advanced_search') }} + -
+
@@ -478,41 +461,22 @@ @mousemove="handleMouseMoveOverList"> -
@@ -679,9 +640,6 @@ localDisplayedMetadata: [], registeredViewModes: tainacan_plugin.registered_view_modes, openAdvancedSearch: false, - openFormAdvancedSearch: false, - advancedSearchResults: false, - isDoingSearch: false, sortingMetadata: [], isFiltersModalActive: false, hasAnOpenModal: false, @@ -746,7 +704,6 @@ openAdvancedSearch(newValue) { if (newValue == false){ this.$eventBusSearch.$emit('closeAdvancedSearch'); - this.advancedSearchResults = false; this.isFiltersModalActive = true; } else { this.isFiltersModalActive = false; @@ -790,10 +747,6 @@ this.hasFiltered = hasFiltered; }); - this.$eventBusSearch.$on('advancedSearchResults', advancedSearchResults => { - this.advancedSearchResults = advancedSearchResults; - }); - this.$eventBusSearch.$on('hasToPrepareMetadataAndFilters', () => { this.prepareMetadata(); }); @@ -1327,7 +1280,6 @@ // $eventBusSearch this.$eventBusSearch.$off('isLoadingItems'); this.$eventBusSearch.$off('hasFiltered'); - this.$eventBusSearch.$off('advancedSearchResults'); this.$eventBusSearch.$off('hasToPrepareMetadataAndFilters'); } } @@ -1347,58 +1299,6 @@ overflow-y: auto; } - .advanced-search-criteria-title { - margin-bottom: 40px; - - h1, h2 { - font-size: 1.25em; - font-weight: 500; - color: var(--tainacan-heading-color); - display: inline-block; - margin-bottom: 0; - } - .field.is-grouped { - margin-left: auto; - } - a.back-link{ - font-weight: 500; - float: right; - margin-top: 5px; - } - hr{ - margin: 3px 0px 4px 0px; - height: 2px; - background-color: var(--tainacan-secondary); - border: none; - } - } - - .advanced-search-results-title { - margin-bottom: 40px; - margin: 0 var(--tainacan-one-column) 42px var(--tainacan-one-column); - - h1, h2 { - font-size: 1.25em; - font-weight: 500; - color: var(--tainacan-heading-color); - display: inline-block; - margin-bottom: 0; - } - .field.is-grouped { - margin-left: auto; - } - a.back-link{ - font-weight: 500; - float: right; - margin-top: 5px; - } - hr{ - margin: 3px 0px 4px 0px; - height: 1px; - background-color: var(--tainacan-secondary); - } - } - .advanced-search-form-submit { display: flex; justify-content: flex-end; @@ -1516,7 +1416,7 @@ opacity: 1; } - .search-area .is-pulled-right { + .search-area .advanced-search-toggle { display: none; } } @@ -1538,10 +1438,6 @@ padding-right: 0; max-width: 100% !important; } - .is-pulled-right { - position: relative; - right: 0px !important; - } } } @@ -1627,14 +1523,26 @@ width: 100%; margin-bottom: 5px; } - .is-pulled-right { - position: absolute; - right: 15px; - top: 100%; - } - a { + a.advanced-search-toggle { margin-left: 12px; white-space: nowrap; + position: absolute; + font-size: 0.75em; + right: 15px; + left: unset; + top: 100%; + transition: font-size 0.2s ease, right 0.3s ease, left 0.3s ease, top 0.4s ease; + + .icon { + display: 0; + opacity: 0.0; + max-width: 0; + transition: opacity 0.2s ease, max-width 0.2s ease; + } + + &.is-open { + font-size: 0; + } } } diff --git a/src/views/admin/pages/lists/metadata-page.vue b/src/views/admin/pages/lists/metadata-page.vue index 9cf65cea0..8893eaeed 100644 --- a/src/views/admin/pages/lists/metadata-page.vue +++ b/src/views/admin/pages/lists/metadata-page.vue @@ -560,8 +560,6 @@ export default { .then(() => { if (!this.isRepositoryLevel) this.updateMetadataOrder(); - else - this.$root.$emit('metadatumUpdated', this.isRepositoryLevel); }) .catch(() => { this.$console.log("Error deleting metadatum.") diff --git a/src/views/admin/scss/_animations.scss b/src/views/admin/scss/_animations.scss index 806694320..13bf35f42 100644 --- a/src/views/admin/scss/_animations.scss +++ b/src/views/admin/scss/_animations.scss @@ -121,6 +121,17 @@ transform: translate(0, 0px); } } +.item-appear-enter-active { + animation-name: item-appear; + animation-duration: 0.2s; + animation-timing-function: ease-out; +} +.item-appear-leave-active { + animation-name: item-appear; + animation-duration: 0.2s; + animation-timing-function: ease-in; + animation-direction: reverse; +} // Filter Item Collapse @keyframes filter-item-in { diff --git a/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/theme-items-page.vue b/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/theme-items-page.vue index dede25134..ebd3dbb28 100644 --- a/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/theme-items-page.vue +++ b/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/theme-items-page.vue @@ -8,57 +8,6 @@ 'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen }" aria-live="polite"> - - -

@@ -398,34 +351,34 @@

- - - +
+ + + + +

{{ @@ -509,16 +475,14 @@

@@ -613,9 +576,6 @@ localDisplayedMetadata: [], registeredViewModes: tainacan_plugin.registered_view_modes, openAdvancedSearch: false, - openFormAdvancedSearch: false, - advancedSearchResults: false, - isDoingSearch: false, sortingMetadata: [], isFiltersModalActive: false, hasAnOpenModal: false, @@ -681,7 +641,6 @@ openAdvancedSearch(newValue){ if (newValue == false){ this.$eventBusSearch.$emit('closeAdvancedSearch'); - this.advancedSearchResults = false; this.isFiltersModalActive = !this.startWithFiltersHidden; } else { this.isFiltersModalActive = false; @@ -739,9 +698,6 @@ }); if (!this.hideAdvancedSearch) { - this.$eventBusSearch.$on('advancedSearchResults', advancedSearchResults => { - this.advancedSearchResults = advancedSearchResults; - }); if (this.$route.query && this.$route.query.advancedSearch) { this.openAdvancedSearch = this.$route.query.advancedSearch; @@ -1208,8 +1164,6 @@ // $eventBusSearch this.$eventBusSearch.$off('isLoadingItems'); this.$eventBusSearch.$off('hasFiltered'); - if (!this.hideAdvancedSearch) - this.$eventBusSearch.$off('advancedSearchResults'); this.$eventBusSearch.$off('hasToPrepareMetadataAndFilters'); }, @@ -1253,58 +1207,6 @@ } } - .advanced-search-criteria-title { - margin-bottom: 40px; - - h1, h2 { - font-size: 1.25em !important; - font-weight: 500; - color: var(--tainacan-heading-color); - display: inline-block; - margin-bottom: 0; - } - .field.is-grouped { - margin-left: auto; - } - a.back-link{ - font-weight: 500; - float: right; - margin-top: 5px; - } - hr{ - margin: 3px 0px 4px 0px; - height: 2px; - background-color: var(--tainacan-secondary); - border: none; - } - } - - .advanced-search-results-title { - margin-bottom: 40px; - margin: 0 var(--tainacan-one-column) 42px var(--tainacan-one-column); - - h1, h2 { - font-size: 1.25em; - font-weight: 500; - color: var(--tainacan-heading-color); - display: inline-block; - margin-bottom: 0; - } - .field.is-grouped { - margin-left: auto; - } - a.back-link{ - font-weight: 500; - float: right; - margin-top: 5px; - } - hr{ - margin: 3px 0px 4px 0px; - height: 1px; - background-color: var(--tainacan-secondary); - } - } - .advanced-search-form-submit { display: flex; justify-content: flex-end; @@ -1315,16 +1217,6 @@ p { margin-left: 0.75em; } } - .tnc-advanced-search-close { - padding-top: 47px; - padding-right: var(--tainacan-one-column); - padding-left: var(--tainacan-one-column); - - .column { - padding: 0 0.3em 0.3em !important; - } - } - .page-container { padding: 0; } @@ -1517,15 +1409,27 @@ width: 100%; margin: -2px 0 5px 0; } - .is-pulled-right { - position: absolute; - right: 0; - top: 100%; - } - a { + a.advanced-search-toggle { margin-left: 12px; white-space: nowrap; - } + position: absolute; + font-size: 0.75em; + right: 15px; + left: unset; + top: 100%; + transition: font-size 0.2s ease, right 0.3s ease, left 0.3s ease, top 0.4s ease; + + .icon { + display: 0; + opacity: 0.0; + max-width: 0; + transition: opacity 0.2s ease, max-width 0.2s ease; + } + + &.is-open { + font-size: 0; + } + } } &#tainacanFiltersButton.is-filters-modal-active .gray-icon i::before { diff --git a/src/views/gutenberg-blocks/blocks/faceted-search/theme.vue b/src/views/gutenberg-blocks/blocks/faceted-search/theme.vue index 5e71adaf0..5b7f42639 100644 --- a/src/views/gutenberg-blocks/blocks/faceted-search/theme.vue +++ b/src/views/gutenberg-blocks/blocks/faceted-search/theme.vue @@ -49,6 +49,7 @@ export default { // Buefy imports @import "../../../../../node_modules/buefy/src/scss/utils/_all.scss"; + @import "../../../../../node_modules/buefy/src/scss/components/_form.scss"; @import "../../../../../node_modules/buefy/src/scss/components/_datepicker.scss"; @import "../../../../../node_modules/buefy/src/scss/components/_checkbox.scss"; @import "../../../../../node_modules/buefy/src/scss/components/_radio.scss"; diff --git a/src/views/tainacan-i18n.php b/src/views/tainacan-i18n.php index 7b01ce0f8..e78c45bc6 100644 --- a/src/views/tainacan-i18n.php +++ b/src/views/tainacan-i18n.php @@ -611,6 +611,8 @@ return apply_filters( 'tainacan-i18n', [ 'label_limit_max_values' => __( 'Limit the amount of multiple values', 'tainacan'), 'label_items_selection' => __( 'Items selection', 'tainacan'), 'label_default_orderby' => __( 'Initial default sorting', 'tainacan' ), + 'label_close_search' => __( 'Close search', 'tainacan' ), + 'label_remove_all_criteria' => __( 'Remove all criteria', 'tainacan' ), // Instructions. More complex sentences to guide user and placeholders 'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),