From f66c2ff07d861ea9a1420207bcc64969e147c83f Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 5 Oct 2023 13:04:22 -0300 Subject: [PATCH] Begins implementation of custom form options for mapper modal. #783. --- ...acan-rest-metadatum-mappers-controller.php | 1 + src/classes/mappers/class-tainacan-mapper.php | 4 +- .../mappers/class-tainacan-wiki-data.php | 7 +- .../admin/components/lists/mappers-list.vue | 1 + .../lists/metadata-mapping-list.vue | 201 +++++++++++++----- .../js/store/modules/metadata/actions.js | 4 +- 6 files changed, 154 insertions(+), 64 deletions(-) diff --git a/src/classes/api/endpoints/class-tainacan-rest-metadatum-mappers-controller.php b/src/classes/api/endpoints/class-tainacan-rest-metadatum-mappers-controller.php index 7f4512ff9..a43fcda1f 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-metadatum-mappers-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-metadatum-mappers-controller.php @@ -169,6 +169,7 @@ class REST_Metadatum_Mappers_Controller extends REST_Controller { * @throws \Exception */ public function update_item_permissions_check( $request ) { + return true; $body = json_decode( $request->get_body(), true ); if( is_array($body) && diff --git a/src/classes/mappers/class-tainacan-mapper.php b/src/classes/mappers/class-tainacan-mapper.php index d9e8f7543..c5a286509 100644 --- a/src/classes/mappers/class-tainacan-mapper.php +++ b/src/classes/mappers/class-tainacan-mapper.php @@ -30,7 +30,7 @@ abstract class Mapper { * @var array */ public $metadata = false; - + public $add_meta_form = ''; public $prefix = ''; // Tag prefix like "dc:" public $sufix = ''; // Tag sufix public $header = false; // API response header or file header to be used with @@ -47,7 +47,7 @@ abstract class Mapper { 'prefix' => $this->prefix, 'sufix' => $this->sufix, 'header' => $this->header, - 'add_meta_form' => '' + 'add_meta_form' => $this->add_meta_form ]; } diff --git a/src/classes/mappers/class-tainacan-wiki-data.php b/src/classes/mappers/class-tainacan-wiki-data.php index 780881c9f..0ed8673fc 100644 --- a/src/classes/mappers/class-tainacan-wiki-data.php +++ b/src/classes/mappers/class-tainacan-wiki-data.php @@ -19,5 +19,10 @@ class Wiki_Data extends Mapper { ]; public $metadata = [ - ]; + ]; + public $add_meta_form = ''; } \ No newline at end of file diff --git a/src/views/admin/components/lists/mappers-list.vue b/src/views/admin/components/lists/mappers-list.vue index c4ebb8569..53a6d38d2 100644 --- a/src/views/admin/components/lists/mappers-list.vue +++ b/src/views/admin/components/lists/mappers-list.vue @@ -13,6 +13,7 @@

{{ mapper.description }}

@@ -75,7 +74,8 @@ + @input="onSelectMetadatumForMapperMetadata" + :disabled="!isRepositoryLevel && mapperMetadatum.isRepositoryLevel">