From c7889eeaa0bbd61b8684b67240a60de2bca02d77 Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Thu, 26 Jul 2018 10:58:35 -0300 Subject: [PATCH 1/7] creating prop semantic_uri to store metadatum schema information --- .../entities/class-tainacan-metadatum.php | 20 ++++++++++++++++++- .../repositories/class-tainacan-metadata.php | 14 ++++++++++++- src/exposers/class-tainacan-exposers.php | 2 +- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/classes/entities/class-tainacan-metadatum.php b/src/classes/entities/class-tainacan-metadatum.php index 9535e82f3..8b1fd5f6e 100644 --- a/src/classes/entities/class-tainacan-metadatum.php +++ b/src/classes/entities/class-tainacan-metadatum.php @@ -210,6 +210,15 @@ class Metadatum extends Entity { public function get_exposer_mapping() { return $this->get_mapped_property('exposer_mapping'); } + + /** + * Return the semantic_uri + * + * @return string + */ + function get_semantic_uri(){ + return $this->get_mapped_property('semantic_uri'); + } /** * Set the metadatum name @@ -361,7 +370,16 @@ class Metadatum extends Entity { public function set_exposer_mapping( $value ) { $this->set_mapped_property('exposer_mapping', $value); } - + + /** + * Set Semantic URI for the metadatum + * + * @param [string] $value + * @return void + */ + function set_semantic_uri( $value ){ + $this->set_mapped_property('semantic_uri', $value); + } /** * Transient property used to store the status of the metadatum for a particular collection diff --git a/src/classes/repositories/class-tainacan-metadata.php b/src/classes/repositories/class-tainacan-metadata.php index 7341b8f3a..bdeb61da0 100644 --- a/src/classes/repositories/class-tainacan-metadata.php +++ b/src/classes/repositories/class-tainacan-metadata.php @@ -40,6 +40,10 @@ class Metadata extends Repository { } + /** + * {@inheritDoc} + * @see \Tainacan\Repositories\Repository::get_map() + */ public function get_map() { return apply_filters('tainacan-get-map-'.$this->get_name(), [ 'name' => [ @@ -182,7 +186,15 @@ class Metadata extends Repository { 'validation' => v::stringType()->in( [ 'yes', 'no', 'never' ] ), 'description' => __( 'Display by default on listing or do not display or never display.', 'tainacan' ), 'default' => 'yes' - ] + ], + 'semantic_uri' => [ + 'map' => 'meta', + 'title' => __( 'The semantic metadatum description URI' ), + 'type' => __( 'url' ), + 'validation' => v::optional(v::url()), + 'description' => __( 'The semantic metadatum description URI like: ', 'tainacan' ).'https://schema.org/URL', + 'default' => '' + ] ] ); } diff --git a/src/exposers/class-tainacan-exposers.php b/src/exposers/class-tainacan-exposers.php index 3295639e7..e0f30fc58 100644 --- a/src/exposers/class-tainacan-exposers.php +++ b/src/exposers/class-tainacan-exposers.php @@ -403,7 +403,7 @@ class Exposers { $metadatum->set_metadata_type('Tainacan\Metadata_Types\Text'); } $metadatum->set_name($mapper_metadatum['label']); - $metadatum->set_description($mapper_metadatum['URI']); + $metadatum->set_semantic_uri($mapper_metadatum['URI']); $metadatum->set_exposer_mapping([ $mapper->slug => $slug ]); From 587e2de1218b0af115ce1ed231b5b85273700149 Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Fri, 27 Jul 2018 00:32:43 -0300 Subject: [PATCH 2/7] fix test semantic_uri --- tests/test-api-exposers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-api-exposers.php b/tests/test-api-exposers.php index 1550b47dd..d2de86517 100644 --- a/tests/test-api-exposers.php +++ b/tests/test-api-exposers.php @@ -430,7 +430,7 @@ class TAINACAN_REST_Exposers extends TAINACAN_UnitApiTestCase { foreach ($metadata as $metadatum) { $this->assertTrue(array_key_exists($metadatum->get_slug(), $mapper->metadata)); if(! array_key_exists('core_metadatum', $mapper->metadata[$metadatum->get_slug()]) || $mapper->metadata[$metadatum->get_slug()]['core_metadatum'] == false) { - $this->assertEquals($mapper->metadata[$metadatum->get_slug()]['URI'], $metadatum->get_description()); + $this->assertEquals($mapper->metadata[$metadatum->get_slug()]['URI'], $metadatum->get_semantic_uri()); } $this->assertEquals($mapper->metadata[$metadatum->get_slug()]['label'], $metadatum->get_name()); } From e483a2735426b56089a359c0ad4ce1fefdf34655 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Fri, 27 Jul 2018 10:30:26 -0300 Subject: [PATCH 3/7] Updates on new color scheme for diferentiating repository and collection level. --- .../edition/collection-edition-form.vue | 2 +- .../edition/importer-edition-form.vue | 2 +- .../edition/importer-mapping-form.vue | 6 +-- .../edition/taxonomy-edition-form.vue | 2 +- src/admin/components/lists/filters-list.vue | 12 +---- src/admin/components/lists/metadata-list.vue | 3 +- src/admin/components/lists/terms-list.vue | 2 +- .../tainacan-collection-subheader.vue | 50 ++++++++++++------- .../components/navigation/tainacan-header.vue | 8 +-- .../tainacan-repository-subheader.vue | 3 +- .../components/navigation/tainacan-title.vue | 2 +- src/admin/components/other/help-button.vue | 2 +- .../components/other/processes-popup.vue | 2 +- .../pages/lists/available-importers-page.vue | 2 +- src/admin/pages/lists/collections-page.vue | 2 +- src/admin/pages/lists/events-page.vue | 2 +- src/admin/pages/lists/filters-page.vue | 2 +- src/admin/pages/lists/items-page.vue | 6 +-- src/admin/pages/lists/metadata-page.vue | 2 +- src/admin/pages/lists/taxonomies-page.vue | 2 +- src/admin/pages/singles/event-page.vue | 2 +- src/admin/pages/singles/taxonomy-page.vue | 2 +- src/admin/scss/_selects.scss | 2 +- src/admin/scss/tainacan-admin.scss | 31 +++++++++++- 24 files changed, 90 insertions(+), 61 deletions(-) diff --git a/src/admin/components/edition/collection-edition-form.vue b/src/admin/components/edition/collection-edition-form.vue index f6e4a79cf..393431cef 100644 --- a/src/admin/components/edition/collection-edition-form.vue +++ b/src/admin/components/edition/collection-edition-form.vue @@ -1,7 +1,7 @@ @@ -70,7 +70,6 @@ export default { h1 { font-size: 18px; - font-weight: 500; color: white; line-height: 18px; max-width: 100%; diff --git a/src/admin/components/navigation/tainacan-title.vue b/src/admin/components/navigation/tainacan-title.vue index 80240175d..0537387c3 100644 --- a/src/admin/components/navigation/tainacan-title.vue +++ b/src/admin/components/navigation/tainacan-title.vue @@ -4,7 +4,7 @@

{{ pageTitle }} {{ isRepositoryLevel ? '' : entityName }}

+ class="back-link has-text-secondary"> {{ $i18n.get('back') }}
diff --git a/src/admin/components/other/help-button.vue b/src/admin/components/other/help-button.vue index d05e496a8..0de1673ab 100644 --- a/src/admin/components/other/help-button.vue +++ b/src/admin/components/other/help-button.vue @@ -1,6 +1,6 @@