diff --git a/src/assets/css/tainacan-gutenberg-block-item-submission-form.css b/src/assets/css/tainacan-gutenberg-block-item-submission-form.css index 87f655ff0..3c9fa7d89 100644 --- a/src/assets/css/tainacan-gutenberg-block-item-submission-form.css +++ b/src/assets/css/tainacan-gutenberg-block-item-submission-form.css @@ -240,12 +240,29 @@ display: flex; flex-wrap: wrap; justify-content: flex-start; } + .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-steps { + margin-top: 1em; + display: flex; + justify-content: space-evenly; + align-items: center; } + .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-steps .fake-step { + width: 1em; + height: 1em; + border-radius: 100%; + background-color: var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3)); } + .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-steps .fake-step:first-of-type { + background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3)); } + .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-steps + .metadata-section { + margin-top: -0.5em; + border: 1px solid var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3)); + padding: 2em; } .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .metadata-section { width: 100%; padding: 0.5em 1em; display: flex; flex-wrap: nowrap; - flex-direction: column; } + flex-direction: column; + box-sizing: border-box; } .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .metadata-section .fake-metadata { display: flex; flex-direction: column; diff --git a/src/assets/css/tainacan-gutenberg-block-item-submission-form.css.map b/src/assets/css/tainacan-gutenberg-block-item-submission-form.css.map index 8f4c4ad39..34cf663bd 100644 --- a/src/assets/css/tainacan-gutenberg-block-item-submission-form.css.map +++ b/src/assets/css/tainacan-gutenberg-block-item-submission-form.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,uBAAwB;EACpB,MAAM,EAAE,kBAAkB;EAE1B,sDAA+B;IAC3B,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,oCAAmC;;AAGlD,uC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scss"], "names": [], "file": "tainacan-gutenberg-block-item-submission-form.css" diff --git a/src/classes/entities/class-tainacan-item.php b/src/classes/entities/class-tainacan-item.php index 0bed813de..1e621204e 100644 --- a/src/classes/entities/class-tainacan-item.php +++ b/src/classes/entities/class-tainacan-item.php @@ -1130,7 +1130,7 @@ class Item extends Entity { * * This function expects a $metadata_section object. For a more generic approach, check the get_metadata_sections_as_html function * - * @param object $metadata_section The Metadata Section object + * @param \Tainacan\Entities\Metadata_Section $metadata_section The Metadata Section object * @param array|string $args { * Optional. Array or string of arguments. * @@ -1169,6 +1169,17 @@ class Item extends Entity { $return = ''; + if($metadata_section->is_conditional_section()) { + $rules = $metadata_section->get_conditional_section_rules(); + $item_id = $this->get_id(); + foreach($rules as $meta_id => $meta_values_conditional) { + $meta_values = get_post_meta( $item_id, $meta_id ); + if (!array_intersect($meta_values, $meta_values_conditional)) { + return $return; + } + } + } + $defaults = array( 'hide_name' => false, 'hide_description' => true, diff --git a/src/classes/entities/class-tainacan-metadata-section.php b/src/classes/entities/class-tainacan-metadata-section.php index 7517fbeff..c7f7592b0 100644 --- a/src/classes/entities/class-tainacan-metadata-section.php +++ b/src/classes/entities/class-tainacan-metadata-section.php @@ -18,7 +18,9 @@ class Metadata_Section extends Entity { $name, $slug, $description, - $description_bellow_name; + $description_bellow_name, + $is_conditional_section, + $conditional_section_rules; /** * {@inheritDoc} @@ -94,6 +96,34 @@ class Metadata_Section extends Entity { return $tainacan_metadata_sections->get_metadata_object_list($this->get_id(), $args); } + /** + * Get if section is conditional. + * + * @return string "yes"|"no" + */ + function get_is_conditional_section() { + return $this->get_mapped_property( 'is_conditional_section' ); + } + + /** + * get the rules of the conditional section + * + * @return array|object + */ + function get_conditional_section_rules() { + return $this->get_mapped_property( 'conditional_section_rules' ); + } + + /** + * Checks if section is conditional + * + * @return boolean + */ + function is_conditional_section() { + return $this->get_is_conditional_section() == 'yes'; + } + + /** * Set the metadata section name * @@ -141,6 +171,25 @@ class Metadata_Section extends Entity { } + /** + * set if section is conditional. + * + * @return void + */ + function set_is_conditional_section($value) { + return $this->set_mapped_property( 'is_conditional_section', $value ); + } + + /** + * set the rules of the conditional section + * + * @return void + */ + function set_conditional_section_rules($value) { + return $this->set_mapped_property( 'conditional_section_rules', $value ); + } + + /** * Transient property used to store the status of the metadatum section for a particular collection * @@ -168,6 +217,25 @@ class Metadata_Section extends Entity { $name = $this->get_name(); $collection = $this->get_collection(); + if ($this->is_conditional_section()) { + $metadata_section_id = $this->get_id(); + if ($metadata_section_id == static::$default_section_slug) { + $this->add_error($this->get_id(), __("conditional section cannot be enabled in default section", 'tainacan')); + $no_errors = false; + } else { + $metadata_list = $this->get_metadata_object_list(); + $required_metadata_list = array_filter($metadata_list, function($m) { + return $m->is_required(); + }); + if ( count($required_metadata_list) ) { + $no_errors = false; + foreach($required_metadata_list as $metadata) { + $this->add_error($metadata->get_id(), __("metadata cannot be required", 'tainacan')); + } + } + } + } + if( empty($collection) ) { $this->add_error($this->get_id(), __("collection is required", 'tainacan')); $no_errors = false; diff --git a/src/classes/entities/class-tainacan-metadatum.php b/src/classes/entities/class-tainacan-metadatum.php index b0aa8dbb4..0efa3d05a 100644 --- a/src/classes/entities/class-tainacan-metadatum.php +++ b/src/classes/entities/class-tainacan-metadatum.php @@ -533,6 +533,17 @@ class Metadatum extends Entity { return false; } } + + if( $this->is_required() ) { + $meta_section_id = $this->get_metadata_section_id(); + if($meta_section_id != \Tainacan\Entities\Metadata_Section::$default_section_slug) { + $meta_section = new \Tainacan\Entities\Metadata_Section($meta_section_id); + if($meta_section->is_conditional_section()) { + $this->add_error($this->get_id(), __('Metadata cannot be required into conditional section', 'tainacan')); + return false; + } + } + } // You cant have a taxonomy metadatum inside a multiple compound metadatum if ( $this->get_parent() > 0 && $this->get_metadata_type_object()->get_primitive_type() == 'term' ) { diff --git a/src/classes/repositories/class-tainacan-metadata-sections.php b/src/classes/repositories/class-tainacan-metadata-sections.php index 37236957f..146a2ebe9 100644 --- a/src/classes/repositories/class-tainacan-metadata-sections.php +++ b/src/classes/repositories/class-tainacan-metadata-sections.php @@ -76,6 +76,21 @@ class Metadata_Sections extends Repository { 'title' => __( 'Collection', 'tainacan' ), 'type' => ['integer', 'string'], 'description' => __( 'The collection ID', 'tainacan' ), + ], + 'is_conditional_section' => [ + 'map' => 'meta', + 'title' => __( 'Enable conditional section', 'tainacan' ), + 'type' => 'string', + 'description' => __( 'Binds this section visibility to a set of rules related to some metadata values.', 'tainacan' ), + 'on_error' => __( 'Value should be "yes" or "no"', 'tainacan' ), + 'validation' => v::stringType()->in( [ 'yes', 'no' ] ), + 'default' => 'no' + ], + 'conditional_section_rules' => [ + 'map' => 'meta', + 'title' => __( 'Conditional section rules', 'tainacan' ), + 'type' => ['object', 'array'], + 'description' => __( 'The conditions that will allow this section to be displayed, based on metadata values.', 'tainacan' ), ] ] ); } diff --git a/src/views/admin/components/edition/item-edition-form.vue b/src/views/admin/components/edition/item-edition-form.vue index 7131b2bcf..7df28141d 100644 --- a/src/views/admin/components/edition/item-edition-form.vue +++ b/src/views/admin/components/edition/item-edition-form.vue @@ -372,19 +372,25 @@
+ :class="'metadata-section-slug-' + metadataSection.slug + (isSectionHidden(metadataSection.id) ? ' metadata-section-hidden' : '')" + :id="'metadata-section-id-' + metadataSection.id" + v-tooltip="{ + content: isSectionHidden(metadataSection.id) ? $i18n.get('info_metadata_section_hidden_conditional') : false, + autoHide: true, + placement: 'auto', + popperClass: ['tainacan-tooltip', 'tooltip'] + }">
+ @click="(isMetadataNavigation || $adminOptions.hideItemEditionCollapses || isSectionHidden(metadataSection.id)) ? null : toggleMetadataSectionCollapse(sectionIndex)"> @@ -409,7 +415,7 @@ + + + + +
+ +   + + + + +
+

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

+
+ + + + + + + + + + + +
+ + {{ conditionalValue }} + +
+
+
+
+